refactor: use trivy-checks/pkg/specs package (#8226)

Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
This commit is contained in:
Nikita Pivkin
2025-01-11 09:44:00 +06:00
committed by GitHub
parent 0aa2607cd8
commit 243e5a3af9

View File

@@ -9,7 +9,7 @@ import (
"golang.org/x/xerrors"
"gopkg.in/yaml.v3"
sp "github.com/aquasecurity/trivy-checks/pkg/spec"
"github.com/aquasecurity/trivy-checks/pkg/specs"
iacTypes "github.com/aquasecurity/trivy/pkg/iac/types"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/set"
@@ -97,7 +97,7 @@ func GetComplianceSpec(specNameOrPath, cacheDir string) (ComplianceSpec, error)
} else {
_, err := os.Stat(filepath.Join(checksDir(cacheDir), "metadata.json"))
if err != nil { // cache corrupt or bundle does not exist, load embedded version
b = []byte(sp.NewSpecLoader().GetSpecByName(specNameOrPath))
b = []byte(specs.GetSpec(specNameOrPath))
log.Debug("Compliance spec loaded from embedded library", log.String("spec", specNameOrPath))
} else {
// load from bundle on disk