Skip to content

Commit

Permalink
feat(build): Add FIPS build
Browse files Browse the repository at this point in the history
  • Loading branch information
pgcrooks-sysdig committed Jan 29, 2025
1 parent 8f98c9e commit 5026306
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

env:
GO_VERSION: 1.23.x
ZIG_VERSION: 0.13.0
GOLINT_ARGS: -v --allow-parallel-runners --timeout=10m --disable errcheck

jobs:
Expand All @@ -31,6 +32,11 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}

- name: Setup Zig 🛠️
uses: goto-bus-stop/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}

- name: Test pkg library 🧪
run: |
cd pkg
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

env:
GO_VERSION: 1.23.x
ZIG_VERSION: 0.13.0
GOLINT_ARGS: -v --allow-parallel-runners --timeout=10m --disable errcheck

jobs:
Expand All @@ -21,6 +22,11 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}

- name: Setup Zig 🛠️
uses: goto-bus-stop/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}

- name: Test pkg library 🧪
run: |
cd pkg
Expand Down
29 changes: 29 additions & 0 deletions runtimes/cloudformation/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,34 @@ builds:
- -X main.commit={{ .Commit }}
- -X main.date={{ .Date }}

- id: fips
no_unique_dist_dir: true
binary: handler-fips/handler-{{ .Os }}-{{ .Arch }}
main: ./cmd/handler
goos:
- linux
goarch:
- amd64
- arm64
goamd64:
- v1
mod_timestamp: "{{ .CommitTimestamp }}"
tags:
- fips
env:
- GOEXPERIMENT=boringcrypto
- CGO_ENABLED=1
- >-
{{- if and (eq .Os "linux") (eq .Arch "amd64") }}CC=zig c++ -target x86_64-linux-gnu{{- end }}
{{- if and (eq .Os "linux") (eq .Arch "arm64") }}CC=zig c++ -target aarch64-linux-gnu{{- end }}
- >-
{{- if and (eq .Os "linux") (eq .Arch "amd64") }}CXX=zig c++ -target x86_64-linux-gnu{{- end }}
{{- if and (eq .Os "linux") (eq .Arch "arm64") }}CXX=zig c++ -target aarch64-linux-gnu{{- end }}
ldflags:
- -s -w
- -X main.version={{ .Version }}
- -X main.commit={{ .Commit }}
- -X main.date={{ .Date }}

snapshot:
version_template: "{{ .Env.BUILD_VERSION }}"
5 changes: 5 additions & 0 deletions runtimes/cloudformation/cmd/handler/fips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//go:build boringcrypto

package main

import _ "crypto/tls/fipsonly"

0 comments on commit 5026306

Please sign in to comment.