本頁說明如何管理橫向移動洞察,這類洞察會找出允許某個專案中的服務帳戶模擬其他專案中服務帳戶的角色。如要進一步瞭解橫向移動深入分析,請參閱 橫向移動深入分析的產生方式。
有時,側向移動洞察資訊會連結至 角色建議。角色建議會提供建議動作,協助您修正側向移動洞察資訊所發現的問題。
事前準備
- 
     
     
      
      
  
   
   
     
   
  
   
   
     
   
  
 
 
   
 
 
  
  
    
      Enable the Recommender API. Roles required to enable APIs To enable APIs, you need the Service Usage Admin IAM role ( roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.
- 熟悉 IAM 角色建議。
- 請確認您已 在機構或專案層級啟用 Security Command Center 的進階或企業方案。詳情請參閱 帳單問題。
- 選用:瞭解建議工具洞察。
必要的角色
如要取得管理橫向移動洞察資訊所需的權限,請要求管理員在您要管理洞察資訊的專案、資料夾或機構中,授予下列 IAM 角色:
- 
            如要查看側向移動深入分析:
              
  
  
    
      IAM Recommender 檢視者  (roles/recommender.iamViewer)
- 
            如要修改側向移動洞察:
              
  
  
    
      IAM Recommender 管理員  (roles/recommender.iamAdmin)
如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。
這些預先定義的角色具備管理側向移動洞察所需的權限。如要查看確切的必要權限,請展開「必要權限」部分:
所需權限
如要管理側向移動深入分析,您必須具備下列權限:
- 
                如要查看橫向移動深入分析:
                - 
                      recommender.iamPolicyLateralMovementInsights.get
- 
                      recommender.iamPolicyLateralMovementInsights.list
 
- 
                      
- 
                如要修改橫向移動深入分析,請按照下列步驟操作:
                  recommender.iamPolicyLateralMovementInsights.update
列出橫向移動深入分析
如要列出專案、資料夾或機構的所有側向移動深入分析,請使用下列任一方法:控制台
- 
    前往 Google Cloud 控制台的「IAM」(身分與存取權管理) 頁面。 
- 選取專案、資料夾或機構。
  「安全性洞察」欄會顯示專案的所有安全性相關洞察,包括橫向移動洞察。橫向移動洞察資訊的格式為 N service account impersonations,其中 N 是服務帳戶在角色繫結中可模擬的服務帳戶數量。
gcloud
      使用 gcloud recommender
      insights list 指令,查看專案、資料夾或機構的所有橫向移動深入分析。
      
        
        
    
執行指令前,請先替換下列值:
- 
          RESOURCE_TYPE:要列出洞察資料的資源類型。請使用以下值:project、folder或organization。
- 
          RESOURCE_ID:要列出洞察資料的專案、資料夾或機構的 ID。
gcloud recommender insights list --insight-type=google.iam.policy.LateralMovementInsight \ --RESOURCE_TYPE=RESOURCE_ID \ --location=global
輸出內容會列出專案、資料夾或機構的所有側向移動深入分析。例如:
INSIGHT_ID CATEGORY INSIGHT_STATE LAST_REFRESH_TIME SEVERITY INSIGHT_SUBTYPE DESCRIPTION 046f8b89-bcee-46cd-9ac4-06818ed5273a SECURITY ACTIVE 2022-05-24T07:00:00Z LOW CROSS_PROJECT_IMPERSONATION Service account sa-1@another-project.iam.gserviceaccount.com from another project can impersonate 2 service account(s) under this project. 1328df82-5af2-4493-9850-d8ede4e72b27 SECURITY ACTIVE 2022-05-24T07:00:00Z LOW CROSS_PROJECT_IMPERSONATION Service account sa-2@another-project.iam.gserviceaccount.com from another project can impersonate 1 service account(s) under this project. 17f50957-333c-4f21-86c1-6a62216b309e SECURITY ACTIVE 2022-05-24T07:00:00Z LOW CROSS_PROJECT_IMPERSONATION Service account sa-3@another-project.iam.gserviceaccount.com from another project can impersonate 1 service account(s) under this project. 187200d2-b42c-48fb-86d7-c2746a87fed2 SECURITY ACTIVE 2022-05-24T07:00:00Z LOW CROSS_PROJECT_IMPERSONATION Service account sa-4@another-project.iam.gserviceaccount.com from another project can impersonate 32 service account(s) under this project. 1f1740a4-ff98-4f64-99a4-5ef5df5a2097 SECURITY ACTIVE 2022-05-24T07:00:00Z LOW CROSS_PROJECT_IMPERSONATION Service account sa-5@another-project.iam.gserviceaccount.com from another project can impersonate 1 service account(s) under this project.
REST
  Recommender API 的 insights.list 方法會列出專案、資料夾或機構的所有側向移動洞察。
使用任何要求資料之前,請先替換以下項目:
- 
          RESOURCE_TYPE:要列出洞察資料的資源類型。請使用以下值:projects、folders或organizations。
- 
          RESOURCE_ID:要列出洞察資料的專案、資料夾或機構的 ID。
- PROJECT_ID:您的 Google Cloud 專案 ID。專案 ID 為英數字串,例如- my-project。
HTTP 方法和網址:
GET https://recommender.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights
如要傳送要求,請展開以下其中一個選項:
回應會列出專案、資料夾或機構的所有側向移動深入分析。例如:
{
  "insights": [
    {
      "name": "projects/123456789012/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights/13088eec-9573-415f-81a7-46e1a260e860",
      "description": "Service account sa-1@another-project.iam.gserviceaccount.com from another project can impersonate 2 service account(s) under this project.",
      "content": {
        "impersonator": {
          "serviceAccount": "sa-1@another-project.iam.gserviceaccount.com",
          "serviceAccountOwner": "//cloudresourcemanager.googleapis.com/projects/987654321098",
          "isGoogleManaged": false
        },
        "targetServiceAccounts": [
          "target-service-account-1@this-project.iam.gserviceaccount.com",
          "target-service-account-2@this-project.iam.gserviceaccount.com"
        ],
        "impersonationPolicy": {
          "resource": "//cloudresourcemanager.googleapis.com/projects/123456789012",
          "role": "roles/editor",
          "member": "serviceAccount:sa-1@another-project.iam.gserviceaccount.com",
          "condition": {
            "expression": "",
            "title": "",
            "description": "",
            "location": ""
          }
        },
        "impersonationPermissionUsage": [
          {
            "permission": "iam.serviceAccounts.actAs"
            "used": false
          }
        ],
        "hasPermissionUsageData": true
      },
      "lastRefreshTime": "2022-05-24T07:00:00Z",
      "observationPeriod": "7776000s",
      "stateInfo": {
        "state": "ACTIVE"
      },
      "category": "SECURITY",
      "associatedRecommendations": [
        {
          "recommendation": "projects/123456789012/locations/global/recommenders/google.iam.policy.Recommender/recommendations/03f3dc20-f9e7-4502-95ab-bf7d3164846f"
        }
      ],
      "targetResources": [
        "//cloudresourcemanager.googleapis.com/projects/123456789012"
      ],
      "insightSubtype": "CROSS_PROJECT_IMPERSONATION",
      "etag": "\"f48fa6a1b15c7741\"",
      "severity": "LOW"
    }
  ]
}如要進一步瞭解洞察資料的組成元素,請參閱本頁的「查看側向移動洞察資料」。
取得單一橫向移動深入分析
如要進一步瞭解單一洞察資料,包括洞察資料的說明、狀態和任何相關聯的建議,請使用下列其中一種方法:
控制台
- 
    前往 Google Cloud 控制台的「IAM」(身分與存取權管理) 頁面。 
- 選取專案、資料夾或機構。
- 
    在「安全性深入分析」欄中,按一下水平擴散深入分析。 橫向移動洞察資料的格式為 N service account impersonations,其中N是角色繫結中服務帳戶可模擬的服務帳戶數量。
Google Cloud 控制台會開啟窗格,顯示洞察資料的詳細資料。
gcloud
      使用 gcloud recommender
      insights describe 指令和洞察 ID,查看單一洞察的相關資訊。
    
- 
        INSIGHT_ID:要查看的洞察 ID。如要找出 ID,請列出專案、資料夾或機構的洞察資料。
- 
          RESOURCE_TYPE:要管理洞察資料的資源類型。請使用以下值:project、folder或organization。
- 
          RESOURCE_ID:您要管理洞察資料的專案、資料夾或機構 ID。
gcloud recommender insights describe INSIGHT_ID \ --insight-type=google.iam.policy.LateralMovementInsight \ --RESOURCE_TYPE=RESOURCE_ID \ --location=global
      輸出內容會詳細顯示洞察資料。舉例來說,下列洞察資訊指出專案 123456789012 的 IAM 政策允許 sa-1@another-project.iam.gserviceaccount.com 模擬 target-service-account-1@this-project.iam.gserviceaccount.com 和 target-service-account-2@this-project.iam.gserviceaccount.com。
associatedRecommendations: - recommendation: projects/123456789012/locations/global/recommenders/google.iam.policy.Recommender/recommendations/03f3dc20-f9e7-4502-95ab-bf7d3164846f category: SECURITY content: hasPermissionUsageData: true impersonationPermissionUsage: - permission: iam.serviceAccounts.actAs used: false impersonationPolicy: condition: description: '' expression: '' location: '' title: '' member: serviceAccount:sa-1@another-project.iam.gserviceaccount.com resource: //cloudresourcemanager.googleapis.com/projects/123456789012 role: roles/editor impersonator: isGoogleManaged: false serviceAccount: sa-1@another-project.iam.gserviceaccount.com serviceAccountOwner: //cloudresourcemanager.googleapis.com/projects/987654321098 targetServiceAccounts: - target-service-account-1@this-project.iam.gserviceaccount.com - target-service-account-2@this-project.iam.gserviceaccount.com description: Service account sa-1@another-project.iam.gserviceaccount.com from another project can impersonate 2 service account(s) under this project. etag: '"f48fa6a1b15c7741"' insightSubtype: CROSS_PROJECT_IMPERSONATION lastRefreshTime: '2022-05-24T07:00:00Z' name: projects/123456789012/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights/13088eec-9573-415f-81a7-46e1a260e860 observationPeriod: 7776000s severity: LOW stateInfo: state: ACTIVE targetResources: - //cloudresourcemanager.googleapis.com/projects/123456789012
如要進一步瞭解洞察資料的組成元素,請參閱本頁的「查看側向移動洞察資料」。
REST
  Recommender API 的 insights.get 方法會取得單一洞察資料。
使用任何要求資料之前,請先替換以下項目:
- 
          RESOURCE_TYPE:要管理洞察資料的資源類型。請使用下列值:projects、folders或organizations。
- 
          RESOURCE_ID:您要管理洞察資料的專案、資料夾或機構 ID。
- 
        INSIGHT_ID:要查看的洞察資料 ID。如果您不知道洞察 ID,可以列出專案、資料夾或機構中的洞察,洞察 ID 是洞察的name欄位中insights/後方的所有內容。
- PROJECT_ID:您的 Google Cloud 專案 ID。專案 ID 為英數字串,例如- my-project。
HTTP 方法和網址:
GET https://recommender.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights/INSIGHT_ID
如要傳送要求,請展開以下其中一個選項:
      回覆會包含洞察資料。舉例來說,下列洞察資訊指出專案 123456789012 的 IAM 政策允許 sa-1@another-project.iam.gserviceaccount.com 模擬 target-service-account-1@this-project.iam.gserviceaccount.com 和 target-service-account-2@this-project.iam.gserviceaccount.com。
{
  "name": "projects/123456789012/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights/13088eec-9573-415f-81a7-46e1a260e860",
  "description": "Service account sa-1@another-project.iam.gserviceaccount.com from another project can impersonate 2 service account(s) under this project.",
  "content": {
    "impersonator": {
      "serviceAccount": "sa-1@another-project.iam.gserviceaccount.com",
      "serviceAccountOwner": "//cloudresourcemanager.googleapis.com/projects/987654321098",
      "isGoogleManaged": false
    },
    "targetServiceAccounts": [
      "target-service-account-1@this-project.iam.gserviceaccount.com",
      "target-service-account-2@this-project.iam.gserviceaccount.com"
    ],
    "impersonationPolicy": {
      "resource": "//cloudresourcemanager.googleapis.com/projects/123456789012",
      "role": "roles/editor",
      "member": "serviceAccount:sa-1@another-project.iam.gserviceaccount.com",
      "condition": {
        "expression": "",
        "title": "",
        "description": "",
        "location": ""
      }
    },
    "impersonationPermissionUsage": [
      {
        "permission": "iam.serviceAccounts.actAs"
        "used": false
      }
    ],
    "hasPermissionUsageData": true
  },
  "lastRefreshTime": "2022-05-24T07:00:00Z",
  "observationPeriod": "7776000s",
  "stateInfo": {
    "state": "ACTIVE"
  },
  "category": "SECURITY",
  "associatedRecommendations": [
    {
      "recommendation": "projects/123456789012/locations/global/recommenders/google.iam.policy.Recommender/recommendations/03f3dc20-f9e7-4502-95ab-bf7d3164846f"
    }
  ],
  "targetResources": [
    "//cloudresourcemanager.googleapis.com/projects/123456789012"
  ],
  "insightSubtype": "CROSS_PROJECT_IMPERSONATION",
  "etag": "\"f48fa6a1b15c7741\"",
  "severity": "LOW"
}如要進一步瞭解洞察資料的組成元素,請參閱本頁的「查看側向移動洞察資料」。
查看橫向移動深入分析
取得單一洞察後,您可以查看其內容,瞭解洞察所強調的資源用量模式。
控制台
在 Google Cloud 控制台中按一下橫向移動深入分析, Google Cloud 控制台就會開啟窗格,顯示深入分析的詳細資料。這些詳細資料的顯示方式,取決於洞察資訊是否與建議相關聯。
如果洞察資訊與建議相關聯,窗格會顯示建議詳細資料。
如果洞察資料未與建議相關聯,窗格會顯示下列內容:
- 
    服務帳戶的來源專案:建立具備模擬權限服務帳戶的專案。     
- 
    可在這項專案中模擬的服務帳戶。目前專案中所有服務帳戶的清單,具有模擬權限的服務帳戶可以模擬這些帳戶。     
- 
    允許在專案中模擬的權限:服務帳戶擁有的模擬權限清單。     
- 
    目前權限:服務帳戶的所有權限清單。     
gcloud
    洞察內容取決於子類型。
    橫向移動深入分析 (google.iam.policy.LateralMovementInsight) 深入分析具有 CROSS_PROJECT_IMPERSONATION 子類型。
    CROSS_PROJECT_IMPERSONATION 洞察包含下列元件,但不一定會依序顯示:
- 
      associatedRecommendations:與洞察資料相關聯的任何建議 ID。如果沒有與洞察資料相關的建議,這個欄位會留空。
- 
      category:IAM 洞察的類別一律為SECURITY。
- 
      content:回報服務帳戶在其他專案中模擬服務帳戶的能力詳細資料。這個欄位包含下列元件:- hasPermissionUsageData:布林值,指出這個角色繫結是否有權限使用資料。權限使用資料會指出角色繫結中的權限是否已使用。條件式角色繫結不提供這項資料。
- impersonationPermissionUsage:模擬權限清單及其使用資訊。如果過去 90 天內曾使用某項權限,系統就會視為已使用。否則會視為未使用。- 如果 - hasPermissionUsageData為 false,則- impersonationPermissionUsage欄位為空白。
- impersonationPolicy:角色繫結的相關資訊,可授予服務帳戶模擬權限。
- impersonator:有權模擬專案中服務帳戶的服務帳戶詳細資料,包括:- isGoogleManaged:服務帳戶是否由 Google 擁有及管理。
- serviceAccount:服務帳戶的電子郵件地址。
- serviceAccountOwner:擁有服務帳戶的專案。如果服務帳戶由 Google 擁有,這個欄位的值為- Google managed。如果服務帳戶屬於貴機構外部的專案,這個欄位的值會是- Unknown to your org。
 
- targetServiceAccounts:服務帳戶清單,- impersonator欄位中的服務帳戶有權模擬這些帳戶。如果模擬者可以模擬超過 1500 個服務帳戶,這份清單就會空白。如要瞭解模擬者可模擬的服務帳戶數量,請參閱「- description」欄位。
 
- 
      description:使用者可自然閱讀的洞察摘要。
- 
      etag:洞察資料目前狀態的專屬 ID。 每次洞察資料變更時,系統都會指派新的etag值。如要變更洞察資料的狀態,必須提供現有洞察資料的 etag。使用etag可確保只有在洞察資料自上次擷取後未變更時,才會執行任何作業。
- 
      insightSubtype:洞察子類型。
- 
      lastRefreshTime:洞察資料上次更新的日期,表示用於產生洞察資料的資料是否為最新狀態。
- 
      name:洞察名稱,格式如下:RESOURCE_TYPE/RESOURCE_ID/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights/INSIGHT_ID 預留位置的值如下: - 
          RESOURCE_TYPE:洞察資訊的產生對象資源類型。
- 
          RESOURCE_ID:洞察資訊所屬的專案、資料夾或機構 ID。
- INSIGHT_ID:洞察資料的專屬 ID。
 
- 
          
- 
      observationPeriod:洞察資料的參考時間範圍。用來生成洞察的來源資料結束於lastRefreshTime,開始於lastRefreshTime減去observationPeriod。
- 
      severity:洞察資訊的嚴重程度。所有橫向移動深入分析的嚴重程度都是LOW。
- 
      stateInfo:提案後,洞察資料會經歷多種狀態轉換:- 
          ACTIVE:洞察資料已產生,但未採取任何行動,或採取行動後未更新洞察資料的狀態。基礎資料變更時,系統會更新有效的洞察資料。
- 
          ACCEPTED:已根據洞察資料採取行動。當相關聯的建議標示為CLAIMED、SUCCEEDED或FAILED,或直接接受洞察資料時,洞察資料就會獲得採用。洞察資料處於ACCEPTED狀態時,洞察資料內容無法變更。接受的洞察資料會在接受後保留 90 天。
 
- 
          
- 
      targetResources:洞察資訊所屬機構、資料夾、專案或服務帳戶的完整資源名稱 。例如://cloudresourcemanager.googleapis.com/projects/123456789012。
REST
    洞察內容取決於子類型。
    橫向移動深入分析 (google.iam.policy.LateralMovementInsight) 深入分析具有 CROSS_PROJECT_IMPERSONATION 子類型。
    CROSS_PROJECT_IMPERSONATION 洞察包含下列元件,但不一定會依序顯示:
- 
      associatedRecommendations:與洞察資料相關聯的任何建議 ID。如果沒有與洞察資料相關的建議,這個欄位會留空。
- 
      category:IAM 洞察的類別一律為SECURITY。
- 
      content:回報服務帳戶在其他專案中模擬服務帳戶的能力詳細資料。這個欄位包含下列元件:- hasPermissionUsageData:布林值,指出這個角色繫結是否有權限使用資料。權限使用資料會指出角色繫結中的權限是否已使用。條件式角色繫結不提供這項資料。
- impersonationPermissionUsage:模擬權限清單及其使用資訊。如果過去 90 天內曾使用某項權限,系統就會視為已使用。否則會視為未使用。- 如果 - hasPermissionUsageData為 false,則- impersonationPermissionUsage欄位為空白。
- impersonationPolicy:角色繫結的相關資訊,可授予服務帳戶模擬權限。
- impersonator:有權模擬專案中服務帳戶的服務帳戶詳細資料,包括:- isGoogleManaged:服務帳戶是否由 Google 擁有及管理。
- serviceAccount:服務帳戶的電子郵件地址。
- serviceAccountOwner:擁有服務帳戶的專案。如果服務帳戶由 Google 擁有,這個欄位的值為- Google managed。如果服務帳戶屬於貴機構外部的專案,這個欄位的值會是- Unknown to your org。
 
- targetServiceAccounts:服務帳戶清單,- impersonator欄位中的服務帳戶有權模擬這些帳戶。如果模擬者可以模擬超過 1500 個服務帳戶,這份清單就會空白。如要瞭解模擬者可模擬的服務帳戶數量,請參閱「- description」欄位。
 
- 
      description:使用者可自然閱讀的洞察摘要。
- 
      etag:洞察資料目前狀態的專屬 ID。 每次洞察資料變更時,系統都會指派新的etag值。如要變更洞察資料的狀態,必須提供現有洞察資料的 etag。使用etag可確保只有在洞察資料自上次擷取後未變更時,才會執行任何作業。
- 
      insightSubtype:洞察子類型。
- 
      lastRefreshTime:洞察資料上次更新的日期,表示用於產生洞察資料的資料是否為最新狀態。
- 
      name:洞察名稱,格式如下:RESOURCE_TYPE/RESOURCE_ID/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights/INSIGHT_ID 預留位置的值如下: - 
          RESOURCE_TYPE:洞察資訊的產生對象資源類型。
- 
          RESOURCE_ID:洞察資訊所屬的專案、資料夾或機構 ID。
- INSIGHT_ID:洞察資料的專屬 ID。
 
- 
          
- 
      observationPeriod:洞察資料的參考時間範圍。用來生成洞察的來源資料結束於lastRefreshTime,開始於lastRefreshTime減去observationPeriod。
- 
      severity:洞察資訊的嚴重程度。所有橫向移動深入分析的嚴重程度都是LOW。
- 
      stateInfo:提案後,洞察資料會經歷多種狀態轉換:- 
          ACTIVE:洞察資料已產生,但未採取任何行動,或採取行動後未更新洞察資料的狀態。基礎資料變更時,系統會更新有效的洞察資料。
- 
          ACCEPTED:已根據洞察資料採取行動。當相關聯的建議標示為CLAIMED、SUCCEEDED或FAILED,或直接接受洞察資料時,洞察資料就會獲得採用。洞察資料處於ACCEPTED狀態時,洞察資料內容無法變更。接受的洞察資料會在接受後保留 90 天。
 
- 
          
- 
      targetResources:洞察資訊所屬機構、資料夾、專案或服務帳戶的完整資源名稱 。例如://cloudresourcemanager.googleapis.com/projects/123456789012。
將橫向移動深入分析標示為 ACCEPTED
  
    如果根據有效洞察資料採取行動,您可以將該洞察資料標示為 ACCEPTED。ACCEPTED 狀態會告知 Recommender API 您已根據這項洞察資料採取行動,有助於改善建議。
    接受的洞察資料在標示為 ACCEPTED 後,會保留 90 天。
  
控制台
    如果深入分析資料與建議相關聯,套用建議會將深入分析資料的狀態變更為 ACCEPTED。
    如要將洞察標示為 ACCEPTED,但不套用建議,請使用 gcloud CLI 或 REST API。
  
gcloud
      使用 
      gcloud recommender insights mark-accepted 指令並提供洞察 ID,將洞察標示為 ACCEPTED。
    
- 
        INSIGHT_ID:要查看的洞察 ID。如要找出 ID,請列出專案、資料夾或機構的洞察資料。
- 
          RESOURCE_TYPE:要管理洞察資料的資源類型。請使用以下值:project、folder或organization。
- 
          RESOURCE_ID:您要管理洞察資料的專案、資料夾或機構 ID。
- 
        ETAG:洞察版本的 ID。如要取得etag,請按照下列步驟操作:- 
            使用 gcloud recommender insights describe指令取得洞察資料。
- 
            從輸出內容中找出並複製 etag值,包括前後的引號。例如:"d3cdec23cc712bd0"。
 
- 
            使用 
gcloud recommender insights mark-accepted INSIGHT_ID \ --insight-type=google.iam.policy.LateralMovementInsight \ --RESOURCE_TYPE=RESOURCE_ID \ --location=global \ --etag=ETAG
      輸出內容會顯示洞察資料,現在狀態為 ACCEPTED:
    
associatedRecommendations: - recommendation: projects/123456789012/locations/global/recommenders/google.iam.policy.Recommender/recommendations/03f3dc20-f9e7-4502-95ab-bf7d3164846f category: SECURITY content: hasPermissionUsageData: true impersonationPermissionUsage: - permission: iam.serviceAccounts.actAs used: false impersonationPolicy: condition: description: '' expression: '' location: '' title: '' member: serviceAccount:sa-1@another-project.iam.gserviceaccount.com resource: //cloudresourcemanager.googleapis.com/projects/123456789012 role: roles/editor impersonator: isGoogleManaged: false serviceAccount: sa-1@another-project.iam.gserviceaccount.com serviceAccountOwner: //cloudresourcemanager.googleapis.com/projects/987654321098 targetServiceAccounts: - target-service-account-1@this-project.iam.gserviceaccount.com - target-service-account-2@this-project.iam.gserviceaccount.com description: Service account sa-1@another-project.iam.gserviceaccount.com from another project can impersonate 2 service account(s) under this project. etag: '"f48fa6a1b15c7741"' insightSubtype: CROSS_PROJECT_IMPERSONATION lastRefreshTime: '2022-05-24T07:00:00Z' name: projects/123456789012/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights/13088eec-9573-415f-81a7-46e1a260e860 observationPeriod: 7776000s severity: LOW stateInfo: state: ACCEPTED targetResources: - //cloudresourcemanager.googleapis.com/projects/123456789012
如要進一步瞭解深入分析的狀態資訊,請參閱本頁的「查看側向移動深入分析」。
REST
  Recommender API 的
  insights.markAccepted
  
  方法會將洞察標示為 ACCEPTED。
使用任何要求資料之前,請先替換以下項目:
- 
          RESOURCE_TYPE:要管理洞察資料的資源類型。請使用下列值:projects、folders或organizations。
- 
          RESOURCE_ID:您要管理洞察資料的專案、資料夾或機構 ID。
- 
        INSIGHT_ID:要查看的洞察資料 ID。如果您不知道洞察 ID,可以列出專案、資料夾或機構中的洞察,洞察 ID 是洞察的name欄位中insights/後方的所有內容。
- 
        ETAG:洞察版本的 ID。如要取得etag,請按照下列步驟操作:- 使用 insights.get方法取得洞察資料。
- 從回應中找出並複製 etag值。
 
- 使用 
- PROJECT_ID:您的 Google Cloud 專案 ID。專案 ID 為英數字串,例如- my-project。
HTTP 方法和網址:
POST https://recommender.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights/INSIGHT_ID:markAccepted
JSON 要求主體:
{
  "etag": "ETAG"
}如要傳送要求,請展開以下其中一個選項:
      回應包含洞察資料,現在會顯示 ACCEPTED 的狀態:
    
{
  "name": "projects/123456789012/locations/global/insightTypes/google.iam.policy.LateralMovementInsight/insights/13088eec-9573-415f-81a7-46e1a260e860",
  "description": "Service account sa-1@another-project.iam.gserviceaccount.com from another project can impersonate 2 service account(s) under this project.",
  "content": {
    "impersonator": {
      "serviceAccount": "sa-1@another-project.iam.gserviceaccount.com",
      "serviceAccountOwner": "//cloudresourcemanager.googleapis.com/projects/987654321098",
      "isGoogleManaged": false
    },
    "targetServiceAccounts": [
      "target-service-account-1@this-project.iam.gserviceaccount.com",
      "target-service-account-2@this-project.iam.gserviceaccount.com"
    ],
    "impersonationPolicy": {
      "resource": "//cloudresourcemanager.googleapis.com/projects/123456789012",
      "role": "roles/editor",
      "member": "serviceAccount:sa-1@another-project.iam.gserviceaccount.com",
      "condition": {
        "expression": "",
        "title": "",
        "description": "",
        "location": ""
      }
    },
    "impersonationPermissionUsage": [
      {
        "permission": "iam.serviceAccounts.actAs"
        "used": false
      }
    ],
    "hasPermissionUsageData": true
  },
  "lastRefreshTime": "2022-05-24T07:00:00Z",
  "observationPeriod": "7776000s",
  "stateInfo": {
    "state": "ACCEPTED"
  },
  "category": "SECURITY",
  "associatedRecommendations": [
    {
      "recommendation": "projects/123456789012/locations/global/recommenders/google.iam.policy.Recommender/recommendations/03f3dc20-f9e7-4502-95ab-bf7d3164846f"
    }
  ],
  "targetResources": [
    "//cloudresourcemanager.googleapis.com/projects/123456789012"
  ],
  "insightSubtype": "CROSS_PROJECT_IMPERSONATION",
  "etag": "\"f48fa6a1b15c7741\"",
  "severity": "LOW"
}如要進一步瞭解深入分析的狀態資訊,請參閱本頁的「查看側向移動深入分析」。
後續步驟
- 瞭解如何查看及套用政策建議。
- 使用 Active Assist 查看及管理專案的所有建議,包括 IAM 建議。