Skip to content

Network policy for compute-to-data access — VPC routing to external research endpoints #10

Closed

Description

@scttfrdmn

Problem

The in-place (compute-to-data) access pattern for NIH/AnVIL/Terra requires SRE VPCs to have controlled outbound access to specific external endpoints. ground currently deploys VPC endpoints for AWS services only. It needs to support routing to external research data endpoints conditioned on compliance posture.

Required work

  1. Approved endpoint list in ground.yaml: Declare approved external data endpoints under external_services or a new data_endpoints: section:

    data_endpoints:
      - name: ncbi-dbgap
        url: s3.amazonaws.com
        condition: attest:nih-approval == true
        sre_types: [nih-genomics]
      - name: anvil-terra
        url: storage.googleapis.com
        condition: attest:nih-approval == true
        sre_types: [nih-genomics]
  2. VPC endpoint policy generator: ground deploy generates VPC endpoint policies that include aws:PrincipalTag conditions for the declared endpoints. Researchers without attest:nih-approval=true cannot reach approved NIH S3 prefixes even from inside the SRE.

  3. Network ACL / Security Group rules: For non-AWS endpoints (Terra/GCP), generate Security Group rules allowing outbound HTTPS to specific CIDRs, conditioned on SRE type.

  4. Integration with attest scan: attest scan should verify network policies match the declared data endpoints and approved researchers.

Design constraint

The VPC endpoint policy is the last line of defense — Cedar evaluates the user's approval status, but the network policy ensures even Cedar-bypassed traffic (e.g., direct AWS CLI calls) is blocked for unapproved principals.

Related

  • attest#100 (compute-to-data Cedar policies — this issue provides the network layer)
  • ground#8 (provision-sre — new SREs of type nih-genomics automatically get these policies)

Activity

  1. added
    type:feature
    priority:medium
    on Jun 8, 2026
  2. scttfrdmn commented on Jun 8, 2026

    @scttfrdmn
    ContributorAuthor

    Triage cross-link: network half of the compute-to-data capability. Pairs with attest#100 (Cedar-gated access) and qualify#36 (approval workflow).

  3. scttfrdmn commented on Jun 9, 2026

    @scttfrdmn
    ContributorAuthor

    Dependency (post-kernel roadmap, #11): blocked by attest#100 (the Cedar compute-to-data policy this enforces at the network layer). This is the VPC/network half of the compute-to-data span.

  4. scttfrdmn commented on Jun 11, 2026

    @scttfrdmn
    ContributorAuthor

    Design recorded: ADR 0002 — Compute-to-data access (provabl umbrella).

    This issue is Decision 3 (the network half): extend NetworkConfig with data_endpoints (name, service/FQDN, sre_types, authorized_ous); render (a) VPC routing to the external endpoint and (b) a new coarse policies/data_endpoint_access_scp.json denying egress unless the account carries the right posture tag (reuse attest:data-classes/compliance-tier — no new tag namespace); include declared endpoints in GroundMeta for attest init.

    The SCP is the coarse outer gate (mirrors the nitro_attestation_scp pattern); attest's dataset-scoped Cedar policy (attest#100) is the fine per-request decision — same two-layer model as AMI gating (#13).

    Honest prerequisite flagged in the ADR: internal/stack/network is a stub today — the VPC-routing half can't ship until that template generation is built. The config + SCP surface is mechanical; the network stack is the real work here.

  5. scttfrdmn commented on Jun 12, 2026

    @scttfrdmn
    ContributorAuthor

    Coarse half shipped: #22 (ADR 0002 Decision 3).

    • NetworkConfig.data_endpoints declarations (url, data_class, sre_types, authorized_ous).
    • policies/data_endpoint_access_scp.json: deny in-place data-access actions unless the principal carries an attest:data-classes posture tag (Null check, not StringNotEquals — data-classes is multi-valued).
    • ground export-metadata emits endpoints in ground-meta.json.
    • TestDataEndpointAccessSCPRequiresDataClassPosture.

    Pairs with attest#100 (dataset-scoped Cedar PDP) — coarse SCP + fine Cedar, mirroring AMI gating (#13).

    Remaining for this issue: the VPC-routing half. internal/stack/network is still a stub — ground declares, gates, and exports the endpoints but does not yet render VPC routes/endpoints to reach them. Keeping this issue open for that network-stack implementation.

  6. scttfrdmn commented on Jun 12, 2026

    @scttfrdmn
    ContributorAuthor

    Routing half now designed: ADR 0001 — network foundation.

    ground#22 shipped the policy/config/metadata surface; the VPC-routing half needs ground's network stack (a stub today), so I designed it first. Decisions:

    • hub-and-spoke — shared hub holds centralized org-conditioned interface endpoints; per-tier spoke VPCs; segregated TGW route tables make the ground:tier/attest:data-classes isolation a routing fact.
    • deterministic CIDR carve from NetworkConfig.CIDRBlock (pure, unit-testable, never renumbers).
    • compute-to-data egress per DataEndpoint — S3 gateway endpoint for dbGaP, PrivateLink/peering for AnVIL/Terra, never a public IGW for controlled data. The network path is the third gate beside the SCP + attest's Cedar policy.

    4-step build order (each its own PR): CIDR allocator → single-VPC template → hub-and-spoke+TGW → compute-to-data egress. Steps 1–2 also deliver the long-promised network foundation independently of this issue's routing (step 4). Implementation begins at the CIDR allocator.

  7. scttfrdmn commented on Jun 12, 2026

    @scttfrdmn
    ContributorAuthor

    ADR 0001 step 2 shipped: single-VPC foundation (#25).

    network.Stack.Template() now emits a private-only VPC (no IGW) on the deterministic hub /16, per-AZ /20 private subnets (region-portable via Fn::GetAZs), gateway endpoints for S3/DynamoDB + interface endpoints with an org-conditioned policy (allow same-org aws:PrincipalOrgID vs a deploy-time OrgId param, deny external). Built as a cfn.Template like the other four stacks (native CloudFormation; CDK stays an optional --output cdk export). Template-as-data tested; surfaced in --dry-run.

    Build order remaining: step 3 (hub-and-spoke + segregated Transit Gateway route tables — the tier isolation) → step 4 (compute-to-data egress per DataEndpoint — this issue's routing). Also pending: wiring the network stack into the live numbered deploy phases (dry-run only today).

  8. scttfrdmn commented on Jun 13, 2026

    @scttfrdmn
    ContributorAuthor

    ADR 0001 step 3 shipped: hub-and-spoke + segregated Transit Gateway (#26).

    Template() now builds a shared hub VPC (centralized endpoints), one private spoke VPC per org.workload_ous tier, and a TGW with segregated per-tier route tables — each spoke routes to the hub but not to sibling spokes, so tier isolation is a routing fact. TGW default association/propagation disabled so new attachments can't silently join a shared table. Single-VPC path (step 2) is the unchanged degrade. Tested incl. the no-cross-spoke-route invariant; verified via --dry-run.

    Remaining for this issue: step 4 — compute-to-data egress per DataEndpoint (S3 gateway endpoint for dbGaP, PrivateLink/peering for AnVIL/Terra, never a public IGW). The topology it rides on now exists.

  9. scttfrdmn commented on Jun 13, 2026

    @scttfrdmn
    ContributorAuthor

    Fully implemented — ADR 0001 step 4 shipped (#27).

    The compute-to-data egress lands: per network.data_endpoints, the hub-and-spoke template renders a hub-side scoped egress path inferred from the URL — S3 host → S3 gateway endpoint (reusing the foundation one), com.amazonaws.* → interface endpoint, public host → no route (declaration-only; never a public IGW for controlled data).

    The three-layer compute-to-data gate is complete: SCP (data_endpoint_access_scp) + attest dataset-scoped Cedar (attest#100) + this network egress path. The network foundation (ADR 0001) is also fully built: CIDR allocator → single-VPC → hub-and-spoke+TGW → egress.

    One unrelated follow-up remains (tracked separately, not this issue): wiring the network stack into the live numbered deploy phases — it's --dry-run-visible today. Closing ground#10 as done.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumtype:feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions