[New Rule] AWS SES Full Access Policy Attached to IAM Entity - #6657
[New Rule] AWS SES Full Access Policy Attached to IAM Entity#6657bryans3c wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new AWS CloudTrail query rule to detect attachment of the AWS-managed AmazonSESFullAccess policy to IAM users, roles, or groups—behavior commonly associated with establishing phishing infrastructure via SES abuse.
Changes:
- Introduces a new
kueryrule matching successfulAttachUserPolicy/AttachRolePolicy/AttachGroupPolicyevents where request parameters containAmazonSESFullAccess. - Adds an investigation guide covering triage steps, false positives, and response/remediation actions.
- Defines initial ATT&CK mappings, setup guidance, and investigation fields for alert context.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| tags = [ | ||
| "Domain: Cloud", | ||
| "Platform: AWS", | ||
| "Data Source: AWS CloudTrail", | ||
| "Service: AWS IAM", | ||
| "Service: AWS SES", | ||
| "Rule Type: Custom Query (KQL)", | ||
| "Tactic: Persistence", | ||
| "Tactic: Resource Development", | ||
| "Resources: Investigation Guide", | ||
| ] |
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| and event.provider: "iam.amazonaws.com" | ||
| and event.action: ("AttachUserPolicy" or "AttachRolePolicy" or "AttachGroupPolicy") | ||
| and event.outcome: "success" | ||
| and aws.cloudtrail.request_parameters: *AmazonSESFullAccess* |
There was a problem hiding this comment.
Since this is a managed policy with a consistent/predictable name couldn't you just avoid the double wildcard usage here by using the full flattened request_parameters.policyArn field or related.entity field to query "arn:aws:iam::aws:policy/AmazonSESFullAccess"
| to an unexpected IAM entity — particularly a newly created user or a role not previously associated | ||
| with email operations — is a documented technique used by threat actors to establish phishing |
There was a problem hiding this comment.
| to an unexpected IAM entity — particularly a newly created user or a role not previously associated | |
| with email operations — is a documented technique used by threat actors to establish phishing | |
| to an unexpected IAM entity, particularly a newly created user or a role not previously associated | |
| with email operations, is a documented technique used by threat actors to establish phishing |
| ] | ||
| from = "now-6m" | ||
| index = ["logs-aws.cloudtrail-*"] | ||
| interval = "5m" |
There was a problem hiding this comment.
| interval = "5m" |
default
| references = [ | ||
| "https://docs.aws.amazon.com/ses/latest/dg/control-user-access.html" | ||
| ] | ||
| risk_score = 73 |
There was a problem hiding this comment.
| risk_score = 73 | |
| risk_score = 47 |
Not inherently malicious, just poor security posture.
| risk_score = 73 | ||
| rule_id = "d2e3f4a5-b6c7-8901-bcde-f23456789012" | ||
| setup = "The AWS integration must be ingesting management events into `logs-aws.cloudtrail-*`. No additional data event selectors are required — `iam:AttachUserPolicy`, `iam:AttachRolePolicy`, and `iam:AttachGroupPolicy` are management-plane APIs logged by default." | ||
| severity = "high" |
There was a problem hiding this comment.
| severity = "high" | |
| severity = "medium" |
| and event.provider: "iam.amazonaws.com" | ||
| and event.action: ("AttachUserPolicy" or "AttachRolePolicy" or "AttachGroupPolicy") | ||
| and event.outcome: "success" | ||
| and aws.cloudtrail.request_parameters: *AmazonSESFullAccess* |
There was a problem hiding this comment.
| and aws.cloudtrail.request_parameters: *AmazonSESFullAccess* | |
| and aws.cloudtrail.flattened.request_parameters.policyArn: "arn:aws:iam::aws:policy/AmazonSESFullAccess" |
to @imays11's point
terrancedejesus
left a comment
There was a problem hiding this comment.
LGTM. Agreed on medium, attaching SESFullAccess is poor posture more than it is inherently malicious. Also +1 on matching the exact policy ARN via flattened.request_parameters.
Pull Request
Issue link(s):
Summary - What I changed
Added a
queryrule that fires when the AWS managed policyAmazonSESFullAccessis attached to any IAM user, role, or group viaAttachUserPolicy,AttachRolePolicy, orAttachGroupPolicy.Why it matters
Threat actors who compromise an AWS account frequently establish phishing infrastructure by attaching
AmazonSESFullAccessto a new or existing IAM entity, enabling bulk email delivery from the victim organization's verified sending domains.AmazonSESFullAccessgrants unrestricted access to send email, manage identities, manage suppression lists, and configure account-level settings — making it the broadest possible SES grant. Attaching this specific managed policy is the simplest one-step path to full SES capability, and its use for legitimate automation is uncommon given that scoped SES policies are the recommended practice.How To Test
Query to verify in our TRaDE stack:
Checklist
Rule: NewContributor checklist