Skip to content

feat(policies): nitro-attestation SCP — gate data access on runtime attestation (closes #12) - #13

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/nitro-attestation-scp
Jun 9, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/nitro-attestation-scp

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #12. Phase-two Stream B (consumer side) of ADR 0001 — epic hub provabl/evidence#2 — following the nitro provider in evidence v0.2.0 (evidence#1).

What this is

The IAM-layer half of runtime/enclave attestation. The evidence nitro provider produces a verified platform.* verdict; this SCP denies sensitive-data actions unless the principal is attested.

policies/nitro_attestation_scp.json

{
  "Effect": "Deny",
  "Action": ["s3:GetObject", "s3:PutObject", "sagemaker:CreateTrainingJob", "sagemaker:CreateNotebookInstance", "sagemaker:CreateProcessingJob", "bedrock:InvokeModel"],
  "Resource": "*",
  "Condition": { "StringNotEquals": { "aws:PrincipalTag/attest:nitro-attested": "true" } }
}

StringNotEquals is fail-closed — it denies when the tag is missing or not "true". The attest: namespace matches ground's existing SCPs (attest:environment-id, attest:data-classes, …) and attest's resolver.

Design

  • No evidence dependency. ground is the policy layer; the proof flows in as a principal tag. (Mirrors the #102/#103 boundary: tools produce; ground/attest consume.)
  • New SCP asset, not new role infra. ground deploys Identity Center permission sets, not workload roles, so a tested Deny-unless-attested SCP is the minimal, idiomatic home — consistent with the other policies/*.json correctness assets.
  • Tested by TestNitroAttestationSCPRequiresAttestedTag (all-Deny; the StringNotEquals condition present; sensitive actions covered) — ground's "every policy is tested before it ships" rule.

⚠️ Loop not yet closed end-to-end

Nothing writes the attest:nitro-attested principal tag yet — that attestation-tagging step is future work (the same shape as qualify writing attest:* training tags). This PR deploys the condition; a follow-up will track the tag-writer.

Verification

go test ./policies/... green · go vet ./... · go build ./... clean.

…ttestation (closes #12)

Phase-two Stream B (consumer side) of ADR 0001, following the nitro provider in
evidence v0.2.0. Adds policies/nitro_attestation_scp.json: a Deny on
sensitive-data actions (s3:GetObject, sagemaker:CreateTrainingJob, ...) unless
the principal carries aws:PrincipalTag/attest:nitro-attested == "true"
(StringNotEquals — fail-closed: covers both a missing and a non-true tag).

This is the IAM-layer half of runtime/enclave attestation: the evidence nitro
provider produces the verdict, a tag carries it, and this SCP gates data access
on it. No evidence dependency — ground is the policy layer; the proof flows in
as a principal tag (the attest:* namespace ground's other SCPs already use).

Tested by TestNitroAttestationSCPRequiresAttestedTag (all-Deny, the
StringNotEquals condition present, sensitive actions covered) — ground's
'every policy is tested before it ships' rule.

Note: nothing writes the attest:nitro-attested tag yet — that attestation-tagging
step is future work (mirrors how qualify writes attest:* training tags); this SCP
deploys the condition. go test ./policies/... + go vet + go build green.
@scttfrdmn
scttfrdmn merged commit b4ee42f into main Jun 9, 2026
2 checks passed
@scttfrdmn
scttfrdmn deleted the feat/nitro-attestation-scp branch June 9, 2026 19:24
scttfrdmn added a commit that referenced this pull request Jun 11, 2026
Layer-1 IAM enforcement for the AMI-gating epic: only vetted AMIs may launch,
and only the vetter may mark one vetted.

- ami_launch_gating_scp.json — Deny ec2:RunInstances unless the AMI carries
  ec2:ResourceTag/attest:vetted == "true". Deny scoped to the image ARN
  (arn:aws:ec2:*::image/*) so the tag condition evaluates only against the AMI;
  a Resource:"*" scope would also match the instance/volumes/ENIs the call
  creates (which lack the tag) and deny every launch.
- ami_vetting_lockdown_scp.json — Deny CreateTags/DeleteTags of the
  attest:vetted key on AMIs except the designated vetter (ArnNotLike
  aws:PrincipalArn). Solves the trust trap: a researcher can't self-mark an AMI
  vetted (same principle as qualify#32's locked attest:* tags). Vetter ARN is a
  deploy-time placeholder ground/vendor substitutes per account.
- Tests mirror the nitro SCP test, with regression guards for the image-scope
  and the vetter exception (verified both fail when violated).

The runtime half (PCR0 proving the booted image) already exists in
nitro/nitrotpm. Deferred follow-ups: vet writing attest:vetted (AMI vetting),
and vendor deploying these SCPs into vended accounts.

Refs: #13
scttfrdmn added a commit that referenced this pull request Jun 11, 2026
…lator (#13) (#19)

Turns the "can a researcher forge attest:vetted?" reasoning into tested fact.
policies/scp_simulate_test.go (build tag awssim, creds-gated, excluded from CI)
drives iam:SimulateCustomPolicy with an attack matrix and asserts each decision:

- researcher CreateTags/DeleteTags of attest:vetted → explicitDeny (forgery blocked)
- the vetter principal may set attest:vetted; an unrelated key is unaffected
- RunInstances denied for a false-tagged OR untagged AMI (missing != vetted)

The simulator is the faithful test: SCPs never apply to an Organization's
management account (the suite's dev account), so the policy can't be observed
denying in-account — the simulator evaluates the logic with no resources, no spend.
Verified all-passing against the live API.

policies/SECURITY.md documents the matrix, how AWS permissions tagging (condition
keys, not per-tag ACLs), and the honest trust boundary: the gate reduces to who can
assume the vetter principal, and SCPs don't restrict the management-account root.

Adds aws-sdk-go-v2/service/iam as a direct dep (simulator client).

Refs: #13
scttfrdmn added a commit that referenced this pull request Jun 11, 2026
The runtime image binding records a vetted AMI's known-good boot measurement as
attest:pcr<N> tags (vet ami-reference). A forgeable golden PCR would defeat that
binding, so the lockdown SCP must protect those keys like attest:vetted.

- ami_vetting_lockdown_scp.json: ForAnyValue:StringEquals → StringLike on
  aws:TagKeys, covering [attest:vetted, attest:pcr*]; vetter ArnNotLike carve-out
  unchanged.
- policies_test: assert the lockdown targets both attest:vetted and attest:pcr*.
- scp_simulate_test (awssim): adversarial cases — non-vetter forging/stripping
  attest:pcr0/pcr7 → explicitDeny; vetter allowed; unrelated key allowed.
  Proven against the live IAM simulator (the StringLike wildcard actually denies).
- SECURITY.md: document the extended lockdown + matrix.

Refs: #13
scttfrdmn added a commit that referenced this pull request Jun 12, 2026
…nd#10) (#22)

The coarse network/posture half of compute-to-data (#11 Tier 2, ADR 0002
Decision 3; pairs with attest#100's dataset-scoped Cedar gate).

- config NetworkConfig.data_endpoints: declare external research-data endpoints
  (name, url, data_class, sre_types, authorized_ous) the SRE may reach in-place.
- policies/data_endpoint_access_scp.json: deny the in-place data-access actions
  (s3:GetObject/ListBucket, sagemaker:Create{Training,Processing}Job) unless the
  principal carries an attest:data-classes posture tag. Null check, not
  StringNotEquals — attest:data-classes is multi-valued (e.g. 'CUI,GENOMIC'), so
  an equality test would wrongly deny a legitimately multi-class principal.
- export-metadata: emit declared endpoints in ground-meta.json for attest init.
- tests: TestDataEndpointAccessSCPRequiresDataClassPosture (Deny-only, posture
  condition present, egress actions covered); ground.example.yaml shows dbGaP.

Two layers mirror AMI gating (#13): coarse SCP outer gate + fine
dataset-scoped Cedar PDP (attest#100). HONEST SCOPE: the VPC-routing half —
internal/stack/network is still a stub — is a follow-up; this is the policy +
config + metadata surface, not the routing implementation.

Refs: #11, #10
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.

Deploy the nitro-attested IAM trust-policy condition for data-access roles

1 participant