本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
在 SageMaker AI Studio Classic 的 CloudTrail 日誌中開啟 sourceIdentity
使用 Amazon SageMaker Studio Classic,您可以監控使用者資源存取。不過,資源存取 AWS CloudTrail 日誌只會列出 Studio Classic 執行 IAM 角色做為識別符。當多個使用者設定檔之間共用單一執行 IAM 角色時,您必須使用 sourceIdentity
組態來取得存取 AWS 資源的特定使用者的相關資訊。
下列主題說明如何開啟或關閉sourceIdentity
組態。
必要條件
-
在安裝或更新最新版本的 AWS CLI中安裝和設定 AWS Command Line Interface 下列步驟。
-
請確定您網域中的 Studio Classic 使用者沒有允許他們更新或修改網域的政策。
-
若要開啟或關閉
sourceIdentity
傳播,網域中的所有應用程式都必須處於Stopped
或Deleted
狀態。如需如何停止和關閉應用程式的詳細資訊,請參閱關閉和更新 Studio Classic 應用程式。 -
如果來源身分傳播已開啟,所有執行角色都必須具有下列信任政策許可:
-
網域執行角色擔任的任何角色都必須具有
sts:SetSourceIdentity
信任政策中的 許可。如果缺少此許可,當您呼叫任務建立 APIValidationError
時AccessDeniedException
,您的動作會失敗。下列範例信任政策包含sts:SetSourceIdentity
許可。{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "sagemaker.amazonaws.com" }, "Action": [ "sts:AssumeRole", "sts:SetSourceIdentity" ] } ] }
-
當您使用一個角色擔任另一個角色,稱為角色串連,請執行下列動作:
-
在擔任該角色的主體之許可政策和目標角色的角色信任政策中都需要
sts:SetSourceIdentity
的許可。否則,擔任角色操作將會失敗。 -
此角色鏈結可能發生在 Studio Classic 或任何其他下游服務中,例如 Amazon EMR。如需有關角色串連的詳細資訊,請參閱中角色術語和概念。
-
-
開啟 sourceIdentity
在 Studio Classic sourceIdentity
中傳播使用者設定檔名稱的功能預設為關閉。
若要啟用將使用者設定檔名稱傳播為 的功能sourceIdentity
,請在網域建立和網域更新 AWS CLI 期間使用 。會在網域層級啟用此功能,而不是在使用者設定檔層級。
啟用此設定後,系統管理員可以在已存取服務的 AWS CloudTrail 日誌中檢視使用者設定檔。在 userIdentity
區段中指定使用者設定檔為 sourceIdentity
。如需搭配 SageMaker AI 使用 AWS CloudTrail 日誌的詳細資訊,請參閱搭配 記錄 Amazon SageMaker AI API 呼叫 AWS CloudTrail。
在使用 create-domain
API 建立網域期間,您可以使用下列程式碼來啟用使用者設定檔名稱為 sourceIdentity
的傳播。
create-domain --domain-name <value> --auth-mode <value> --default-user-settings <value> --subnet-ids <value> --vpc-id <value> [--tags <value>] [--app-network-access-type <value>] [--home-efs-file-system-kms-key-id <value>] [--kms-key-id <value>] [--app-security-group-management <value>] [--domain-settings "ExecutionRoleIdentityConfig=USER_PROFILE_NAME"] [--cli-input-json <value>] [--generate-cli-skeleton <value>]
在使用 update-domain
API 更新網域期間,您可以啟用使用者設定檔名稱為 sourceIdentity
的傳播。
若要更新此設定,網域中的所有應用程式都必須處於 Stopped
或 Deleted
狀態。如需如何停止和關閉應用程式的詳細資訊,請參閱關閉和更新 Studio Classic 應用程式。
使用下列程式碼來啟用使用者設定檔名稱為 sourceIdentity
的傳播。
update-domain --domain-id <value> [--default-user-settings <value>] [--domain-settings-for-update "ExecutionRoleIdentityConfig=USER_PROFILE_NAME"] [--cli-input-json <value>] [--generate-cli-skeleton <value>]
關閉sourceIdentity
您也可以使用 AWS CLI關閉使用者設定檔名稱為 sourceIdentity
的傳播。在網域更新期間,傳遞 --domain-settings-for-update
參數的 ExecutionRoleIdentityConfig=DISABLED
值做為 update-domain
API 呼叫的一部分時會發生。
在 中 AWS CLI,使用下列程式碼來停用使用者設定檔名稱的傳播做為 sourceIdentity
。
update-domain --domain-id <value> [--default-user-settings <value>] [--domain-settings-for-update "ExecutionRoleIdentityConfig=DISABLED"] [--cli-input-json <value>] [--generate-cli-skeleton <value>]