-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add docker images built using FIPS binaries #7392
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
Conversation
API Changes
no api changes detected
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
CI Consistency
FIPS CI/prod builds use distroless Dockerfile and push multi-arch images, but image names/tags differ from std/ee; verify that downstream consumers and promotion rules expect 'tykio/tyk-gateway' with '-fips' suffix and that manifests are created only on tag pushes to avoid accidental CI pollution.
- name: Docker metadata for fips CI id: ci_metadata_fips if: ${{ matrix.golang_cross == '1.24-bullseye' }} uses: docker/metadata-action@v5 with: images: | ${{ steps.ecr.outputs.registry }}/tyk flavor: | latest=false tags: | type=ref,event=branch type=ref,event=pr type=sha,format=long type=semver,pattern={{major}},prefix=v type=semver,pattern={{major}}.{{minor}},prefix=v type=semver,pattern={{version}},prefix=v - name: push fips image to CI if: ${{ matrix.golang_cross == '1.24-bullseye' }} uses: docker/build-push-action@v6 with: context: "dist" platforms: linux/amd64,linux/arm64,linux/s390x file: ci/Dockerfile.distroless provenance: mode=max sbom: true push: true cache-from: type=gha cache-to: type=gha,mode=max tags: ${{ steps.ci_metadata_fips.outputs.tags }} labels: ${{ steps.ci_metadata_fips.outputs.labels }} build-args: | BUILD_PACKAGE_NAME=tyk-gateway-fips - name: Docker metadata for fips tag push id: tag_metadata_fips uses: docker/metadata-action@v5 with: images: | tykio/tyk-gateway flavor: | latest=false prefix=v tags: | type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{version}} labels: | org.opencontainers.image.title=Tyk Gateway FIPS org.opencontainers.image.description=Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols Built with boringssl org.opencontainers.image.vendor=tyk.io org.opencontainers.image.version=${{ github.ref_name }} - name: push fips image to prod if: ${{ matrix.golang_cross == '1.24-bullseye' }} uses: docker/build-push-action@v6 with: context: "dist" platforms: linux/amd64,linux/arm64,linux/s390x file: ci/Dockerfile.distroless provenance: mode=max sbom: true cache-from: type=gha cache-to: type=gha,mode=max push: ${{ startsWith(github.ref, 'refs/tags') }} tags: ${{ steps.tag_metadata_fips.outputs.tags }} labels: ${{ steps.tag_metadata_fips.outputs.labels }} build-args: | BUILD_PACKAGE_NAME=tyk-gateway-fips - name: Docker metadata for std CI
Cleanup Change
The cleanup path removal now omits '/var/lib/dpkg' from deletion; confirm this is intentional and won't leave residual apt metadata increasing image size or CVE surface compared to previous state.
# Clean up caches, unwanted .a and .o files RUN rm -rf /root/.cache \ && apt-get -y autoremove \ && apt-get clean \ && rm -rf /usr/include/* /var/cache/apt/archives /var/lib/apt /var/lib/cache /var/log/* \ && find /usr/lib -type f -name '*.a' -o -name '*.o' -delete
FIPS Build Flags
New FIPS builds add GOEXPERIMENT=boringcrypto and boringssl description; verify toolchain actually links boringcrypto for all arches (amd64/arm64/s390x) and that cross-compilers CC=... exist in the build env to avoid mismatched crypto backends.
- s390x binary: tyk - id: fips-amd64 flags: - -tags=goplugin,fips,boringcrypto env: - NOP=nop # ignore this, it is jsut to avoid a complex conditional in the templates - CC=gcc - GOEXPERIMENT=boringcrypto ldflags: - -X github.com/TykTechnologies/tyk/internal/build.Version={{.Version}} - -X github.com/TykTechnologies/tyk/internal/build.Commit={{.FullCommit}} - -X github.com/TykTechnologies/tyk/internal/build.BuildDate={{.Date}} - -X github.com/TykTechnologies/tyk/internal/build.BuiltBy=goreleaser goos: - linux goarch: - amd64 binary: tyk - id: fips-arm64 flags: - -tags=goplugin,fips,boringcrypto env: - NOP=nop # ignore this, it is jsut to avoid a complex conditional in the templates - CC=aarch64-linux-gnu-gcc - GOEXPERIMENT=boringcrypto ldflags: - -X github.com/TykTechnologies/tyk/internal/build.Version={{.Version}} - -X github.com/TykTechnologies/tyk/internal/build.Commit={{.FullCommit}} - -X github.com/TykTechnologies/tyk/internal/build.BuildDate={{.Date}} - -X github.com/TykTechnologies/tyk/internal/build.BuiltBy=goreleaser goos: - linux goarch: - arm64 binary: tyk - id: fips-s390x flags: - -tags=goplugin,fips,boringcrypto env: - NOP=nop # ignore this, it is jsut to avoid a complex conditional in the templates - CC=s390x-linux-gnu-gcc - GOEXPERIMENT=boringcrypto ldflags: - -X github.com/TykTechnologies/tyk/internal/build.Version={{.Version}} - -X github.com/TykTechnologies/tyk/internal/build.Commit={{.FullCommit}} - -X github.com/TykTechnologies/tyk/internal/build.BuildDate={{.Date}} - -X github.com/TykTechnologies/tyk/internal/build.BuiltBy=goreleaser goos: - linux goarch: - s390x binary: tyk
PR Code Suggestions ✨Explore these optional code suggestions:
|
Quality Gate Failed Quality Gate failed
Failed conditions
4 Security Hotspots
Uh oh!
There was an error while loading. Please reload this page.
User description
Description
Auto generated changes by gromit to add fips compliant docker images to releases. These changes are in response to a customer request for fips compliant docker images. These are provided by using our existing fips binaries in a distroless image. THESE ARE NOT FIPS VALIDATED IMAGES. Tyk's FIPS documentation has been updated as a result of this request.
Related Issue
see this ticket. A PR has also been made against branch
release-5.8
ontyk-analytics
Motivation and Context
These images were request to be included in regular releases by a client.
How This Has Been Tested
goreleaser was run locally, everything seems okay a fips image is built using the fips binary. More end to end testing is needed with the other fips components.
Types of changes
Checklist
PR Type
Enhancement, Other
Description
Add FIPS Docker builds and manifests
Enable multi-arch FIPS packages (amd64/arm64/s390x)
CI workflow pushes FIPS images to CI/prod
Adjust std Dockerfile install and cleanup
Diagram Walkthrough
File Walkthrough
release.yml
CI pipeline to build and publish FIPS images
.github/workflows/release.yml
Dockerfile.std
Standard Dockerfile installs from dist and cleans
ci/Dockerfile.std
goreleaser.yml
Goreleaser: FIPS multi-arch builds and manifests
ci/goreleaser/goreleaser.yml