Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 5 min read

Post-quantum by default: Barbacane and the NSA's advisory

Security that depends on every operator reading every advisory is security most deployments never get. We would rather the defaults do the reading. On December 2, the NSA advised the owners, operators and vendors of Nat

Security that depends on every operator reading every advisory is security most deployments never get. We would rather the defaults do the reading.

On December 2, the NSA advised the owners, operators and vendors of National Security Systems to immediately accelerate their move to post-quantum cryptography. It cited discoveries that AI companies had disclosed to the government, without naming them. The same day, the NSA, CISA and the Office of the National Cyber Director said in a joint statement that those discoveries do not present an immediate and widespread threat, and asked organisations to upgrade expeditiously. No deadline moved: CNSA 2.0, the NSA's algorithm suite for national security systems, still applies to new acquisitions from January 2027.

Barbacane sits in front of your APIs, so its cryptography is your cryptography. Here is what it did on December 2, what changes in 1.0.0-rc.6, released on December 4, and what we have not done yet.

Where Barbacane stood on December 2

Every TLS connection Barbacane accepts or opens already offered hybrid post-quantum key exchange first: X25519MLKEM768, which combines ML-KEM (FIPS 203) with X25519. That covers the listener your clients reach, the connections to your upstreams, the data plane's link to the control plane, LDAP, PostgreSQL and OpenTelemetry export. It comes from rustls with the aws-lc-rs backend, and the FIPS build keeps it.

That answers the threat that is not hypothetical: traffic recorded today and decrypted later, once a quantum computer or a new attack breaks classical key exchange. When both sides speak ML-KEM, as current browsers, Go, OpenSSL 3.5 and rustls do by default, the session keys are already out of reach.

What an operator could not do was require it, or see who still connected without it. And the signatures Barbacane checks and makes were all classical.

What changes in 1.0.0-rc.6

TLS 1.3 by default. Post-quantum key exchange exists only in TLS 1.3. A listener that admits TLS 1.2 admits clients that will always negotiate a classical key exchange, so Barbacane now accepts TLS 1.3 only, unless you say otherwise. If you still serve clients that speak only TLS 1.2, --tls-min-version 1.2 keeps them; the migration guide covers it.

A TLS policy. --tls-policy sets what the listener accepts:

  • prefer-post-quantum, the default: X25519MLKEM768 first, and the classical groups for clients without it.
  • post-quantum: ML-KEM groups only. Browsers are served; a client that can only do classical key exchange is refused during the handshake.
  • cnsa2: ML-KEM-1024 and AES-256-GCM only, as CNSA 2.0 requires. With an ML-DSA-87 certificate, every algorithm in the handshake is one CNSA 2.0 approves. We checked that combination with OpenSSL as the client: ML-KEM-1024, AES-256-GCM, an ML-DSA-87 signature. Browsers do not offer ML-KEM-1024 by default, so this policy is for clients you control.

Handshake metrics. Before tightening a policy, you want to know who it would turn away. barbacane_tls_handshakes_total counts completed handshakes by TLS version and key exchange group, and barbacane_tls_handshake_failures_total{reason="incompatible"} counts the clients a policy refuses. Run the default for a while, read the key_exchange label, then decide.

Post-quantum artifact signatures. A Barbacane data plane loads only artifacts signed by the key it pins. That key is a root of trust, the kind of key the advisory singles out because it is hard to replace once deployed. Artifacts can now be signed with ML-DSA-87 (FIPS 204):

barbacane key generate --algorithm ml-dsa-87 --out signing.pk8
BARBACANE_SIGNING_KEY=signing.pk8 barbacane compile -m barbacane.yaml -o api.bca
BARBACANE_TRUSTED_PUBKEY=$(barbacane key public --key signing.pk8) \
  barbacane serve --artifact api.bca

Ed25519 stays the default, and moving to ML-DSA-87 is an ordinary key rotation. A data plane that pins a key of one algorithm refuses an artifact signed with the other.

An inventory. The advisory's first step is to know where your cryptography is. The new cryptography page lists the algorithms each part of Barbacane uses and their post-quantum status, so the Barbacane line of your inventory is already written.

What is still open

  • JWT verification. jwt-auth and oidc-auth verify RSA and ECDSA signatures. ML-DSA for JOSE was published as RFC 9964 in May, and Authentik already issues such tokens. Supporting it is next on our list, and its tests are already written (see below).
  • Release signing. Our container images are signed with Sigstore, whose signatures are ECDSA P-256 today. Sigstore plans a post-quantum instance for 2027, and we will move when it exists.
  • SHA-256. Artifact hashes are SHA-256, which known quantum algorithms weaken only modestly. CNSA 2.0 asks for SHA-384 or SHA-512, which would take a new version of the artifact format.

None of these is exposed to recording now and decrypting later: a forged signature needs a quantum computer at the moment it is checked, and none exists. They stay on the list, because the time to change a root of trust is before you have to.

Tests anyone can use

ML-DSA for JOSE is new, and a verifier can get it wrong in ways the RFC's examples do not catch: accepting a signature made with a context string, or a valid signature under a header that names another parameter set. Before writing our own support, we wrote the tests, and published them on their own: jose-pq-vectors, test vectors for RFC 9964 in plain JSON, dedicated to the public domain. For each parameter set there is the RFC's example, tokens a verifier must accept and tokens it must reject, each with its reason, plus real tokens from Authentik to check interoperability.

We ran them against go-jose, panva/jose and the ML-DSA support proposed for Rust's jsonwebtoken, and shared the results on that pull request. All three reject every token they must. The vectors will be the tests of Barbacane's own verifier, and a runner for another library is welcome.

Why defaults

Most deployments of any software run with the settings it ships. So the question we ask of every security feature is what someone gets without configuring anything. For post-quantum key exchange, the answer was already yes. With 1.0.0-rc.6, it is also TLS 1.3, a policy to require more, a metric to know when you can, and a signature for your artifacts that a quantum computer cannot forge.

If you run Barbacane, the advisory comes down to three steps: upgrade, watch one metric, and decide whether to rotate your signing key. If you are evaluating gateways for a system that falls under CNSA 2.0, the CLI reference shows the policy, and the cryptography page shows the rest.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.