fix(terraform): allow AWS FIPS TLS policies in insecure-load-balancer-tls-version - #4003
Open
sbruton wants to merge 1 commit into
Open
fix(terraform): allow AWS FIPS TLS policies in insecure-load-balancer-tls-version#4003sbruton wants to merge 1 commit into
sbruton wants to merge 1 commit into
Conversation
…on AWS FIPS policies The allowlist regexes match policy-name suffixes with the character class [(Res)0-9-]+, which only admits R/e/s/digits/hyphens. AWS's FIPS policy family (2023-04, and the FIPS-PQ hybrid post-quantum variants, 2025-09) put a FIPS token in the suffix, so these policies are flagged as insecure even though their minimum protocol version is TLS 1.2. Per the AWS API (aws elbv2 describe-ssl-policies), ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04 supports TLS 1.2/1.3 only and its cipher list is exactly the allowlisted TLS13-1-2-2021-06 minus ChaCha20-Poly1305 (not FIPS-approved) — no weaker suite is added. Add one allowlist regex for the FIPS family: ELBSecurityPolicy-TLS13-1-[23]-(Res-)?FIPS-. The version segment before the FIPS token encodes the protocol floor, so the insecure TLS13-1-1-FIPS-2023-04 / TLS13-1-0-FIPS-* variants are still flagged (covered by new ruleid tests). The Ext0/1/2-FIPS variants are deliberately NOT allowlisted: they add SHA1-HMAC and/or static-RSA (non-forward-secret) suites.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to an issue, if relevant
No existing issue — the full analysis is inline below. Happy to file one separately if you prefer.
Why this change
terraform.aws.security.insecure-load-balancer-tls-versionfalse-positives on AWS's FIPS TLS policies:The allowlist matches policy-name suffixes with the character class
[(Res)0-9-]+(the parentheses are literal characters inside a class), which only admitsR/e/s/digits/hyphens. AWS's FIPS policy family (2023-04) and the hybrid post-quantumFIPS-PQvariants (2025-09) put aFIPStoken in the suffix —F/I/Pfall outside the class, so thepattern-not-regexnever matches and the rule fires on policies whose minimum protocol version is TLS 1.2.The fix
One added allowlist entry:
The version segment before the FIPS token is what encodes the protocol floor, so the genuinely insecure
ELBSecurityPolicy-TLS13-1-1-FIPS-2023-04/-TLS13-1-0-FIPS-*variants (min TLS 1.1/1.0) still fail the regex and remain flagged — pinned by two newruleidtest cases.This admits no weaker crypto than the existing allowlist
Verified against the live AWS API (
aws elbv2 describe-ssl-policies) and the ALB security policies docs:TLS13-1-2-FIPS-2023-04,TLS13-1-2-FIPS-PQ-2025-09,TLS13-1-3-FIPS-2023-04,TLS13-1-3-FIPS-PQ-2025-09) is a strict cipher-subset of the already-allowlistedELBSecurityPolicy-TLS13-1-2-2021-06(AWS's default policy). The only cipher delta is a removal — ChaCha20-Poly1305, which is not FIPS-approved.1-3policies raise the floor to TLS 1.3-only.PQvariants add hybrid post-quantum key exchange (X25519MLKEM768,SecP256r1MLKEM768,SecP384r1MLKEM1024); hybrid retains full classical ECDHE security, and AWS recommends these policies.Deliberately not allowlisted: the
Ext0/1/2-FIPSvariants — the same API data shows they add SHA1-HMAC and/or static-RSA (non-forward-secret) suites — and the non-FIPSPQpolicies, which are out of scope for this fix.Tests
okcases:TLS13-1-2-FIPS-2023-04,TLS13-1-2-Res-FIPS-2023-04,TLS13-1-2-FIPS-PQ-2025-09ruleidcases:TLS13-1-1-FIPS-2023-04,TLS13-1-0-PQ-2025-09semgrep --validateandsemgrep --testpass locally (semgrep 1.169.0)