Skip to main content

Scanner Architecture

Applies to:
PQC Scanner CLIWindowsLinuxmacOS

Data flow

Scanner architecture

Scanner architectureEvery scan runs through five stages: the CLI dispatches a command, a scanner collects raw cryptographic data, parsers extract metadata, the risk scorer grades each finding and an output formatter writes the report.ANALYSIS CORE01CLIone command per kindfilesystem · domaininventory · sshsource-code · cloudvault · terraform …02Scannersraw crypto dataTLS handshakescertificate filescode patternsKMS · SSH host keys03Parserscertificate metadataPEM · DERPKCS#12Windows cert storeCBOM04Risk scoring0–10 per findingseverity Critical–Infopriority P0–P4recommendations05Outputfile or stdoutJSON · YAML · HTMLANSI terminalSARIFCycloneDX 1.7 CBOMLEGENDStageParser layerQuantum risk scorerData passed on

Every scan follows the same five stages, from CLI dispatch to a formatted report; the risk scorer grades each finding from 0 to 10 with a P0 to P4 priority.

High-Level Data Flow​

Every scan follows the same five-stage pipeline, from CLI invocation through to report output.

1

CLI Parsing

The user invokes one of the scanner's subcommands (filesystem, domain, inventory, source-code, ci, cbom, qrs, ssh, fortinet, jfrog, terraform, cloud, vault, plus the cockpit-integration commands agent, enroll, and upload-scan, and (feature-gated) packet-capture / network). The CLI parses arguments, validates inputs, and dispatches to the corresponding scanner.

2

Scanner Execution

The selected scanner collects raw cryptographic data -- TLS handshakes, certificate files, source code patterns, cloud KMS metadata, or SSH host keys. Scanners run concurrently and parallelize file traversal for large scans.

3

Parser Layer (PEM / DER / PKCS#12)

Raw data is fed to format-specific parsers for PEM, DER, PKCS#12, the Windows certificate store, and CBOM that extract certificate metadata, key algorithms, and signature schemes.

4

Risk Scoring (0-10)

Each parsed finding passes through the risk scoring engine, which assigns a quantum risk score from 0 to 10, maps it to a severity level (Critical through Info), assigns a priority (P0 through P4), and generates human-readable reasons and recommendations.

5

Output Formatting

The scored scan result is serialized by the chosen output formatter -- JSON, YAML, HTML, ANSI terminal, or CycloneDX 1.7 CBOM -- and written to file or stdout.

Runtime

Scanner operations run concurrently, with structured logging throughout and CPU-bound parsing parallelized across worker threads for throughput.

Module Hierarchy​

The scanner is organized into a set of focused functional areas, each with a single responsibility.

AreaResponsibility
CLIOne subcommand per scan kind -- filesystem, domain, inventory, source-code, ci, cbom, qrs, ssh, fortinet, jfrog, terraform, cloud, vault, agent, enroll, upload-scan, plus feature-gated packet-capture / network
CoreCentral data structures (findings, scan results, risk assessments) and quantum risk scoring engine
ScannersData collectors for filesystem, domain/TLS, host inventory, source code, cloud KMS, SSH, Fortinet, JFrog, Terraform, vault, packet capture (offline) and network (live)
ParsersFormat parsers for PEM, DER, PKCS#12, Windows cert store, CycloneDX CBOM
OutputReport generators -- JSON, YAML, ANSI terminal, HTML, SARIF, CycloneDX 1.7 CBOM export
ConfigurationCMDB context, logging verbosity, and input validation
EntrypointApplication entrypoint, logging initialization, CLI dispatch
Note

Compliance-framework checking runs inside DuoKey CPM (the Cockpit) against a saved scan result, and the ServiceNow Store application pulls its data from the Cockpit. Neither is a standalone dke-scanner-agent CLI subcommand. See Integrations.

CLI Commands​

The CLI exposes one subcommand per scan kind, plus cockpit-integration commands. Each maps to a dedicated scanner or service.

CommandDescription
filesystemScan local paths for certificates and keystores (PEM, DER, PKCS#12, JKS)
domainClassic SSL/TLS audit of a remote endpoint; add --pqc for the PQC readiness report and Quantum Risk Score
inventoryOne-shot, full local-host cryptographic inventory -- filesystem sweep + SSH keys, plus (Windows) cert store, apps, registry policy
sshDiscover SSH keys (ssh-agent, user keys, host keys) and classify them
source-codeStatic analysis with 150+ detection rules across 8 programming languages
ciCI/CD pipeline mode with SARIF output for GitHub Actions, GitLab CI, and Azure DevOps
cbomParse or generate a CycloneDX 1.7 Cryptography Bill of Materials
qrsCompute and render the Quantum Risk Score from a saved scan result
fortinet / jfrog / terraform / cloudScan a FortiGate appliance, a JFrog Artifactory instance, Terraform IaC, or a cloud KMS
vaultThin client that asks the cockpit to scan a registered vault (server-side)
agent / enroll / upload-scanCockpit-integration commands: persistent heartbeat agent, one-time enrollment, and one-shot scan upload
packet-capture / networkFeature-gated: offline .pcap/.pcapng analysis, and live interface capture

Core Data Structures​

All scan results share the same data model. This ensures consistent output regardless of which scanner produced the data.

A finding represents a single cryptographic asset discovered during a scan.

FieldTypeDescription
idTextUnique identifier for the finding
finding_typeEnumCertificate, Keystore, Key, ConfigFile, or SshKey
sourceTextWhich scanner produced this finding
locationTextFile path, URL, or hostname where the asset was found
certificateCertificate details (optional)Parsed certificate metadata (subject, issuer, algorithm, key size, validity)
keystoreKeystore details (optional)Keystore format and contained entries
risk_assessmentRisk assessmentQuantum vulnerability scoring and recommendations
tls_infoTLS details (optional)TLS protocol version, cipher suite, and handshake details

Every finding is scored for quantum vulnerability by the risk scoring engine.

FieldTypeDescription
quantum_vulnerableBooleanWhether the asset uses algorithms breakable by quantum computers
quantum_risk_scoreNumber (0-10)0 = no risk (pure PQC), 10 = maximum risk (RSA-1024, DSA-1024)
severityEnumCritical, High, Medium, Low, or Info
priorityEnumP0 (immediate), P1 (urgent), P2 (planned), P3 (monitor), P4 (informational)
reasonsList of textHuman-readable explanations for the assigned score
recommendationsList of textActionable steps to remediate the vulnerability
Tip

Risk scores map to priorities: P0 (score 9-10, e.g. RSA-1024, MD5 signatures), P1 (7-8, e.g. RSA-2048, SHA-1), P2 (5-6, e.g. RSA-3072), P3 (2-4, e.g. RSA-4096, ECDSA P-384), P4 (0-1, e.g. hybrid or pure PQC algorithms).

The top-level output structure returned by every scan operation.

FieldTypeDescription
scan_metadataScan metadataScanner version, scan mode, date, hostname, duration in seconds
findingsList of findingsAll cryptographic assets discovered during the scan
summaryScan summaryAggregated counts by severity, finding type, and algorithm
recommendationsList of textTop-level remediation guidance based on all findings

Scanner Modules​

Each scanner is a self-contained component that collects raw cryptographic data from a specific source. Scanners run concurrently and parallelize file traversal where applicable.

Recursively walks directories, detecting certificate and keystore files by extension and magic bytes. Supports PEM, DER, PKCS#12, and JKS formats. Files are handled by the corresponding format parser.

Detection strategy:

  • File extension matching (.pem, .crt, .cer, .der, .p12, .pfx, .jks, .key)
  • Magic byte signature detection for binary formats
  • Configurable directory depth and exclusion patterns
  • Parallel file I/O for large directory trees

Connects to TLS endpoints using a native TLS client. Captures the full TLS handshake including protocol version, cipher suite negotiation, server certificate chain, and key exchange parameters. Supports subdomain enumeration via WhoisXML API integration.

Performs a system-wide cryptographic inventory combining results from multiple sub-scanners: filesystem certificates, the Windows certificate store, SSH host keys, and cloud KMS metadata (for AWS KMS, Azure Key Vault, and GCP Cloud KMS).

Static analysis engine with 150+ detection rules covering 8 programming languages. It walks source trees and applies regex-based pattern matching to detect vulnerable cryptographic function calls (e.g., RSA_generate_key, ECDSA_sign, hardcoded keys).

Capabilities:

  • Detection pattern definitions (algorithm, function name, severity)
  • File traversal and rule matching engine
  • SARIF output format for CI/CD integration
  • Connectors for GitHub, GitLab, and Azure DevOps repositories

Parser Layer​

Parsers convert raw binary or text data into structured certificate and keystore objects. They are called by scanners and are format-specific.

ParserFormats Handled
PEMBase64-encoded certificates, private keys, CSRs
DERBinary-encoded X.509 certificates (.der, .cer)
PKCS#12Password-protected certificate/key bundles (.p12, .pfx)
Windows Cert StoreLocalMachine and CurrentUser certificate stores on Windows
CBOMCycloneDX Cryptographic Bill of Materials (JSON input)

Risk Scoring Engine​

The risk scoring engine evaluates each finding on a 0-to-10 quantum vulnerability scale. Scoring considers the algorithm family, key size, signature scheme, and contextual factors.

Score RangePrioritySeverityExample Algorithms
9 - 10P0 (Immediate)CriticalRSA-1024, DSA-1024, MD5 signatures, DES, 3DES
7 - 8P1 (Urgent)HighRSA-2048, ECDSA P-256, SHA-1 signatures
5 - 6P2 (Planned)MediumRSA-3072, Diffie-Hellman 2048-bit
2 - 4P3 (Monitor)LowRSA-4096, ECDSA P-384, ECDSA P-521
0 - 1P4 (Informational)InfoML-KEM, ML-DSA, SLH-DSA, hybrid PQC algorithms

Output Formatters​

The scanner provides five output backends. The CLI --format flag selects which formatter renders the scan result.

FormatUse Case
JSONMachine-readable output for pipelines, APIs, and integrations
YAMLHuman-readable structured output for configuration management
Terminal (ANSI)Color-coded console output with severity highlighting for interactive use
HTMLSelf-contained HTML reports for sharing with stakeholders
CycloneDX CBOMCycloneDX 1.7 Cryptographic Bill of Materials export
Tip

The CI mode (ci command) produces SARIF output, which is distinct from the standard output formatters. SARIF integrates directly with GitHub Code Scanning, GitLab SAST, and Azure DevOps.

Cockpit Dashboard​

The scan dashboard, compliance engine, and integrations described below are part of DuoKey Cockpit (the PQC Readiness module) — the CLI's role is to run scans and hand off the result. There is no built-in dke-scanner-agent web server command.

  • REST API -- Cockpit endpoints for scans, findings, CBOMs, and compliance
  • Authentication -- Cockpit session authentication (SSO / password)
  • Real-time visualization -- Scan results with risk scoring and distribution charts

Compliance Engine​

The compliance engine (inside DuoKey Cockpit) evaluates scan findings against 8+ regulatory and industry frameworks.

ComponentPurpose
CheckerEvaluates findings against framework-specific rules
FrameworksFramework definitions -- NIST, BSI TR-02102, CNSA 2.0, PCI DSS, FIPS 140-3, ETSI, ISO 27001, SOC 2
Gap AnalyzerIdentifies gaps between current posture and target compliance state
Report GeneratorProduces compliance reports in HTML, PDF, and JSON formats
PDF ParserExtracts requirements from custom organizational policy PDFs

Integrations​

Post Quantum Scanner is a ServiceNow Store application installed in your instance. It connects to your Cockpit tenant with OAuth 2.1 and pulls scans, crypto assets, CBOMs and compliance results. The Cockpit serves read-only endpoints for that purpose and does not write into ServiceNow. There is no servicenow dke-scanner-agent CLI command.

Capabilities:

  • Pull synchronisation, on demand and once a day, chunked and resumable
  • Aggregate counts per application by default, one row per finding on request
  • Certificate items reconciled with the CMDB through the Identification and Reconciliation Engine
  • An Incident raised when a synchronisation job keeps failing

Post Quantum Scanner dashboard in ServiceNow

The dashboard of the ServiceNow application shows the PQC score, the compliance and risk indicators and the share of quantum-vulnerable assets.

Architecture Principles​

Single Binary

Ships as one native executable per platform. No runtime dependencies, no JVM, no Python interpreter. Just copy and run.

Concurrent by Design

Network I/O runs concurrently, and CPU-bound work (file parsing, rule matching) is parallelized across worker threads for maximum throughput.

Zero OpenSSL

Modern TLS and certificate parsing with no OpenSSL or C-library dependencies for cryptographic operations.

Modular Scanners

Each scan command is an independent module. New scanners can be added without modifying existing code.

Next Steps​