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

[SECCOMP-31579] - FIPS support #68

Merged
merged 1 commit into from
Dec 13, 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 Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.4 as builder

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Scan results for localbuild/redis-exporter:latest

warn dockerfile

warn dockerfile:instruction Dockerfile directive 'HEALTHCHECK' not found, matching condition 'not_exists' check

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Scan results for localbuild/redis-exporter:latest

warn files

warn files:suid_or_guid_set SUID or SGID found set on file /usr/bin/chage. Mode: 0o104755

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Scan results for localbuild/redis-exporter:latest

warn files

warn files:suid_or_guid_set SUID or SGID found set on file /usr/bin/gpasswd. Mode: 0o104755

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Scan results for localbuild/redis-exporter:latest

warn files

warn files:suid_or_guid_set SUID or SGID found set on file /usr/bin/newgrp. Mode: 0o104755
WORKDIR /go/src/github.com/oliver006/redis_exporter/

ADD . /go/src/github.com/oliver006/redis_exporter/
Expand All @@ -7,7 +7,7 @@
ARG SHA1="[no-sha]"
ARG TAG="[no-tag]"

RUN BUILD_DATE=$(date +%F-%T) CGO_ENABLED=0 GOOS=linux GOARCH=$GOARCH go build -o /redis_exporter \
RUN BUILD_DATE=$(date +%F-%T) CGO_ENABLED=1 GOEXPERIMENT=boringcrypto GOOS=linux GOARCH=$GOARCH go build -o /redis_exporter \
-ldflags "-s -w -extldflags \"-static\" -X main.BuildVersion=$TAG -X main.BuildCommitSha=$SHA1 -X main.BuildDate=$BUILD_DATE" .

RUN [ $GOARCH = "amd64" ] && /redis_exporter -version || ls -la /redis_exporter
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ upload-coverage:


BUILD_DT:=$(shell date +%F-%T)
GO_LDFLAGS:="-s -w -extldflags \"-static\" -X main.BuildVersion=${DRONE_TAG} -X main.BuildCommitSha=${DRONE_COMMIT_SHA} -X main.BuildDate=$(BUILD_DT)"
GO_LDFLAGS:="-s -w -extldflags \"-static\" -X main.BuildVersion=${DRONE_TAG} -X main.BuildCommitSha=${DRONE_COMMIT_SHA} -X main.BuildDate=$(BUILD_DT)"

.PHONE: build-binaries
build-binaries:
go install github.com/oliver006/gox@master

rm -rf .build | true

export CGO_ENABLED=0 ; \
export CGO_ENABLED=1 ; \
export GOEXPERIMENT=boringcrypto ; \
gox -os="linux windows freebsd netbsd openbsd" -arch="amd64 386" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${DRONE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="darwin solaris illumos" -arch="amd64" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${DRONE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="darwin" -arch="arm64" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${DRONE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"strconv"
"time"

_ "crypto/tls/fipsonly"

"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"

Expand Down
Loading