Skip to content
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

Add stricter checking to resource attributes #177

Merged
merged 4 commits into from
Mar 15, 2021

Conversation

briandbecker
Copy link
Contributor

Example

The following policy validates in the current version but fails when applied in AWS:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:ListRoleTags"
            ],
            "Resource": "arn:aws:iam::123456789012:*/*"
        }
    ]
}

image

With this change it now catches this violation. All other tests pass.

I didn't include these in the is_arn_match function as these checks aren't strictly about matching arns.

* Certain resource strings were incorrectly accepted as valid
* Adds is_arn_strictly_valid function to do tighter checks on resources
  against their documented requirements
* Appears to fix duo-labs#167
@CLAassistant
Copy link

CLAassistant commented Mar 4, 2021

CLA assistant check
All committers have signed the CLA.

@0xdabbad00
Copy link
Collaborator

Thank you @briandbecker! The logic in this is pretty complex, but if the tests pass, it must work. Nice job figuring this out!

This is ready to merge @steiza

@steiza steiza merged commit 22f6d6f into duo-labs:main Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parliament should catch invalid s3 bucket object resource arns
4 participants