Skip to content

False Positives with Deny Actions in IAM Policy #111

@marcsantamaria-sky

Description

There can be false positives in CFRipper when an IAM policy has specific Actions with Deny Effect.

The issue seems to be caused because in "policy_document.py" the Denys are not taken into account.

The function "allowed_actions_with" is not excluding actions that have a Deny Effect.

def allowed_actions_with(self, pattern: Pattern) -> List[Statement]:
"""
Finds all statements which have at least one action with the pattern.
Arguments:
pattern: Pattern to match.
Returns:
List of [statements][pycfmodel.model.resources.properties.statement.Statement].
"""
return [
statement
for statement in self._statement_as_list()
if statement.actions_with(pattern) and self._is_statement_effect_allow(statement.Effect)
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions