

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# を使用した IAM Identity Center SCIM API コールのログ記録 AWS CloudTrail
<a name="scim-logging-using-cloudtrail"></a>

[IAM Identity Center SCIM](other-idps.md) は、ユーザー AWS CloudTrail、ロール、または によって実行されたアクションを記録するサービスである と統合されています AWS のサービス。CloudTrail は、SCIM の API コールをイベントとしてキャプチャします。CloudTrail によって収集される情報を使用することで、リクエストされたアクション、アクションの日付と時刻、リクエストパラメータなどに関する情報を確認できます。CloudTrail の詳細については、「[AWS CloudTrail ユーザーガイド](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html)」を参照してください。

**注記**  
CloudTrail は、アカウントの作成 AWS アカウント 時に で有効になります。ただし、トークンが 2024 年 9 月より前に作成された場合は、SCIM からのイベントを確認するためにアクセストークンをローテーションする必要がある場合があります。  
詳細については、「[アクセストークンをローテーションする](rotate-token.md)」を参照してください。

SCIM は、以下のオペレーションを CloudTrail のイベントとして記録するログをサポートしています。
+ [CreateGroup](https://docs.aws.amazon.com/singlesignon/latest/developerguide/creategroup.html)
+ [CreateUser](https://docs.aws.amazon.com/singlesignon/latest/developerguide/createuser.html)
+ [DeleteGroup](https://docs.aws.amazon.com/singlesignon/latest/developerguide/deletegroup.html)
+ [DeleteUser](https://docs.aws.amazon.com/singlesignon/latest/developerguide/deleteuser.html)
+ [GetGroup](https://docs.aws.amazon.com/singlesignon/latest/developerguide/getgroup.html)
+ [GetSchema](https://docs.aws.amazon.com/singlesignon/latest/developerguide/getschema.html)
+ [GetUser](https://docs.aws.amazon.com/singlesignon/latest/developerguide/getuser.html)
+ [ListGroups](https://docs.aws.amazon.com/singlesignon/latest/developerguide/listgroups.html)
+ [ListResourceTypes](https://docs.aws.amazon.com/singlesignon/latest/developerguide/listresourcetypes.html)
+ [ListSchemas](https://docs.aws.amazon.com/singlesignon/latest/developerguide/listschemas.html)
+ [ListUsers](https://docs.aws.amazon.com/singlesignon/latest/developerguide/listusers.html)
+ [PatchGroup](https://docs.aws.amazon.com/singlesignon/latest/developerguide/patchgroup.html)
+ [PatchUser](https://docs.aws.amazon.com/singlesignon/latest/developerguide/patchuser.html)
+ [PutUser](https://docs.aws.amazon.com/singlesignon/latest/developerguide/putuser.html)
+ [ServiceProviderConfig](https://docs.aws.amazon.com/singlesignon/latest/developerguide/serviceproviderconfig.html)

## の CloudTrail イベントの例
<a name="scim-logging-using-cloudtrail-examples"></a>

次の例は、IAM アイデンティティセンターでの SCIM オペレーション中に生成される一般的な CloudTrail イベントログを示しています。これらの例は、成功したオペレーションと一般的なエラーシナリオのイベントの構造と内容を示し、SCIM プロビジョニングの問題をトラブルシューティングするときに CloudTrail ログを解釈する方法を理解するのに役立ちます。

### 正常な `CreateUser` オペレーション
<a name="scim-successful-createuser-example"></a>

この CloudTrail イベントは、SCIM API を通じて正常に実行された `CreateUser` オペレーションを示します。イベントは、リクエストパラメータ (機密情報がマスクされている) と、新しく作成されたユーザーの ID を含むレスポンス要素の両方をキャプチャします。このタイプのイベントは、ID プロバイダーが SCIM プロトコルを使用して IAM アイデンティティセンターに新しいユーザーを正常にプロビジョニングしたときに生成されます。

```
{
  "eventVersion": "1.10",
  "userIdentity": {
    "type": "WebIdentityUser",
    "accountId": "123456789012",
    "accessKeyId": "xxxx"
  },
  "eventTime": "xxxx",
  "eventSource": "identitystore-scim.amazonaws.com",
  "eventName": "CreateUser",
  "awsRegion": "us-east-1",
  "sourceIPAddress": "xx.xxx.xxx.xxx",
  "userAgent": "Go-http-client/2.0",
  "requestParameters": {
    "httpBody": {
      "displayName": "HIDDEN_DUE_TO_SECURITY_REASONS",
      "schemas" : [
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "name": {
        "familyName": "HIDDEN_DUE_TO_SECURITY_REASONS",
        "givenName": "HIDDEN_DUE_TO_SECURITY_REASONS"
      },
      "active": true,
      "userName": "HIDDEN_DUE_TO_SECURITY_REASONS"
    },
    "tenantId": "xxxx"
  },
  "responseElements": {
    "meta" : {
      "created" : "Oct 10, 2024, 1:23:45 PM",
      "lastModified" : "Oct 10, 2024, 1:23:45 PM",
      "resourceType" : "User"
    },
    "displayName" : "HIDDEN_DUE_TO_SECURITY_REASONS",
    "schemas" : [
      "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "name": {
      "familyName": "HIDDEN_DUE_TO_SECURITY_REASONS",
      "givenName": "HIDDEN_DUE_TO_SECURITY_REASONS"
    },
    "active": true,  
    "id" : "c4488478-a0e1-700e-3d75-96c6bb641596",
    "userName": "HIDDEN_DUE_TO_SECURITY_REASONS"
  },
  "requestID": "xxxx",
  "eventID": "xxxx",
  "readOnly": false,
  "eventType": "AwsApiCall",
  "managementEvent": true,
  "recipientAccountId": "123456789012",
  "eventCategory": "Management",
  "tlsDetails": {
    "clientProvidedHostHeader": "scim.us-east-1.amazonaws.com"
  }
}
```

### 失敗した `PatchGroup` オペレーション: 必須のパス属性がありません
<a name="scim-failed-patchgroup-example"></a>

この CloudTrail イベントは、失敗した `PatchGroup` オペレーションが`ValidationException` を引き起こし、エラーメッセージ `"Missing path in PATCH request"` が発生したことを示します。`PATCH` オペレーションで、変更するグループ属性を指定するためのパス属性が必要なため、エラーが発生しましたが、この属性がリクエストにありませんでした。

```
{
  "eventVersion": "1.10",
  "userIdentity": {
    "type": "Unknown",
    "accountId": "123456789012",
    "accessKeyId": "xxxx"
  },
  "eventTime": "xxxx",
  "eventSource": "identitystore-scim.amazonaws.com",
  "eventName": "PatchGroup",
  "awsRegion": "us-east-1",
  "sourceIPAddress": "xxx.xxx.xxx.xxx",
  "userAgent": "Go-http-client/2.0",
  "errorCode": "ValidationException",
  "errorMessage": "Missing path in PATCH request",
  "requestParameters": {
    "httpBody": {
      "operations": [
        {
          "op": "REMOVE",
          "value": "HIDDEN_DUE_TO_SECURITY_REASONS"
        }
      ],
      "schemas": [
        "HIDDEN_DUE_TO_SECURITY_REASONS"
      ]
    },
    "tenantId": "xxxx",
    "id": "xxxx"
  },
  "responseElements": null,
  "requestID": "xxxx",
  "eventID": "xxxx",
  "readOnly": false,
  "eventType": "AwsApiCall",
  "managementEvent": true,
  "recipientAccountId": "123456789012",
  "eventCategory": "Management",
  "tlsDetails": {
    "clientProvidedHostHeader": "scim.us-east-1.amazonaws.com"
  }
}
```

### 失敗した `CreateGroup` オペレーション: グループ名は既に存在します
<a name="scim-failed-creategroup-example"></a>

この CloudTrail イベントは、失敗した `CreateGroup` オペレーションが`ConflictException` を引き起こし、エラーメッセージ `"Duplicate GroupDisplayName"` が発生したことを示します。このエラーは、IAM アイデンティティセンターに既に存在する表示名を持つグループを作成しようとすると発生します。ID プロバイダーは、新しいグループを作成する代わりに、一意のグループ名を使用するか、既存のグループを更新する必要があります。

```
{
  "eventVersion": "1.10",
  "userIdentity": {
    "type": "Unknown",
    "accountId": "123456789012",
    "accessKeyId": "xxxx"
  },
  "eventTime": "xxxx",
  "eventSource": "identitystore-scim.amazonaws.com",
  "eventName": "CreateGroup",
  "awsRegion": "us-east-1",
  "sourceIPAddress": "xxx.xxx.xxx.xxx",
  "userAgent": "Go-http-client/2.0",
  "errorCode": "ConflictException",
  "errorMessage": "Duplicate GroupDisplayName",
  "requestParameters": {
    "httpBody": {
      "displayName": "HIDDEN_DUE_TO_SECURITY_REASONS"
    },
    "tenantId": "xxxx"
  },
  "responseElements": null,
  "requestID": "xxxx",
  "eventID": "xxxx",
  "readOnly": false,
  "eventType": "AwsApiCall",
  "managementEvent": true,
  "recipientAccountId": "123456789012",
  "eventCategory": "Management",
  "tlsDetails": {
    "clientProvidedHostHeader": "scim.us-east-1.amazonaws.com"
  }
}
```

### 失敗した `PatchUser` オペレーション: 複数の E メールアドレスはサポートされていません
<a name="scim-failed-patchuser-example"></a>

この CloudTrail イベントは、失敗した `PatchUser` オペレーションが`ValidationException` を引き起こし、エラーメッセージ `"List attribute emails exceeds allowed limit of 1"` が発生したことを示します。このエラーは、IAM アイデンティティセンターがユーザーごとに 1 つの E メールアドレスのみをサポートしているため、ユーザーに複数の E メールアドレスを割り当てるときに発生します。ID プロバイダーは、ユーザーごとに 1 つの E メールアドレスのみを送信するように SCIM マッピングを設定する必要があります。

```
{
  "eventVersion": "1.10",
  "userIdentity": {
    "type": "Unknown",
    "accountId": "123456789012",
    "accessKeyId": "xxxx"
  },
  "eventTime": "xxxx",
  "eventSource": "identitystore-scim.amazonaws.com",
  "eventName": "PatchUser",
  "awsRegion": "us-east-1",
  "sourceIPAddress": "xxx.xxx.xxx.xxx",
  "userAgent": "Go-http-client/2.0",
  "errorCode": "ValidationException",
  "errorMessage": "List attribute emails exceeds allowed limit of 1",
  "requestParameters": {
    "httpBody": {
      "operations": [
        {
          "op": "REPLACE",
          "path": "emails",
          "value": "HIDDEN_DUE_TO_SECURITY_REASONS"
        }
      ],
      "schemas": [
        "HIDDEN_DUE_TO_SECURITY_REASONS"
      ]
    },
    "tenantId": "xxxx",
    "id": "xxxx"
  },
  "responseElements": null,
  "requestID": "xxxx",
  "eventID": "xxxx",
  "readOnly": false,
  "eventType": "AwsApiCall",
  "managementEvent": true,
  "recipientAccountId": "123456789012",
  "eventCategory": "Management",
  "tlsDetails": {
    "clientProvidedHostHeader": "scim.us-east-1.amazonaws.com"
  }
}
```

## IAM アイデンティティセンターでの一般的な SCIM API 検証エラー
<a name="scim-cloudtrail-common-errors"></a>

IAM アイデンティティセンターで SCIM API を使用する場合、CloudTrail イベントには一般的に次の検証エラーメッセージが表示されます。これらの検証エラーは通常、ユーザーおよびグループのプロビジョニングオペレーション中に発生します。

これらのエラーを解決し、SCIM プロビジョニングを適切に設定するための詳細なガイダンスについては、この[AWS re:Post 記事](https://repost.aws//knowledge-center/iam-identity-center-provision)を参照してください。
+ 「リスト属性の E メールが 1 件の上限を超えています」
+ 「リスト属性のアドレスは、1 つまでに制限されています」
+ 「1 つの検証エラーが検出されました: '\$1name.familyName\$1' の値が制約を満たしませんでした: メンバー名は次の正規表現パターンを満たす必要があります: [\$1\$1p\$1L\$1\$1\$1p\$1M\$1\$1\$1p\$1S\$1\$1\$1p\$1N\$1\$1\$1p\$1P\$1\$1\$1t\$1\$1n\$1\$1r ]\$1」
+ 「2 つの検証エラーが検出されました: 'name.familyName' の値が制約を満たしませんでした: メンバー名の長さは 1 以上である必要があります。 'name.familyName' の値が制約を満たしませんでした: メンバー名は次の正規表現パターンを満たす必要があります: [\$1\$1p\$1L\$1\$1\$1p\$1M\$1\$1\$1p\$1S\$1\$1\$1p\$1N\$1\$1\$1p\$1P\$1\$1\$1t\$1\$1n\$1\$1r ]\$1」
+ 「2 つの検証エラーが検出されました: 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager.value' の値が制約を満たしませんでした: メンバー名の長さは 1 以上である必要があります。 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager.value' の値が制約を満たしませんでした: メンバー名は次の正規表現パターンを満たす必要があります: [\$1\$1p\$1L\$1\$1\$1p\$1M\$1\$1\$1p\$1S\$1\$1\$1p\$1N\$1\$1\$1p\$1P\$1\$1\$1t\$1\$1n\$1\$1r ]\$1"、」
+ 「RequestBody からの無効な JSON」
+ 「無効なフィルター形式」