Skip to content

[New Rule] AWS SES Full Access Policy Attached to IAM Entity - #6657

Open
bryans3c wants to merge 3 commits into
mainfrom
new-rule/aws-ses-fullaccess-policy-attached
Open

[New Rule] AWS SES Full Access Policy Attached to IAM Entity#6657
bryans3c wants to merge 3 commits into
mainfrom
new-rule/aws-ses-fullaccess-policy-attached

Conversation

@bryans3c

Copy link
Copy Markdown
Contributor

Pull Request

Issue link(s):

Summary - What I changed

Added a query rule that fires when the AWS managed policy AmazonSESFullAccess is attached to any IAM user, role, or group via AttachUserPolicy, AttachRolePolicy, or AttachGroupPolicy.

Why it matters

Threat actors who compromise an AWS account frequently establish phishing infrastructure by attaching AmazonSESFullAccess to a new or existing IAM entity, enabling bulk email delivery from the victim organization's verified sending domains. AmazonSESFullAccess grants 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.

image

How To Test

Query to verify in our TRaDE stack:

data_stream.dataset: "aws.cloudtrail"
    and event.provider: "iam.amazonaws.com"
    and event.action: ("AttachUserPolicy" or "AttachRolePolicy" or "AttachGroupPolicy")
    and event.outcome: "success"
    and aws.cloudtrail.request_parameters: *AmazonSESFullAccess*

Checklist

  • Added a label for the type of pr: Rule: New
  • Secret and sensitive material has been managed correctly
  • Automated testing was updated or added to match the most common scenarios
  • Documentation and comments were added for features that require explanation

Contributor checklist

Copilot AI lite review requested due to automatic review settings August 14, 2026 17:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 kuery rule matching successful AttachUserPolicy / AttachRolePolicy / AttachGroupPolicy events where request parameters contain AmazonSESFullAccess.
  • 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.

Comment thread rules/integrations/aws/persistence_iam_ses_fullaccess_policy_attached.toml Outdated
Comment on lines +65 to +75
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",
]
Comment thread rules/integrations/aws/persistence_iam_ses_fullaccess_policy_attached.toml Outdated
@bryans3c bryans3c added the Rule: New Proposal for new rule label Aug 14, 2026
@bryans3c bryans3c self-assigned this Aug 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Rule: New - Guidelines

These guidelines serve as a reminder set of considerations when proposing a new rule.

Documentation and Context

  • Detailed description of the rule.
  • List any new fields required in ECS/data sources.
  • Link related issues or PRs.
  • Include references.

Rule Metadata Checks

  • creation_date matches the date of creation PR initially merged.
  • min_stack_version should support the widest stack versions.
  • name and description should be descriptive and not include typos.
  • query should be inclusive, not overly exclusive, considering performance for diverse environments. Non ecs fields should be added to non-ecs-schema.json if not available in an integration.
  • min_stack_comments and min_stack_version should be included if the rule is only compatible starting from a specific stack version.
  • index pattern should be neither too specific nor too vague, ensuring it accurately matches the relevant data stream (e.g., use logs-endpoint.process-* for process data).
  • integration should align with the index. If the integration is newly introduced, ensure the manifest, schemas, and new_rule.yaml template are updated.
  • setup should include the necessary steps to configure the integration.
  • note should include any additional information (e.g. Triage and analysis investigation guides, timeline templates).
  • tags should be relevant to the threat and align/added to the EXPECTED_RULE_TAGS in the definitions.py file.
  • threat, techniques, and subtechniques should map to ATT&CK always if possible.

New BBR Rules

  • building_block_type should be included if the rule is a building block and the rule should be located in the rules_building_block folder.
  • bypass_bbr_timing should be included if adding custom lookback timing to the rule.

Testing and Validation

  • Provide evidence of testing and detecting the expected threat.
  • Check for existence of coverage to prevent duplication.

bryans3c and others added 2 commits August 14, 2026 19:28
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*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Comment on lines +13 to +14
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interval = "5m"

default

references = [
"https://docs.aws.amazon.com/ses/latest/dg/control-user-access.html"
]
risk_score = 73

@terrancedejesus terrancedejesus Aug 25, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and aws.cloudtrail.request_parameters: *AmazonSESFullAccess*
and aws.cloudtrail.flattened.request_parameters.policyArn: "arn:aws:iam::aws:policy/AmazonSESFullAccess"

to @imays11's point

@terrancedejesus terrancedejesus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants