-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(cloudformation): enrich cloudformation cloudsplaining inspected key line #6590
base: main
Are you sure you want to change the base?
Conversation
…ewio/checkov into enrich_cloudsplaining_eval_keys
…ewio/checkov into enrich_cloudsplaining_eval_keys
@@ -42,7 +42,7 @@ jobs: | |||
id: changed-files-specific | |||
uses: tj-actions/changed-files@eaf854ef0c266753e1abec356dcf17d92695b251 # v44 | |||
with: | |||
files: tests/cloudformation/checks/resource/aws/**/* | |||
files: tests/cloudformation/checks/resource/aws/example*/**/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it won't run cfn-lint of python files which exist in: tests/cloudformation/checks/resource/aws/
if fnmatch.fnmatch(violating_action, action): # found the violating action in our list of actions | ||
action_line = self.extract_action_line(statement.statement, action) | ||
if action_line > 0: | ||
self.inspected_key_line = action_line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we have only one inspected_key_line in a resource?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be one inspected key line per violation. This field gets copied to the record, which then gets put in the report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
This PR adds capability for cloudformation cloudsplaining to mark inspected_key_line for exposing of error lines.
Checklist: