收集 AWS IAM 記錄

剖析器版本:1.0

支援的國家/地區:

本文說明如何使用第三方 API 饋給,將 AWS Identity and Access Management (IAM) 設定資料擷取至 Google Security Operations。

AWS IAM 剖析器會將 IAM 實體資料 (使用者、群組、角色和政策) 轉換為結構化統一資料模型 (UDM),並擷取使用者詳細資料、角色資訊、權限和時間戳記等欄位,以進行一致的安全性分析。

事前準備

請確認您已完成下列事前準備事項:

  • Google SecOps 執行個體
  • AWS 控制台的特殊存取權
  • 建立 IAM 使用者和政策的權限

取得 Google SecOps IP 範圍

  1. 依序前往「SIEM 設定」>「動態饋給」
  2. 按一下「新增動態消息」
  3. 記下頁面頂端顯示的 IP 範圍。

建立具備必要權限的 IAM 使用者

重要事項:如要允許 Google SecOps 使用 API 擷取 AWS IAM 資料,您必須建立具備適當讀取權限的 IAM 使用者。

  1. 按照本指南中的操作說明建立「使用者」建立 IAM 使用者
  2. 選取建立的「使用者」
  3. 選取「安全憑證」分頁標籤。
  4. 在「Access Keys」部分中,按一下「Create Access Key」
  5. 選取「第三方服務」做為「用途」
  6. 按一下「下一步」
    • 選用:新增說明標記。
  7. 按一下「建立存取金鑰」
  8. 按一下「Download .csv file」(下載 .csv 檔案),儲存「Access Key ID」(存取金鑰 ID) 和「Secret Access Key」(存取密鑰),以供日後參考。
  9. 按一下 [完成]
  10. 選取 [權限] 分頁標籤。
  11. 在「Permissions policies」(權限政策) 區段中,按一下「Add permissions」(新增權限)
  12. 選取「新增權限」
  13. 選取「直接附加政策」
  14. 搜尋 IAMReadOnlyAccess (AWS 代管政策)。
  15. 選取政策。
  16. 點選「下一步」
  17. 按一下「Add permissions」。

重要事項:IAMReadOnlyAccess 政策包含所有必要權限:

  • iam:GetUser
  • iam:ListUsers
  • iam:GetGroup
  • iam:ListGroups
  • iam:GetPolicy
  • iam:ListPolicies
  • iam:GetRole
  • iam:ListRoles
  • iam:ListAttachedUserPolicies
  • iam:ListAttachedGroupPolicies
  • iam:ListAttachedRolePolicies
  • iam:GetAccountSummary

方法 B:建立自訂政策 (最低權限)

如果安全性政策要求使用最低權限,而非受管理政策:

  1. 在 AWS 控制台中,依序前往「IAM」>「Policies」>「Create policy」>「JSON」分頁標籤
  2. 貼上下列政策:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "iam:GetUser",
            "iam:ListUsers",
            "iam:GetGroup",
            "iam:ListGroups",
            "iam:GetPolicy",
            "iam:ListPolicies",
            "iam:GetRole",
            "iam:ListRoles",
            "iam:ListAttachedUserPolicies",
            "iam:ListAttachedGroupPolicies",
            "iam:ListAttachedRolePolicies",
            "iam:GetAccountSummary"
          ],
          "Resource": "*"
        }
      ]
    }
    
  3. 點選「下一步」

  4. 將政策命名為 chronicle-iam-api-read-policy

  5. 點選「建立政策」

  6. 按照本指南中的操作說明建立「使用者」建立 IAM 使用者

  7. 選取建立的「使用者」

  8. 選取「安全憑證」分頁標籤。

  9. 在「Access Keys」部分中,按一下「Create Access Key」

  10. 選取「第三方服務」做為「用途」

  11. 點選「下一步」

    • 選用:新增說明標記。
  12. 按一下「建立存取金鑰」

  13. 按一下「Download .csv file」(下載 .csv 檔案),儲存「Access Key ID」(存取金鑰 ID) 和「Secret Access Key」(存取密鑰),以供日後參考。

  14. 按一下 [完成]

  15. 選取 [權限] 分頁標籤。

  16. 在「Permissions policies」(權限政策) 區段中,按一下「Add permissions」(新增權限)

  17. 選取「新增權限」

  18. 選取「直接附加政策」

  19. 搜尋並選取 chronicle-iam-api-read-policy

  20. 點選「下一步」

  21. 按一下「Add permissions」。

在 Google SecOps 中設定動態饋給,擷取 IAM 設定資料

AWS IAM 資訊提供會根據「API 類型」欄位 (「使用者」、「角色」或「群組」) 選取,每個資訊提供收集一個 IAM 實體清單。如要收集所有 IAM 實體,請為每個 API 類型建立一個資訊提供,全部都使用 AWS IAM 記錄類型。

  1. 依序前往「內容中心」>「內容套件」>「開始使用」
  2. 按一下「Amazon Cloud Platform」套件。
  3. 在清單中找出「AWS IAM」記錄類型。
  4. 從「來源類型」下拉式選單中選取「第三方 API」
  5. 請提供下列設定詳細資料:
    • 使用者名稱:先前建立的 IAM 使用者存取金鑰 ID。
    • Secret:先前建立的 IAM 使用者存取密鑰。
    • API 類型:選取要收集的 IAM 實體清單:「使用者」、「角色」或「群組」
    • 動態饋給名稱:系統預先填入的值,用於識別動態饋給 (例如 AWS IAM Users)。
    • 資產命名空間:與動態饋給相關聯的命名空間。
    • 擷取標籤:套用至這個動態饋給所有事件的標籤。
  6. 點選「建立動態饋給」

如要進一步瞭解如何為這個產品系列中的不同記錄類型設定多個動態饋給,請參閱「依產品設定動態饋給」。

使用 SIEM 設定

  1. 依序前往「SIEM 設定」>「動態饋給」
  2. 按一下「新增動態消息」
  3. 在下一個頁面中,按一下「設定單一動態饋給」
  4. 在「動態饋給名稱」欄位中輸入動態饋給名稱 (例如 AWS IAM API Configuration)。
  5. 選取「第三方 API」做為「來源類型」
  6. 選取「AWS IAM」做為「記錄類型」
  7. 點選「下一步」
  8. 指定下列輸入參數的值:
    • 使用者名稱:先前建立的 IAM 使用者存取金鑰 ID。
    • Secret:先前建立的 IAM 使用者存取密鑰。
    • API 類型:選取要收集的 IAM 實體清單:「使用者」、「角色」或「群組」
    • 資產命名空間資產命名空間
    • 擷取標籤:要套用至這個動態饋給事件的標籤。
  9. 點選「下一步」
  10. 在「Finalize」(完成) 畫面中檢查新的動態饋給設定,然後按一下「Submit」(提交)

UDM 對應表

記錄欄位 UDM 對應 邏輯
Group.CreateDate entity.group.attribute.creation_time 已剖析為 ISO8601
Group.Path entity.group.attribute.labels.value 直接對應
IsTruncated entity.group.attribute.labels.value 直接對應
Marker entity.group.attribute.labels.value 直接對應
Group.GroupName entity.group.email_addresses 已合併
Group.GroupName entity.group.group_display_name 直接對應
Group.GroupID entity.group.product_object_id 直接對應
RoleLastUsed.Region entity.location.name 直接對應
CreateDate entity.resource.attribute.creation_time 已剖析為 ISO8601
MaxSessionDuration entity.resource.attribute.labels.value 直接對應
Path entity.resource.attribute.labels.value 直接對應
RoleLastUsed.LastUsedDate entity.resource.attribute.labels.value 直接對應
AssumeRolePolicyDocument entity.resource.attribute.permissions.name 直接對應
Description entity.resource.attribute.roles.description 直接對應
RoleName entity.resource.attribute.roles.name 直接對應
Arn entity.resource.name 直接對應
Group.Arn entity.resource.name 直接對應
RoleID entity.resource.product_object_id 直接對應
CreateDate entity.user.attribute.creation_time 已剖析為 ISO8601
PasswordLastUsed entity.user.last_login_time 已剖析為 ISO8601
UserID entity.user.product_object_id 直接對應
UserName entity.user.userid 直接對應
PermissionsBoundary.PermissionsBoundaryArn relations.entity.resource.attribute.labels.value 直接對應
PermissionsBoundary.PermissionsBoundaryType relations.entity.resource.attribute.labels.value 直接對應
user.PermissionsBoundary.PermissionsBoundaryArn relations.entity.resource.attribute.labels.value 直接對應
user.PermissionsBoundary.PermissionsBoundaryType relations.entity.resource.attribute.labels.value 直接對應
user.Arn relations.entity.resource.name 直接對應
user.CreateDate relations.entity.user.attribute.creation_time 已剖析為 ISO8601
tag.Key relations.entity.user.attribute.labels.key 直接對應
Path relations.entity.user.attribute.labels.value 直接對應
tag.Value relations.entity.user.attribute.labels.value 直接對應
user.Path relations.entity.user.attribute.labels.value 直接對應
user.PasswordLastUsed relations.entity.user.last_login_time 已剖析為 ISO8601
user.UserID relations.entity.user.product_object_id 直接對應
user.UserName relations.entity.user.userid 直接對應
不適用 entity.group.attribute.labels.key 常數:is_truncated
不適用 entity.resource.attribute.cloud.environment 常數:AMAZON_WEB_SERVICES
不適用 entity.resource.attribute.labels.key 常數:max_session_duration
不適用 entity.resource.resource_subtype 常數:User
不適用 entity.resource.resource_type 常數:ACCESS_POLICY
不適用 metadata.entity_type 常數:USER
不適用 metadata.product_name 常數:AWS IAM
不適用 metadata.vendor_name 常數:AWS
不適用 relations.direction 常數:UNIDIRECTIONAL
不適用 relations.entity.resource.attribute.labels.key 常數:permissions_boundary_arn
不適用 relations.entity.resource.resource_subtype 常數:User
不適用 relations.entity.user.attribute.labels.key 常數:path
不適用 relations.entity_type 常數:USER
不適用 relations.relationship 常數:MEMBER

變更記錄

查看這個剖析器的變更記錄

還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。