Skip to content

Commit

Permalink
[SECCOMP-31579] - FIPS support
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbxbx committed Dec 13, 2024
1 parent 0be31e1 commit ffacb22
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ WORKDIR /go/src/github.com/prometheus-community/postgres_exporter

FROM base AS builder
COPY . .

ENV CGO_ENABLED=1
ENV GOEXPERIMENT=boringcrypto

RUN go mod tidy
RUN make build
RUN cp postgres_exporter /bin/postgres_exporter
Expand All @@ -22,4 +26,4 @@ FROM quay.io/sysdig/sysdig-stig-mini-ubi9:1.2.0 AS ubi
COPY --from=builder /bin/postgres_exporter /bin/postgres_exporter
EXPOSE 9187
USER 59000:59000
ENTRYPOINT [ "/bin/postgres_exporter" ]
ENTRYPOINT [ "/bin/postgres_exporter" ]
4 changes: 4 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
# Ensure GOBIN is not set during build so that promu is installed to the correct path
unexport GOBIN

# Export flags required for FIPS compliance
export CGO_ENABLED=1
export GOEXPERIMENT=boringcrypto

GO ?= go
GOFMT ?= $(GO)fmt
FIRST_GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))
Expand Down
2 changes: 2 additions & 0 deletions cmd/postgres_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
"os"
"strings"

_ "crypto/tls/fipsonly"

Check failure on line 22 in cmd/postgres_exporter/main.go

View workflow job for this annotation

GitHub Actions / lint

could not import crypto/tls/fipsonly (-: build constraints exclude all Go files in /opt/hostedtoolcache/go/1.21.13/x64/src/crypto/tls/fipsonly) (typecheck)

"github.com/alecthomas/kingpin/v2"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
Expand Down

0 comments on commit ffacb22

Please sign in to comment.