Repository navigation
feat(evaluator): inject nitro runtime attestation into context.platform.* (closes #104) - #106
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 alongsideprincipal.*(training, qualify) andcontext.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(mirrorsinternal/workload, incl. thefilepath.Absconfinement the custom Semgrep rule requires); absent →(nil,nil)(default-deny); malformed → error. Single mapping point.cmd/attest/main.go—attest evaluategains--platform-dir(default.nitro); injectscontext.platform.*.buildContext(from Inject lowered workload attributes into Cedar context (context.workload.*) #103) groupscontext.<group>.<attr>generically, socontext.platform.*works exactly likecontext.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)
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 · e2eattest evaluateagainst a real.nitro/attestation.json→ ALLOW attested / DENY unattested / DENY absent · Semgrep 0 findings.