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

Print rule name in CLI output needed for skip rule annotations #729

Open
HariSekhon opened this issue Jul 18, 2022 · 4 comments
Open

Print rule name in CLI output needed for skip rule annotations #729

HariSekhon opened this issue Jul 18, 2022 · 4 comments
Labels
enhancement New feature or request up for grabs Looking for a contributor to take this task
Projects

Comments

@HariSekhon
Copy link

When you get a policy rule violation output in the CLI or CI/CD, it would be nice if it printed the rule name needed to set an ignore - relates to #726.

This would save having to go to the dashboard, figure out which rule it is, and click the i for information to get the rule name to put into an ignore annotation.

@HariSekhon HariSekhon added the enhancement New feature or request label Jul 18, 2022
@HariSekhon HariSekhon changed the title Print rule name in output for faster ignores Print rule name in CLI output needed for skip rule annotations Jul 18, 2022
@adifayer
Copy link
Contributor

@HariSekhon I get your point, though I wonder if presenting this identifier can create more noise than value, since it's relevant mainly for users that have Policy-As-Code mode on, or users that want to skip a rule, therefore it may confuse other users.

I suggest that we add the PAC identifier to the output when using the --verbose flag, that way each user can decide whether to have it or not. WDYT?

@HariSekhon
Copy link
Author

Agreed, this should probably be in the first level of verbose mode.

@adifayer
Copy link
Contributor

These are the product requirements:

Is your feature request related to a problem? Please describe.
Skipping a rule on a specific resource is done by adding an annotation in the manifest. The annotation syntax is the following: datree.skip/[identifier] while the identifier is the unique rule identifier (policy as code identifier).
The PAC identifier is available only within the dashboard, which creates an extra step to the process of skipping a rule.

Describe the solution you'd like
When passing the --verbose flag within datree test run, display each rule's Policy-as-code.
Output example:

❌  Ensure each container image has a pinned (tag) version  [9 occurrences]
      Policy as code identifier: CONTAINERS_MISSING_IMAGE_VALUE_VERSION
      How to fix: https://hub.datree.io/ensure-image-pinned-version
       - metadata.name: N/A (kind: Pod)
💡  Incorrect value for key `image` - specify an image version to avoid unpleasant "version surprises" in the future

@adifayer adifayer added the up for grabs Looking for a contributor to take this task label Jul 19, 2022
@github-actions github-actions bot added this to To Do in Datree Jul 19, 2022
@Meyazhagan
Copy link
Contributor

Meyazhagan commented Apr 27, 2023

@adifayer @eyarz shall I work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request up for grabs Looking for a contributor to take this task
Projects
Datree
To Do
Development

No branches or pull requests

3 participants