Skip to content

config-check: "Module has no input selectors - it will be loaded for all inputs" (all exceptions ignored) #7926

Answered by nikpivkin
bovy89 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @bovy89 !

You can ignore a check by content. For example, you know that the AVD-KSV-0114 check should not be triggered for the validatingwebhookconfigurations resource, then you can write the following ignore rule:

package trivy

import rego.v1

default ignore := false

ignore if {
    input.AVDID == "AVD-KSV-0114"
    some line in input.CauseMetadata.Code.Lines
    contains(line.Content, "validatingwebhookconfigurations")
}
❯ trivy conf cert-manager.yaml |grep AVD-KSV-0114
2024-11-20T17:06:26+06:00       INFO    [misconfig] Misconfiguration scanning is enabled
2024-11-20T17:06:30+06:00       INFO    Detected config files   num=1
AVD-KSV-0114 (CRITICAL): ClusterRole 'cert-manager-cainj…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@bovy89
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by simar7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
kind/bug Categorizes issue or PR as related to a bug.
3 participants