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

platform(general): Fix policy.name to use the spaces as specified on CLI. #6296

Merged
merged 1 commit into from May 14, 2024

Conversation

jpaloalto
Copy link
Contributor

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:

  • [ 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

…olicy, only that policy should run and return in the result. 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.
Copy link
Contributor

@kartikp10 kartikp10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jpaloalto jpaloalto merged commit c531859 into main May 14, 2024
37 of 38 checks passed
@jpaloalto jpaloalto deleted the fix-policy-names-with-spaces branch May 14, 2024 20:57
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.

None yet

3 participants