diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 602f9ae..f76b736 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -80,7 +80,7 @@ jobs: - name: Run Gosec Security Scanner run: | - go install github.com/securego/gosec/v2/cmd/gosec@1af1d5bb49259b62e45c505db397dd2ada5d74f8 + go install github.com/securego/gosec/v2/cmd/gosec@e0cca6fe95306b7e7790d6f1bf6a7bec6d622459 # v2.22.0 make gosec if [[ $? != 0 ]] then diff --git a/Dockerfile b/Dockerfile index 9585598..3614e26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,9 @@ # limitations under the License. # Build the manager binary -FROM golang:1.21@sha256:b405b620c7b53ef64695c7da7c8396f411f381c1eb7da6713c585dd7eca1559b as builder +FROM registry.access.redhat.com/ubi9/go-toolset:1.22.9@sha256:e4193e71ea9f2e2504f6b4ee93cadef0fe5d7b37bba57484f4d4229801a7c063 as builder ARG TARGETARCH=amd64 +USER root WORKDIR /workspace # Copy the Go Modules manifests @@ -41,9 +42,8 @@ ENV ENABLE_WEBHOOKS=${ENABLE_WEBHOOKS} ARG ENABLE_WEBHOOK_HTTP2=false ENV ENABLE_WEBHOOK_HTTP2=${ENABLE_WEBHOOK_HTTP2} -# Use distroless as minimal base image to package the manager binary -# Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot-${TARGETARCH} +# Use ubi-micro as minimal base image to package the manager binary +FROM registry.access.redhat.com/ubi9/ubi-micro:9.6@sha256:955512628a9104d74f7b3b0a91db27a6bbecdd6a1975ce0f1b2658d3cd060b98 WORKDIR / COPY --from=builder /workspace/manager . USER 1001 diff --git a/Makefile b/Makefile index dd1ac06..5ae8480 100644 --- a/Makefile +++ b/Makefile @@ -340,5 +340,5 @@ bundle-push: .PHONY: gosec gosec: # Run this command to install gosec, if not installed: - # go install github.com/securego/gosec/v2/cmd/gosec@v2.14.0 + # go install github.com/securego/gosec/v2/cmd/gosec@v2.22.0 gosec -no-fail -fmt=sarif -out=gosec.sarif -exclude-dir pkg/test -exclude-dir tests ./... diff --git a/README.md b/README.md index d234636..bc8e3e9 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@