feat(permissions): add the sandbox permission sets - #395
Conversation
Greptile SummaryThe PR adds least-privilege sandbox permission sets for provisioning, lifecycle management, execution, and heartbeat operations across AWS and Azure.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/alien-permissions/permission-sets/sandbox/provision.jsonc | Adds setup-tier AWS image and Azure sandbox-group provisioning permissions while excluding role-assignment authority. |
| crates/alien-permissions/permission-sets/sandbox/execute.jsonc | Restricts session-content credentials to the explicit execute set and scopes Azure access to one sandbox group. |
| crates/alien-permissions/permission-sets/sandbox/management.jsonc | Adds image-scoped AWS and resource-scoped Azure session lifecycle permissions without session-content access. |
| crates/alien-permissions/permission-sets/sandbox/heartbeat.jsonc | Adds parent metadata reads while excluding account-wide AWS session enumeration and Azure stack scope. |
| crates/alien-permissions/src/generators/azure_runtime.rs | Allows individual Azure permission entries to decline a target while preserving an error when the entire set does not support that target. |
| crates/alien-infra/src/remote_stack_management/azure.rs | Skips permission sets that deliberately provide no Azure stack binding during management-role generation. |
| crates/alien-terraform/src/emitters/azure/helpers.rs | Aligns Terraform stack-role emission with the Azure runtime generator's binding-target behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Setup["Setup identity"] --> Provision["sandbox/provision"]
Runtime["Runtime management identity"] --> Management["sandbox/management"]
Workload["Resource-linked workload"] --> Execute["sandbox/execute"]
HeartbeatIdentity["Heartbeat identity"] --> Heartbeat["sandbox/heartbeat"]
Provision --> Parent["Sandbox image or group"]
Management --> Sessions["Session lifecycle"]
Execute --> Contents["Session commands and files"]
Heartbeat --> Metadata["Parent metadata"]
Reviews (33): Last reviewed commit: "feat(permissions): add the sandbox permi..." | Re-trigger Greptile
b03c4c7 to
454d8f0
Compare
454d8f0 to
e7e0597
Compare
e7e0597 to
53618cb
Compare
53618cb to
20a0772
Compare
20a0772 to
1170ea7
Compare
1170ea7 to
b84c357
Compare
b84c357 to
c129036
Compare
c129036 to
64d14df
Compare
64d14df to
e7785d8
Compare
e7785d8 to
49bfe79
Compare
49bfe79 to
3561d35
Compare
3561d35 to
cf18963
Compare
3f47f93 to
7801481
Compare
7801481 to
47b76f5
Compare
47b76f5 to
3af5cf7
Compare
3af5cf7 to
4a18a68
Compare
4a18a68 to
d9496dc
Compare
d9496dc to
c812f47
Compare
c812f47 to
b180b21
Compare
b180b21 to
1fe705b
Compare
1fe705b to
c694998
Compare
8706810 to
5a9e2fb
Compare
5a9e2fb to
b60343f
Compare
b60343f to
8b3326c
Compare
8b3326c to
c494a33
Compare
|
The
The RG-scope @greptile-apps please re-review. |
Summary
Adds the four cloud permission sets a sandbox needs —
provision,management,executeandheartbeat— so a deployment can build a sandbox image, start and stop sessions, and run code in one, each with only the access that job requires.The sets divide along one line: reaching inside a live session is separate from managing sessions.
provisionbuilds and tears down the image a session launches from, and tags it — that tag is the boundary everything else scopes against.managementstarts, stops and lists sessions. It can end a session it cannot read.executemints the credential that reaches inside a session, and is the only set that does. This is the line the whole split exists to draw.heartbeatcounts sessions and reads image metadata, and nothing else.A resource link hands a workload
execute, so anything a workload should not have has to live outside it.What I did
Each cloud authorizes these operations differently, and the sets follow the platform rather than a house shape:
RunMicrovm,TerminateMicrovm,SuspendMicrovm,ResumeMicrovm,GetMicrovmand the auth-token mint are all scoped to this sandbox's own image ARNs. Three actions (CreateMicrovmImage,ListMicrovmImages,ListMicrovms) are authorized against no resource type at all; creation is bounded by boundary tags in the request instead, and the two list actions are name-only reads.managementtakes the lifecycle four andexecutetakes the role that carries the data plane.Files touched
crates/alien-permissions/permission-sets/sandbox/*.jsonc— the four sets.crates/alien-permissions/src/generators/azure_runtime.rs— one role-id mapping.crates/alien-permissions/tests/*— the invariant and coverage tests below.How I tested
managementfails the test. It passed before the change, which is why the test was extended.cargo test -p alien-permissions— 134 tests.Security review of this diff, since these grants are what a customer's cloud enforces:
management,provisionorheartbeatholder reaching session contents — refused by construction and pinned by test on both clouds; the auth-token mint and the Azure data-plane role appear inexecutealone.CreateMicrovmShellAuthTokenis granted nowhere, and is named in the test constants so adding it has to be deliberate.Nothing turned up.