Skip to content

Commit ffacb22

Browse files
committed
[SECCOMP-31579] - FIPS support
1 parent 0be31e1 commit ffacb22

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ WORKDIR /go/src/github.com/prometheus-community/postgres_exporter
88

99
FROM base AS builder
1010
COPY . .
11+
12+
ENV CGO_ENABLED=1
13+
ENV GOEXPERIMENT=boringcrypto
14+
1115
RUN go mod tidy
1216
RUN make build
1317
RUN cp postgres_exporter /bin/postgres_exporter
@@ -22,4 +26,4 @@ FROM quay.io/sysdig/sysdig-stig-mini-ubi9:1.2.0 AS ubi
2226
COPY --from=builder /bin/postgres_exporter /bin/postgres_exporter
2327
EXPOSE 9187
2428
USER 59000:59000
25-
ENTRYPOINT [ "/bin/postgres_exporter" ]
29+
ENTRYPOINT [ "/bin/postgres_exporter" ]

Makefile.common

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
# Ensure GOBIN is not set during build so that promu is installed to the correct path
2626
unexport GOBIN
2727

28+
# Export flags required for FIPS compliance
29+
export CGO_ENABLED=1
30+
export GOEXPERIMENT=boringcrypto
31+
2832
GO ?= go
2933
GOFMT ?= $(GO)fmt
3034
FIRST_GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))

cmd/postgres_exporter/main.go

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
"os"
2020
"strings"
2121

22+
_ "crypto/tls/fipsonly"
23+
2224
"github.com/alecthomas/kingpin/v2"
2325
"github.com/go-kit/log"
2426
"github.com/go-kit/log/level"

0 commit comments

Comments
 (0)