-
Notifications
You must be signed in to change notification settings - Fork 692
[New Rule] AWS S3 Bucket MFA Delete Disabled #6653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bryans3c
wants to merge
2
commits into
main
Choose a base branch
from
new-rule/aws-s3-mfa-delete-disabled
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+109
−1
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
rules/integrations/aws/impact_s3_mfa_delete_disabled.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,107 @@ | ||||
| [metadata] | ||||
| creation_date = "2026/08/14" | ||||
| integration = ["aws"] | ||||
| maturity = "production" | ||||
| updated_date = "2026/08/14" | ||||
|
|
||||
| [rule] | ||||
| author = ["Elastic"] | ||||
| description = """ | ||||
| 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 | ||||
| step in ransomware attacks that target S3 versioning as a backup mechanism. MFA Delete is | ||||
| configured via PutBucketVersioning with the MfaDelete parameter set to Disabled. | ||||
| """ | ||||
| false_positives = [ | ||||
| """ | ||||
| Disabling MFA Delete when rotating the root account credentials used to manage versioning | ||||
| may trigger this rule. This operation requires root account credentials and is uncommon | ||||
| in automated pipelines. | ||||
| """, | ||||
| ] | ||||
| from = "now-6m" | ||||
| index = ["logs-aws.cloudtrail-*"] | ||||
| interval = "5m" | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
default is 5m |
||||
| language = "kuery" | ||||
| license = "Elastic License v2" | ||||
| name = "AWS S3 Bucket MFA Delete Disabled" | ||||
| note = """## Triage and analysis | ||||
|
|
||||
| ### Investigating AWS S3 Bucket MFA Delete Disabled | ||||
|
|
||||
| MFA Delete protects versioned S3 buckets by requiring MFA authentication to permanently delete object versions or change the versioning state. This protection is specifically designed to prevent ransomware from destroying version history after encrypting the current object copies. Disabling MFA Delete removes this safeguard and is a recognized ransomware preparation step. | ||||
|
|
||||
| Importantly, only the AWS account root user can enable or disable MFA Delete. A `PutBucketVersioning` call disabling MFA Delete from a non-root identity is a strong indicator of root credential compromise or unauthorized use. | ||||
|
|
||||
| ### Possible investigation steps | ||||
|
|
||||
| - Identify the caller from `aws.cloudtrail.user_identity.type`. If this is not a `Root` identity, treat it as high-confidence unauthorized access. | ||||
| - Check `aws.cloudtrail.request_parameters` to confirm `mfaDeleteEnabled=false` (Go-map format) or `MfaDelete=Disabled` is present. | ||||
| - Review all API calls by the same identity in the surrounding window for other data-destruction or encryption-related actions. | ||||
| - Check whether object versioning remains enabled on the affected bucket. If both versioning and MFA Delete are disabled, the bucket has no object-level recovery protection. | ||||
| - Investigate whether MFA was presented (`aws.cloudtrail.additional_eventdata` contains MFA information for requests that required it). | ||||
|
|
||||
| ### Response and remediation | ||||
|
|
||||
| - If unauthorized, immediately re-enable MFA Delete using root credentials and verify that object version history is intact. | ||||
| - Rotate all credentials associated with the calling identity. | ||||
| - Review S3 object versions for any permanent deletions that occurred after MFA Delete was disabled. | ||||
| - Enable AWS Config rules to detect versioning and MFA Delete configuration changes. | ||||
| """ | ||||
| references = [ | ||||
| "https://docs.aws.amazon.com/AmazonS3/latest/userguide/MultiFactorAuthenticationDelete.html", | ||||
| "https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html", | ||||
| "https://rhinosecuritylabs.com/aws/s3-ransomware-part-1-attack-vector/", | ||||
| "https://www.halcyon.ai/blog/abusing-aws-native-services-ransomware-encrypting-s3-buckets-with-sse-c", | ||||
| ] | ||||
| risk_score = 73 | ||||
| rule_id = "b8654454-2757-41b4-ae1a-69b3be704c28" | ||||
| setup = "The AWS integration must be ingesting management events into `logs-aws.cloudtrail-*`. S3 management events are logged by default." | ||||
| severity = "high" | ||||
| tags = [ | ||||
| "Domain: Cloud", | ||||
| "Platform: AWS", | ||||
| "Data Source: AWS CloudTrail", | ||||
| "Service: AWS S3", | ||||
| "Rule Type: Custom Query (KQL)", | ||||
| "Tactic: Impact", | ||||
| "Resources: Investigation Guide", | ||||
| ] | ||||
| timestamp_override = "event.ingested" | ||||
| type = "query" | ||||
|
|
||||
| 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") | ||||
| ''' | ||||
|
|
||||
| [[rule.threat]] | ||||
| framework = "MITRE ATT&CK" | ||||
| [[rule.threat.technique]] | ||||
| id = "T1490" | ||||
| name = "Inhibit System Recovery" | ||||
| reference = "https://attack.mitre.org/techniques/T1490/" | ||||
|
|
||||
| [rule.threat.tactic] | ||||
| id = "TA0040" | ||||
| name = "Impact" | ||||
| reference = "https://attack.mitre.org/tactics/TA0040/" | ||||
|
|
||||
| [rule.investigation_fields] | ||||
| field_names = [ | ||||
| "@timestamp", | ||||
| "aws.cloudtrail.user_identity.arn", | ||||
| "aws.cloudtrail.user_identity.type", | ||||
| "user.name", | ||||
| "event.action", | ||||
| "event.outcome", | ||||
| "aws.cloudtrail.request_parameters", | ||||
| "source.ip", | ||||
| "cloud.region", | ||||
| "cloud.account.id", | ||||
| ] | ||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.