Skip to content

Commit e8d99f3

Browse files
bugerclaude
andcommitted
Add FIPS build configuration and Docker image workflow
- Add fips-amd64 and fips-arm64 build targets with boringcrypto - Add tyk-gateway-fips nfpm package configuration - Add FIPS publisher for packagecloud - Add FIPS Docker image build steps for CI and production - FIPS images built for amd64/arm64 only, pushed to tykio/tyk-gateway-fips Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c23654f commit e8d99f3

File tree

2 files changed

+166
-0
lines changed

2 files changed

+166
-0
lines changed

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
debvers: 'ubuntu/xenial ubuntu/bionic ubuntu/focal ubuntu/jammy ubuntu/noble debian/jessie debian/buster debian/bullseye debian/bookworm debian/trixie'
5151
outputs:
5252
ee_tags: ${{ steps.ci_metadata_ee.outputs.tags }}
53+
fips_tags: ${{ steps.ci_metadata_fips.outputs.tags }}
5354
std_tags: ${{ steps.ci_metadata_std.outputs.tags }}
5455
commit_author: ${{ steps.set_outputs.outputs.commit_author}}
5556
steps:
@@ -197,6 +198,71 @@ jobs:
197198
labels: ${{ steps.tag_metadata_ee.outputs.labels }}
198199
build-args: |
199200
BUILD_PACKAGE_NAME=tyk-gateway-ee
201+
- name: Docker metadata for fips CI
202+
id: ci_metadata_fips
203+
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
204+
uses: docker/metadata-action@v5
205+
with:
206+
images: |
207+
${{ steps.ecr.outputs.registry }}/tyk
208+
flavor: |
209+
latest=false
210+
tags: |
211+
type=ref,event=branch
212+
type=ref,event=pr
213+
type=sha,format=long
214+
type=semver,pattern={{major}},prefix=v
215+
type=semver,pattern={{major}}.{{minor}},prefix=v
216+
type=semver,pattern={{version}},prefix=v
217+
- name: push fips image to CI
218+
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
219+
uses: docker/build-push-action@v6
220+
with:
221+
context: "dist"
222+
platforms: linux/amd64,linux/arm64
223+
file: ci/Dockerfile.distroless
224+
provenance: mode=max
225+
sbom: true
226+
push: true
227+
cache-from: type=gha
228+
cache-to: type=gha,mode=max
229+
tags: ${{ steps.ci_metadata_fips.outputs.tags }}
230+
labels: ${{ steps.ci_metadata_fips.outputs.labels }}
231+
build-args: |
232+
BUILD_PACKAGE_NAME=tyk-gateway-fips
233+
- name: Docker metadata for fips tag push
234+
id: tag_metadata_fips
235+
uses: docker/metadata-action@v5
236+
with:
237+
images: |
238+
tykio/tyk-gateway-fips
239+
flavor: |
240+
latest=false
241+
prefix=v
242+
tags: |
243+
type=semver,pattern={{major}}.{{minor}}
244+
type=semver,pattern={{version}}
245+
labels: |
246+
org.opencontainers.image.title=Tyk Gateway Enterprise Edition FIPS
247+
org.opencontainers.image.description=Tyk API Gateway Enterprise Edition written in Go, supporting REST, GraphQL, TCP and gRPC protocols Built with boringssl
248+
org.opencontainers.image.vendor=tyk.io
249+
org.opencontainers.image.version=${{ github.ref_name }}
250+
- name: push fips image to prod
251+
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
252+
uses: docker/build-push-action@v6
253+
with:
254+
context: "dist"
255+
platforms: linux/amd64,linux/arm64
256+
file: ci/Dockerfile.distroless
257+
provenance: mode=max
258+
sbom: true
259+
cache-from: type=gha
260+
cache-to: type=gha,mode=max
261+
push: ${{ startsWith(github.ref, 'refs/tags') }}
262+
tags: ${{ steps.tag_metadata_fips.outputs.tags }}
263+
labels: ${{ steps.tag_metadata_fips.outputs.labels }}
264+
build-args: |
265+
BUILD_PACKAGE_NAME=tyk-gateway-fips
200266
- name: Docker metadata for std CI
201267
id: ci_metadata_std
202268
if: ${{ matrix.golang_cross == '1.24-bullseye' }}

ci/goreleaser/goreleaser.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,42 @@ builds:
5757
goarch:
5858
- s390x
5959
binary: tyk
60+
- id: fips-amd64
61+
flags:
62+
- -tags=goplugin,ee,fips,boringcrypto
63+
- -trimpath
64+
env:
65+
- NOP=nop # ignore this, it is jsut to avoid a complex conditional in the templates
66+
- CC=gcc
67+
- GOEXPERIMENT=boringcrypto
68+
ldflags:
69+
- -X github.com/TykTechnologies/tyk/internal/build.Version={{.Version}}
70+
- -X github.com/TykTechnologies/tyk/internal/build.Commit={{.FullCommit}}
71+
- -X github.com/TykTechnologies/tyk/internal/build.BuildDate={{.Date}}
72+
- -X github.com/TykTechnologies/tyk/internal/build.BuiltBy=goreleaser
73+
goos:
74+
- linux
75+
goarch:
76+
- amd64
77+
binary: tyk
78+
- id: fips-arm64
79+
flags:
80+
- -tags=goplugin,ee,fips,boringcrypto
81+
- -trimpath
82+
env:
83+
- NOP=nop # ignore this, it is jsut to avoid a complex conditional in the templates
84+
- CC=aarch64-linux-gnu-gcc
85+
- GOEXPERIMENT=boringcrypto
86+
ldflags:
87+
- -X github.com/TykTechnologies/tyk/internal/build.Version={{.Version}}
88+
- -X github.com/TykTechnologies/tyk/internal/build.Commit={{.FullCommit}}
89+
- -X github.com/TykTechnologies/tyk/internal/build.BuildDate={{.Date}}
90+
- -X github.com/TykTechnologies/tyk/internal/build.BuiltBy=goreleaser
91+
goos:
92+
- linux
93+
goarch:
94+
- arm64
95+
binary: tyk
6096
- id: std-amd64
6197
flags:
6298
- -tags=goplugin
@@ -168,6 +204,64 @@ nfpms:
168204
signature:
169205
key_file: tyk.io.signing.key
170206
type: origin
207+
- id: fips
208+
vendor: "Tyk Technologies Ltd"
209+
homepage: "https://tyk.io"
210+
maintainer: "Tyk <info@tyk.io>"
211+
description: Tyk API Gateway Enterprise Edition written in Go, supporting REST, GraphQL, TCP and gRPC protocols Built with boringssl
212+
package_name: tyk-gateway-fips
213+
file_name_template: "{{ .ConventionalFileName }}"
214+
ids:
215+
- fips-amd64
216+
- fips-arm64
217+
formats:
218+
- deb
219+
- rpm
220+
contents:
221+
- src: "README.md"
222+
dst: "/opt/share/docs/tyk-gateway/README.md"
223+
- src: "ci/install/*"
224+
dst: "/opt/tyk-gateway/install"
225+
- src: ci/install/inits/systemd/system/tyk-gateway.service
226+
dst: /lib/systemd/system/tyk-gateway.service
227+
- src: ci/install/inits/sysv/init.d/tyk-gateway
228+
dst: /etc/init.d/tyk-gateway
229+
- src: /opt/tyk-gateway
230+
dst: /opt/tyk
231+
type: "symlink"
232+
- src: "LICENSE.md"
233+
dst: "/opt/share/docs/tyk-gateway/LICENSE.md"
234+
- src: "apps/app_sample.*"
235+
dst: "/opt/tyk-gateway/apps"
236+
- src: "templates/*.json"
237+
dst: "/opt/tyk-gateway/templates"
238+
- src: "templates/playground/*"
239+
dst: "/opt/tyk-gateway/templates/playground"
240+
- src: "middleware/*.js"
241+
dst: "/opt/tyk-gateway/middleware"
242+
- src: "event_handlers/sample/*.js"
243+
dst: "/opt/tyk-gateway/event_handlers/sample"
244+
- src: "policies/*.json"
245+
dst: "/opt/tyk-gateway/policies"
246+
- src: "coprocess/*"
247+
dst: "/opt/tyk-gateway/coprocess"
248+
- src: tyk.conf.example
249+
dst: /opt/tyk-gateway/tyk.conf
250+
type: "config|noreplace"
251+
scripts:
252+
preinstall: "ci/install/before_install.sh"
253+
postinstall: "ci/install/post_install.sh"
254+
postremove: "ci/install/post_remove.sh"
255+
bindir: "/opt/tyk-gateway"
256+
rpm:
257+
scripts:
258+
posttrans: ci/install/post_trans.sh
259+
signature:
260+
key_file: tyk.io.signing.key
261+
deb:
262+
signature:
263+
key_file: tyk.io.signing.key
264+
type: origin
171265
- id: std
172266
vendor: "Tyk Technologies Ltd"
173267
homepage: "https://tyk.io"
@@ -234,6 +328,12 @@ publishers:
234328
env:
235329
- PACKAGECLOUD_TOKEN={{ .Env.PACKAGECLOUD_TOKEN }}
236330
cmd: packagecloud publish --debvers "{{ .Env.DEBVERS }}" --rpmvers "{{ .Env.RPMVERS }}" tyk/tyk-ee-unstable {{ .ArtifactPath }}
331+
- name: fips
332+
ids:
333+
- fips
334+
env:
335+
- PACKAGECLOUD_TOKEN={{ .Env.PACKAGECLOUD_TOKEN }}
336+
cmd: packagecloud publish --debvers "{{ .Env.DEBVERS }}" --rpmvers "{{ .Env.RPMVERS }}" tyk/tyk-ee-unstable {{ .ArtifactPath }}
237337
- name: std
238338
ids:
239339
- std

0 commit comments

Comments
 (0)