File tree 6 files changed +10
-16
lines changed
6 files changed +10
-16
lines changed Original file line number Diff line number Diff line change 3
3
set -euo pipefail
4
4
5
5
FLEET_SERVER_VERSION=${1:? " Fleet Server version is needed" }
6
+ FILE_PREFIX=" build/distributions/fleet-server-${FLEET_SERVER_VERSION} -"
6
7
7
8
PLATFORM_FILES=(darwin-aarch64.tar.gz darwin-x86_64.tar.gz linux-arm64.tar.gz linux-x86_64.tar.gz windows-x86_64.zip)
8
9
if [ " $FIPS " = " true" ] ; then
9
10
PLATFORM_FILES=(linux-arm64.tar.gz linux-x86_64.tar.gz)
11
+ FILE_PREFIX=" build/distributions/fleet-server-fips-${FLEET_SERVER_VERSION} -"
10
12
fi
11
13
12
14
# make release
13
15
14
- FILE_PREFIX=" build/distributions/fleet-server-${FLEET_SERVER_VERSION} -"
15
-
16
16
RED=' \033[0;31m'
17
17
GREEN=' \033[0;32m'
18
18
NO_COLOR=' \033[0m'
Original file line number Diff line number Diff line change @@ -40,6 +40,6 @@ USER fleet-server
40
40
COPY --chown=fleet-server:fleet-server --chmod=644 fleet-server.yml /etc/fleet-server.yml
41
41
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
42
42
43
- ENV GOFIPS=1
43
+ ENV GODEBUG=fips140=on
44
44
45
45
CMD [ "/usr/bin/fleet-server", "-c", "/etc/fleet-server.yml" ]
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ DOCKER_PLATFORMS ?= linux/amd64 linux/arm64
56
56
# only want to define the tag if none is specified, this allows an invocation like
57
57
# FIPS=true make test-e2e
58
58
# 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
59
60
ifndef DOCKER_IMAGE_TAG
60
61
DOCKER_IMAGE_TAG? =${VERSION}
61
62
ifeq "${DEV}" "true"
Original file line number Diff line number Diff line change @@ -2,18 +2,16 @@ ARG ELASTIC_AGENT_IMAGE # e.g. docker.elastic.co/cloud-release/elastic-agent-clo
2
2
3
3
FROM --platform=linux/amd64 ${ELASTIC_AGENT_IMAGE} as elastic_agent_amd64
4
4
ARG STACK_VERSION # e.g. 8.5.0-SNAPSHOT
5
- ARG FLEET_SUFFIX # e.g. -linux-x86_64
6
5
ARG FLEET_FIPS="" # should be -fips if a fips distribution will be used
7
6
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 \
9
8
./data/elastic-agent-${VCS_REF_SHORT}/components/fleet-server
10
9
11
10
FROM --platform=linux/arm64 ${ELASTIC_AGENT_IMAGE} as elastic_agent_arm64
12
11
ARG STACK_VERSION # e.g. 8.5.0-SNAPSHOT
13
- ARG FLEET_SUFFIX # e.g. -linux-x86_64
14
12
ARG FLEET_FIPS="" # should be -fips if a fips distribution will be used
15
13
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 \
17
15
./data/elastic-agent-${VCS_REF_SHORT}/components/fleet-server
18
16
19
17
FROM elastic_agent_${TARGETARCH}
Original file line number Diff line number Diff line change @@ -24,10 +24,6 @@ VCS_REF=$(docker inspect -f '{{index .Config.Labels "org.label-schema.vcs-ref"}}
24
24
25
25
CUSTOM_IMAGE_TAG=${STACK_VERSION} -e2e-${COMMIT} -$( date +%s)
26
26
27
- FLEET_SUFFIX=" -linux-x86_64"
28
- if [[ " $GOARCH " == " arm64" ]]; then
29
- FLEET_SUFFIX=" -linux-arm64"
30
- fi
31
27
FLEET_FIPS=" "
32
28
if [[ " $FIPS " == " true" ]]; then
33
29
FLEET_FIPS=" -fips"
@@ -37,7 +33,6 @@ docker build \
37
33
-f $REPO_ROOT /dev-tools/e2e/Dockerfile \
38
34
--build-arg ELASTIC_AGENT_IMAGE=$BASE_IMAGE \
39
35
--build-arg STACK_VERSION=${FLEET_VERSION} \
40
- --build-arg FLEET_SUFFIX=${FLEET_SUFFIX} \
41
36
--build-arg FLEET_FIPS=${FLEET_FIPS} \
42
37
--build-arg VCS_REF_SHORT=${VCS_REF: 0: 6} \
43
38
--platform linux/$GOARCH \
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ The following make commands have different behaviour when FIPS is enabled:
36
36
A Multipass VM created with ` FIPS=true make multipass ` is able to compile FIPS enabled golang programs, but is not able to run them.
37
37
When you try to run one the following error occurs:
38
38
```
39
- GOFIPS=1 ./bin/fleet-server -c fleet-server.yml
39
+ GODEBUG=fips140=on ./bin/fleet-server -c fleet-server.yml
40
40
panic: opensslcrypto: can't enable FIPS mode for OpenSSL 3.0.13 30 Jan 2024: openssl: FIPS mode not supported by any provider
41
41
42
42
goroutine 1 [running]:
@@ -92,14 +92,14 @@ activate = 1
92
92
default_properties = fips=yes
93
93
```
94
94
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.,
96
96
```
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
98
98
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
99
99
i...
100
100
```
101
101
102
102
## Usage
103
103
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.
105
105
The system/image is required to have a FIPS compliant provider available.
You can’t perform that action at this time.
0 commit comments