그런데 JuypterLab 화면 안에서의 특정 권한을 막는 것은 IAM으로 적용되는 사항이 아닙니다. JupyterLab의 특정 기능을을 막는(예 : 파일 다운로드 방지) 설정들은 JuypterLab의 설정 파일을 조정해야합니다. 이는 Sagemaker의 Life Cycle Configuration의 기능을 통해서 Jupyter Notebook이 실행 될 때 Bootstrap을 통해 Config를 수정하여 해당 기능을 차단 할 수 있습니다.
LCC 기능을 통해 Jupyter Notebook에서 다운로드 차단 방법
#LCC에 설정한 Script
jupyter labextension disable jupyterlab/docmanager-extension:download
jupyter labextension disable @jupyterlab/filebrowser-extension:download
Sagemaker Studio에서 사용자가 실행하는 AWS API들은 모두 Cloudtrail 서비스에서 확인이 가능합니다. CloudTrail에서 확인이 가능한 Log 형식과 API Call들은 아래 문서에서 확인이 가능합니다. https://docs.aws.amazon.com/sagemaker/latest/dg/logging-using-cloudtrail.html
그러나 해당 CloudTrail의 Log에서는 호출한 User Profile 이름이 나오지 않고, User Profile이 갖고 있는 Role Name이 나오게 되는데, User Profile 이름까지 함께 나오기 위해서는 아래의 조치가 필요합니다. https://docs.aws.amazon.com/sagemaker/latest/dg/monitor-user-access.html
Sagemaker Studio의 Juypter Notebook에서 출력되는 모든 Log들은 CloudWatch에 모두 기록되며 Cloudwatch의 /aws/sagemaker/studio안에서 각 User-Profile 별로 로그들이 기록됩니다.
https://docs.aws.amazon.com/sagemaker/latest/dg/logging-cloudwatch.html
https://github.com/aws-samples/sagemaker-studio-apps-lifecycle-config-examples/tree/main/scripts/auto-stop-idle
아래의 스크린은 위 LCC을 적용하여 Jupyter을 생성하고 직접 테스트 한 결과 Log입니다.