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

Config Overrides Overwrite One Another #221

Open
squatched opened this issue Aug 3, 2022 · 0 comments
Open

Config Overrides Overwrite One Another #221

squatched opened this issue Aug 3, 2022 · 0 comments

Comments

@squatched
Copy link

If I specify something like:

# Comment explaining why this exception pattern exists.
INVALID_ARN:
  ignore_locations:
    - Resource:
      - "^arn:aws:cloudformation:\\*:aws:.*$"

# ... several lines later ...

# Comment explaining why THIS exception pattern exists (spoiler, issue #220)
INVALID_ARN:
  ignore_locations:
    - Resource:
      - "^arn:aws:[^:]+:us-west-\\?:.*$"

I would expect the two exceptions to be combined. Instead, the second exceptional case overwrites the first and the policy statements that didn't used to trigger INVALID_ARN start triggering it again.

The fix is simple, I just combined the two. BUT, I figured this was worth reporting because I could easily see a situation where there are several exceptions and someone adding a new one doesn't realize it should be combined (maybe they don't notice an exception already exists), then the old exception starts being ignored and the person who added the new exception winds up tearing their hair out trying to figure out why their change introduced linting errors in documents they didn't touch.

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

No branches or pull requests

1 participant