Detection rules › Panther

IAM Assume Role Blocklist Ignored

Severity
high
Log types
AWS.CloudTrail
Tags
AWS, Configuration Required, Identity and Access Management, Privilege Escalation:Abuse Elevation Control Mechanism
Reference
https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html
Source
github.com/panther-labs/panther-analysis

A user assumed a role that was explicitly blocklisted for manual user assumption.

MITRE ATT&CK coverage

TacticTechniques
Privilege EscalationT1548 Abuse Elevation Control Mechanism

Rule body yaml

AnalysisType: rule
Filename: aws_iam_assume_role_blocklist_ignored.py
RuleID: "AWS.CloudTrail.IAMAssumeRoleBlacklistIgnored"
DisplayName: "IAM Assume Role Blocklist Ignored"
Enabled: false
LogTypes:
  - AWS.CloudTrail
Tags:
  - AWS
  - Configuration Required
  - Identity and Access Management
  - Privilege Escalation:Abuse Elevation Control Mechanism
Reports:
  MITRE ATT&CK:
    - TA0004:T1548
Severity: High
Description: >
  A user assumed a role that was explicitly blocklisted for manual user assumption.
Runbook: >
  Verify that this was an approved assume role action. If not, consider revoking the access immediately and updating the AssumeRolePolicyDocument to prevent this from happening again.
Reference: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html
SummaryAttributes:
  - userAgent
  - sourceIpAddress
  - recipientAccountId
  - p_any_aws_arns
Tests:
  - Name: IAM Blocklisted Role Assumed
    ExpectedResult: true
    Log:
      {
        "awsRegion": "us-east-1",
        "eventID": "1111",
        "eventName": "AssumeRole",
        "eventSource": "sts.amazonaws.com",
        "eventTime": "2019-01-01T00:00:00Z",
        "eventType": "AwsApiCall",
        "eventVersion": "1.05",
        "recipientAccountId": "123456789012",
        "requestID": "1111",
        "requestParameters":
          {
            "durationSeconds": 900,
            "roleArn": "arn:aws:iam::123456789012:role/FullAdminRole",
            "roleSessionName": "1111",
          },
        "resources":
          [
            {
              "ARN": "arn:aws:iam::123456789012:role/FullAdminRole",
              "accountId": "123456789012",
              "type": "AWS::IAM::Role",
            },
          ],
        "responseElements":
          {
            "assumedRoleUser":
              {
                "arn": "arn:aws:sts::123456789012:assumed-role/FullAdminRole/1111",
                "assumedRoleId": "ABCD:1111",
              },
            "credentials":
              {
                "accessKeyId": "1111",
                "expiration": "Jan 01, 2019 0:00:00 PM",
                "sessionToken": "1111",
              },
          },
        "sharedEventID": "1111",
        "sourceIPAddress": "111.111.111.111",
        "userAgent": "aws-sdk-go/1.4.14 (go1.11.4; darwin; amd64)",
        "userIdentity":
          {
            "accesKeyId": "1111",
            "accessKeyId": "1111",
            "accountId": "123456789012",
            "arn": "arn:aws:iam::123456789012:user/example-user",
            "principalId": "1111",
            "sessionContext":
              {
                "attributes":
                  {
                    "creationDate": "2019-01-01T00:00:00Z",
                    "mfaAuthenticated": "true",
                  },
              },
            "type": "IAMUser",
            "userName": "example-user",
          },
      }
  - Name: IAM Non Blocklisted Role Assumed
    ExpectedResult: false
    Log:
      {
        "awsRegion": "us-east-1",
        "eventID": "1111",
        "eventName": "AssumeRole",
        "eventSource": "sts.amazonaws.com",
        "eventTime": "2019-01-01T00:00:00Z",
        "eventType": "AwsApiCall",
        "eventVersion": "1.05",
        "recipientAccountId": "123456789012",
        "requestID": "1111",
        "requestParameters":
          {
            "durationSeconds": 900,
            "roleArn": "arn:aws:iam::123456789012:role/example-role",
            "roleSessionName": "1111",
          },
        "resources":
          [
            {
              "ARN": "arn:aws:iam::123456789012:role/example-role",
              "accountId": "123456789012",
              "type": "AWS::IAM::Role",
            },
          ],
        "responseElements":
          {
            "assumedRoleUser":
              {
                "arn": "arn:aws:sts::123456789012:assumed-role/example-role/1111",
                "assumedRoleId": "ABCD:1111",
              },
            "credentials":
              {
                "accessKeyId": "1111",
                "expiration": "Jan 01, 2019 0:00:00 PM",
                "sessionToken": "1111",
              },
          },
        "sharedEventID": "1111",
        "sourceIPAddress": "111.111.111.111",
        "userAgent": "aws-sdk-go/1.4.14 (go1.11.4; darwin; amd64)",
        "userIdentity":
          {
            "accesKeyId": "1111",
            "accessKeyId": "1111",
            "accountId": "123456789012",
            "arn": "arn:aws:iam::123456789012:user/example-user",
            "principalId": "1111",
            "sessionContext":
              {
                "attributes":
                  {
                    "creationDate": "2019-01-01T00:00:00Z",
                    "mfaAuthenticated": "true",
                  },
              },
            "type": "IAMUser",
            "userName": "example-user",
          },
      }
  - Name: Error Assuming IAM Blocked Role
    ExpectedResult: false
    Log:
      {
        "awsRegion": "us-east-1",
        "errorCode": "ExpiredToken",
        "eventID": "1111",
        "eventName": "AssumeRole",
        "eventSource": "sts.amazonaws.com",
        "eventTime": "2019-01-01T00:00:00Z",
        "eventType": "AwsApiCall",
        "eventVersion": "1.05",
        "recipientAccountId": "123456789012",
        "requestID": "1111",
        "requestParameters":
          {
            "durationSeconds": 900,
            "roleArn": "arn:aws:iam::123456789012:role/FullAdminRole",
            "roleSessionName": "1111",
          },
        "resources":
          [
            {
              "ARN": "arn:aws:iam::123456789012:role/FullAdminRole",
              "accountId": "123456789012",
              "type": "AWS::IAM::Role",
            },
          ],
        "responseElements":
          {
            "assumedRoleUser":
              {
                "arn": "arn:aws:sts::123456789012:assumed-role/FullAdminRole/1111",
                "assumedRoleId": "ABCD:1111",
              },
            "credentials":
              {
                "accessKeyId": "1111",
                "expiration": "Jan 01, 2019 0:00:00 PM",
                "sessionToken": "1111",
              },
          },
        "sharedEventID": "1111",
        "sourceIPAddress": "111.111.111.111",
        "userAgent": "aws-sdk-go/1.4.14 (go1.11.4; darwin; amd64)",
        "userIdentity":
          {
            "accesKeyId": "1111",
            "accessKeyId": "1111",
            "accountId": "123456789012",
            "arn": "arn:aws:iam::123456789012:user/example-user",
            "principalId": "1111",
            "sessionContext":
              {
                "attributes":
                  {
                    "creationDate": "2019-01-01T00:00:00Z",
                    "mfaAuthenticated": "true",
                  },
              },
            "type": "IAMUser",
            "userName": "example-user",
          },
      }

Detection logic

Condition

not (errorCode is_not_null or errorMessage is_not_null or eventName ne "AssumeRole")
userIdentity.type in ["IAMUser", "FederatedUser"]
requestParameters.roleArn in "arn:aws:iam::123456789012:role/FullAdminRole"

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
errorCodeis_not_null(no value, null check)
errorMessageis_not_null(no value, null check)
eventNameneAssumeRole

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
requestParameters.roleArnin
  • arn:aws:iam::123456789012:role/FullAdminRole
userIdentity.typein
  • FederatedUser
  • IAMUser

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

Field
eventName
eventSource
awsRegion
recipientAccountId
sourceIPAddress
userAgent
userIdentity