Lately in the news we have a rolling news cycle about the cryptography doomsday.
First we had the warning that RSA is no loner secured, we tried to address this in Responding to the RSA-2048 Warning: How Antigravity AI Agents Audited and Hardened a 14-Node Fleet.
Now we got real warning from NSA that RSA and Eliptic Curve should not longer be considered secure, see https://media.defense.gov/2026/Dec/01/2004039413/-1/-1/0/CSA_Immediate_Actions_Push_Toward_PQC.PDF.
So looks like our RSA mitigation was not enough. Here are the exact gaps found in the live audit and the recommended changes to migrate to post-quantum cryptography while keeping blog.voina.org publicly accessible:
Verified Posture
blog.voina.org (nas1, Apache 2.4.71 / OpenSSL 4.0.3):
Already PQ-hardened for external HTTPS. Enforces TLS 1.3 only (TLS 1.2 rejected with alert 70), negotiates hybrid X25519MLKEM768 key exchange, and returns HTTP 200 with an ECDSA P-256 (ecdsa_secp256r1_sha256) leaf certificate (required for public browsers/ACME).
SSH Key Exchange:
• nas1–nas4 (OpenSSH_10.6p1) and the 5 Trixie Pis (rpi-rack, rpi-4, rpi-5, rpi-1, rpi-zero on OpenSSH_10.0p2) negotiate mlkem768x25519-sha256.
• 5 ClusterHAT Bookworm Pis (cbridge, p1–p4 on OpenSSH_9.2p1) still negotiate classical curve25519-sha256 (ECC-only), even though 9.2p1 supports sntrup761x25519-sha512@openssh.com (hybrid Streamlined
NTRU Prime + X25519 PQ KEX).
SSH Hardening & RSA Key Cleanup:
• /etc/ssh/sshd_config.d/90-post-quantum.conf is missing (NONE) on nas1, rpi-rack, cbridge (and newly flashed Pis).
• Legacy ssh-rsa keys remain in ~/.ssh/authorized_keys (3 on nas1, 1 on rpi-rack/cbridge).
• 4 legacy RSA private keys (id_rsa, id_rsa_alba 2048-bit, id_rsa_dell) still live in ~/.ssh/, with id_rsa_alba referenced in ~/.ssh/config.
Recommended Changes Implemented
Enforce PQ-Only SSH Key Exchange Across All 14 Hosts (/etc/ssh/sshd_config.d/90-post-quantum.conf + ~/.ssh/config):
• On nas1–nas4 (10.6p1) & 5 Trixie Pis (10.0p2): Enforce KexAlgorithms mlkem768x25519-sha256,mlkem768nistp256-sha256,sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com (disabling all non-PQ
curve25519/ecdh/dh fallbacks).
• On cbridge + p1–p4 (9.2p1): Enforce KexAlgorithms sntrup761x25519-sha512@openssh.com so they immediately stop using classical curve25519-sha256.
• Disable RSA & DSA in sshd & ~/.ssh/config: Set HostKeyAlgorithms ssh-ed25519 and PubkeyAcceptedAlgorithms ssh-ed25519, and pin KexAlgorithms in ~/.ssh/config on the laptop (Host *).
Prune Legacy RSA Keys (After Verifying Ed25519-Only Login on All 14 Hosts):
• Remove ssh-rsa entries from ~/.ssh/authorized_keys across all 14 hosts.
• Remove IdentityFile ~/.ssh/id_rsa_alba from ~/.ssh/config and archive the 4 id_rsa* files out of ~/.ssh/ (e.g., to ~/.ssh/archived_rsa/ with 0600).
Keep blog.voina.org Publicly Accessible:
• Leave Apache httpd on nas1 serving TLS 1.3 (X25519MLKEM768 + ECDSA P-256 leaf) so external browsers and Let’s Encrypt continue working without breakage.
Update rpi_fleet_backup.py / Nightly Snapshots:
• Trigger a fresh rpi_fleet_backup.py backup after hardening the 10 Pis so /etc/ssh/sshd_config.d/90-post-quantum.conf and cleaned authorized_keys are preserved in backups.
Additional mitigation
• Mitigation Register (NSA Action 6): Create 01-Projects/PQC Mitigation Register.md in the Obsidian vault documenting the accepted/upstream-blocked items (Tailscale Curve25519, Ed25519 SSH signatures, EdgeRouters on OpenSSH_8.4p1, Authentik’s Go TLS stack, Wi-Fi WPA2-PSK with PMF off, and Bookworm Pis on sntrup761).
• Daily Detection Timer: Install and enable a systemd — user timer (pqc-crypto-audit.timer) to run /home/gvoina/scripts/pqc_crypto_audit.py –notify-signal automatically.
• Docs & Vault Sync: Document pqc_crypto_audit.py in /home/gvoina/.agents/AGENTS.md and update RSA-2048 Post-Quantum Migration Plan.md + Meta/agent-log.md.
pqc_crypto_audit.py
#!/usr/bin/env python3
"""pqc_crypto_audit.py - live weak-cryptography detection (NSA CSA PP-26-4956, action 6).
Probes every TLS endpoint and SSH host in the fleet from the outside and checks that
only the approved post-quantum / CNSA profile is accepted:
TLS : TLS 1.3 only, PQ hybrid groups (SecP384r1MLKEM1024 / X25519MLKEM768) + secp384r1,
TLS_AES_256_GCM_SHA384 only, leaf key >= P-384, no RSA signature in served chain.
SSH : PQ hybrid KEX only (mlkem768x25519 / sntrup761x25519), classical KEX rejected,
AES-256 ciphers only, ssh-ed25519 host key (no RSA/ECDSA).
Known, accepted exceptions (see [[PQC Mitigation Register]]) are reported as WAIVED,
not FAIL. Regressions vs. the previous run are logged to Meta/agent-log.md and can be
queued to Signal via the sentinel outbox.
Usage:
pqc_crypto_audit.py [--json] [--notify-signal] [--only tls|ssh]
"""
import argparse
import json
import subprocess
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
VAULT_META = Path("/home/gvoina/Vault/George/Meta")
STATE_FILE = VAULT_META / "states" / "pqc-audit.json"
OUTBOX_FILE = VAULT_META / "states" / "sentinel-outbox.jsonl"
MEMORY_SCRIPT = Path("/home/gvoina/scripts/obsidian_memory.py")
# name, connect host, port, SNI (None = no SNI)
TLS_TARGETS = [
("blog.voina.org", "blog.voina.org", 443, "blog.voina.org"),
("blog.voina.be", "blog.voina.org", 443, "blog.voina.be"),
("home.voina.org", "blog.voina.org", 443, "home.voina.org"),
("nas3-portal", "100.105.1.41", 443, None),
("nas3-authentik", "100.105.1.41", 9443, None),
]
TLS_GOOD_GROUPS = ["SecP384r1MLKEM1024", "X25519MLKEM768"]
TLS_BAD_GROUPS = ["X25519", "secp256r1", "ffdhe2048"]
TLS_BAD_CIPHERS = ["TLS_AES_128_GCM_SHA256", "TLS_CHACHA20_POLY1305_SHA256"]
# name, user@host, port
SSH_TARGETS = [
("nas1", "gvoina@blog.voina.org", 2222),
("nas2", "gvoina@100.104.211.90", 22),
("nas3", "gvoina@100.105.1.41", 22),
("nas4", "gvoina@100.118.77.109", 22),
("rpi-1", "pi@100.120.50.0", 22),
("rpi-4", "pi@100.112.98.4", 22),
("rpi-5", "pi@100.124.39.30", 22),
("cbridge", "pi@100.77.241.80", 22),
("p1", "pi@100.80.58.18", 22),
("p2", "pi@100.95.145.66", 22),
("p3", "pi@100.108.91.65", 22),
("p4", "pi@100.124.61.64", 22),
("rpi-rack", "pi@100.93.53.41", 22),
("rpi-zero", "pi@100.92.254.51", 22),
("er4-zorilor", "192.168.2.1", 22),
("er6p", "192.168.25.1", 22),
]
SSH_CLASSICAL_KEX = "curve25519-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,diffie-hellman-group14-sha256"
SSH_PQ_KEX = "mlkem768x25519-sha256,sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com"
SSH_WEAK_CIPHERS = "aes128-gcm@openssh.com,aes128-ctr,chacha20-poly1305@openssh.com"
# Accepted exceptions: (target, check) -> reason. Mirrors [[PQC Mitigation Register]].
WAIVERS = {
("er4-zorilor", "*"): "EdgeOS OpenSSH_8.4p1 has no PQ KEX (vendor firmware)",
("er6p", "*"): "EdgeOS OpenSSH_8.4p1 has no PQ KEX (vendor firmware)",
("nas3-authentik", "*"): "Authentik Go TLS stack exposes no group/cipher config",
}
def _run(cmd, timeout=12, stdin=None):
try:
p = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, stdin=stdin)
return p.returncode, p.stdout + p.stderr
except subprocess.TimeoutExpired:
return 124, "timeout"
def _tls_ok(host, port, sni, extra):
cmd = ["openssl", "s_client", "-connect", f"{host}:{port}"] + (["-servername", sni] if sni else []) + extra
_, out = _run(cmd, stdin=subprocess.DEVNULL)
return "CONNECTION ESTABLISHED" in out
def audit_tls(target):
name, host, port, sni = target
res = {"target": name, "type": "tls", "checks": {}}
c = res["checks"]
if not _tls_ok(host, port, sni, ["-brief"]):
res["reachable"] = False
return res
res["reachable"] = True
c["tls12_rejected"] = not _tls_ok(host, port, sni, ["-tls1_2", "-brief"])
c["pq_group_accepted"] = any(_tls_ok(host, port, sni, ["-tls1_3", "-groups", g, "-brief"]) for g in TLS_GOOD_GROUPS)
c["mlkem1024_accepted"] = _tls_ok(host, port, sni, ["-tls1_3", "-groups", "SecP384r1MLKEM1024", "-brief"])
c["classical_groups_rejected"] = not any(_tls_ok(host, port, sni, ["-tls1_3", "-groups", g, "-brief"]) for g in TLS_BAD_GROUPS)
c["weak_ciphers_rejected"] = not any(_tls_ok(host, port, sni, ["-tls1_3", "-ciphersuites", cs, "-brief"]) for cs in TLS_BAD_CIPHERS)
# certificate chain
cmd = ["openssl", "s_client", "-connect", f"{host}:{port}", "-showcerts"] + (["-servername", sni] if sni else [])
_, chain = _run(cmd, stdin=subprocess.DEVNULL)
certs = [b for b in chain.split("-----BEGIN CERTIFICATE-----")[1:]]
leaf_ok, rsa_in_chain = False, False
for i, b in enumerate(certs):
pem = "-----BEGIN CERTIFICATE-----" + b.split("-----END CERTIFICATE-----")[0] + "-----END CERTIFICATE-----\n"
p = subprocess.run(["openssl", "x509", "-noout", "-text"], input=pem, capture_output=True, text=True)
txt = p.stdout
if "sha256WithRSAEncryption" in txt or "rsaEncryption" in txt:
rsa_in_chain = True
if i == 0:
leaf_ok = ("P-384" in txt or "P-521" in txt or "ML-DSA" in txt)
c["leaf_p384_or_better"] = leaf_ok
c["no_rsa_in_chain"] = not rsa_in_chain
return res
def audit_ssh(target):
name, dest, port = target
base = ["ssh", "-o", "BatchMode=yes", "-o", "ConnectTimeout=6", "-o", "StrictHostKeyChecking=accept-new",
"-p", str(port)]
res = {"target": name, "type": "ssh", "checks": {}}
c = res["checks"]
def offered(opt):
# Pre-auth handshake test: True = key exchange completed with this restriction
# (authentication result is irrelevant), False = server refused, None = unreachable.
rc, out = _run(base + ["-v", "-o", opt, dest, "true"])
if rc == 124 or any(s in out for s in ("Connection timed out", "No route to host", "Connection refused")):
return None
return "SSH2_MSG_NEWKEYS received" in out
pq = offered(f"KexAlgorithms={SSH_PQ_KEX}")
if pq is None:
res["reachable"] = False
return res
res["reachable"] = True
c["pq_kex_accepted"] = bool(pq)
c["classical_kex_rejected"] = not offered(f"KexAlgorithms={SSH_CLASSICAL_KEX}")
c["weak_ciphers_rejected"] = not offered(f"Ciphers={SSH_WEAK_CIPHERS}")
c["rsa_ecdsa_hostkey_rejected"] = not offered("HostKeyAlgorithms=rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256")
return res
def _waiver(target, check):
return WAIVERS.get((target, check)) or WAIVERS.get((target, "*"))
def main():
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
ap.add_argument("--json", action="store_true")
ap.add_argument("--notify-signal", action="store_true")
ap.add_argument("--only", choices=["tls", "ssh"])
a = ap.parse_args()
jobs = []
with ThreadPoolExecutor(max_workers=6) as ex:
if a.only in (None, "tls"):
jobs += [ex.submit(audit_tls, t) for t in TLS_TARGETS]
if a.only in (None, "ssh"):
jobs += [ex.submit(audit_ssh, t) for t in SSH_TARGETS]
results = [j.result() for j in jobs]
fails, waived, unreachable = [], [], []
for r in results:
if not r.get("reachable"):
unreachable.append(r["target"])
continue
for chk, ok in r["checks"].items():
if ok:
continue
w = _waiver(r["target"], chk)
(waived if w else fails).append(f"{r['target']}:{chk}" + (f" (waived: {w})" if w else ""))
prev = {}
if STATE_FILE.exists():
try:
prev = json.loads(STATE_FILE.read_text())
except Exception:
prev = {}
new_fails = sorted(set(fails) - set(prev.get("fails", [])))
summary = {"timestamp": time.strftime("%Y-%m-%dT%H:%M:%S%z"), "fails": sorted(fails),
"waived": sorted(waived), "unreachable": sorted(unreachable),
"new_fails": new_fails, "results": results}
STATE_FILE.parent.mkdir(parents=True, exist_ok=True)
STATE_FILE.write_text(json.dumps(summary, indent=2))
if new_fails:
msg = "PQC audit regression: " + ", ".join(new_fails)
subprocess.run([sys.executable, str(MEMORY_SCRIPT), "log", msg], capture_output=True, timeout=10)
if a.notify_signal:
with OUTBOX_FILE.open("a") as f:
f.write(json.dumps({"timestamp": time.time(), "message": "🔐 " + msg}) + "\n")
if a.json:
print(json.dumps(summary, indent=2))
else:
for r in sorted(results, key=lambda x: (x["type"], x["target"])):
if not r.get("reachable"):
print(f"[----] {r['type']:3} {r['target']:15} unreachable")
continue
bad = [k for k, v in r["checks"].items() if not v]
tag = "PASS" if not bad else ("WAIV" if all(_waiver(r["target"], k) for k in bad) else "FAIL")
print(f"[{tag}] {r['type']:3} {r['target']:15} " + (", ".join(f"!{k}" for k in bad) if bad else "all checks ok"))
print(f"\nfails={len(fails)} waived={len(waived)} unreachable={len(unreachable)} new_regressions={len(new_fails)}")
sys.exit(1 if fails else 0)
if __name__ == "__main__":
main()