-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
--ignore-policy unavailable in config target #3490
Comments
|
I tried it with |
|
even tough it works, the exception seems wrong:
|
Thanks for looking into this. I think I just discovered this the hard way myself 😅 Also, there seems to be a lot of places in the docs (and the examples) mentioning the Also, as a Trivy n00b, it's not clear to me what the difference is between a "ignore policy" and and "exception policy". But that might be out of topic :) |
@anderseknert about |
I added the support... I didn't remember it at all 😄 Lines 195 to 207 in 6cac6c9
|
Signed-off-by: AnaisUrlichs <[email protected]>
Revisiting this thread, can someone remind me of the expected behavior here? Below is what I see with the latest release of Trivy cat ignore.rego
package trivy
default ignore=true
ignore=false {
input.AVDID == "avd-aws-0094"
}
trivy fs ~/repos/trivy/pkg/fanal/artifact/local/testdata/misconfig/cloudformation/passed/src/ --security-checks config --ignore-policy ./ignore.rego --format json
2023-08-08T23:22:33.374-0600 WARN '--security-checks' is deprecated. Use '--scanners' instead.
2023-08-08T23:22:33.389-0600 INFO Misconfiguration scanning is enabled
2023-08-08T23:22:33.699-0600 INFO Detected config files: 1
{
"SchemaVersion": 2,
"ArtifactName": "/Users/simarpreetsingh/repos/trivy/pkg/fanal/artifact/local/testdata/misconfig/cloudformation/passed/src",
"ArtifactType": "filesystem",
"Metadata": {
"ImageConfig": {
"architecture": "",
"created": "0001-01-01T00:00:00Z",
"os": "",
"rootfs": {
"type": "",
"diff_ids": null
},
"config": {}
}
},
"Results": [
{
"Target": "main.yaml",
"Class": "config",
"Type": "cloudformation",
"MisconfSummary": {
"Successes": 2,
"Failures": 9,
"Exceptions": 0
}
}
]
} Below is what I have able to gather from the discussion so far:
Please correct me if I'm wrong. |
Description
works:
doesn't work:
What did you expect to happen?
able to ignore with rego policies in config scan
What happened instead?
error:
Output of run with
-debug
:same
Output of
trivy -v
:Additional details (base image name, container registry info...):
The text was updated successfully, but these errors were encountered: