Skip to content
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

Update dependencies and enable gosec for SAST scans #116

Merged
merged 5 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .ci/hack/set_dependency_version
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ if name in injectedSpecialCases:
elif name == 'autoscaler':
names = ['cluster-autoscaler']
elif name == 'vpn2':
names = ['vpn-seed-server', 'vpn-shoot-client']
names = ['vpn-server', 'vpn-client']
elif name == 'external-dns-management':
names = ['dns-controller-manager']
elif name == 'logging':
Expand Down
19 changes: 18 additions & 1 deletion .ci/pipeline_definitions
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0

gardener-extension-shoot-lakom-service:
templates:
templates:
helmcharts:
- &shoot-lakom-service
name: shoot-lakom-service
Expand Down Expand Up @@ -34,6 +34,13 @@ gardener-extension-shoot-lakom-service:
attribute: image.tag

base_definition:
repo:
source_labels:
- name: cloud.gardener.cnudie/dso/scanning-hints/source_analysis/v1
value:
policy: skip
comment: |
We use gosec for sast scanning, see attached log.
traits:
version:
preprocess: 'inject-commit-hash'
Expand Down Expand Up @@ -112,6 +119,16 @@ gardener-extension-shoot-lakom-service:
nextversion: 'bump_minor'
next_version_callback: '.ci/prepare_release'
release_callback: '.ci/prepare_release'
assets:
- type: build-step-log
step_name: verify
purposes:
- lint
- sast
- gosec
comment: |
We use gosec (linter) for SAST scans, see: https://github.com/securego/gosec.
Enabled by https://github.com/gardener/gardener-extension-shoot-lakom-service/pull/116
slack:
default_channel: 'internal_scp_workspace'
channel_cfgs:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ dive.log
/example/lakom
/.vscode
/vendor

# gosec
gosec-report.sarif
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ tidy:
@cp $(GARDENER_HACK_DIR)/.ci/* $(REPO_ROOT)/.ci/hack/
@chmod +xw $(REPO_ROOT)/.ci/hack/*
@cp $(GARDENER_HACK_DIR)/cherry-pick-pull.sh $(HACK_DIR)/cherry-pick-pull.sh && chmod +xw $(HACK_DIR)/cherry-pick-pull.sh
@cp $(GARDENER_HACK_DIR)/sast.sh $(HACK_DIR)/sast.sh && chmod +xw $(HACK_DIR)/sast.sh
# @$(HACK_DIR)/update-github-templates.sh

.PHONY: clean
Expand Down Expand Up @@ -121,6 +122,14 @@ format: $(GOIMPORTSREVISER)
@GOIMPORTS_REVISER_OPTIONS="-imports-order std,project,general,company" \
bash $(GARDENER_HACK_DIR)/format.sh ./cmd ./pkg ./test

.PHONY: sast
sast: tidy $(GOSEC)
@$(HACK_DIR)/sast.sh

.PHONY: sast-report
sast-report: tidy $(GOSEC)
@$(HACK_DIR)/sast.sh --gosec-report true

.PHONY: test
test: $(REPORT_COLLECTOR)
@SKIP_FETCH_TOOLS=1 bash $(GARDENER_HACK_DIR)/test.sh ./cmd/... ./pkg/...
Expand All @@ -134,10 +143,10 @@ test-clean:
@bash $(GARDENER_HACK_DIR)/test-cover-clean.sh

.PHONY: verify
verify: check format test
verify: check format test sast

.PHONY: verify-extended
verify-extended: check-generate check format test test-cov test-clean
verify-extended: check-generate check format test test-cov test-clean sast-report

.PHONY: update-skaffold-deps
update-skaffold-deps: $(YQ)
Expand Down
105 changes: 54 additions & 51 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ toolchain go1.23.1
require (
github.com/Masterminds/semver/v3 v3.3.0
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0
github.com/gardener/gardener v1.103.0
github.com/gardener/gardener v1.106.0
github.com/gardener/service-account-issuer-discovery v0.6.0
github.com/go-logr/logr v1.4.2
github.com/google/go-containerregistry v0.20.0
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20240129192428-8dadbe76ff8c
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20240129192428-8dadbe76ff8c
github.com/onsi/ginkgo/v2 v2.20.0
github.com/onsi/gomega v1.34.1
github.com/onsi/ginkgo/v2 v2.20.1
github.com/onsi/gomega v1.34.2
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0
github.com/prometheus/client_golang v1.20.0
github.com/prometheus/client_golang v1.20.4
github.com/sigstore/cosign/v2 v2.2.4
github.com/sigstore/sigstore v1.8.3
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
go.uber.org/mock v0.4.0
golang.org/x/sync v0.8.0
golang.org/x/tools v0.24.0
k8s.io/api v0.29.8
k8s.io/apimachinery v0.29.8
golang.org/x/tools v0.26.0
k8s.io/api v0.31.1
k8s.io/apimachinery v0.31.1
k8s.io/autoscaler/vertical-pod-autoscaler v1.2.1
k8s.io/client-go v0.29.8
k8s.io/code-generator v0.29.8
k8s.io/component-base v0.29.8
k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3
sigs.k8s.io/controller-runtime v0.17.6
k8s.io/client-go v0.31.1
k8s.io/code-generator v0.31.1
k8s.io/component-base v0.31.1
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6
sigs.k8s.io/controller-runtime v0.19.0
sigs.k8s.io/yaml v1.4.0
)

Expand All @@ -50,7 +50,7 @@ require (
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2 v1.26.0 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.9 // indirect
Expand All @@ -76,7 +76,7 @@ require (
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20231217050601-ba74d44ecf5f // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/cyphar/filepath-securejoin v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect
github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect
Expand All @@ -86,15 +86,15 @@ require (
github.com/docker/docker-credential-helpers v0.8.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fluent/fluent-operator/v2 v2.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/gardener/cert-management v0.15.0 // indirect
github.com/gardener/etcd-druid v0.22.5 // indirect
github.com/gardener/hvpa-controller/api v0.16.0 // indirect
github.com/gardener/machine-controller-manager v0.53.1 // indirect
github.com/gardener/etcd-druid v0.22.7 // indirect
github.com/gardener/hvpa-controller/api v0.17.0 // indirect
github.com/gardener/machine-controller-manager v0.54.0 // indirect
github.com/go-chi/chi v4.1.2+incompatible // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
Expand All @@ -109,7 +109,7 @@ require (
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-openapi/validate v0.24.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/gobuffalo/flect v1.0.3 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
Expand All @@ -120,7 +120,7 @@ require (
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -130,7 +130,7 @@ require (
github.com/imdario/mergo v0.3.16 // indirect
github.com/in-toto/in-toto-golang v0.9.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ironcore-dev/vgopath v0.1.4 // indirect
github.com/ironcore-dev/vgopath v0.1.5 // indirect
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand All @@ -147,7 +147,7 @@ require (
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/spdystream v0.4.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand All @@ -160,7 +160,7 @@ require (
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.58.0 // indirect
github.com/prometheus/common v0.60.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
Expand All @@ -182,48 +182,51 @@ require (
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
github.com/transparency-dev/merkle v0.0.2 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.7.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
helm.sh/helm/v3 v3.14.4 // indirect
istio.io/api v1.22.4 // indirect
istio.io/client-go v1.22.0 // indirect
k8s.io/apiextensions-apiserver v0.29.8 // indirect
k8s.io/apiserver v0.29.8 // indirect
k8s.io/cluster-bootstrap v0.29.8 // indirect
k8s.io/component-helpers v0.29.8 // indirect
helm.sh/helm/v3 v3.16.2 // indirect
istio.io/api v1.23.2 // indirect
istio.io/client-go v1.23.2 // indirect
k8s.io/apiextensions-apiserver v0.31.1 // indirect
k8s.io/apiserver v0.31.1 // indirect
k8s.io/cluster-bootstrap v0.31.1 // indirect
k8s.io/component-helpers v0.31.1 // indirect
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-aggregator v0.29.8 // indirect
k8s.io/kube-openapi v0.0.0-20240221221325-2ac9dc51f3f1 // indirect
k8s.io/kubelet v0.29.8 // indirect
k8s.io/metrics v0.29.8 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-aggregator v0.31.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/kubelet v0.31.1 // indirect
k8s.io/metrics v0.31.1 // indirect
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20231015215740-bf15e44028f9 // indirect
sigs.k8s.io/controller-tools v0.14.0 // indirect
sigs.k8s.io/controller-tools v0.16.4 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
Loading