Expand description
FIPS 140-3 mode (DW-111, Enterprise).
FIPS enforcement is an Enterprise-only capability gated behind the
ent cargo feature. When ent is compiled in, the gateway operates
in FIPS 140-3 mode: the rustls process-default crypto provider is the
FIPS-validated aws-lc-rs provider, TLS cipher suites are restricted
to the FIPS-approved allowlist, non-approved primitives (Ed25519
certificates, Argon2 credential hashing) are rejected at config
validation, and a startup self-test verifies the provider before the
gateway accepts traffic.
aws-lc-rs is already the default rustls crypto provider in every
build (see crate::security::tls::install_aws_lc_rs_provider), so
the FIPS-validated code path is present regardless. The ent feature
turns ON the enforcement layer (provider self-test, cipher-suite
restriction, primitive allowlist, license assertion).
§OSS vs Enterprise
In OSS builds (no ent feature), FIPS enforcement is OFF:
FipsMode is FipsMode::Disabled, the self-test returns a
Disabled attestation, and is_primitive_allowed always returns
true (no restriction). The aws-lc-rs provider is still installed
(it is the default provider), but no FIPS restrictions are enforced.
§Self-test
fips_self_test verifies that the process-default crypto provider
is the aws-lc-rs FIPS provider and returns a FipsAttestation
capturing the provider name, version, self-test result, and
timestamp. In Enterprise builds the binary runs this at startup and
refuses to boot (exit 1) if the self-test fails. The attestation is
also surfaced on the /healthz endpoint so orchestrators and
monitoring can confirm FIPS mode.
§Primitive allowlist
FIPS_ALLOWED_CIPHERS and FIPS_ALLOWED_SIGNATURES are the
FIPS-approved TLS cipher suites and signature schemes.
is_primitive_allowed checks a primitive name against the
allowlist. In OSS builds every function in this module is inert.
Structs§
- Fips
Attestation - The result of the FIPS startup self-test. Captured at startup and
surfaced on the
/healthzendpoint so orchestrators and monitoring can confirm FIPS mode is active and the provider self-test passed.
Enums§
- Fips
Mode - The FIPS mode of the gateway.
Constants§
- FIPS_
ALLOWED_ CIPHERS - The FIPS-approved TLS 1.2 cipher suites (IANA names, lowercase). These are the AEAD suites rustls negotiates under the aws-lc-rs FIPS provider for TLS 1.2 connections. TLS 1.3 ciphers (AES-256-GCM-SHA384, AES-128-GCM-SHA256, CHACHA20-POLY1305-SHA256) are governed by the TLS 1.3 cipher suite policy; CHACHA20-POLY1305 is NOT FIPS-approved and is excluded.
- FIPS_
ALLOWED_ CREDENTIAL_ HASHES - The FIPS-approved credential hash formats. Argon2 is NOT FIPS-approved and is excluded; sha256 and hmac-sha256 (the fast-path formats) are approved under the aws-lc-rs FIPS provider.
- FIPS_
ALLOWED_ SIGNATURES - The FIPS-approved TLS signature schemes (lowercase). Ed25519 is NOT on the FIPS-validated list for aws-lc-rs and is excluded unless a future validated-list update adds it.
- FIPS_
PROVIDER_ NAME - The canonical name of the aws-lc-rs FIPS provider as registered with rustls. Used by the self-test to confirm the process-default provider is the FIPS-validated one.
Functions§
- fips_
self_ test - Run the FIPS startup self-test.
- health_
attestation - The FIPS attestation for the
/healthzendpoint. Returns the attestation as a JSON-serializable value. When FIPS mode is disabled, returnsNone(thefipsfield is omitted from the health response). - install_
fips_ provider - Install the aws-lc-rs FIPS provider as the process-default crypto
provider. Idempotent: installing twice returns Ok the first time and
an ignorable error afterwards (the same shape as
crate::security::tls::install_aws_lc_rs_provider). - is_
cipher_ suite_ disallowed - True when FIPS mode is active and the given cipher suite name is NOT on the FIPS-approved allowlist. Used by snapshot validation to reject non-approved cipher suite configs.
- is_
credential_ hash_ disallowed - True when FIPS mode is active and the given credential hash format is NOT on the FIPS-approved allowlist. Used by snapshot validation to reject Argon2 credential hashing (Argon2 is not FIPS-approved).
- is_
primitive_ allowed - Check whether a named primitive is allowed under FIPS mode.
- is_
signature_ disallowed - True when FIPS mode is active and the given signature scheme is NOT on the FIPS-approved allowlist. Used by snapshot validation to reject Ed25519 certificates and other non-approved signature schemes.