-
Notifications
You must be signed in to change notification settings - Fork 571
[New Rule] AWS CloudTrail Log Evasion #4788
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
base: main
Are you sure you want to change the base?
Conversation
Identifies the evasion of cloudtrail logging for IAM actions involving policy creation, modification or attachment. When making certain policy-related API calls, an adversary may pad the associated policy document with whitespaces to trigger CloudTrail’s logging size constraints, resulting in incomplete logging where critical details about the policy are omitted. By exploiting this gap, threat actors can bypass monitoring performed through CloudTrail and can effectively obscure unauthorized changes. This rule looks for IAM API calls with the requestParameters property containing reason:”requestParameters too large” and omitted:true. This is a known gap in AWS with no immediate remediation steps. While the size constraint issue affects additional services, IAM policy-related API calls are the only that pose a security risk which is why this rule is scoped specifically to `event.provider: iam.amazonaws.com`. For additional background on the evasion technique refer to Permisso's [research](https://permiso.io/blog/cloudtrail-logging-evasion-where-policy-size-matters).
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
|
rules/integrations/aws/defense_evasion_cloudtrail_logging_evasion.toml
Outdated
Show resolved
Hide resolved
added investigation fields
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.
LGTM!
] | ||
risk_score = 73 | ||
rule_id = "9ebd48ac-a0e2-430a-a219-fe072a50146b" | ||
severity = "high" |
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.
Potentially put in medium at first and bump to high if there truly are no FPs?
Pull Request
Issue link(s):
https://github.com/elastic/ia-trade-team/issues/616
Summary - What I changed
Identifies the evasion of cloudtrail logging for IAM actions involving policy creation, modification or attachment. When making certain policy-related API calls, an adversary may pad the associated policy document with whitespaces to trigger CloudTrail’s logging size constraints, resulting in incomplete logging where critical details about the policy are omitted. By exploiting this gap, threat actors can bypass monitoring performed through CloudTrail and can effectively obscure unauthorized changes. This rule looks for IAM API calls with the requestParameters property containing reason:”requestParameters too large” and omitted:true.
This is a known gap in AWS with no immediate remediation steps. While the size constraint issue affects additional services, IAM policy-related API calls are the only that pose a security risk which is why this rule is scoped specifically to
event.provider: iam.amazonaws.com
. For additional background on the evasion technique refer to Permisso's research.How To Test
You can use the provided test script to test this rule against the following IAM policy-related API calls:
PutRolePolicy
,CreatePolicy
, andCreatePolicyVersion
.Otherwise any IAM policy-related API call can be used so long as the target policy is padded with white spaces in order to reach the size range of 102,401 to 131,072 characters, which is when cloudtrail entries will be ommited and replaced with "requestParameters too large". The above script will create such a policy.