Skip to content

feat(misconf): Add minimum supported version #8637

@simar7

Description

@simar7

Description

Today trivy supports the ability to load any check, regardless of whether or not it has the ability to actually run it. This is the case for those checks where the support for a new service or provider is added.

This leads to situations where an older version of Trivy can download a new check for which it may not have the support for. In such a case today we don't evaluate the check and end up skipping it.

Solution

A more optimized approach in such a case would be to add a metadata annotation to the check itself, which could specify the "minimum trivy version" needed to run that particular check. This would then be used by the Trivy CLI to determine if it makes sense for it to load that particular check or not.

Example

An example of this could look like the following (details omitted for brevity):

# METADATA
# title: "Runtime/Default Seccomp profile not set"
# description: "Some description text"
# scope: package
# minimum_trivy_version: v0.60
# schemas:
# - input: schema["kubernetes"]
# related_resources:
# - https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted

In this case a trivy version semantically higher than v0.60 would be able to load this check. As we only introduce new features in a minor release (not a patch), we can omit checking/specifying for the patch release version.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.scan/misconfigurationIssues relating to misconfiguration scanning

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions