Skip to content

Quantum-safety compliance must not pass when policy evaluation is absent or incomplete #342

Open

Description

@AAH20

Problem

CBOMkit can currently report or imply a successful quantum-safety result when the selected policy was not actually evaluated.

The README documents two fail-open cases:

If no "quantum-vulnerable" components are found, or if no rule matches and hence no findings are generated, the CBOM is assumed to be quantum-safe.

and:

This same “quantum-safe” result will also occur for a non-empty CBOM if OPA cannot locate the specified policy or if no policy is configured at all.

The OPA adapter also returns an empty successful ComplianceCheckResultDTO when OPAResponse.noFindings() is true or the response does not contain findings:

if (opaResponse.noFindings() || !opaResponse.getResult().containsKey(FINDINGS)) {
    return Collections.emptyList();
}

An empty finding set is therefore ambiguous: it can mean that all applicable assets passed, no rule applied, the requested policy did not exist, or the response did not contain the expected result. Those states should not produce the same global verdict.

Why this matters

CBOM compliance output may be used to prioritize post-quantum migration work. A green result without evidence that every applicable cryptographic asset was evaluated creates false assurance and can incorrectly remove systems from a migration backlog.

Proposed semantics

A global quantum-safe verdict should be possible only when:

  1. the requested policy was found and executed successfully;
  2. at least one applicable cryptographic asset was evaluated;
  3. every applicable asset has a conclusive result;
  4. no applicable asset is quantum-vulnerable or unknown.

Missing policies, empty/malformed OPA results, policy evaluation failures, and incomplete asset coverage should be represented as not_evaluated, partial, or error, never as quantum-safe. A CBOM containing only non-applicable assets should be not_applicable, not quantum-safe.

Bounded implementation proposal

  • Add an evaluation status to the compliance response, for example evaluated, partial, not_evaluated, or error.
  • Include counts for total cryptographic assets, applicable assets, evaluated assets, unknown assets, and vulnerable assets.
  • Calculate globalComplianceStatus=true only for a complete, conclusive evaluation.
  • Render an explicit Not evaluated or Partial evaluation state in the frontend instead of the green quantum-safe state.
  • Preserve the existing per-asset compliance levels where possible.

Tests should cover:

  • missing policy;
  • empty OPA findings;
  • result without a findings key;
  • OPA outage or malformed response;
  • empty CBOM;
  • symmetric-only/non-applicable CBOM;
  • unknown asymmetric algorithm;
  • mixed quantum-safe, vulnerable, and unknown assets;
  • a fully evaluated quantum-safe CBOM as the positive control.

Would you prefer an explicit evaluation-status field on the API response, or should these states be expressed using the existing error, default compliance level, and global status fields to avoid an API model change?

If the direction is acceptable, I can post a file-level implementation plan before opening a PR.

Activity

  1. san-zrl commented on Sep 9, 2026

    @san-zrl
    Contributor

    Hi @AAH20 - Thank you for your interest in CBOMkit. Please go ahead and file a PR or send an implementation plan first if you prefer.
    I'll be happy to review. For the PR please make sure that

    • your code compiles locally (mvn clean package)
    • you include test (as indicated above) and all tests pass (not braking existing tests)
    • you add a DCO sign-off msg to your commits
  2. AAH20 commented on Sep 12, 2026

    @AAH20
    Author

    @san-zrl Thanks — I've opened a PR with the fail-closed evaluation status semantics discussed here:

    #375

    Includes DCO sign-off, unit tests for the scenarios listed in this issue, and frontend banners for Not evaluated / Partial evaluation / Not applicable. Happy to adjust based on review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions