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

check-permissions filter fails to match if Resource in IAM policy is anything other than "*" #4612

Open
FireballDWF opened this issue Aug 16, 2019 · 3 comments

Comments

@FireballDWF
Copy link
Collaborator

When a ec2 resource policy includes the fillter:

      - type: check-permissions
        match: allowed
        match-operator: or
        actions:
          - s3:GetObject
          - s3:* 

it will fail to match if the Resource in the relevant IAM policy is anything other than "*", such as

       {

            "Effect": "Allow",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::*/*"
        }
@kapilt
Copy link
Collaborator

kapilt commented Aug 16, 2019

thats per the documentation for simulate policy api, what are you suggesting? custodian won't be enumerating every arn permutation.

@FireballDWF
Copy link
Collaborator Author

Ok, I understand the limitation in the api. I was looking for check-permissions to tell me if there was any allow for that action regardless of resource arns in the policy, but the simulate-principal-policy doesn't answer such a question. So I'll modify the request to ask that check-permissions be enhanced to support passing a list of arns, passing them in the api's resource-arns parameter. This would enable the use of checking if a given instance has GetObject access to a specific sensitive bucket or any access to a list of buckets.

@kapilt
Copy link
Collaborator

kapilt commented Aug 16, 2019

okay so grow a resource-arns: attribute here for passthrough. i think we want some behavior validation, as i suspect that this is a literal string match as opposed to useful evaluation, ie wildcard in arn vs individual bucket resource (or even worse say path in bucket). ie. the actual api here needs improvements for more scenarios to be useful (not sure it handles permission boundaries, org scp, etc either).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants