fix(aws): Corrects privilege escalation vectors #3823
Merged
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.
Context
Prowler includes a list of (combinations of) dangerous actions that allow for privilege escalation. This list is currently incorrect, leading to false positives and false negatives.
Description
This PR improves the AWS privilege escalation logic in Prowler.
I checked the actions defined in iam_policy_allows_privilege_escalation.py for mistakes after finding that Prowler produced false positives if a policy just included
"cloudformation:CreateStack"
and"cloudformation:DescribeStacks"
. These actions alone do not suffice for privilege escalation. Judging by the name,"iam:PassRole"
is obviously missing.I cross-checked the other definitions against this document. In total, I found three incorrect definitions:
"PassRole+CloudFormation"
: missed theiam:PassRole
action"PassRole+DataPipeline"
: missed theiam:PassRole
action"GlueUpdateDevEndpoints"
: specified"glue:UpdateDevEndpoint"
rather than"glue:UpdateDevEndpoints"
(s missing!)Fixes #3807
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.