Module fips

Module fips 

Source
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§

FipsAttestation
The result of the FIPS startup self-test. Captured at startup and surfaced on the /healthz endpoint so orchestrators and monitoring can confirm FIPS mode is active and the provider self-test passed.

Enums§

FipsMode
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 /healthz endpoint. Returns the attestation as a JSON-serializable value. When FIPS mode is disabled, returns None (the fips field 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.