Skip to content

Commit

Permalink
[v12] Remove unused FIPS infrastructure (#32540)
Browse files Browse the repository at this point in the history
* Remove unused FIPS build boxes (#26859)

FIPS is only built on amd64, and only on our centos:7 buildboxes.  These
other dockerfiles and targets are vestigial.  Furthermore, the buildbox
is a security risk, as ubuntu:18.04 is not supported after 2023-05-31.

If/when we want to support FIPS on ARM, we can build off the centos:7
infrastructure, or its successor.

(cherry picked from commit fafa16a)

* Remove further unused fips infrastructure (#27900)

* Remove Dockerfile-arm-fips

We don't build fips for arm, as documented in
#10581.

* Stop building buildbox-fips

We do not use this buildbox for anything. This step is failing because
the supporting infrastructure for buildbox-fips was removed in
#26859.

* Fix fips buildbox

BUILDBOX_FIPS was removed, replaced by BUILDBOX_CENTOS7_FIPS.
Unfortunately I missed updating this target in #26859.
This subsequently broke e CI.

(cherry picked from commit 6ef1186)

* Update signature

---------

Co-authored-by: Walt <walt@goteleport.com>
  • Loading branch information
gzdunek and wadells authored Sep 26, 2023
1 parent e9d3724 commit 5fe14d6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 253 deletions.
25 changes: 1 addition & 24 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6184,29 +6184,6 @@ steps:
path: /var/run
- name: dockerconfig
path: /root/.docker
- name: Build and push buildbox-fips
image: docker
pull: if-not-exists
commands:
- apk add --no-cache make aws-cli
- chown -R $UID:$GID /go
- aws ecr get-login-password --profile staging --region=us-west-2 | docker login
-u="AWS" --password-stdin 146628656107.dkr.ecr.us-west-2.amazonaws.com
- make -C build.assets buildbox-fips
- docker tag public.ecr.aws/gravitational/teleport-buildbox-fips:$BUILDBOX_VERSION
146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-buildbox-fips:$BUILDBOX_VERSION-$DRONE_COMMIT_SHA
- docker push 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-buildbox-fips:$BUILDBOX_VERSION-$DRONE_COMMIT_SHA
- docker logout 146628656107.dkr.ecr.us-west-2.amazonaws.com
- aws ecr-public get-login-password --profile production --region=us-east-1 | docker
login -u="AWS" --password-stdin public.ecr.aws
- docker push public.ecr.aws/gravitational/teleport-buildbox-fips:$BUILDBOX_VERSION
volumes:
- name: awsconfig
path: /root/.aws
- name: dockersock
path: /var/run
- name: dockerconfig
path: /root/.docker
- name: Build and push buildbox-arm
image: docker
pull: if-not-exists
Expand Down Expand Up @@ -19682,6 +19659,6 @@ image_pull_secrets:
- DOCKERHUB_CREDENTIALS
---
kind: signature
hmac: a1dd263395a8e6d01c667265c21ebddc12310d39b0b6708f991054680794d73a
hmac: 0e3b73a1357ea40b0a94bd0c968f81af4c2aa536a4c16c97e139861b04ccec7e

...
6 changes: 0 additions & 6 deletions build.assets/Dockerfile-arm-fips

This file was deleted.

186 changes: 0 additions & 186 deletions build.assets/Dockerfile-fips

This file was deleted.

37 changes: 4 additions & 33 deletions build.assets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ include grpcbox.mk # Requires images.mk
# target. The other solution was to remove the 'buildbox' dependency from the 'release' target, but this would
# make it harder to run `make -C build.assets release` locally as the buildbox would not automatically be built.
BUILDBOX_NAME=$(BUILDBOX)
BUILDBOX_FIPS_NAME=$(BUILDBOX_FIPS)

DOCSBOX=public.ecr.aws/gravitational/docs

Expand Down Expand Up @@ -141,20 +140,7 @@ buildbox:
# Builds a Docker buildbox for FIPS
#
.PHONY:buildbox-fips
buildbox-fips:
if [[ "$(BUILDBOX_FIPS_NAME)" == "$(BUILDBOX_FIPS)" ]]; then \
if [[ $${DRONE} == "true" ]] && ! docker inspect --type=image $(BUILDBOX_FIPS) 2>&1 >/dev/null; then docker pull $(BUILDBOX_FIPS) || true; fi; \
docker build \
--build-arg UID=$(UID) \
--build-arg GID=$(GID) \
--build-arg BUILDARCH=$(RUNTIME_ARCH) \
--build-arg GOLANG_VERSION=$(GOLANG_VERSION) \
--build-arg NODE_VERSION=$(NODE_VERSION) \
--build-arg RUST_VERSION=$(RUST_VERSION) \
--build-arg LIBBPF_VERSION=$(LIBBPF_VERSION) \
--cache-from $(BUILDBOX_FIPS) \
--tag $(BUILDBOX_FIPS) -f Dockerfile-fips . ; \
fi
buildbox-fips: buildbox-centos7-fips

#
# Builds a Docker buildbox for CentOS 7 builds
Expand Down Expand Up @@ -204,20 +190,6 @@ buildbox-arm: buildbox
--cache-from $(BUILDBOX_ARM) \
--tag $(BUILDBOX_ARM) -f Dockerfile-arm .

#
# Builds a Docker buildbox for ARMv7/ARM64 FIPS builds
# ARM buildboxes use a regular Teleport buildbox as a base which already has a user
# with the correct UID and GID created, so those arguments are not needed here.
#
.PHONY:buildbox-arm-fips
buildbox-arm-fips: buildbox-fips
@if [[ $${DRONE} == "true" ]] && ! docker inspect --type=image $(BUILDBOX_ARM_FIPS) 2>&1 >/dev/null; then docker pull $(BUILDBOX_ARM_FIPS) || true; fi;
docker build \
--build-arg BUILDBOX_VERSION=$(BUILDBOX_VERSION) \
--cache-from $(BUILDBOX_FIPS) \
--cache-from $(BUILDBOX_ARM_FIPS) \
--tag $(BUILDBOX_ARM_FIPS) -f Dockerfile-arm-fips .

CONNECT_VERSION ?= $(VERSION)
ifeq ($(CONNECT_VERSION),)
CONNECT_VERSION := $(BUILDBOX_VERSION)-dev
Expand Down Expand Up @@ -393,8 +365,7 @@ release-amd64:
$(MAKE) release ARCH=amd64 FIDO2=yes

.PHONY: release-amd64-fips
release-amd64-fips:
$(MAKE) release-fips ARCH=amd64 FIPS=yes BUILDBOX_FIPS_NAME=$(BUILDBOX_FIPS)
release-amd64-fips: release-amd64-centos7-fips

.PHONY: release-386
release-386:
Expand Down Expand Up @@ -471,9 +442,9 @@ release-enterprise:
# CI should not use this target, it should use named Makefile targets like release-amd64-fips.
#
.PHONY:release-fips
release-fips: buildbox-fips webassets
release-fips: buildbox-centos7-fips webassets
@if [ -z ${VERSION} ]; then echo "VERSION is not set"; exit 1; fi
docker run $(DOCKERFLAGS) -i $(NOROOT) $(BUILDBOX_FIPS_NAME) \
docker run $(DOCKERFLAGS) -i $(NOROOT) $(BUILDBOX_CENTOS7_FIPS) \
/usr/bin/make -C e release -e ADDFLAGS="$(ADDFLAGS)" OS=$(OS) ARCH=$(ARCH) RUNTIME=$(GOLANG_VERSION) FIPS=yes VERSION=$(VERSION) GITTAG=v$(VERSION) REPRODUCIBLE=yes

#
Expand Down
2 changes: 0 additions & 2 deletions build.assets/images.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ BUILDBOX_VERSION ?= teleport12
BUILDBOX_BASE_NAME ?= public.ecr.aws/gravitational/teleport-buildbox

BUILDBOX=$(BUILDBOX_BASE_NAME):$(BUILDBOX_VERSION)
BUILDBOX_FIPS=$(BUILDBOX_BASE_NAME)-fips:$(BUILDBOX_VERSION)
BUILDBOX_CENTOS7=$(BUILDBOX_BASE_NAME)-centos7:$(BUILDBOX_VERSION)
BUILDBOX_CENTOS7_FIPS=$(BUILDBOX_BASE_NAME)-centos7-fips:$(BUILDBOX_VERSION)
BUILDBOX_ARM=$(BUILDBOX_BASE_NAME)-arm:$(BUILDBOX_VERSION)
BUILDBOX_ARM_FIPS=$(BUILDBOX_BASE_NAME)-arm-fips:$(BUILDBOX_VERSION)
BUILDBOX_UI=$(BUILDBOX_BASE_NAME)-ui:$(BUILDBOX_VERSION)
BUILDBOX_CONNECT=$(BUILDBOX_BASE_NAME)-connect:$(BUILDBOX_VERSION)
BUILDBOX_CENTOS7_ASSETS=$(BUILDBOX_BASE_NAME)-centos7-assets:$(BUILDBOX_VERSION)
4 changes: 2 additions & 2 deletions dronegen/buildbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func buildboxPipelineSteps() []step {

for _, name := range []string{"buildbox", "buildbox-arm", "buildbox-centos7"} {
for _, fips := range []bool{false, true} {
// FIPS is unsupported on ARM/ARM64
if name == "buildbox-arm" && fips {
// FIPS is only supported on centos7
if fips && name != "buildbox-centos7" {
continue
}
steps = append(steps, buildboxPipelineStep(name, fips))
Expand Down

0 comments on commit 5fe14d6

Please sign in to comment.