Skip to content

[New Rule] AWS S3 Bucket MFA Delete Disabled - #6653

Open
bryans3c wants to merge 2 commits into
mainfrom
new-rule/aws-s3-mfa-delete-disabled
Open

[New Rule] AWS S3 Bucket MFA Delete Disabled#6653
bryans3c wants to merge 2 commits into
mainfrom
new-rule/aws-s3-mfa-delete-disabled

Conversation

@bryans3c

@bryans3c bryans3c commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Issue link(s):

Summary - What I changed

Added a rule that fires when MFA Delete is disabled on an S3 bucket via PutBucketVersioning with MfaDelete=Disabled. Also adds aws.cloudtrail.flattened.request_parameters.mfaDeleteEnabled to the non-ECS schema to enable the flattened field query.

Why it matters

MFA Delete protects versioned S3 buckets by requiring MFA authentication to permanently delete object versions — the primary defense against ransomware destroying version history after encrypting current object copies. Disabling MFA Delete removes this safeguard and is a recognized ransomware preparation step documented in S3 ransomware research. Critically, only the AWS root account can enable or disable MFA Delete; a PutBucketVersioning call disabling it from a non-root identity is itself a strong indicator of root credential compromise or unauthorized use.

How To Test

Query to verify in our TRaDE stack:

data_stream.dataset: "aws.cloudtrail"
    and event.provider: "s3.amazonaws.com"
    and event.action: "PutBucketVersioning"
    and event.outcome: "success"
    and aws.cloudtrail.flattened.request_parameters.mfaDeleteEnabled: (false or "false")

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 16:49

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 detection rule to alert when an S3 bucket’s MFA Delete protection is disabled via PutBucketVersioning, and updates the non-ECS schema so the rule’s flattened request-parameter field is recognized by repo validation.

Changes:

  • Added a new KQL (Kuery) rule: AWS S3 Bucket MFA Delete Disabled with investigation guidance and ATT&CK Impact mapping.
  • Extended non-ecs-schema.json to include aws.cloudtrail.flattened.request_parameters.mfaDeleteEnabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
rules/integrations/aws/defense_evasion_s3_mfa_delete_disabled.toml New CloudTrail-based rule for detecting MFA Delete being disabled on S3 buckets.
detection_rules/etc/non-ecs-schema.json Adds the flattened CloudTrail request parameter field used by the new rule to the non-ECS schema.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +75 to +81
query = '''
data_stream.dataset: "aws.cloudtrail"
and event.provider: "s3.amazonaws.com"
and event.action: "PutBucketVersioning"
and event.outcome: "success"
and aws.cloudtrail.flattened.request_parameters.mfaDeleteEnabled: (false or "false")
'''
Comment on lines +63 to +71
tags = [
"Domain: Cloud",
"Platform: AWS",
"Data Source: AWS CloudTrail",
"Service: AWS S3",
"Rule Type: Custom Query (KQL)",
"Tactic: Impact",
"Resources: Investigation Guide",
]
@bryans3c bryans3c added the Rule: New Proposal for new rule label 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 bryans3c self-assigned this Aug 24, 2026
@imays11

imays11 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Any test data for this one?

@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. Nits on the default interval and swapping the emdash in the description for a comma.

]
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 is 5m

Detects when MFA Delete is disabled on an Amazon S3 bucket. MFA Delete is an additional layer of
security for versioned S3 buckets that requires multi-factor authentication to permanently delete
object versions or disable versioning. When MFA Delete is disabled, an adversary with S3 write
access and a compromised long-term access key can permanently delete object versions — a critical

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
access and a compromised long-term access key can permanently delete object versions a critical
access and a compromised long-term access key can permanently delete object versions, a critical

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.

5 participants