mvdmanish4/pq-inventory
About
Open-source, self-hosted cryptography inventory. Finds every use of RSA and elliptic-curve cryptography, shows what must change for post-quantum, and how to fix it.
Security & PrivacyMeasured star growth
- in 24h
- Collecting history
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalpq-inventory
Open-source, self-hosted cryptography inventory. It finds every place you use public-key cryptography, shows which uses need to change for post-quantum, ranks them by what to fix first, and tells you how to fix each one.
You clone it or download a binary, run it on your laptop or a VM, connect your GitHub organization, your Google Cloud projects and your domains once, and it keeps scanning. Nothing leaves your machine.
What it does
- Finds public-key cryptography in TLS, IPsec, SSH, PKI and certificates, code signing, identity (OIDC, SAML, workload identity), libraries and runtimes, and imported Wi-Fi and appliance records.
- Classifies each use against a versioned policy profile. Every rule cites a source and says whether it rests on guidance (a published source says so) or inference (an expert's reading).
- Ranks what to fix first: algorithms your profile does not approve, then internet-facing systems, systems that protect long-lived data, mission-critical systems and widely depended-on ones. Each factor says where it came from, and inferred ones are marked.
- Checks every TLS server and load balancer against a clear target: TLS 1.3, hybrid post-quantum key exchange (RFC 10024), weaker curves and deprecated DH groups removed, TLS 1.2 only with CNSA 1.0 suites where 1.3 is not possible, and a mitigation-plan row for anything you cannot change yourself, such as TLS terminated by your hosting platform.
- Gives a fix for each finding, including server configuration lines and Google Cloud SSL policy commands.
- Tracks progress with a trend of findings that must be replaced, run after run.
- Works with coding agents through a read-only MCP server, so Claude Code, Cursor, Codex and other agents can read the inventory and help fix findings in your code.
How it works
- Collectors read each source you connect, with read-only access. Cloud support is Google Cloud only today; AWS and Azure are coming soon.
- Everything they find becomes one CryptoAsset list: algorithm, key size, location and public fingerprint, never key material.
- The policy engine classifies each asset against the active profile, and each rule cites its source.
- Risk and fixes sets the risk level (Critical, High, Medium or Post-quantum ready) and attaches a fix.
- Results go to the local dashboard, which stores runs in SQLite and rescans on a schedule, or to report files for one-off scans and CI.
Quick start: the dashboard
New here? docs/GETTING-STARTED.md takes you from install to a fix list in four steps.
go install github.com/mvdmanish4/pq-inventory/cmd/pq-inventory@latest
pq-inventory serve --open
The dashboard runs at http://127.0.0.1:8765 and only answers on this machine. Open Connections and add:
- Domains: your apex domains, and optionally hosts and CIDR ranges. Names under those apexes found in certificates, in your Cloud DNS zones or behind your load balancers are probed too. Names outside them are listed but never contacted. Certificate Transparency lookup and IPsec probing are opt-in.
- GitHub: creates a private, read-only GitHub App in your organization through GitHub's App manifest flow, then reads code, lockfiles, workflows, releases, deploy keys and members' keys through the API. Repositories are read as archives in memory, never cloned to disk. A personal token works too.
- Cloud (Google Cloud only for now; AWS and Azure coming soon): a read-only reader service account reads Cloud Asset Inventory for a project, folder or organization.
scripts/gcp-setup.shcreates it, and you impersonate it, so there are no key files. See docs/GCP.md. - Import: a CSV template (downloadable from the dashboard) for what no API can reach, such as Wi-Fi networks and appliances, or a CycloneDX CBOM from another tool. See docs/IMPORT.md.
Each connection has its own schedule (GitHub and Google Cloud every 6 hours, domains daily, imports when the file changes). The dashboard shows risk by level and system type, findings you can filter by risk, who fixes it, what to do and more, Findings by Artifact, and the policy rules with their sources.
Data stays in ~/.pq-inventory (a SQLite database, mode 0600). Credentials go to the OS keychain, or to a 0600 file where there is none.
Use it from coding agents (MCP)
pq-inventory includes an MCP server, so a coding agent can read your cryptography inventory and help you fix what it finds. It is read-only: agents can look at findings, fixes and policies, but cannot start scans, change connections or see credentials. Text is redacted the same way as on the dashboard.
Run pq-inventory serve and connect at least one source first. The MCP server reads the same data in ~/.pq-inventory.
Claude Code
claude mcp add pq-inventory -- pq-inventory mcp
Or, while serve is running, connect over HTTP:
claude mcp add --transport http pq-inventory http://127.0.0.1:8765/mcp
Cursor, Claude Desktop, Windsurf and other agents that use an mcpServers JSON file:
{
"mcpServers": {
"pq-inventory": { "command": "pq-inventory", "args": ["mcp"] }
}
}
Codex (~/.codex/config.toml):
[mcp_servers.pq-inventory]
command = "pq-inventory"
args = ["mcp"]
If the agent cannot find the command, use its full path (for go install, usually ~/go/bin/pq-inventory). Add --data <dir> if serve uses a different data directory.
| Tool | What it returns |
|---|---|
get_summary |
Counts by risk, what to do, who fixes it and system; connected sources; the top findings to start with |
list_findings |
Findings in rank order. Filter by risk, what to do, who fixes it, system, source, exposure, repository, policy rule or text |
get_finding |
One finding in full: the policy rule and its source, guidance or inference, the evidence and the fix steps |
list_policies |
The active profile's rules, with sources and how many findings each one decided |
list_changes |
What changed between scans, to confirm a fix landed |
Then ask your agent something like "Use pq-inventory to find the Critical and High findings in this repository and fix them." Findings that the provider fixes (TLS on a managed platform, a CA's certificates) are marked, so the agent tells you about them instead of changing code.
Quick start: one-off scans and CI
pq-inventory scan --domains example.com,api.example.com
pq-inventory scan --repo . --format md,json,html,sarif
You get a short answer in the terminal and files in ./pq-report/: report.md, inventory.json, and on request report.html (a self-contained copy of the dashboard), SARIF for GitHub code scanning and a CycloneDX CBOM.
pq-inventory init example.com api.example.com # writes pq-inventory.yaml
pq-inventory scan --fail-on high --baseline pq-baseline.json
Exit codes: 0 ok, 1 error, 2 usage, 3 a finding at or above --fail-on that is not in the baseline. The CLI's --github and --gcp flags use GITHUB_TOKEN or gh auth, and Application Default Credentials or gcloud auth, for people who prefer that to the dashboard.
pq-inventory profiles # profiles, rules and their sources
pq-inventory doctor # which collectors have the credentials they need
Profiles
| Profile | Use it for |
|---|---|
interim-2026-12 (default) |
Follows NSA PP-26-4956 (see Background): curves other than P-384/P-521, EdDSA, DSA, deprecated DH and pairing-based cryptography are not approved; RSA-3072+, DH-3072+ and P-384 are stopgaps |
cnsa-2.0 |
National Security Systems and suppliers |
nist-ir-8547 |
The conventional NIST timeline (deprecated 2030, disallowed 2035) |
The default profile lists 256-bit curves (P-256, X25519, Ed25519) as not approved, following the NSA advisory; that part is guidance. The advisory gives no reason. The claim that they are weakened by a classical attack is an inference, not a confirmed break, and every report labels it as one.
What it covers
| Area | Where pq-inventory gets it |
|---|---|
| TLS | Domain probes (every accepted group, versions, TLS 1.2 suites, DHE size), GCP load balancers and SSL policies, settings in code |
| IPsec | IKEv2 probe (opt-in; groups 1 to 32 including deprecated 22 to 24, RFC 9370 ML-KEM hybrids), GCP Cloud VPN tunnels |
| SSH | Host keys and key exchange, deploy keys, members' keys |
| PKI and certificates | Certificate chains and roots, CA Service, Certificate Manager, Compute, Cloud SQL and GKE CAs, committed keys |
| Code signing | Workflow signing steps, release signature files, KMS signing keys |
| Wi-Fi | Import (no API exposes it) |
| Identity credentials | OIDC/JWKS, SAML metadata, workload identity providers, service account keys, JWT algorithms in code |
| Algorithms | RSA, ECDSA/ECDH, EdDSA, DSA, DH, pairing-based, plus ML-KEM, ML-DSA, SLH-DSA, LMS/XMSS and hybrids |
| Internal or internet-facing | DNS, IP ranges and load balancer schemes, recorded with their source |
| Criticality | Labels, topics, pq-inventory.yaml, and marked inferences (token issuers, CAs, shared runtimes) |
| Make, model and patch level | Server headers, SSH banners, library and runtime versions from lockfiles, cloud product versions |
| Owners | Deferred. pq-inventory.yaml, labels and topics fill it where present |
Safety
- Only scan systems you own or are authorized to test. The domains connector enforces this: it probes only names under the apexes you enter, hosts you list, and what your own GitHub and cloud accounts return.
- Read-only: TLS and SSH handshakes that stop before authentication, IKE_SA_INIT only, GETs of public discovery documents, and read calls to the GitHub and Google Cloud APIs. The GitHub client refuses any write; its only POSTs mint short-lived tokens.
- No telemetry. Nothing leaves your machine except the probes and API calls you configure.
- Private key material and secrets are never written to any output, database or log. Keys are reported by algorithm, size and public fingerprint, and tests check every output path for this.
- The dashboard binds to 127.0.0.1, refuses other Host headers, and requires a CSRF token for every change.
- The MCP server is read-only. Over HTTP it shares the dashboard's localhost-only listener and refuses requests from web pages on other sites.
Background
The project started from the NSA's December 2026 advisory on immediate steps toward post-quantum cryptography (PP-26-4956), which begins with an inventory of where you use RSA and elliptic-curve cryptography. The default profile and the TLS target follow it, and each rule cites the page it comes from. The advisory is written for National Security Systems; applying it elsewhere is your choice, and the nist-ir-8547 profile gives the conventional timeline.
Docs
- Getting started
- Scope and acceptance checklist
- Architecture
- Google Cloud setup
- Importing Wi-Fi and appliances
License
Apache-2.0. See LICENSE. The dashboard ships the Geist fonts under the SIL Open Font License.
Explore related projects
Loading…