feat: add --policy flag in verify-policy command for example policies #1189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This Pull Request introduces a new
--policy
flag to theverify-policy
command, allowing users to run example policies by name without specifying a file path. It also adds support for policy templates.The new
--policy
(-p
) flag executes a predefined policy template by name. If the template exists, it populates the<PACKAGE_PURL>
placeholder with the value from the--package-url
(-purl
) argument and runs the policy. If the template name is not found, it lists all available templates.Example policies
Description of changes
--policy
(-p
) argument to theverify-policy
CLI command, enabling users to select and run example policies from the built-in resources.resources/policies/datalog
directory.--package-url
(-purl
) argument to substitute the<PACKAGE_PURL>
placeholder in policy templates.Related issues
N/A
Checklist
verified
label should appear next to all of your commits on GitHub.