Skip to content

feat(policy): Refactor policy release to be AS-aware - #42

Open
shariqahmed-cohere wants to merge 6 commits into
shariq/rm-stale-funcfrom
shariq/add-platform-layer
Open

feat(policy): Refactor policy release to be AS-aware#42
shariqahmed-cohere wants to merge 6 commits into
shariq/rm-stale-funcfrom
shariq/add-platform-layer

Conversation

@shariqahmed-cohere

@shariqahmed-cohere shariqahmed-cohere commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Currently, Integritee generates and releases policies specifically for ITA for GCP TDX nodes. This PR makes all changes required to support releasing policies for more than one attestation service (e.g. Trustee and ITA) as well as enable routes for other platforms and TEEs (Azure, SNP).


Note

High Risk
Changes the attestation policy generation and release path (measurements, Rego semantics, manifest schema, and ITA upload inputs), which directly controls what confidential workloads can pass attestation.

Overview
Refactors generate-policy from a single ITA-only pipeline into a shared manifest → measure → render flow with pluggable Renderer implementations. ITA logic moves to ita.py (baselines, firmware, Rego from ita-template.rego); generate.py owns PodVM pulls, initdata, machine-type resolution, predicate updates, stale-policy cleanup, and GITHUB_OUTPUT reporting.

Callers pass policy-types (e.g. ita) instead of output-policy-file. Policies land under generated-policies/; the action returns ita-policy-file and ita-target-count. Release and test workflows consume those outputs and ship ita_policy.rego.

Hardware facts (platform, tee, ram_gib) live in one machine-types.yaml under generate-policy. Manifest targets no longer carry ram_gib; derive, validate, and merge only reference machine_type. ITA skips targets whose TEE is not TDX (e.g. Azure SNP) before baseline work; non-TDX types can still appear in the manifest for future renderers.

ITA Rego adds default deny rules when platform/workload blocks are empty, accepts multiple NVIDIA driver versions per manifest (set membership vs. a single ==), and fails the run only when no requested policy type matched any target.

Validation drops the policy-id initdata check. CI installs opa so tests compile and evaluate generated policies. Predicate JSON gains target_counts per policy type.

Reviewed by Cursor Bugbot for commit 1857e33. Bugbot is set up for automated code reviews on this repo. Configure here.

With the addition of Trustee in integritee, initdata no longer is expected to have single ITA policy ID
- Updated driver version handling to support multiple NVIDIA driver versions.
- Introduced a mechanism to generate an inert policy when no targets match, ensuring the policy remains loadable.
- Added checks for supported TEE types in ITA and improved error handling in policy rendering.
- Updated policy template to accommodate changes in driver version placeholders.

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6b87cd1. Configure here.

Comment thread .github/actions/generate-policy/generate_policy/generate.py Outdated
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.

1 participant