Skip to content

Add policy validation tests for RVPS key alignment - #20

Open
beraldoleal wants to merge 1 commit into
confidential-devhub:mainfrom
beraldoleal:trustee-115-policy-validation
Open

Add policy validation tests for RVPS key alignment#20
beraldoleal wants to merge 1 commit into
confidential-devhub:mainfrom
beraldoleal:trustee-115-policy-validation

Conversation

@beraldoleal

Copy link
Copy Markdown
Contributor

Veritas produces RVPS reference values that the Trustee attestation policy (Rego) checks during attestation. If key names drift between the two, attestation silently fails. These tests catch that:

  • Download the latest policy from openshift/trustee-operator on every run (never stale).
  • Parse the Rego AST via OPA to extract query_reference_value() calls, grouped by TEE block (tdx, snp, az-tdx-vtpm, az-snp-vtpm).
  • Cross-reference against the key names each Veritas extractor declares via the new reference_key_names() method.
  • Run OPA eval with synthetic input to confirm the policy passes when all Veritas keys are present with matching values.

Also adds a GitHub Actions workflow to run tests on PRs and pushes to main, pytest as an optional dependency, and TESTING.md.

TRUSTEE-115

Comment thread src/veritas/platforms/azure.py
Comment thread src/veritas/platforms/azure.py
Comment thread tests/test_policy_validation.py
Comment thread tests/test_policy_validation.py
Veritas produces RVPS reference values that the Trustee attestation
policy (Rego) checks during attestation. If key names drift between
the two, attestation silently fails. These tests catch that:

- Download the latest policy from openshift/trustee-operator on
  every run (never stale).
- Parse the Rego AST via OPA to extract query_reference_value()
  calls, grouped by TEE block (tdx, snp, az-tdx-vtpm, az-snp-vtpm).
- Cross-reference against the key names each Veritas extractor
  declares via the new reference_key_names() method.
- Run OPA eval with synthetic input to confirm the policy passes
  when all Veritas keys are present with matching values.

Also adds a GitHub Actions workflow to run tests on PRs and pushes
to main, pytest as an optional dependency, and TESTING.md.

TRUSTEE-115

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@beraldoleal
beraldoleal force-pushed the trustee-115-policy-validation branch from c7bde8d to 6e90724 Compare August 12, 2026 11:55

@lmilleri lmilleri left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants