Skip to content

feat(misconf): Add short_code for checks into AVD #8850

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

Open
simar7 opened this issue May 9, 2025 · 0 comments
Open

feat(misconf): Add short_code for checks into AVD #8850

simar7 opened this issue May 9, 2025 · 0 comments
Assignees
Labels
kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. scan/misconfiguration Issues relating to misconfiguration scanning
Milestone

Comments

@simar7
Copy link
Member

simar7 commented May 9, 2025

Short code is defined here:

func (r Rule) LongID() string {
return strings.ToLower(fmt.Sprintf("%s-%s-%s", r.Provider, r.Service, r.ShortCode))
}

Discussed in #8846

Originally posted by nekketsuuu May 8, 2025

Description

I propose to add a long ID of a check to the documentation of the check on https://avd.aquasec.com/. For example, I want that google-gke-encrypt-instance-storage-data is written in https://avd.aquasec.com/misconfig/google/gke/avd-gcp-0051/.

This would help writing inline ignore comments. First, we can write inline comments in several formats, especially a short ID format # trivy:ignore:AVD-GCP-0051 and a long ID format # trivy:ignore:google-gke-encrypt-instance-storage-data (Ref. https://trivy.dev/v0.62/docs/scanner/misconfiguration/#skipping-detected-misconfigurations-by-inline-comments). Currently, when scanning with Trivy, it provides a URL like https://avd.aquasec.com/misconfig/avd-gcp-0051 for details, and the page only displays the short ID.

I prefer the long ID format because the short ID makes it difficult to understand its purpose in the code without additional searching. However, since the check's documentation only shows the short ID, it takes extra time to locate the correct long ID (for example, by searching through the metadata in aquasecurity/trivy-checks: https://github.com/aquasecurity/trivy-checks/blob/a5cb6398785b450db3bc7a569eaaa12b9683e1e9/checks/cloud/google/gke/use_cluster_labels.rego). This is why I suggest including the long ID of a check in its documentation.

Link

As an example: https://avd.aquasec.com/misconfig/avd-gcp-0051

Suggestions

I'd like to add a long ID, in which is <provider>-<service>-<short-code> style, into the docs of checks.

@simar7 simar7 self-assigned this May 9, 2025
@simar7 simar7 added kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. scan/misconfiguration Issues relating to misconfiguration scanning labels May 9, 2025
@simar7 simar7 added this to the v0.63.0 milestone May 9, 2025
@simar7 simar7 changed the title feat(misconf): Add long-id for checks into AVD feat(misconf): Add short_code for checks into AVD May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. scan/misconfiguration Issues relating to misconfiguration scanning
Projects
Status: No status
Development

No branches or pull requests

1 participant