Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

feat: support SBOM #422

Merged
merged 32 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c5768a3
refactor: replace with go-redis
knqyf263 Oct 30, 2023
2417e61
chore(deps): go mod tidy
knqyf263 Oct 30, 2023
f5e338e
chore: add run target
knqyf263 Oct 30, 2023
acfc507
Merge branch 'main' into go-redis
knqyf263 Oct 30, 2023
5255848
test: fix args
knqyf263 Oct 30, 2023
9f204ff
feat: support SBOM
knqyf263 Oct 31, 2023
fb83feb
fix: move header to body
knqyf263 Nov 1, 2023
20a84b7
feat: scan SBOM
knqyf263 Nov 1, 2023
9dea0f2
Merge branch 'main' into sbom
knqyf263 Jan 9, 2024
146f247
feat: add SBOM capability
knqyf263 Jan 9, 2024
c04fb14
feat: add support for enabled capabilities
knqyf263 Jan 9, 2024
19908e0
test(integration): fix
knqyf263 Jan 9, 2024
c175279
feat: add support for multiple capabilities
knqyf263 Jan 11, 2024
2d702f4
test: fix scan job key
knqyf263 Jan 11, 2024
08454d0
test: fix component tests
knqyf263 Jan 11, 2024
219adbe
test: fix integration tests
knqyf263 Jan 11, 2024
876e17f
Merge branch 'main' into sbom
knqyf263 Jan 11, 2024
e48bbfe
feat: add additional_attributes
knqyf263 Jan 18, 2024
767979c
feat: take "sbom_media_type" in the GET query parameter
knqyf263 Jan 18, 2024
88edd7c
test: add test cases for SBOM
knqyf263 Jan 18, 2024
128d128
test: add cases for SBOM generation
knqyf263 Jan 18, 2024
af20c7f
test: add a component test for SBOM generation
knqyf263 Jan 18, 2024
bcb93c3
refactor: remove ioutil
knqyf263 Jan 19, 2024
6102cbf
test(integration): remove mock
knqyf263 Jan 22, 2024
3476964
Merge branch 'main' into sbom
knqyf263 Jan 22, 2024
e402b84
fix: yaml lint issues
knqyf263 Jan 22, 2024
6c68b72
chore: install Trivy
knqyf263 Jan 22, 2024
d5db690
test: fix arch to amd64
knqyf263 Jan 22, 2024
dca6114
Merge branch 'main' into sbom
knqyf263 Feb 27, 2024
f9211e6
fix: return 400 when missing sbom_media_type
knqyf263 Feb 27, 2024
3bc7455
fix: return 400 when missing produces_mime_types
knqyf263 Feb 27, 2024
2cfba90
Merge branch 'main' into sbom
knqyf263 Apr 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ IMAGE := aquasec/harbor-scanner-trivy:$(IMAGE_TAG)
build: $(BINARY)

test: build
GO111MODULE=on go test -v -short -race -coverprofile=coverage.txt -covermode=atomic ./...
go test -v -short -race -coverprofile=coverage.txt -covermode=atomic ./...

test-integration: build
GO111MODULE=on go test -count=1 -v -tags=integration ./test/integration/...
go test -count=1 -v -tags=integration ./test/integration/...

.PHONY: test-component
test-component: docker-build
GO111MODULE=on go test -count=1 -v -tags=component ./test/component/...
go test -count=1 -v -tags=component ./test/component/...

$(BINARY): $(SOURCES)
GOOS=linux GO111MODULE=on CGO_ENABLED=0 go build -o $(BINARY) cmd/scanner-trivy/main.go
GOOS=linux CGO_ENABLED=0 go build -o $(BINARY) cmd/scanner-trivy/main.go

.PHONY: docker-build
docker-build: build
Expand All @@ -29,6 +29,7 @@ lint:

setup:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.48.3

submodule:
git submodule update --init --recursive
Expand Down
31 changes: 25 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ module github.com/aquasecurity/harbor-scanner-trivy
go 1.21

require (
github.com/alicebob/miniredis/v2 v2.31.1
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986
github.com/caarlos0/env/v6 v6.10.1
github.com/docker/docker v24.0.7+incompatible
github.com/docker/go-connections v0.5.0
github.com/google/go-containerregistry v0.14.0
github.com/gorilla/mux v1.8.1
github.com/gorilla/schema v1.2.1
github.com/opencontainers/go-digest v1.0.0
github.com/prometheus/client_golang v1.18.0
github.com/redis/go-redis/v9 v9.5.1
Expand All @@ -22,25 +26,34 @@ require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/containerd/containerd v1.7.11 // indirect
github.com/containerd/containerd v1.7.7 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/docker/cli v24.0.0+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/fatih/color v1.9.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/goccy/go-yaml v1.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/term v0.5.0 // indirect
Expand All @@ -59,13 +72,19 @@ require (
github.com/stretchr/objx v0.5.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
github.com/yuin/gopher-lua v1.1.0 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/tools v0.10.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.3 // indirect
golang.org/x/tools v0.9.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/grpc v1.57.1 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/google/go-containerregistry => github.com/knqyf263/go-containerregistry v0.16.2-0.20231101014841-fd95d0f749dd
Loading
Loading