

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 啟用安全事件回應，並使用 API/CLI 設定您的事件回應團隊
<a name="enable-sir-using-cli"></a>

本節提供使用 API/CLI AWS 安全事件應變啟用 AWS 安全事件應變、指定委派管理員，以及設定事件回應團隊的步驟。

身為 Organizations 的管理員，請務必閱讀委派安全事件回應管理員帳戶的運作[考量事項和建議](considerations_important.md)方式。在繼續之前，請確定您擁有 [指定委派的安全事件回應管理員帳戶所需的許可](organizations_permissions.md)。

------
#### [ Onboard with a delegated administrator using the API/CLI (recommended) ]

1. 在您的 AWS Organizations 管理帳戶中建立`AWSServiceRoleForSecurityIncidentResponse_Triage`服務連結角色：

   ```
   aws iam create-service-linked-role --aws-service-name "triage.security-ir.amazonaws.com"
   ```

1. （選用） 若要驗證角色是否已建立，請執行下列命令：

   ```
   aws iam get-role --role-name AWSServiceRoleForSecurityIncidentResponse_Triage
   ```

1. 從您的 AWS Organizations 管理帳戶中，註冊 的委派管理員帳戶 AWS 安全事件應變：

   ```
   aws organizations register-delegated-administrator \
     --account-id {{delegated-admin-account-id}} \
     --service-principal security-ir.amazonaws.com
   ```

1. 為您的組織啟用 AWS 安全事件應變 服務存取：

   ```
   aws organizations enable-aws-service-access \
     --service-principal security-ir.amazonaws.com
   ```

1. 登入委派管理員帳戶以建立成員資格並指定您的事件回應團隊。您必須列出至少兩個事件回應團隊成員。

   ```
   aws security-ir create-membership \
     --membership-name "{{membership-name}}" \
     --incident-response-team '[
       {
         "name": "{{name}}",
         "jobTitle": "{{job-title}}",
         "email": "{{email@example.com}}",
         "communicationPreferences": ["email"]
       }
       {
         "name": "{{name}}",
         "jobTitle": "{{job-title}}",
         "email": "{{email@example.com}}",
         "communicationPreferences": ["email"]
       }
     ]'
   ```

1. （選用） 確認已建立成員資格：

   ```
   aws security-ir list-memberships
   ```

1. （選用） 取得成員資格詳細資訊：

   ```
   aws security-ir get-membership \
     --membership-id {{membership-id}}
   ```

------
#### [ Onboard with a management account using the API/CLI ]

1. 為您的組織啟用 AWS 安全事件應變 服務存取：

   ```
   aws organizations enable-aws-service-access \
     --service-principal security-ir.amazonaws.com
   ```

1. 登入管理帳戶以建立成員資格並指定您的事件回應團隊。您必須列出至少兩個事件回應團隊成員。

   ```
   aws security-ir create-membership \
     --membership-name "{{membership-name}}" \
     --incident-response-team '[
       {
         "name": "{{name}}",
         "jobTitle": "{{job-title}}",
         "email": "{{email@example.com}}",
         "communicationPreferences": ["email"]
       }
       {
         "name": "{{name}}",
         "jobTitle": "{{job-title}}",
         "email": "{{email@example.com}}",
         "communicationPreferences": ["email"]
       }
     ]'
   ```

1. （選用） 確認已建立成員資格：

   ```
   aws security-ir list-memberships
   ```

1. （選用） 取得成員資格詳細資訊：

   ```
   aws security-ir get-membership \
     --membership-id {{membership-id}}
   ```

------