Skip to content

feat(evaluator): inject nitro runtime attestation into context.platform.* (closes #104) - #106

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/context-platform-entity
Jun 9, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/context-platform-entity

Conversation

@scttfrdmn

Copy link
Copy Markdown
Collaborator

Closes #104. Relates to #1, provabl/ground#12. Phase-two Stream B (consumer side) of ADR 0001 — epic hub provabl/evidence#2 — following the nitro provider in evidence v0.2.0 and mirroring the merged #103 (context.workload.*).

What this is

Surfaces nitro's runtime/enclave attestation to Cedar as context.platform.*, so policies can gate on enclave identity alongside principal.* (training, qualify) and context.workload.* (supply chain, vet). Completes the three-layer picture.

Files

  • pkg/schema/types.go — PlatformAttributes (nitro_attested, module_id, nonce_verified, signature_valid, pcr0/1/2/8); snake_case json tags matching the nitro provider's lowered claims.
  • internal/platform/platform.go (new) — Load(dir) reads .nitro/attestation.json (mirrors internal/workload, incl. the filepath.Abs confinement the custom Semgrep rule requires); absent → (nil,nil) (default-deny); malformed → error. Single mapping point.
  • cmd/attest/main.go — attest evaluate gains --platform-dir (default .nitro); injects context.platform.*.
  • NO evaluator change — buildContext (from Inject lowered workload attributes into Cedar context (context.workload.*) #103) groups context.<group>.<attr> generically, so context.platform.* works exactly like context.workload.*. (This is the payoff of Inject lowered workload attributes into Cedar context (context.workload.*) #103's generic design.)
  • docs/integrations/nitro.md — the contract + the attested/workload/training example policy + the ground#12 IAM-layer counterpart.

Boundary

No evidence-kernel dependency — attest reads the durable JSON artifact, it does not run the kernel (the #102/#103 boundary). The producer that writes .nitro/attestation.json (a nitro CLI / enclave runtime) doesn't exist yet (provabl/evidence#5); attest ships the consumer half now, absent file → default-deny, so it's correct today and the loop closes when the producer lands.

Example policy (full three-layer gate)

permit(principal, action, resource in ResourceGroup::"cui-data")
when {
  principal.cui_training_current == true &&     // qualify
  context.workload.slsa_level >= 2 &&           // vet
  context.platform.nitro_attested == true       // nitro
};

Verification

go build/vet/test ./... green · new evaluator test: context.platform.nitro_attested == true → ALLOW/DENY/DENY-absent + a pcr0-match case · reader test present/absent/malformed · e2e attest evaluate against a real .nitro/attestation.json → ALLOW attested / DENY unattested / DENY absent · Semgrep 0 findings.

…rm.* (closes #104)

Phase-two Stream B (consumer side) of ADR 0001, following the nitro provider in
evidence v0.2.0 and mirroring #103 (context.workload.*). Surfaces nitro's
runtime/enclave attestation to Cedar as context.platform.*, so policies can gate
on enclave identity alongside principal.* (training) and context.workload.*
(supply chain).

- pkg/schema: PlatformAttributes (nitro_attested, module_id, nonce_verified,
  signature_valid, pcr0/1/2/8) — Go fields PascalCase, json tags snake_case
  matching the nitro provider's lowered claim keys.
- internal/platform: Load(dir) reads .nitro/attestation.json (mirrors
  internal/workload, incl. the filepath.Abs confinement the custom Semgrep rule
  requires); absent -> (nil,nil) (default-deny); malformed -> error. The single
  point mapping the nitro JSON to attest's schema.
- cmd/attest: 'attest evaluate' gains --platform-dir (default .nitro); injects
  context.platform.* keys.
- NO evaluator change: buildContext (from #103) groups context.<group>.<attr>
  generically, so context.platform.* works exactly like context.workload.*.
- docs/integrations/nitro.md: the contract (nitro JSON -> context.platform.*),
  the attested/workload/training example policy, and the ground#12 IAM-layer
  counterpart.

No evidence-kernel dependency — attest reads the durable JSON artifact, it does
not run the kernel (#102/#103 boundary). The producer that writes
.nitro/attestation.json doesn't exist yet (evidence#5); attest ships the consumer
half now, absent file -> default-deny.

Verified: build/vet/test green; new evaluator test proves
context.platform.nitro_attested == true policy yields ALLOW/DENY/DENY-absent
(plus a pcr0-match case); reader test covers present/absent/malformed; e2e
'attest evaluate' against a real .nitro/attestation.json confirms ALLOW attested,
DENY unattested, DENY absent. Semgrep 0 findings.

Relates to #1, ground#12.
@scttfrdmn
scttfrdmn merged commit 80abae4 into main Jun 9, 2026
2 checks passed
@scttfrdmn
scttfrdmn deleted the feat/context-platform-entity branch June 9, 2026 19:35
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.

Inject nitro:// runtime attributes into Cedar context

1 participant