

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# SageMaker AI Studio Classic에서 CloudTrail 로그의 sourceIdentity 사용 설정
<a name="monitor-user-access-how-to"></a>

Amazon SageMaker Studio Classic을 사용하여 사용자가 리소스에 액세스하는 것을 모니터링할 수 있습니다. 하지만, 리소스 액세스에 대한 AWS CloudTrail 로그에는 Studio Classic 실행 IAM 역할만 식별자로 나열됩니다. 여러 사용자 프로필 간에 단일 실행 IAM 역할을 공유하는 경우 `sourceIdentity` 구성을 사용하여 AWS 리소스에 액세스한 특정 사용자에 대한 정보를 가져와야 합니다.

다음 주제에서는 `sourceIdentity` 구성을 켜거나 끄는 방법을 설명합니다.

**Topics**
+ [사전 조건](#monitor-user-access-prereq)
+ [sourceIdentity 켜기](#monitor-user-access-enable)
+ [sourceIdentity 사용 중지](#monitor-user-access-disable)

## 사전 조건
<a name="monitor-user-access-prereq"></a>
+ [최신 버전의 설치 또는 업데이트 AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)의 AWS Command Line Interface 다음 단계를 설치하고 구성합니다.
+ 도메인의 Studio Classic 사용자에게 도메인을 업데이트하거나 수정할 수 있는 정책이 없도록 해야 합니다.  
+ `sourceIdentity` 전파를 켜거나 끄려면 도메인의 모든 앱이 `Stopped` 또는 `Deleted` 상태여야 합니다. 앱을 중지하고 종료하는 방법에 대한 자세한 내용은 [Studio Classic 앱 종료 및 업데이트](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-tasks-update-apps.html)를 참고하세요.
+ 소스 ID 전파가 켜져 있는 경우 모든 실행 역할에는 다음과 같은 신뢰 정책 권한이 있어야 합니다. 
  + 도메인의 실행 역할이 위임하는 모든 역할에는 다음과 같은 신뢰 정책에 `sts:SetSourceIdentity` 권한이 있어야 합니다. 이 권한이 누락된 경우 작업 생성 API를 호출할 `ValidationError` 때 `AccessDeniedException` 또는 에서 작업이 실패합니다. 다음 예시 신뢰 정책에는 `sts:SetSourceIdentity` 권한이 포함되어 있습니다.

------
#### [ JSON ]

****  

    ```
    {
        "Version":"2012-10-17",		 	 	 
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Service": "sagemaker.amazonaws.com"
                },
                "Action": [
                    "sts:AssumeRole",
                    "sts:SetSourceIdentity"
                ]
            }
        ]
    }
    ```

------
  + 역할 체이닝이라고 하는 다른 역할을 맡을 때는 다음과 같이 하세요.
    + 역할을 맡고 있는 보안 주체의 권한 정책 및 대상 역할의 역할 신뢰 정책 모두에서 `sts:SetSourceIdentity`에 대한 권한이 필요합니다. 그렇지 않으면 역할 수임 작업이 실패합니다.
    +  이 역할 체이닝은 Studio Classic 또는 Amazon EMR과 같은 다른 다운스트림 서비스에서 발생할 수 있습니다. 역할 체이닝에 대한 자세한 내용은 [역할 용어 및 개념](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html)을 참고하세요.

## sourceIdentity 켜기
<a name="monitor-user-access-enable"></a>

Studio Classic에서 `sourceIdentity`와 같이 사용자 프로필 이름을 전파하는 기능은 기본적으로 꺼져 있습니다.

사용자 프로필 이름을 로 전파하는 기능을 활성화하려면 도메인 생성 및 도메인 업데이트 AWS CLI 중에를 `sourceIdentity`사용합니다. 이 기능은 사용자 프로필 수준이 아닌 도메인 수준에서 사용할 수 있습니다.

 이 구성을 활성화하면 관리자는 액세스한 서비스의 AWS CloudTrail 로그에서 사용자 프로필을 볼 수 있습니다. 사용자 프로필은 `userIdentity` 섹션의 `sourceIdentity` 값으로 제공됩니다. SageMaker AI에서 AWS CloudTrail 로그를 사용하는 방법에 대한 자세한 내용은 [를 사용하여 Amazon SageMaker AI API 호출 로깅을 참조하세요 AWS CloudTrail](https://docs.aws.amazon.com/sagemaker/latest/dg/logging-using-cloudtrail.html).

다음 코드를 사용하면 `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 앱 종료 및 업데이트](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-tasks-update-apps.html)를 참고하세요.

다음 코드를 사용하면 `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 사용 중지
<a name="monitor-user-access-disable"></a>

 AWS CLI를 사용하여 `sourceIdentity`와 마찬가지로 사용자 프로필 이름의 전파를 끌 수도 있습니다. 이는 도메인 업데이트 중에 `update-domain` API 직접 호출의 일부로 `--domain-settings-for-update` 매개변수의 `ExecutionRoleIdentityConfig=DISABLED` 값을 전달하여 발생합니다.

에서 다음 코드를 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>]
```