Repository navigation
fcvm-fleet-terraform: gpubox-only allow list instead of AdministratorAccess (#922) - #934
Conversation
…Access; gpuboxes run without secrets (#922) The fleet account holds staging's and, once enabled, production's certificates and tokens. fcvm-arm's dev-server-role may assume fcvm-fleet-terraform there, and that role held AdministratorAccess. An administrator reaches any secret: by reading it, by passing a role that can, or by changing what a role-holding workload runs (a launch template, the AMI pointer, a host through Run Command). gpubox.sh also launched with the fleet's own host profile, which reads the certificate and the agents' Access token. The owner chose image-factory-only AMI builds (2026-11-21), so fcvm-arm needs this account for gpuboxes alone. - fcvm-fleet-account.tf: drop the AdministratorAccess attachment. Add the gpubox-only policy: - describes, the quota read, and GetParameter on the two AMI release parameters, all in us-west-2 and us-east-1; - RunInstances only with Purpose=fcvm-fleet-gpubox; - CreateTags at launch, or on gpubox-tagged instances, and TerminateInstances on gpubox-tagged instances; - SendCommand of AWS-RunShellScript to gpubox-tagged instances; - PassRole of fcvm-fleet-gpubox to EC2 only; - S3 get, put and delete under the asset bucket's gpubox/ prefix (copy staging objects, the admission lock and ledger); - an explicit deny of secretsmanager:*, kms:Decrypt, IAM writes, ssm:PutParameter, ssm:StartSession, launch-template edits and ModifyInstanceAttribute. The G admission deny stays. - New fcvm-fleet-gpubox role and instance profile: SSM managed-instance core and release-artifact reads only, no secret. - AGENTS.md and the account file's header describe the narrowed role. - test-fcvm-fleet-account.py, GpuboxRoleTests: - no AdministratorAccess, and only the two policies on the role; - every allowed Action is on the gpubox list; - instance actions need the gpubox tag; - PassRole only of the gpubox role, and S3 only under gpubox/; - the deny names secrets, IAM writes and what workloads run; - the gpubox role reads no secret. Apply order: this first (it creates the profile), then fcvm's gpubox.sh change, which launches with fcvm-fleet-gpubox. Until fcvm merges, gpubox up is refused, since the old script passes the host role; nothing else is affected. fcvm's build-ami.sh and measure-boot.sh no longer run from fcvm-arm. Tested: test-fcvm-fleet-account.py (17 tests). Six mutations each turn it red: the admin attachment back, a secret read allowed, a launch without the gpubox tag, PassRole of the host role, the whole bucket, and a gpubox role that reads a secret. test-constellation-account, test-fcvm-fleet, test-agents-md and test-tests-quiet pass. terraform 1.10.3 fmt -check and validate (backend-free init) pass.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 38 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@coderabbitai review The code review on a473ae1 has completed. Please check the dev role, instance profile, and isolation of staging and production credentials. |
Action not completed
|
|
Please tighten the new gpubox instance profile before apply. I checked the live AmazonSSMManagedInstanceCore policy version. It grants both ssm:GetParameter and ssm:GetParameters on every parameter. The static test only inspects the inline policy, so it misses those effective permissions. Preserve SSM registration and command delivery while limiting parameter reads to the intended public or release paths. Add a regression check covering the effective permissions and verify authorized and unrelated parameter ARNs through IAM simulation. Please also keep the gpubox ownership tag immutable after launch. The TagAndEndOnlyGpuboxes statement currently restricts which instances can be tagged while allowing any request tag key, including Purpose. Limit post-launch tagging to the keys gpubox actually updates. That keeps fleet discovery and cleanup reliable. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
RED-VERIFIED: Both missing-key paths failed with 403 under the old client. fcvm#1979 fixed both at Cross-check with the running tool and 90-day role inventory found a cold-start regression. fcvm Please preserve these paths in the companion fcvm PR. An exact-key conditional create ( Across all 130,733 fleet-account events from sessions containing “gpubox”, 126,089 succeeded across 17 operations. The 36 KMS CreateGrant and 36 ReEncrypt calls in us-west-2 all came via the EC2 frontend and used the AWS-managed alias/aws/ebs key. I checked its policy: it already allows those actions specifically via regional EC2 for this account. Keep broad KMS rights out and verify the current encrypted AMI boots in the live launch smoke. CloudTrail did not record fleet asset-bucket object operations; the ledger finding comes from the client and documented S3 behavior. |
|
I’m taking the current branch through the remaining review fixes. I’ll restrict effective SSM parameter reads on the gpubox instance role, protect resource classification tags, and fix the Haiku role classification test. The linked fcvm change for missing admission objects is already underway on #1979. I’ll push one fast-forward update to this branch and post the verification results here. |
Limit post-launch tagging to LeaseUntil and scope launch tags to the instance's six gpubox keys. Deny parameter reads outside AWS public parameters and the two us-east-1 release pointers even with SSM ManagedInstanceCore attached. Cover both IAM boundaries and classify gpuboxes as fleet-account workloads in the Haiku test.
|
Fixed the effective gpubox parameter grant, writable classification tags and the CI role inventory in On ARM, 168 tests passed across six suites. Ruff, Terraform formatting, the lockfile-pinned backend-free Terraform validation and diff checks passed. The two new boundary tests failed against the preceding implementation. I also ran 21 AWS IAM simulations against the rendered prospective policies plus AWS's live The missing admission-object behavior is being fixed on the paired fcvm PR, using the existing prefix grant. @codex review |
Action not completed
|
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Verified the deployed role from All 21 live IAM simulation cases passed. Two calls from the restricted ARM caller confirmed AWS denies the former DNS secret and an unrelated production parameter. On the GPU itself, both The operator requested termination of its only test instance, |
Part of #922. fcvm-arm's
dev-server-rolemay assumefcvm-fleet-terraformin the fleet account. That account holds staging's certificates and tokens, and will hold production's. The role hadAdministratorAccess, which reaches any secret in three ways:/fcvm-fleet/ami-release, or a host through Run Command.gpubox.shalso launched with the fleet's ownfcvm-fleet-hostprofile, which reads the certificate and the agents' Access token. The owner chose factory-only AMI builds on 2026-11-21, so fcvm-arm needs this account for gpuboxes alone (#922 comments).Change
fcvm-fleet-account.tf. TheAdministratorAccessattachment is removed, andgpubox-onlyreplaces it. Every allowed call is limited to us-west-2 and us-east-1:GetParameteron/fcvm-fleet/ami-releaseand-copies;RunInstancesonly withaws:RequestTag/Purpose = fcvm-fleet-gpubox, plus the image, subnet, security group, network interface, volume and spot request a launch uses;LeaseUntilon existing gpuboxes;TerminateInstancesandssm:SendCommand(AWS-RunShellScript) on gpubox-tagged instances only;iam:PassRoleoffcvm-fleet-gpubox, to EC2 only;gpubox/prefix, which coverscopy's staging objects (the signed URLs carry this role's permissions) and the admission lock and ledger.An explicit deny backstops the allow list:
secretsmanager:*,kms:Decrypt, IAM writes,ssm:PutParameter,ssm:StartSession, launch-template edits andModifyInstanceAttribute. The G admission deny stays as it is.The new
fcvm-fleet-gpuboxrole and instance profile. They grant SSM managed-instance core and release-artifact reads. An explicit deny limits parameter reads to AWS public service parameters and the two fleet release pointers in us-east-1.AGENTS.md and the account file's header describe the narrowed role.
Apply order
gpubox.shlaunches withfcvm-fleet-gpubox. I merge it as soon as this apply finishes.Between the two steps,
gpubox upis refused because the old script passes the host role. Nothing else is affected. fcvm'sbuild-ami.shandmeasure-boot.shstop working from fcvm-arm, which is the decision.Verification
test-fcvm-fleet-account.pyhas 17 tests. The newGpuboxRoleTestscheck:AdministratorAccessis attached, and only the two policies are;PassRoleis only for the gpubox role, and S3 is only undergpubox/;PassRoleof the host role;test-constellation-account,test-fcvm-fleet,test-agents-mdandtest-tests-quietpass.fmt -checkandvalidate(backend-free init) pass.gpubox.sh up,run,copyanddownfrom fcvm-arm with #1979. Asecretsmanager get-secret-valueonfcvm-fleet/cloudflare-dns-tokenfrom the same session must return AccessDenied.