Skip to content

Commit

Permalink
fix(worker): use ecr repositories; add sql driver
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
  • Loading branch information
fabriziosestito committed Dec 3, 2024
1 parent 02f5d3a commit e176538
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/handlers/generate_sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"log/slog"
"os"

_ "modernc.org/sqlite" // sqlite driver for RPM DB and Java DB

trivyCommands "github.com/aquasecurity/trivy/pkg/commands"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -79,6 +81,8 @@ func (h *GenerateSBOMHandler) Handle(message messaging.Message) error {
"image",
"--cache-dir", h.workDir,
"--format", "spdx-json",
"--db-repository", "public.ecr.aws/aquasecurity/trivy-db",
"--java-db-repository", "public.ecr.aws/aquasecurity/trivy-java-db",
"--output", sbomFile.Name(),
fmt.Sprintf("%s/%s:%s", image.GetImageMetadata().RegistryURI, image.GetImageMetadata().Repository, image.GetImageMetadata().Tag),
})
Expand Down

0 comments on commit e176538

Please sign in to comment.