Persistence: IAM Anomalous Grant

This document describes a threat finding type in Security Command Center. Threat findings are generated by threat detectors when they detect a potential threat in your cloud resources. For a full list of available threat findings, see Threat findings index.

Finding description

Audit logs are examined to detect the addition of IAM role bindings that might be considered suspicious.

The following are examples of anomalous grants:

  • Inviting an external user, such as gmail.com user, as a project owner from the Google Cloud console
  • A service account granting sensitive permissions
  • A custom role granting sensitive permissions
  • A service account added from outside your organization or project

The IAM Anomalous Grant finding is unique in that it includes sub-rules that provide more specific information about each instance of this finding. The severity classification of this finding depends on the sub-rule. Each sub-rule might require a different response.

The following list shows all possible sub-rules and their severities:

  • external_service_account_added_to_policy:
    • HIGH, if a highly sensitive role was granted or if a medium-sensitivity role was granted at the organization level. For more information, see Highly-sensitive roles.
    • MEDIUM, if a medium sensitivity role was granted. For more information, see Medium-sensitivity roles.
  • external_member_invited_to_policy: HIGH
  • external_member_added_to_policy:
    • HIGH, if a highly sensitive role was granted or if a medium-sensitivity role was granted at the organization level. For more information, see Highly-sensitive roles.
    • MEDIUM, if a medium sensitivity role was granted. For more information, see Medium-sensitivity roles.
  • custom_role_given_sensitive_permissions: MEDIUM
  • service_account_granted_sensitive_role_to_member: HIGH
  • policy_modified_by_default_compute_service_account: HIGH

To respond to this finding, do the following:

Step 1: Review finding details

  1. Open a Persistence: IAM Anomalous Grant finding as directed in Reviewing findings. The details panel for the finding opens to the Summary tab.

  2. On the Summary tab, review the information in the following sections:

    • What was detected, especially the following fields:
      • Principal email: email address for the user or service account that assigned the role.
    • Affected resource

    • Related links, especially the following fields:

      • Cloud Logging URI: link to Logging entries.
      • MITRE ATT&CK method: link to the MITRE ATT&CK documentation.
      • Related findings: links to any related findings.
      • VirusTotal indicator: link to the VirusTotal analysis page.
  3. Click the JSON tab. The complete JSON of the finding is displayed.

  4. In the JSON for the finding, note the following fields:

    • detectionCategory:
      • subRuleName: more specific information about the type of anomalous grant that occurred. The sub-rule determines the severity classification of this finding.
    • evidence:
      • sourceLogId:
      • projectId: the ID of the project that contains the finding.
    • properties:
      • sensitiveRoleGrant:
        • bindingDeltas:
        • Action: the action taken by the user.
        • Role: the role assigned to the user.
        • member: the email address of the user that received the role.

Step 2: Check logs

  1. On the Summary tab of the finding details panel, click the Cloud Logging URI link to open the Logs Explorer.
  2. On the page that loads, look for new or updated IAM resources using the following filters:
    • protoPayload.methodName="SetIamPolicy"
    • protoPayload.methodName="google.iam.admin.v1.UpdateRole"
    • protoPayload.methodName="google.iam.admin.v1.CreateRole"

Step 3: Research attack and response methods

  1. Review MITRE ATT&CK framework entries for this finding type: Valid Accounts: Cloud Accounts.
  2. Review related findings by clicking the link on the Related findings row in the Summary tab of the finding details. Related findings are the same finding type and the same instance and network.
  3. To develop a response plan, combine your investigation results with MITRE research.

Step 4: Implement your response

The following response plan might be appropriate for this finding, but might also impact operations. Carefully evaluate the information you gather in your investigation to determine the best way to resolve findings.

  • Contact the owner of the project with the compromised account.
  • Delete the compromised service account and rotate and delete all service account access keys for the compromised project. After deletion, resources that use the service account for authentication lose access.
  • Delete project resources created by unauthorized accounts, like unfamiliar Compute Engine instances, snapshots, service accounts, and IAM users.
  • To restrict adding gmail.com users, use the Organization Policy.
  • To identify and fix overly permissive roles, use IAM Recommender.

What's next