[Rule Tuning] AWS IAM Virtual MFA Device Rules #5275
Draft
+196
−70
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.
Pull Request
Issue link(s):
Summary - What I changed
AWS IAM Virtual MFA Device Registration Attempt with Session Token
ASIA*, temporary session determination.ASIA*) as temporary session tokens created by actions likeGetSessionTokenorAssumeRole, which is what this rule meant to capture. Our current data source does now allow us to distinguigh between these type of events. However, cloudtrail does provide a fieldsessionCredentialFromConsole:truethat I am putting in a request for Integrations to include. This would allow us to exclude Console login sessions from rules like this that look for temporary token abuse.AWS IAM Deactivation of MFA Device
DeleteVirtualMFADevicefrom the scope of this rule. When Deleting an MFA device you must deactivate it first if it is associated with a user. You can also Create an MFA device and then Delete it without it being activated for a particular user. By capturing both Deactivation and Deletion events we have duplicate alerts for the same activity (This duplication of events is seen in telemetry.) We also capture benign instances where un-used MFA devices are deleted (which is a clean-up best practice). By reducing the scope to onlyDeactivateMFADeviceactions, we capture the most threat-centric behavior which should be investigated.How To Test
Test data in our stack for running the queries against.
Scripts for testing:
trigger_impact_iam_deactivate_mfa_device.py
trigger_persistence_aws_attempt_to_register_virtual_mfa_device.py
Screenshot of new working query for temp token MFA device creation
Screenshots of Delete + Deactivate MFA events vs Deactivate-only working query