Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 71 additions & 27 deletions .github/workflows/fips.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# SPDX-FileCopyrightText: 2026 Sudo Apt Holdings LLC
# SPDX-License-Identifier: Apache-2.0
#
# The suite on Erlang/OTP in FIPS mode, against the validated OpenSSL FIPS provider.
# The suite on Erlang/OTP in FIPS mode, against a validated OpenSSL FIPS provider.
#
# What runs: OTP 28.5.0.8 (a patched release of the pinned line, at or above the CVE-2026-55737
# floor in tools/otp-floors) built with --enable-fips, over OpenSSL 3.5.8's
# libcrypto with the FIPS provider built from OpenSSL 3.1.2, the source CMVP certificate #4985
# (FIPS 140-3) validates, following its security policy (section 11.1: `enable-fips`,
# `make install_fips`, then `openssl fipsinstall` on the machine that runs it). Pairing a newer
# libcrypto with the validated 3.1.2 provider is what OpenSSL's README-FIPS describes and its
# own provider-compatibility CI exercises nightly. Every download is checked against its
# published SHA-256 before it is built.
# What runs: OTP 28.5.0.9 (a patched release of the pinned line, at or above its floor in
# tools/otp-floors) built with --enable-fips over OpenSSL 3.5.9's libcrypto, once with each of
# two FIPS providers, each built from the source its CMVP certificate validates and installed
# as its security policy's section 11.1 says (`enable-fips`, `make install_fips`, then
# `openssl fipsinstall` on the machine that runs it):
# - 3.5.9, CMVP #5586 (FIPS 140-3): ML-DSA-44/65/87 approved (pure, external mu), with
# SHA-2 and SHAKE. Built from the same tree as the libcrypto.
# - 3.1.2, CMVP #4985 (FIPS 140-3): SHA-2 and the classical algorithms, no ML-DSA. Paired
# with the newer libcrypto, as OpenSSL's README-FIPS describes and its own
# provider-compatibility CI exercises nightly.
# beam_mcp itself needs only SHA-2 (docs/fips.md); the 3.5.9 row also records whether ML-DSA-87
# is offered in FIPS mode, a fact a signer behind `BeamMCP.Signer` relies on. Every download is
# checked against its published SHA-256 before it is built.
#
# The order is fixed: deps and compile with FIPS mode OFF (Hex fetches over TLS, rebar3 builds
# telemetry), then the suite with `-crypto fips_mode true`, asserted inside the same VM before
Expand All @@ -20,13 +25,15 @@
# A negative control runs first: without the provider configuration, `fips_mode true` must not
# give a working crypto (it fails closed: the NIF does not load).
#
# Not a validation claim: ubuntu-24.04 is not an operational environment #4985 names, and this
# job proves the package's behaviour under FIPS mode, nothing about the module. See docs/fips.md.
# Not a validation claim: a GitHub runner is not an operational environment either certificate
# names (#5586 tests x86_64 machines and an Apple M4, none of them Linux on aarch64; #4985 its
# own list), and this job proves the package's behaviour under FIPS mode, nothing about the
# module. See docs/fips.md.
#
# Two architectures: x86_64 and aarch64 (GitHub's arm64 runner, free for public repositories),
# because the fielded edge box is aarch64 and `:crypto` rides on the OTP and OpenSSL built for
# the target. Each builds its own toolchain from the same checked sources; the cache key carries
# the architecture.
# the architecture and the provider.
#
# When: every push to main and every pull request that touches the code, weekly, and on demand.
# The toolchain is built once and cached (keyed on the versions and this file); a warm run is
Expand All @@ -52,12 +59,16 @@ permissions:

jobs:
fips:
name: FIPS - OTP 28.5.0.8, OpenSSL FIPS provider 3.1.2 (CMVP 4985), ${{ matrix.os }}
name: FIPS - OTP 28.5.0.9, OpenSSL FIPS provider ${{ matrix.provider }} (CMVP ${{ matrix.cmvp }}), ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
provider: ["3.5.9", "3.1.2"]
include:
- { provider: "3.5.9", cmvp: "5586", mldsa: "offered" }
- { provider: "3.1.2", cmvp: "4985", mldsa: "refused" }
timeout-minutes: 45
env:
# Fixed absolute paths: the rpath, OpenSSL's MODULESDIR and OTP's ROOTDIR are baked in.
Expand All @@ -71,23 +82,32 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /home/runner/fips
key: fips-${{ runner.os }}-${{ runner.arch }}-ubuntu24-otp28.5.0.8-ossl3.5.8-fipsprov3.1.2-ex1.18.4-${{ hashFiles('.github/workflows/fips.yml') }}
key: fips-${{ runner.os }}-${{ runner.arch }}-ubuntu24-otp28.5.0.9-ossl3.5.9-fipsprov${{ matrix.provider }}-ex1.18.4-${{ hashFiles('.github/workflows/fips.yml') }}

- name: build OpenSSL 3.5.8 (libcrypto), the 3.1.2 FIPS provider, and OTP 28.5.0.8 --enable-fips
- name: build OpenSSL 3.5.9 (libcrypto), the ${{ matrix.provider }} FIPS provider, and OTP 28.5.0.9 --enable-fips
if: steps.cache.outputs.cache-hit != 'true'
env:
PROVIDER: ${{ matrix.provider }}
run: |
set -euo pipefail
sudo apt-get update -q && sudo apt-get install -y -q --no-install-recommends libncurses-dev
cd "$RUNNER_TEMP"
dl() { curl -fsSLO "$1"; echo "$2 $(basename "$1")" | sha256sum -c -; }
dl https://github.com/openssl/openssl/releases/download/openssl-3.5.8/openssl-3.5.8.tar.gz a8f84a39918ec6415ce765d9b429d313ba97b8143169c172e734b9514464f5b2
dl https://github.com/openssl/openssl/releases/download/openssl-3.1.2/openssl-3.1.2.tar.gz a0ce69b8b97ea6a35b96875235aa453b966ba3cba8af2de23657d8b6767d6539
dl https://github.com/erlang/otp/releases/download/OTP-28.5.0.8/otp_src_28.5.0.8.tar.gz 8a696e15bcbe5d57197b1f4c03c92d415f9fd9af70f9222a05911c8a5463cba6
dl https://github.com/openssl/openssl/releases/download/openssl-3.5.9/openssl-3.5.9.tar.gz 603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a
dl https://github.com/erlang/otp/releases/download/OTP-28.5.0.9/otp_src_28.5.0.9.tar.gz 3ecc6abcaed81fa45f17aabe7677136aaf53247d533727fe51a778c369d2142c
dl https://builds.hex.pm/builds/elixir/v1.18.4-otp-28.zip cbd98899abdd4b1243d8ea6dae7258f9bc71cc2dcb55b8f9c241b07f04b3de67
for t in openssl-3.5.8 openssl-3.1.2 otp_src_28.5.0.8; do tar xzf "$t.tar.gz"; done
(cd openssl-3.5.8 && ./Configure --prefix="$P" --openssldir="$P/ssl" --libdir=lib shared no-docs && make -j4 && make install_sw)
(cd openssl-3.1.2 && ./Configure enable-fips --prefix="$P" --openssldir="$P/ssl" --libdir=lib shared && make -j4 && make install_fips)
(cd otp_src_28.5.0.8 && ./configure --prefix="$OTP" --enable-fips --with-ssl="$P" --with-ssl-rpath="$P/lib" --without-javac --without-odbc --without-wx && make -j4 && make install)
for t in openssl-3.5.9 otp_src_28.5.0.9; do tar xzf "$t.tar.gz"; done
if [ "$PROVIDER" = "3.5.9" ]; then
# CMVP #5586's section 11.1: the provider and the library from one `enable-fips` build.
(cd openssl-3.5.9 && ./Configure enable-fips --prefix="$P" --openssldir="$P/ssl" --libdir=lib shared no-docs && make -j4 && make install_sw install_fips)
else
# The 3.5.9 library, then the provider CMVP #4985 validates, from its own source.
dl https://github.com/openssl/openssl/releases/download/openssl-3.1.2/openssl-3.1.2.tar.gz a0ce69b8b97ea6a35b96875235aa453b966ba3cba8af2de23657d8b6767d6539
tar xzf openssl-3.1.2.tar.gz
(cd openssl-3.5.9 && ./Configure --prefix="$P" --openssldir="$P/ssl" --libdir=lib shared no-docs && make -j4 && make install_sw)
(cd openssl-3.1.2 && ./Configure enable-fips --prefix="$P" --openssldir="$P/ssl" --libdir=lib shared && make -j4 && make install_fips)
fi
(cd otp_src_28.5.0.9 && ./configure --prefix="$OTP" --enable-fips --with-ssl="$P" --with-ssl-rpath="$P/lib" --without-javac --without-odbc --without-wx && make -j4 && make install)
mkdir -p "$EX" && unzip -q v1.18.4-otp-28.zip -d "$EX"

- name: fipsinstall on this machine, and the configuration that activates the provider
Expand All @@ -106,25 +126,49 @@ jobs:
# the OTP it just built is at or above its line's patched release (tools/otp-floors).
- name: the OTP built here is at or above its patched floor
run: bash tools/otp_floor.sh
- name: FIPS mode is on, served by the 3.1.2 provider, and fails closed without it
# ML-DSA-87 is judged by signing and verifying, not by `crypto:supports/1`, which leaves
# mldsa87 out in FIPS mode even where the provider serves it (measured on the signer).
- name: FIPS mode is on, served by the ${{ matrix.provider }} provider, ML-DSA-87 ${{ matrix.mldsa }}, and fails closed without it
env:
PROVIDER: ${{ matrix.provider }}
CMVP: ${{ matrix.cmvp }}
MLDSA: ${{ matrix.mldsa }}
run: |
set -euo pipefail
erl -noshell -crypto fips_mode true -eval '
{ok, _} = application:ensure_all_started(crypto),
enabled = crypto:info_fips(),
I = crypto:info(),
true = maps:get(fips_provider_available, I),
"3.1.2" = maps:get(fips_provider_buildinfo, I),
Provider = os:getenv("PROVIDER"),
Provider = maps:get(fips_provider_buildinfo, I),
{'"'"'EXIT'"'"', _} = (catch crypto:hash(md5, <<"x">>)),
<<16#ba7816bf:32, _/binary>> = crypto:hash(sha256, <<"abc">>),
48 = byte_size(crypto:hash(sha384, <<"abc">>)),
64 = byte_size(crypto:hash(sha512, <<"abc">>)),
io:format("FIPS enabled: provider ~s over ~s~n", ["3.1.2", maps:get(cryptolib_version_linked, I)]),
MLDSA = try
{Pub, Priv} = crypto:generate_key(mldsa87, []),
Sig = crypto:sign(mldsa87, none, <<"abc">>, Priv),
true = crypto:verify(mldsa87, none, <<"abc">>, Sig, Pub),
false = crypto:verify(mldsa87, none, <<"abd">>, Sig, Pub),
"offered"
catch _:_ -> "refused"
end,
MLDSA = os:getenv("MLDSA"),
io:format("FIPS enabled: provider ~s (CMVP #~s) over ~s; ML-DSA-87 ~s~n",
[Provider, os:getenv("CMVP"), maps:get(cryptolib_version_linked, I), MLDSA]),
halt(0).'
if env -u OPENSSL_CONF erl -noshell -crypto fips_mode true -eval 'enabled = crypto:info_fips(), halt(0).'; then
# The control starts the application before it asks, as the check above does: without
# that, `fips_mode` is never read and the control fails with or without a provider
# (measured 2026-11-29: it failed with the provider configured too, so it showed
# nothing). It must fail, and for the reason OTP documents: the NIF refuses to load.
if out=$(env -u OPENSSL_CONF erl -noshell -crypto fips_mode true -eval '{ok, _} = application:ensure_all_started(crypto), enabled = crypto:info_fips(), halt(0).' 2>&1); then
echo "FAIL: fips_mode true gave a working crypto without the provider configuration"; exit 1
fi
echo "negative control: without the provider configuration, crypto does not load"
if ! grep -q "load-call unsuccessful" <<<"$out"; then
echo "FAIL: the control failed, but not because the crypto NIF refused to load:"; echo "$out"; exit 1
fi
echo "negative control: without the provider configuration, the crypto NIF does not load"

- name: deps and compile, FIPS mode off
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flake-hunt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- { leg: floor, otp: "27", elixir: "1.17", os: ubuntu-24.04, version-type: loose }
- { leg: pinned, otp: "28", elixir: "1.18", os: ubuntu-24.04, version-type: loose }
- { leg: head, otp: "29", elixir: "1.20", os: ubuntu-24.04, version-type: loose }
- { leg: box, otp: "28.5.0.8", elixir: "1.20.4", os: ubuntu-26.04-arm, version-type: strict }
- { leg: box, otp: "28.5.0.9", elixir: "1.20.4", os: ubuntu-26.04-arm, version-type: strict }
env:
# Through the environment, never inline in a script: the input is the dispatcher's text,
# and tools/flake_hunt.sh refuses anything but a positive integer.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- { leg: floor, otp: "27", elixir: "1.17", os: ubuntu-24.04, version-type: loose }
- { leg: pinned, otp: "28", elixir: "1.18", os: ubuntu-24.04, version-type: loose }
- { leg: head, otp: "29", elixir: "1.20", os: ubuntu-24.04, version-type: loose }
- { leg: box, otp: "28.5.0.8", elixir: "1.20.4", os: ubuntu-26.04-arm, version-type: strict }
- { leg: box, otp: "28.5.0.9", elixir: "1.20.4", os: ubuntu-26.04-arm, version-type: strict }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
erlang 28.5.0.8
erlang 28.5.0.9
elixir 1.18.4-otp-28
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ All notable changes to this project are documented here. The format follows

## [Unreleased]

### Changed: patched OTP floors, and a second validated FIPS provider in CI (instruments; no public entry)

- `tools/otp-floors` moves every line to the releases of 2026-11-24: 27.3.4.20, 28.5.0.9 and
29.1.3. They fix ten EEF CNA advisories, five of them in the runtime itself
(CVE-2026-115747, CVE-2026-116293, CVE-2026-117642, CVE-2026-120961, CVE-2026-125658), and
CVE-2026-124286, a critical TLS 1.2 client defect (servers are not affected; a host's node is
a client wherever it calls out). The box leg, the flake hunt and the FIPS leg run 28.5.0.9.
- The FIPS leg runs twice on each architecture: with OpenSSL FIPS provider 3.5.9 (CMVP #5586,
which approves ML-DSA-44/65/87) and with 3.1.2 (CMVP #4985), both over OpenSSL 3.5.9's
libcrypto. Before any test, the same VM checks that ML-DSA-87 signs and verifies under 3.5.9
and is refused under 3.1.2. This package signs nothing, but a signer behind
`BeamMCP.Signer` runs in the same VM, and the row records what each provider gives it.
- Fixed: the FIPS leg's negative control could not fail. It asked `crypto:info_fips()` without
starting the `crypto` application, so FIPS mode was never requested and the check failed
whether or not a provider was configured. It now starts the application, and it requires the
failure OTP documents (the `crypto` NIF refusing to load). FIPS mode itself was always
checked by the positive assertion before it.
- `docs/fips.md` names both providers, their certificates and what neither validates: no
OpenSSL FIPS provider is validated for Linux on aarch64 today.

### Added: a weekly advisory watch on main (instruments; no public entry)

- `.github/workflows/advisory-watch.yml` reads the lock on `main` every Monday, and by hand,
Expand Down
2 changes: 1 addition & 1 deletion docs/assurance-case.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ partial scheme.

## How the case is kept true

- The gate runs on every push on four OTP/Elixir legs (three pairs on x86_64, and the box pair, OTP 28.5.0.8 with Elixir 1.20.4, on aarch64 over the OpenSSL 3.5 line the box's image pins; every runner named by its image, so none moves without a commit), each held to its line's patched OTP floor; the censuses above fail when the code
- The gate runs on every push on four OTP/Elixir legs (three pairs on x86_64, and the box pair, OTP 28.5.0.9 with Elixir 1.20.4, on aarch64 over the OpenSSL 3.5 line the box's image pins; every runner named by its image, so none moves without a commit), each held to its line's patched OTP floor; the censuses above fail when the code
they describe changes.
- The threat model's citations and the will-not-implement page's entries are each held to the
test suite by a census of their own.
Expand Down
Loading