Detection rules › Panther

AWS Resource Made Public

Severity
medium
Entities
aws_account_ids, aws_arns
Log types
AWS.CloudTrail
Tags
AWS, Exfiltration:Transfer Data to Cloud Account
Reference
https://aws.amazon.com/blogs/security/identifying-publicly-accessible-resources-with-amazon-vpc-network-access-analyzer/
Source
github.com/panther-labs/panther-analysis

Some AWS resource was made publicly accessible over the internet. Checks ECR, Elasticsearch, KMS, S3, S3 Glacier, SNS, SQS, and Secrets Manager.

MITRE ATT&CK coverage

TacticTechniques
ExfiltrationT1537 Transfer Data to Cloud Account

Rule body yaml

AnalysisType: rule
Filename: aws_resource_made_public.py
RuleID: "AWS.CloudTrail.ResourceMadePublic"
DisplayName: "AWS Resource Made Public"
Enabled: true
LogTypes:
  - AWS.CloudTrail
Tags:
  - AWS
  - Exfiltration:Transfer Data to Cloud Account
Severity: Medium
Reports:
  MITRE ATT&CK:
    - TA0010:T1537
Description: >
  Some AWS resource was made publicly accessible over the internet.
  Checks ECR, Elasticsearch, KMS, S3, S3 Glacier, SNS, SQS, and Secrets Manager.
Runbook: Adjust the policy so that the resource is no longer publicly accessible
Reference: https://aws.amazon.com/blogs/security/identifying-publicly-accessible-resources-with-amazon-vpc-network-access-analyzer/
SummaryAttributes:
  - userAgent
  - sourceIpAddress
  - vpcEndpointId
  - recipientAccountId
  - p_any_aws_arns
Tests:
  - Name: ECR Made Public
    ExpectedResult: true
    Log:
      {
        "awsRegion": "eu-west-1",
        "eventID": "685e066d-a3aa-4323-a6a1-2f187a2fc986",
        "eventName": "SetRepositoryPolicy",
        "eventSource": "ecr.amazonaws.com",
        "eventTime": "2020-11-20 06:19:05.000",
        "eventType": "AwsApiCall",
        "eventVersion": "1.05",
        "recipientAccountId": "112233445566",
        "requestID": "95fd6392-627c-467b-b940-895183d3298d",
        "requestParameters":
          {
            "force": false,
            "policyText": '{"Version":"2012-10-17","Statement":[{"Action":["ecr:BatchCheckLayerAvailability","ecr:BatchGetImage","ecr:GetAuthorizationToken","ecr:GetDownloadUrlForLayer"],"Effect":"Allow","Principal":"*","Sid":"PublicRead"}]}',
            "repositoryName": "community",
          },
        "resources":
          [
            {
              "accountId": "112233445566",
              "arn": "arn:aws:ecr:eu-west-1:112233445566:repository/community",
            },
          ],
        "responseElements":
          {
            "policyText": "{\n  \"Version\" : \"2012-10-17\",\n  \"Statement\" : [ {\n    \"Sid\" : \"PublicRead\",\n    \"Effect\" : \"Allow\",\n    \"Principal\" : \"*\",\n    \"Action\" : [ \"ecr:BatchCheckLayerAvailability\", \"ecr:BatchGetImage\", \"ecr:GetAuthorizationToken\", \"ecr:GetDownloadUrlForLayer\" ]\n  } ]\n}",
            "registryId": "112233445566",
            "repositoryName": "community",
          },
        "sourceIPAddress": "cloudformation.amazonaws.com",
        "userAgent": "cloudformation.amazonaws.com",
        "userIdentity":
          {
            "accessKeyId": "ASIAIJJG73VC6IW5OFVQ",
            "accountId": "112233445566",
            "arn": "arn:aws:sts::112233445566:assumed-role/ServiceRole/AWSCloudFormation",
            "invokedBy": "cloudformation.amazonaws.com",
            "principalId": "AROAJJJJTTTT44445IJJJ:AWSCloudFormation",
            "sessionContext":
              {
                "attributes":
                  {
                    "creationDate": "2020-11-20T06:19:04Z",
                    "mfaAuthenticated": "false",
                  },
                "sessionIssuer":
                  {
                    "accountId": "112233445566",
                    "arn": "arn:aws:iam::112233445566:role/ServiceRole",
                    "principalId": "AROAJJJJTTTT44445IJJJ",
                    "type": "Role",
                    "userName": "ServiceRole",
                  },
                "webIdFederationData": {},
              },
            "type": "AssumedRole",
          },
        "p_event_time": "2020-11-20 06:19:05.000",
        "p_parse_time": "2020-11-20 06:31:53.258",
        "p_log_type": "AWS.CloudTrail",
        "p_row_id": "ea68a92f0295a6bed49fa8af068faa05",
        "p_any_aws_account_ids": ["112233445566"],
        "p_any_aws_arns":
          [
            "arn:aws:ecr:eu-west-1:112233445566:repository/community",
            "arn:aws:iam::112233445566:role/ServiceRole",
            "arn:aws:sts::112233445566:assumed-role/ServiceRole/AWSCloudFormation",
          ],
      }
  - Name: S3 Made Publicly Accessible
    ExpectedResult: true
    Log:
      {
        "additionalEventData":
          {
            "AuthenticationMethod": "AuthHeader",
            "CipherSuite": "ECDHE-RSA-AES128-SHA",
            "SignatureVersion": "SigV4",
            "vpcEndpointId": "vpce-1111",
          },
        "awsRegion": "us-west-2",
        "eventID": "1111",
        "eventName": "PutBucketPolicy",
        "eventSource": "s3.amazonaws.com",
        "eventTime": "2019-01-01T00:00:00Z",
        "eventType": "AwsApiCall",
        "eventVersion": "1.05",
        "recipientAccountId": "123456789012",
        "requestID": "1111",
        "requestParameters":
          {
            "bucketName": "example-bucket",
            "bucketPolicy":
              {
                "Statement":
                  [
                    {
                      "Action": "s3:GetBucketAcl",
                      "Effect": "Allow",
                      "Principal": { "AWS": "*" },
                      "Resource": "arn:aws:s3:::example-bucket",
                      "Sid": "Public Access",
                    },
                  ],
                "Version": "2012-10-17",
              },
            "host": ["s3.us-west-2.amazonaws.com"],
            "policy": [""],
          },
        "responseElements": null,
        "sourceIPAddress": "111.111.111.111",
        "userAgent": "Mozilla/2.0 (compatible; NEWT ActiveX; Win32)",
        "userIdentity":
          {
            "accessKeyId": "1111",
            "accountId": "123456789012",
            "arn": "arn:aws:sts::123456789012:assumed-role/example-role/example-user",
            "principalId": "1111",
            "sessionContext":
              {
                "attributes":
                  {
                    "creationDate": "2019-01-01T00:00:00Z",
                    "mfaAuthenticated": "true",
                  },
                "sessionIssuer":
                  {
                    "accountId": "123456789012",
                    "arn": "arn:aws:iam::123456789012:role/example-role",
                    "principalId": "1111",
                    "type": "Role",
                    "userName": "example-role",
                  },
              },
            "type": "AssumedRole",
          },
        "vpcEndpointId": "vpce-1111",
      }
  - Name: S3 Not Made Publicly Accessible
    ExpectedResult: false
    Log:
      {
        "additionalEventData":
          {
            "AuthenticationMethod": "AuthHeader",
            "CipherSuite": "ECDHE-RSA-AES128-SHA",
            "SignatureVersion": "SigV4",
            "vpcEndpointId": "vpce-1111",
          },
        "awsRegion": "us-west-2",
        "eventID": "1111",
        "eventName": "PutBucketPolicy",
        "eventSource": "s3.amazonaws.com",
        "eventTime": "2019-01-01T00:00:00Z",
        "eventType": "AwsApiCall",
        "eventVersion": "1.05",
        "recipientAccountId": "123456789012",
        "requestID": "1111",
        "requestParameters":
          {
            "bucketName": "example-bucket",
            "bucketPolicy":
              {
                "Statement":
                  [
                    {
                      "Action": "s3:GetBucketAcl",
                      "Effect": "Allow",
                      "Principal": { "Service": "cloudtrail.amazonaws.com" },
                      "Resource": "arn:aws:s3:::example-bucket",
                      "Sid": "Public Access",
                    },
                  ],
                "Version": "2012-10-17",
              },
            "host": ["s3.us-west-2.amazonaws.com"],
            "policy": [""],
          },
        "responseElements": null,
        "sourceIPAddress": "111.111.111.111",
        "userAgent": "Mozilla/2.0 (compatible; NEWT ActiveX; Win32)",
        "userIdentity":
          {
            "accessKeyId": "1111",
            "accountId": "123456789012",
            "arn": "arn:aws:sts::123456789012:assumed-role/example-role/example-user",
            "principalId": "1111",
            "sessionContext":
              {
                "attributes":
                  {
                    "creationDate": "2019-01-01T00:00:00Z",
                    "mfaAuthenticated": "true",
                  },
                "sessionIssuer":
                  {
                    "accountId": "123456789012",
                    "arn": "arn:aws:iam::123456789012:role/example-role",
                    "principalId": "1111",
                    "type": "Role",
                    "userName": "example-role",
                  },
              },
            "type": "AssumedRole",
          },
        "vpcEndpointId": "vpce-1111",
      }
  - Name: Null Request Parameters
    ExpectedResult: false
    Log:
      {
        "additionalEventData":
          {
            "AuthenticationMethod": "AuthHeader",
            "CipherSuite": "ECDHE-RSA-AES128-SHA",
            "SignatureVersion": "SigV4",
            "vpcEndpointId": "vpce-1111",
          },
        "awsRegion": "us-west-2",
        "eventID": "1111",
        "eventName": "PutBucketPolicy",
        "eventSource": "s3.amazonaws.com",
        "eventTime": "2019-01-01T00:00:00Z",
        "eventType": "AwsApiCall",
        "eventVersion": "1.05",
        "recipientAccountId": "123456789012",
        "requestID": "1111",
        "requestParameters": null,
        "responseElements": null,
        "sourceIPAddress": "111.111.111.111",
        "userAgent": "Mozilla/2.0 (compatible; NEWT ActiveX; Win32)",
        "userIdentity":
          {
            "accessKeyId": "1111",
            "accountId": "123456789012",
            "arn": "arn:aws:sts::123456789012:assumed-role/example-role/example-user",
            "principalId": "1111",
            "sessionContext":
              {
                "attributes":
                  {
                    "creationDate": "2019-01-01T00:00:00Z",
                    "mfaAuthenticated": "true",
                  },
                "sessionIssuer":
                  {
                    "accountId": "123456789012",
                    "arn": "arn:aws:iam::123456789012:role/example-role",
                    "principalId": "1111",
                    "type": "Role",
                    "userName": "example-role",
                  },
              },
            "type": "AssumedRole",
          },
        "vpcEndpointId": "vpce-1111",
      }
  - Name: S3 Failed to make Publicly Accessible
    ExpectedResult: false
    Log:
      {
        "additionalEventData":
          {
            "AuthenticationMethod": "AuthHeader",
            "CipherSuite": "ECDHE-RSA-AES128-SHA",
            "SignatureVersion": "SigV4",
            "vpcEndpointId": "vpce-1111",
          },
        "errorCode": "AccessDenied",
        "awsRegion": "us-west-2",
        "eventID": "1111",
        "eventName": "PutBucketPolicy",
        "eventSource": "s3.amazonaws.com",
        "eventTime": "2019-01-01T00:00:00Z",
        "eventType": "AwsApiCall",
        "eventVersion": "1.05",
        "recipientAccountId": "123456789012",
        "requestID": "1111",
        "requestParameters":
          {
            "bucketName": "example-bucket",
            "bucketPolicy":
              {
                "Statement":
                  [
                    {
                      "Action": "s3:GetBucketAcl",
                      "Effect": "Allow",
                      "Principal": { "AWS": "*" },
                      "Resource": "arn:aws:s3:::example-bucket",
                      "Sid": "Public Access",
                    },
                  ],
                "Version": "2012-10-17",
              },
            "host": ["s3.us-west-2.amazonaws.com"],
            "policy": [""],
          },
        "responseElements": null,
        "sourceIPAddress": "111.111.111.111",
        "userAgent": "Mozilla/2.0 (compatible; NEWT ActiveX; Win32)",
        "userIdentity":
          {
            "accessKeyId": "1111",
            "accountId": "123456789012",
            "arn": "arn:aws:sts::123456789012:assumed-role/example-role/example-user",
            "principalId": "1111",
            "sessionContext":
              {
                "attributes":
                  {
                    "creationDate": "2019-01-01T00:00:00Z",
                    "mfaAuthenticated": "true",
                  },
                "sessionIssuer":
                  {
                    "accountId": "123456789012",
                    "arn": "arn:aws:iam::123456789012:role/example-role",
                    "principalId": "1111",
                    "type": "Role",
                    "userName": "example-role",
                  },
              },
            "type": "AssumedRole",
          },
        "vpcEndpointId": "vpce-1111",
      }
  - Name: Empty Policy Payload
    ExpectedResult: false
    Log:
      {
        "additionalEventData":
          {
            "AuthenticationMethod": "AuthHeader",
            "CipherSuite": "ECDHE-RSA-AES128-SHA",
            "SignatureVersion": "SigV4",
            "vpcEndpointId": "vpce-1111",
          },
        "awsRegion": "us-west-2",
        "eventID": "1111",
        "eventName": "SetQueueAttributes",
        "eventSource": "s3.amazonaws.com",
        "eventTime": "2019-01-01T00:00:00Z",
        "eventType": "AwsApiCall",
        "eventVersion": "1.05",
        "recipientAccountId": "123456789012",
        "requestID": "1111",
        "requestParameters":
          {
            "attributes": { "Policy": "" },
            "queueUrl": "https://sqs.us-east-1.amazonaws.com/123456789012/example-queue",
          },
        "responseElements": null,
        "sourceIPAddress": "111.111.111.111",
        "userAgent": "Mozilla/2.0 (compatible; NEWT ActiveX; Win32)",
        "userIdentity":
          {
            "accessKeyId": "1111",
            "accountId": "123456789012",
            "arn": "arn:aws:sts::123456789012:assumed-role/example-role/example-user",
            "principalId": "1111",
            "sessionContext":
              {
                "attributes":
                  {
                    "creationDate": "2019-01-01T00:00:00Z",
                    "mfaAuthenticated": "true",
                  },
                "sessionIssuer":
                  {
                    "accountId": "123456789012",
                    "arn": "arn:aws:iam::123456789012:role/example-role",
                    "principalId": "1111",
                    "type": "Role",
                    "userName": "example-role",
                  },
              },
            "type": "AssumedRole",
          },
        "vpcEndpointId": "vpce-1111",
      }
  - Name: Invalid JSON Policy (Should Not Alert)
    ExpectedResult: false
    Log:
      {
        "awsRegion": "us-west-2",
        "eventID": "test-01",
        "eventName": "PutBucketPolicy",
        "eventSource": "s3.amazonaws.com",
        "eventTime": "2024-01-01 00:00:00.000",
        "eventType": "AwsApiCall",
        "requestParameters": {
          "bucketPolicy": "invalid-json-policy"
        },
        "userIdentity": {
          "type": "AssumedRole",
          "userName": "TestRole"
        }
      }
  - Name: Multiple Conditions All Restrictive (Should Not Alert)
    ExpectedResult: false
    Log:
      {
        "awsRegion": "us-west-2",
        "eventID": "test-02",
        "eventName": "PutResourcePolicy",
        "eventSource": "secretsmanager.amazonaws.com",
        "eventTime": "2024-01-01 00:00:00.000",
        "eventType": "AwsApiCall",
        "requestParameters": {
          "resourcePolicy": {
            "Version": "2012-10-17",
            "Statement": [{
              "Effect": "Allow",
              "Principal": "*",
              "Action": "secretsmanager:GetSecretValue",
              "Resource": "*",
              "Condition": {
                "StringEquals": {
                  "aws:PrincipalOrgID": "o-test123456",
                  "aws:SourceVpc": "vpc-12345678"
                },
                "IpAddress": {
                  "aws:SourceIp": "10.0.0.0/8"
                }
              }
            }]
          }
        },
        "userIdentity": {
          "type": "AssumedRole",
          "userName": "TestRole"
        }
      }
  - Name: Public Finding Keywords (Should Alert)
    ExpectedResult: true
    Log:
      {
        "awsRegion": "us-west-2",
        "eventID": "test-03",
        "eventName": "CreateElasticsearchDomain",
        "eventSource": "es.amazonaws.com",
        "eventTime": "2024-01-01 00:00:00.000",
        "eventType": "AwsApiCall",
        "requestParameters": {
          "accessPolicies": {
            "Version": "2012-10-17",
            "Statement": [{
              "Effect": "Allow",
              "Principal": "*",
              "Action": "es:*",
              "Resource": "*",
              "Sid": "PublicInternetAccess"
            }]
          }
        },
        "userIdentity": {
          "type": "AssumedRole",
          "userName": "TestRole"
        }
      }
  - Name: Wildcard Principal No Conditions (Should Alert)
    ExpectedResult: true
    Log:
      {
        "awsRegion": "us-west-2",
        "eventID": "test-04",
        "eventName": "PutKeyPolicy",
        "eventSource": "kms.amazonaws.com",
        "eventTime": "2024-01-01 00:00:00.000",
        "eventType": "AwsApiCall",
        "requestParameters": {
          "policy": {
            "Version": "2012-10-17",
            "Statement": [{
              "Effect": "Allow",
              "Principal": "*",
              "Action": "kms:Decrypt",
              "Resource": "*"
            }]
          }
        },
        "userIdentity": {
          "type": "AssumedRole",
          "userName": "TestRole"
        }
      }
  - Name: Mixed Conditions Some Restrictive (Should Alert)
    ExpectedResult: true
    Log:
      {
        "awsRegion": "us-west-2",
        "eventID": "test-05",
        "eventName": "SetQueueAttributes",
        "eventSource": "sqs.amazonaws.com",
        "eventTime": "2024-01-01 00:00:00.000",
        "eventType": "AwsApiCall",
        "requestParameters": {
          "attributes": {
            "Policy": {
              "Version": "2012-10-17",
              "Statement": [
                {
                  "Effect": "Allow",
                  "Principal": "*",
                  "Action": "sqs:*",
                  "Resource": "*",
                  "Condition": {
                    "StringEquals": {
                      "aws:PrincipalOrgID": "o-test123456"
                    }
                  }
                },
                {
                  "Effect": "Allow",
                  "Principal": "*",
                  "Action": "sqs:SendMessage",
                  "Resource": "*"
                }
              ]
            }
          }
        },
        "userIdentity": {
          "type": "AssumedRole",
          "userName": "TestRole"
        }
      }
  - Name: All Restrictive Conditions Types (Should Not Alert)
    ExpectedResult: false
    Log:
      {
        "awsRegion": "us-west-2",
        "eventID": "test-06",
        "eventName": "PutBucketPolicy",
        "eventSource": "s3.amazonaws.com",
        "eventTime": "2024-01-01 00:00:00.000",
        "eventType": "AwsApiCall",
        "requestParameters": {
          "bucketPolicy": {
            "Version": "2012-10-17",
            "Statement": [{
              "Effect": "Allow",
              "Principal": "*",
              "Action": "s3:GetObject",
              "Resource": "*",
              "Condition": {
                "StringEquals": {
                  "aws:PrincipalOrgID": "o-test123456"
                },
                "StringLike": {
                  "aws:SourceVpc": "vpc-*"
                },
                "IpAddress": {
                  "aws:SourceIp": ["10.0.0.0/8", "172.16.0.0/12"]
                }
              }
            }]
          }
        },
        "userIdentity": {
          "type": "AssumedRole",
          "userName": "TestRole"
        }
      }
  - Name: Secrets Manager Restricted Access (Should Not Alert)
    ExpectedResult: false
    Log:
      {
        "awsRegion": "us-west-2",
        "eventCategory": "Management",
        "eventID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "eventName": "PutResourcePolicy",
        "eventSource": "secretsmanager.amazonaws.com",
        "eventTime": "2025-03-05 19:48:47.000000000",
        "eventType": "AwsApiCall",
        "eventVersion": "1.11",
        "managementEvent": true,
        "readOnly": false,
        "recipientAccountId": "123456789012",
        "requestID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "requestParameters": {
          "blockPublicPolicy": true,
          "resourcePolicy": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [{\n    \"Effect\": \"Allow\",\n    \"Principal\": \"*\",\n    \"Action\": \"secretsmanager:GetSecretValue\",\n    \"Resource\": \"arn:aws:secretsmanager:us-west-2:123456789012:secret:paloma/example-secret-xxxxxx\",\n    \"Condition\": {\n      \"StringEquals\": {\n        \"aws:PrincipalOrgID\": \"o-xxxxxxxxxx\"\n      },\n      \"ForAnyValue:StringLike\": {\n        \"aws:PrincipalArn\": [\"arn:aws:iam::*:role/ExampleDeploymentRole*\", \"arn:aws:iam::*:role/ExampleCodeBuild-*\"]\n      }\n    }\n  }, \n  {\n    \"Effect\": \"Allow\",\n    \"Principal\": \"*\",\n    \"Action\": \"secretsmanager:GetSecretValue\",\n    \"Resource\": \"arn:aws:secretsmanager:us-west-2:123456789012:secret:paloma/example-secret-xxxxxx\",\n    \"Condition\": {\n      \"StringEquals\": {\n        \"aws:PrincipalOrgID\": \"o-xxxxxxxxxx\"\n      },\n      \"ForAnyValue:StringLike\": {\n        \"aws:PrincipalArn\": [\"arn:aws:iam::*:role/ExampleDeploymentRole*\", \"arn:aws:iam::*:role/ExampleCodeBuild-*\"]\n      }\n    }\n  },\n  {\n    \"Effect\": \"Allow\",\n    \"Principal\": {\n      \"AWS\": [\"arn:aws:iam::123456789012:role/ExampleRoleAssumption1\", \"arn:aws:iam::123456789012:role/ExampleRoleAssumption2\"]\n    },\n    \"Action\": [\"secretsmanager:Get*\", \"secretsmanager:Describe*\", \"secretsmanager:List*\"],\n    \"Resource\": \"arn:aws:secretsmanager:us-west-2:123456789012:secret:paloma/example-secret-xxxxxx\"\n  }]\n}",
          "secretId": "arn:aws:secretsmanager:us-west-2:123456789012:secret:paloma/example-secret-xxxxxx"
        },
        "responseElements": {
          "arn": "arn:aws:secretsmanager:us-west-2:123456789012:secret:paloma/example-secret-xxxxxx",
          "name": "paloma/example-secret"
        },
        "sessionCredentialFromConsole": true,
        "sourceIPAddress": "10.0.0.1",
        "tlsDetails": {
          "cipherSuite": "TLS_AES_128_GCM_SHA256",
          "clientProvidedHostHeader": "secretsmanager.us-west-2.amazonaws.com",
          "tlsVersion": "TLSv1.3"
        },
        "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
        "userIdentity": {
          "accessKeyId": "EXAMPLEACCESSKEYID",
          "accountId": "123456789012",
          "arn": "arn:aws:sts::123456789012:assumed-role/AWSReservedSSO_ExampleRole_xxxxxxxxxxxxxxxx/example.user",
          "principalId": "AROAXXXXXXXXXXXXXXXXX:example.user",
          "sessionContext": {
            "attributes": {
              "creationDate": "2025-03-05T19:41:35Z",
              "mfaAuthenticated": "false"
            },
            "sessionIssuer": {
              "accountId": "123456789012",
              "arn": "arn:aws:iam::123456789012:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_ExampleRole_xxxxxxxxxxxxxxxx",
              "principalId": "AROAXXXXXXXXXXXXXXXXX",
              "type": "Role",
              "userName": "AWSReservedSSO_ExampleRole_xxxxxxxxxxxxxxxx"
            }
          },
          "type": "AssumedRole"
        }
      } 
  - Name: KMS Key Restricted Access (Should Not Alert)
    ExpectedResult: false
    Log:
      {
        "awsRegion": "us-west-2",
        "eventCategory": "Management",
        "eventID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "eventName": "PutKeyPolicy",
        "eventSource": "kms.amazonaws.com",
        "eventTime": "2025-03-05 21:19:44.000000000",
        "eventType": "AwsApiCall",
        "eventVersion": "1.11",
        "managementEvent": true,
        "readOnly": false,
        "recipientAccountId": "123456789012",
        "requestID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "requestParameters": {
          "bypassPolicyLockoutSafetyCheck": false,
          "keyId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "policy": "{\n    \"Version\": \"2008-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Principal\": {\n                \"AWS\": \"arn:aws:iam::123456789012:root\"\n            },\n            \"Action\": \"kms:*\",\n            \"Resource\": \"*\"\n        },\n        {\n            \"Effect\": \"Allow\",\n            \"Principal\": {\n                \"AWS\": [\n                    \"arn:aws:iam::123456789012:role/ExampleRoleAssumption1\",\n                    \"arn:aws:iam::123456789012:role/ExampleRoleAssumption2\"\n                ]\n            },\n            \"Action\": [\n                \"kms:Decrypt\",\n                \"kms:DescribeKey\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Effect\": \"Allow\",\n            \"Principal\": \"*\",\n            \"Action\": \"kms:Decrypt\",\n            \"Resource\": \"*\",\n            \"Condition\": {\n                \"StringEquals\": {\n                    \"aws:PrincipalOrgID\": \"o-xxxxxxxxxx\"\n                },\n                \"ForAnyValue:StringLike\": {\n                    \"aws:PrincipalArn\": [\n                        \"arn:aws:iam::*:role/ExampleDeploymentRole*\",\n                        \"arn:aws:iam::*:role/ExampleCodeBuild-*\"\n                    ]\n                }\n            }\n        },\n        {\n            \"Effect\": \"Allow\",\n            \"Principal\": \"*\",\n            \"Action\": \"kms:Decrypt\",\n            \"Resource\": \"*\",\n            \"Condition\": {\n                \"StringEquals\": {\n                    \"aws:PrincipalOrgID\": \"o-yyyyyyyyyy\"\n                },\n                \"ForAnyValue:StringLike\": {\n                    \"aws:PrincipalArn\": [\n                        \"arn:aws:iam::*:role/ExampleDeploymentRole*\",\n                        \"arn:aws:sts::*:role/ExampleCodeBuild-*\",\n                        \"arn:aws:sts::*:assumed-role/ExampleDeploymentRole*\",\n                        \"arn:aws:sts::*:assumed-role/ExampleCodeBuild-*\"\n                    ]\n                }\n            }\n        }\n    ]\n}",
          "policyName": "default"
        },
        "resources": [
          {
            "accountId": "123456789012",
            "arn": "arn:aws:kms:us-west-2:123456789012:key/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "type": "AWS::KMS::Key"
          }
        ],
        "responseElements": {
          "keyId": "arn:aws:kms:us-west-2:123456789012:key/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        },
        "sessionCredentialFromConsole": true,
        "sourceIPAddress": "10.0.0.1",
        "tlsDetails": {
          "cipherSuite": "TLS_AES_256_GCM_SHA384",
          "clientProvidedHostHeader": "kms.us-west-2.amazonaws.com",
          "tlsVersion": "TLSv1.3"
        },
        "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
        "userIdentity": {
          "accessKeyId": "EXAMPLEACCESSKEYID",
          "accountId": "123456789012",
          "arn": "arn:aws:sts::123456789012:assumed-role/AWSReservedSSO_ExampleRole_xxxxxxxxxxxxxxxx/example.user",
          "principalId": "AROAXXXXXXXXXXXXXXXXX:example.user",
          "sessionContext": {
            "attributes": {
              "creationDate": "2025-03-05T21:15:00Z",
              "mfaAuthenticated": "false"
            },
            "sessionIssuer": {
              "accountId": "123456789012",
              "arn": "arn:aws:iam::123456789012:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_ExampleRole_xxxxxxxxxxxxxxxx",
              "principalId": "AROAXXXXXXXXXXXXXXXXX",
              "type": "Role",
              "userName": "AWSReservedSSO_ExampleRole_xxxxxxxxxxxxxxxx"
            }
          },
          "type": "AssumedRole"
        }
      }

Detection logic

Condition

not (errorCode is_not_null or errorMessage is_not_null)
requestParameters is_not_null
eventName eq "SetTopicAttributes"
requestParameters.attributeName eq "Policy"
requestParameters.attributeValue is_not_null

This rule also runs imperative logic the parser cannot express as a filter; the conditions above are the structured part it could extract.

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)

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
eventNameeq
  • SetTopicAttributes
requestParametersis_not_null
  • (no value, null check)
requestParameters.attributeNameeq
  • Policy
requestParameters.attributeValueis_not_null
  • (no value, null check)

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.

FieldSource
eventName
eventSource
awsRegion
recipientAccountId
sourceIPAddress
userAgent
userIdentity
Resources
userNameuserIdentity.userName