The RSA rumor is a good excuse to count your RSA keys

Last week a rumor went around that an AI lab had found a fast way to break RSA on ordinary computers. No quantum computer needed. This week it stopped being only a rumor. On December 2 the NSA told owners, operators and vendors of National Security Systems to immediately accelerate their move to post-quantum cryptography. Later that day eight companies, including Amazon, Google, Microsoft and Oracle, backed the guidance.
Nobody has said RSA is broken. The joint ONCD, NSA and CISA statement says AI labs privately disclosed findings that affect some cryptography in use today, and that there's no immediate, widespread threat (summary). The findings aren't public. The advice is still to move now.
The first item on the NSA's list is an inventory of cryptographic dependencies, including public-key algorithms and digital signatures. Inventory is what we built CloudQuery for. The guidance is aimed at national security systems, but I'd treat it as a signal for everyone else.
So if we're to create an inventory of all our keys, how do we even start, and what are all the keys that could be affected?
In this article:
- What's actually exposed
- Sync only what you need
- AWS
- GCP
- Azure
- One list
- What this won't find
- What I'd do with the list
What's actually exposed
RSA and elliptic curve keys (ECDSA and Ed25519 included) fall to Shor's algorithm on a large enough quantum computer. A faster classical factoring method would only hit RSA. In both cases the inventory is the same: asymmetric keys and the certificates built on them. AES-256 is fine.
That also changes what "secrets" means here. AWS Secrets Manager encrypts secrets with symmetric KMS keys, so the stored secret isn't the weak spot. The weak spots are private keys and certificates, including the ones people stored as secrets.
Sync only what you need
Below is a CloudQuery config file. It syncs the tables we need from AWS, GCP and Azure into one SQLite database, so there's nothing to set up beyond the CloudQuery CLI. If you don't use one or more of the clouds, remove or comment out its section. Save it as config.yml:
Then run cloudquery sync config.yml. All tables are synced to the db.sql database, and sqlite3 db.sql is all you need to run the queries below.
If you have the AWS, gcloud and Azure CLIs installed and signed in, CloudQuery uses those credentials automatically. There's nothing to put in the config.
- AWS: sign in with the AWS CLI. Read-only permissions are enough.
- GCP: run
gcloud auth application-default login. The account needsroles/viewerandroles/iam.securityAuditor. Leave outproject_idsto sync every project it can see. - Azure: run
az login. All visible subscriptions are synced unless you setsubscriptions. That's fine for a one-off run. For a scheduled sync, use a service principal (AZURE_TENANT_ID,AZURE_CLIENT_ID,AZURE_CLIENT_SECRET).
AWS
KMS keys that are RSA or elliptic curve:
ACM only issues RSA and EC certificates, so everything is in scope. What I care about is what's attached to something:
EC2 key pairs, which is where the old SSH keys live:
Load balancer listeners tell you which certificate terminates TLS, so you can see which of those RSA certificates are on the front door:
An empty key_algorithm means the certificate isn't in ACM (an IAM server certificate, for example), so it needs a look by hand.
GCP
The not so cool: gcp_compute_ssl_certificates has the certificate as a PEM and no algorithm column. SQL can't parse a PEM, so let openssl do it:
Each line shows the algorithm and key size, for example rsaEncryption with (2048 bit), or id-ecPublicKey with (256 bit). Rows with an empty certificate column are skipped.
Azure
Key Vault certificates carry their key type in the policy:
Private keys stored as plain secrets are harder. If people set a content type, you can find them:
The managed filter drops the secrets Key Vault creates behind certificates, which the query above already covers. The rest only works as well as your team's labeling habits.
The other gap: azure_keyvault_keys has the key ID, attributes, tags and a managed flag. No key type. What it can do is count standalone keys per vault, and the vault tier narrows it down. Standard vaults only hold RSA and EC keys. Premium vaults can also hold symmetric AES keys.
Every key in a standard vault is a quantum-vulnerable one. For a premium vault, az keyvault key show per key is the only way to tell. The managed filter drops the keys Key Vault creates behind certificates, which the certificate query already covers.
One list
Put the pieces together and you have the answer to Monday's question:
What this won't find
These queries read metadata. They tell you a key exists and what algorithm it uses. They don't tell you what depends on it.
They also miss crypto inside your own applications and libraries, and anything outside these three clouds. TLS is a separate question: the load balancer query shows which policy each listener uses, but whether that policy offers a post-quantum key exchange is a lookup you'll have to do by hand.
What I'd do with the list
It depends on how RSA falls. If it takes a quantum computer, that's years away, so a certificate that expires in 90 days is a small problem and a KMS signing key nobody has touched in years is a bigger one. If the rumor turns out to be true and the attack runs on ordinary hardware, 90 days is a long time. Rotating to a new RSA key doesn't help either. Then the question is which keys you can move to another algorithm, and how fast.
Sort the list by what each key protects first, and by how long it lives second.
Key size matters too. According to coverage of the advisory, the NSA uses RSA-3072 or P-384 as the base size for root keys and allows RSA-2048 only where legacy support requires it. The size is already in key_spec, key_algorithm and the GCP algorithm column, and in key_size on Azure, so you can filter on it.
Then schedule the sync. The list is only useful if it's current when someone asks.
If you'd rather have an AI assistant do this with you, I put the same steps, config and queries in a skill you can hand to it. Copy this prompt into your assistant:
Try CloudQuery yourself
Self-hosted, open source, and free to start. Or schedule a demo to see the managed version.
