Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
Instead all the policies are returned (and hence run). This is fixed by handling the spaces in the policy names and leading and trailing whitespaces appropriately.
Fixes # (issue)
When adding the flag policy.name with a valid value of a particular policy, only that policy should run and return in the result. Instead all the policies are returned (and hence run)
Fix
This is fixed by handling the spaces in the policy names and leading and trailing whitespaces appropriately.
Checklist:
[ X] My code follows the style guidelines of this project
[ X] I have performed a self-review of my own code
[ X] I have commented my code, particularly in hard-to-understand areas
[ X] I have made corresponding changes to the documentation
[ X] I have added tests that prove my feature, policy, or fix is effective and works
[ X] New and existing tests pass locally with my changes
[ X] Any dependent changes have been merged and published in downstream modules
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
PR Title
platform(general): Fix policy.name to use the spaces as specified on CLI.
Description
When adding the flag policy.name with a valid value of a particular policy, only that policy should run and return in the result.
checkov -f main.tf --skip-results-upload --repo-id ts/test --policy-metadata-filter policy.name="Data exfiltration allowed without resource constraints"
Instead all the policies are returned (and hence run). This is fixed by handling the spaces in the policy names and leading and trailing whitespaces appropriately.
Fixes # (issue) When adding the flag policy.name with a valid value of a particular policy, only that policy should run and return in the result. Instead all the policies are returned (and hence run)
Fix
This is fixed by handling the spaces in the policy names and leading and trailing whitespaces appropriately.
Checklist: