Skip to content

Commit 0267fe6

Browse files
Fix test-release and docker image
1 parent c438318 commit 0267fe6

File tree

6 files changed

+10
-16
lines changed

6 files changed

+10
-16
lines changed

.buildkite/scripts/test-release.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
set -euo pipefail
44

55
FLEET_SERVER_VERSION=${1:?"Fleet Server version is needed"}
6+
FILE_PREFIX="build/distributions/fleet-server-${FLEET_SERVER_VERSION}-"
67

78
PLATFORM_FILES=(darwin-aarch64.tar.gz darwin-x86_64.tar.gz linux-arm64.tar.gz linux-x86_64.tar.gz windows-x86_64.zip)
89
if [ "$FIPS" = "true" ] ; then
910
PLATFORM_FILES=(linux-arm64.tar.gz linux-x86_64.tar.gz)
11+
FILE_PREFIX="build/distributions/fleet-server-fips-${FLEET_SERVER_VERSION}-"
1012
fi
1113

1214
#make release
1315

14-
FILE_PREFIX="build/distributions/fleet-server-${FLEET_SERVER_VERSION}-"
15-
1616
RED='\033[0;31m'
1717
GREEN='\033[0;32m'
1818
NO_COLOR='\033[0m'

Dockerfile.fips

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ USER fleet-server
4040
COPY --chown=fleet-server:fleet-server --chmod=644 fleet-server.yml /etc/fleet-server.yml
4141
COPY --chown=fleet-server:fleet-server --chmod=555 --from=builder /go/src/github.com/elastic/fleet-server/build/binaries/fleet-server-fips-${VERSION}-${TARGETOS:-linux}-*/fleet-server /usr/bin/fleet-server
4242

43-
ENV GOFIPS=1
43+
ENV GODEBUG=fips140=on
4444

4545
CMD [ "/usr/bin/fleet-server", "-c", "/etc/fleet-server.yml" ]

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ DOCKER_PLATFORMS ?= linux/amd64 linux/arm64
5656
# only want to define the tag if none is specified, this allows an invocation like
5757
# FIPS=true make test-e2e
5858
# to use a tag like X.Y.Z-fips and not X.Y.Z-fips-fips as the test-e2e target calls into make
59+
# TODO: We should change FIPS stand-alone/e2e images to use fleet-server-fips:TAG instead of fleet-server:TAG-fips
5960
ifndef DOCKER_IMAGE_TAG
6061
DOCKER_IMAGE_TAG?=${VERSION}
6162
ifeq "${DEV}" "true"

dev-tools/e2e/Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ ARG ELASTIC_AGENT_IMAGE # e.g. docker.elastic.co/cloud-release/elastic-agent-clo
22

33
FROM --platform=linux/amd64 ${ELASTIC_AGENT_IMAGE} as elastic_agent_amd64
44
ARG STACK_VERSION # e.g. 8.5.0-SNAPSHOT
5-
ARG FLEET_SUFFIX # e.g. -linux-x86_64
65
ARG FLEET_FIPS="" # should be -fips if a fips distribution will be used
76
ARG VCS_REF_SHORT # e.g. abc123
8-
ONBUILD COPY --chmod=0755 --chown=elastic-agent cover/fleet-server${FLEET_FIPS}-${STACK_VERSION}${FLEET_SUFFIX}/fleet-server \
7+
ONBUILD COPY --chmod=0755 --chown=elastic-agent cover/fleet-server${FLEET_FIPS}-${STACK_VERSION}-linux-x86_64/fleet-server \
98
./data/elastic-agent-${VCS_REF_SHORT}/components/fleet-server
109

1110
FROM --platform=linux/arm64 ${ELASTIC_AGENT_IMAGE} as elastic_agent_arm64
1211
ARG STACK_VERSION # e.g. 8.5.0-SNAPSHOT
13-
ARG FLEET_SUFFIX # e.g. -linux-x86_64
1412
ARG FLEET_FIPS="" # should be -fips if a fips distribution will be used
1513
ARG VCS_REF_SHORT # e.g. abc123
16-
ONBUILD COPY --chmod=0755 --chown=elastic-agent cover/fleet-server${FLEET_FIPS}-${STACK_VERSION}${FLEET_SUFFIX}/fleet-server \
14+
ONBUILD COPY --chmod=0755 --chown=elastic-agent cover/fleet-server${FLEET_FIPS}-${STACK_VERSION}-linux-arm64/fleet-server \
1715
./data/elastic-agent-${VCS_REF_SHORT}/components/fleet-server
1816

1917
FROM elastic_agent_${TARGETARCH}

dev-tools/e2e/build.sh

-5
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ VCS_REF=$(docker inspect -f '{{index .Config.Labels "org.label-schema.vcs-ref"}}
2424

2525
CUSTOM_IMAGE_TAG=${STACK_VERSION}-e2e-${COMMIT}-$(date +%s)
2626

27-
FLEET_SUFFIX="-linux-x86_64"
28-
if [[ "$GOARCH" == "arm64" ]]; then
29-
FLEET_SUFFIX="-linux-arm64"
30-
fi
3127
FLEET_FIPS=""
3228
if [[ "$FIPS" == "true" ]]; then
3329
FLEET_FIPS="-fips"
@@ -37,7 +33,6 @@ docker build \
3733
-f $REPO_ROOT/dev-tools/e2e/Dockerfile \
3834
--build-arg ELASTIC_AGENT_IMAGE=$BASE_IMAGE \
3935
--build-arg STACK_VERSION=${FLEET_VERSION} \
40-
--build-arg FLEET_SUFFIX=${FLEET_SUFFIX} \
4136
--build-arg FLEET_FIPS=${FLEET_FIPS} \
4237
--build-arg VCS_REF_SHORT=${VCS_REF:0:6} \
4338
--platform linux/$GOARCH \

docs/fips.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The following make commands have different behaviour when FIPS is enabled:
3636
A Multipass VM created with `FIPS=true make multipass` is able to compile FIPS enabled golang programs, but is not able to run them.
3737
When you try to run one the following error occurs:
3838
```
39-
GOFIPS=1 ./bin/fleet-server -c fleet-server.yml
39+
GODEBUG=fips140=on ./bin/fleet-server -c fleet-server.yml
4040
panic: opensslcrypto: can't enable FIPS mode for OpenSSL 3.0.13 30 Jan 2024: openssl: FIPS mode not supported by any provider
4141
4242
goroutine 1 [running]:
@@ -92,14 +92,14 @@ activate = 1
9292
default_properties = fips=yes
9393
```
9494

95-
4. Run the program with the `OPENSSL_CONF=openssl.cnf` and `GOFIPS=1` env vars, i.e.,
95+
4. Run the program with the `OPENSSL_CONF=openssl.cnf` and `GODEBUG=fips140=on` env vars, i.e.,
9696
```
97-
OPENSSL_CONF=./openssl.cnf GOFIPS=1 ./bin/fleet-server -c fleet-server.yml
97+
OPENSSL_CONF=./openssl.cnf GODEBUG=fips140=on ./bin/fleet-server -c fleet-server.yml
9898
23:48:47.871 INF Boot fleet-server args=["-c","fleet-server.yml"] commit=55104f6f ecs.version=1.6.0 exe=./bin/fleet-server pid=65037 ppid=5642 service.name=fleet-server service.type=fleet-server version=9.0.0
9999
i...
100100
```
101101

102102
## Usage
103103

104-
A FIPS enabled binary should be ran with the env var `GOFIPS=1` set.
104+
A FIPS enabled binary should be ran with the env var `GODEBUG=fips140=on` set.
105105
The system/image is required to have a FIPS compliant provider available.

0 commit comments

Comments
 (0)