-
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
feat(misconf): Implement aliases for misconf checks #5691
feat(misconf): Implement aliases for misconf checks #5691
Comments
Fixes: aquasecurity/trivy#5691 Signed-off-by: Simar <[email protected]>
Fixes: aquasecurity/trivy#5691 Signed-off-by: Simar <[email protected]>
Fixes: aquasecurity/trivy#5691 Signed-off-by: Simar <[email protected]>
* feat(checks): Add aliasing support Fixes: aquasecurity/trivy#5691 Signed-off-by: Simar <[email protected]> * fix lint --------- Signed-off-by: Simar <[email protected]>
Hello,
Is this supposed to be working ? I'd like to used CSPM IDs instead of the trivy ID as the former is really convenient and readable. I'm using
Thanks ! |
@RobinFrcd please the PR here. The feature is supported within Trivy but adding aliases is done on a per need basis as going forwards we try to support the AVD IDs as we guarantee them to be unique. If you have other checks that you'd like us to add aliases for, please leave them as a comment in the PR mentioned. Thanks. |
Description
Sometimes Trivy and tfsec checks can have different
short_code
to reference the same check. This can create friction for users to reuse their existing terraform code withtrivy:ignore
ortfsec:ignore
that they were using with tfsec, to now use in Trivy.Instead, we can add an alias field to our checks which can allow us to support alternate names for our existing checks. This is backwards compatible as it will not break any existing checks for users that are already using newer IDs.
Action Items
This change will require logic addition to the static metadata here
We will also need to include this alias as part of check evaluation. The logic to do so will be added here
In addition, we'll have to add aliases for all tfsec checks as defined here https://github.com/aquasecurity/tfsec/blob/master/rules.md
Discussed in #5684
Originally posted by bsolomon1124 November 29, 2023
Description
Multiple discussion and issues including #3620, #2961, aquasecurity/tfsec#1994, https://github.com/aquasecurity/tfsec/issues/1997 state that
trivy
will respecttfsec:ignore
directives to ease the transition fromtfsec
totrivy
, but it appears thattrivy
(0.47.0) does not respecttfsec:ignore
directives at all.So,
tfsec:ignore
?Desired Behavior
Respect
tfsec:ignore
Actual Behavior
Does not respect
tfsec:ignore
and reports the corresponding AVD ID as a violation/failure.Reproduction Steps
main.tf
:Trivy should ignore this check given
tfsec:ignore:aws-s3-enable-bucket-logging
.Target
Filesystem
Scanner
Misconfiguration
Output Format
None
Mode
Standalone
Debug Output
Operating System
macOS 13.6.2
Version
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: