Draft: feat: add a FIPS 140-3 build of glab

What does this MR do and why?

Draft, opened to gather information. It's not ready for review yet.

Adds a FIPS 140-3 build of glab for the Duo Flows executor image. glab is built against the Go Cryptographic Module v1.0.0 (CMVP #5247), the same approach the CNG -fips images use for Gitaly and gitlab-shell.

  • Release: adds a linux-fips goreleaser build (linux/amd64, GOFIPS140=v1.0.0) and a glab_<ver>_linux_amd64_fips.tar.gz archive on the normal release. nfpms and dockers now set ids explicitly so they don't pick up the FIPS binary.
  • SHA-1: SHA-1 panics under GODEBUG=fips140=only. Our two uses aren't for security (GitLab's line_code format, and the UUIDv5 used by govern audit sync), so they're wrapped in fips140.WithoutEnforcement.
  • auth dpop generate: hidden when FIPS mode is on. Passphrase-protected SSH keys are decrypted with bcrypt_pbkdf, which is outside the module.
  • tests:fips: a new CI job.
    • make check-fips-binary checks that the binary records GOFIPS140=v1.0.0, fips140=on and the fips140v1.0 tag, and contains no BoringCrypto or OpenSSL symbols.
    • make test-fips runs the unit tests under fips140=only, so new non-approved crypto fails CI.

Related to https://gitlab.com/gitlab-org/cli/-/work_items/8682

What this pipeline should tell us

  • build_test: the goreleaser snapshot builds the linux-fips target and the _fips archive, and the nfpms and dockers ids changes don't break packaging or images.
  • tests:fips: binary verification and unit tests pass under fips140=only in CI. Locally, 6724 tests passed apart from one timing flake that is unrelated.
  • How long tests:fips takes.

Still to do before review

  • Docs for the FIPS asset.
  • Security Compliance confirmation that #5247 covers glab (tracked in 8682).

🤖 Generated with Claude Code

Edited by Jay McCure

Merge request reports

Loading
Loading