| `policies/workspace-user.json` | The **workspace user** tier, part 1: create, start, stop, connect to and delete **their own** workspaces in an existing environment |
| `policies/workspace-user-tasks.json` | The **workspace user** tier, part 2: register and tag **their own** ECS task definitions, read **their own** secrets, and read Fargate prices for the cost estimate (`workspace-user.json` has no room left) |
| `policies/environment-admin.json` | The **environment admin** tier, part 1: apply and destroy the environment and onboarding modules (`terraform/`) with OpenTofu, and keep their state |
| `policies/environment-admin-network.json` | The **environment admin** tier, part 2: the network those modules create (VPC, subnets, gateways, routes, security groups) |
| `policies/environment-admin-compute.json` | The **environment admin** tier, part 3: per-user EC2 capacity the onboarding module creates (phase 7): capacity providers, launch templates, the launch rules, the instance role passed to EC2, the ECS-optimized AMI parameter |
| `policies/environment-admin-scaling.json` | The **environment admin** tier, part 4: the per-user Auto Scaling groups, instance profiles and the Auto Scaling/ECS service-linked roles |
| `aws_route_table_association` | `ec2:AssociateRouteTable`, `DisassociateRouteTable` (the tagged route table and subnet; untaggable). Never `ReplaceRouteTableAssociation`: it names no subnet when it swaps a VPC's main route table, so it could re-route a VPC that isn't Triple-C's; the modules never change an association's table |
| `aws_eip` | `ec2:AllocateAddress` (request tag), `CreateTags` (at create), `ReleaseAddress` (tagged), `DisassociateAddress` (only the literal `*/*` EC2 names once the NAT gateway holding the association is gone), `Describe*` |
| `aws_efs_mount_target` | `elasticfilesystem:CreateMountTarget`, `ModifyMountTargetSecurityGroups`, `DeleteMountTarget` (the tagged file system; untaggable), and the interface EFS makes with the caller's permissions: `ec2:CreateNetworkInterface`, `ec2:DeleteNetworkInterface` (only with `aws:CalledViaLast = elasticfilesystem.amazonaws.com`, verified live; in the environment's subnets, which in `existing` mode are the user's own) |
| `aws_ecs_cluster` (the user's) | as the environment's cluster, on `cluster/triple-c-<env>--u-<user tag>` (the capacity provider, Auto Scaling group and launch template use the same name) |
| `aws_launch_template` | `ec2:CreateLaunchTemplate` (request tag), `CreateTags` (at create), `CreateLaunchTemplateVersion`, `CreateTags`/`DeleteTags`, `DeleteLaunchTemplate` (tagged), `Describe*`. Never `ModifyLaunchTemplate`: the default version never moves (the module must not set `update_default_version` or `default_version`) |
| `aws_autoscaling_group` | `autoscaling:CreateAutoScalingGroup` (`triple-c-*--u-*`, request tag, `autoscaling:LaunchTemplateVersionSpecified = true`, no `TargetGroupARNs`/`LoadBalancerNames`, `autoscaling:InstanceTypes` supported when present — a template-only create sends none, verified live, so the type is held by the launch check below), `UpdateAutoScalingGroup` (tagged; the same, except that an update which leaves the template alone passes the version check), `SetInstanceProtection`, `CreateOrUpdateTags`/`DeleteTags`, `DeleteAutoScalingGroup` (tagged), `Describe*` (`*`); `iam:CreateServiceLinkedRole` for `autoscaling.amazonaws.com`. Creating a group checks that the caller could launch its template: `ec2:RunInstances` on the tagged launch template; on the instance and its volume only with the component request tag, `ec2:LaunchTemplate` set and (instance) a supported `ec2:InstanceType` (required: a launch whose type IAM doesn't see is denied); on the network interface and subnet with `ec2:LaunchTemplate`; on the security group only the template's own (`ec2:IsLaunchTemplateResource`) component-tagged group; on images only Amazon's, named by the template; `ec2:CreateTags` at `RunInstances`; `iam:PassRole` of the instance role to `ec2.amazonaws.com`. ASG tags are **not** the provider's `default_tags`: the module must set the component tag on the group itself |
| `aws_iam_instance_profile` | `iam:CreateInstanceProfile`, `TagInstanceProfile`, `AddRoleToInstanceProfile` (expected to need `iam:PassRole` of the role too), `GetInstanceProfile`, `ListInstanceProfileTags`, `UntagInstanceProfile`, `RemoveRoleFromInstanceProfile`, `DeleteInstanceProfile` (`instance-profile/triple-c-*`) |
| `data.aws_ssm_parameter` (AMI) | `ssm:GetParameter`/`GetParameters` on the public `parameter/aws/service/ecs/optimized-ami/*` |
| `aws_ssm_parameter` (user record) | as the environment record, on `/triple-c/users/<env>/<owner key>` |
| S3 backend | `s3:ListBucket` (the state bucket), `GetObject`/`PutObject`/`DeleteObject` (`triple-c-tfstate-*/*`, the `.tflock` objects included), in the caller's own account |
The app also creates the state bucket: `s3:CreateBucket` with a `triple-c:component` request tag
(and `s3:TagResource`, which a create with tags also needs, under the same conditions), then `PutBucketVersioning`, `PutEncryptionConfiguration`, `PutBucketPublicAccessBlock`,
| `terraform/environment` | what every user shares: ECS cluster (Fargate, Fargate Spot), the tasks security group (no inbound rules), KMS key and alias, log group `/triple-c/<env>`, the network (`network_mode`: `public`, `private-nat`, `existing`) and, last, the record `/triple-c/environments/<env>` (which carries the advisory `max_workspace_hours` lifetime cap, 0 = none, at most 168) | `environments/<env>/terraform.tfstate` |
| `terraform/user-onboard` | one user's task and execution roles (with the boundary) and their own EFS file system, its `-efs` security group, two mount targets and a file-system policy that admits only their task role. With `ec2_instance_type` set (phase 7) also their own EC2 capacity: cluster `triple-c-<env>--u-<user tag>`, one capacity provider, an Auto Scaling group (min 0), a launch template, the instance role and profile, and the record `/triple-c/users/<env>/<owner key>` | `users/<env>/<owner key>/terraform.tfstate` |
| `${aws:PrincipalArn}` as a Resource | ✗→fixed. IAM refuses it ("must be in ARN format or \"*\""), so neither tier policy could be attached at all. Now SSO permission-set roles, `triple-c-*` roles and `user/${aws:username}`, `user/*/${aws:username}` (see the workspace user's own principal) |
| SSO role path | ✓ `iam:GetRole` returns `role/aws-reserved/sso.amazonaws.com/<region>/AWSReservedSSO_…`, and the check simulates that ARN. The SSO admin session checks as Environment admin, Simulated |
| `${aws:PrincipalAccount}` in `iam:PermissionsBoundary` | ✓ `CreateRole` with `triple-c-permissions-boundary` succeeds as the admin tier; without a boundary, or with another one, it is denied |
| Boundary fences | ✓ removing, replacing or editing the boundary is an explicit deny |
| Simulator and context | ✓ the simulator substitutes `${aws:userid}` and `${aws:username}` from context entries. It **does** apply the simulated principal's own permissions boundary (verified); it does not apply session policies. SCPs: not verifiable here |
| Simulator rate limit | ✗→fixed (app). `SimulatePrincipalPolicy` throttles ("Rate exceeded") within a full check; the check now uses adaptive retries and two requests at a time |
| KMS `CreateKey` with tags | ✓ allowed: tag-on-create passes the tag rule on `kms:TagResource`. Untagged `CreateKey`, and `CreateAlias`/`TagResource`/`ScheduleKeyDeletion` on an untagged key, are denied |
| ECS Exec on the cluster | ✗→fixed. `ecs:ExecuteCommand` is authorized against the cluster, then the task. Added `ExecOnTripleCClusters`; with only the cluster allowed, the call is denied on the task, so the owner rule still decides |
| ECS tag keys | ✓ (service reference) `aws:ResourceTag` is supported on tasks, clusters and task definitions. Live: — needs phase 4/5 ECS resources |
| SSM `StartSession` to a task | ✓ authorized against `arn:aws:ecs:<region>:<account>:task/<cluster>/<task-id>`, which `task/triple-c-*/*` matches. The tag condition on a real task: — needs phase 5 |
| SSO session ownership | ✓ (AWS docs) the `aws:ssmmessages:session-id` tag is the starter's `aws:userid` for users and role sessions alike. Live: — needs a session. Added `ssmmessages:OpenDataChannel` on own sessions, which AWS's current examples require |
| EC2 tag-on-create | ✓ `CreateSecurityGroup` (DryRun) is allowed with a `triple-c:component` tag and denied without one or with only other tags. `security-group-rule` resources on `AuthorizeSecurityGroup*`: — needs a security group |
| EFS | ✗→fixed: `CreateFileSystem` has no resource type, so `Resource` is now `*`. ✓ a tagged `CreateFileSystem`/`CreateAccessPoint` authorizes `elasticfilesystem:TagResource` first. `elasticfilesystem:CreateAction`, `CreateAccessPoint` against the file system's tags, `ClientMount`/`ClientWrite`: — need phase 6 file systems |
| Secrets tag-on-create | ✓ `CreateSecret` with tags authorizes `secretsmanager:TagResource` separately (refused without `TagOwnSecrets`), and that statement's `StringEqualsIfExists`/`Null` conditions pass at create |
| `secretsmanager:KmsKeyId` | ✓ carries the request's value: a key ARN passes, a bare key ID, an alias or no key is refused |
| Secrets Manager's KMS calls | ✓ made as the caller with `kms:ViaService`. ✗→fixed: `CreateSecret`/`PutSecretValue` on a customer key also need `kms:Decrypt`, which the policy lacked ("Access to KMS is not allowed"). `PutSecretValue` on an own secret now passes |
| `aws/secretsmanager` key | ✓ denied, and the Deny is what denies it: the same policy without `NeverEncryptSecretsWithOtherKeys` creates the secret |
| Secret ownership | ✓ another owner's or a component-tagged secret cannot be written, deleted or claimed; `triple-c:component` cannot be set. An untagged `triple-c/*` secret *can* be claimed (invariant 3) |
| `aws:TagKeys` | ✓ for `CreateSecret` and secret `TagResource`. `RunTask` (including `aws:ecs:*` and propagated tags), `CreateAccessPoint`, ECS/EFS tag-on-create: — need phase 4/5/6 resources |
| Boundary and key tags | ✓ a role under the boundary decrypts through Secrets Manager with a component-tagged key and is refused with an untagged customer key, so KMS supplies the key's `aws:ResourceTag` |
| `cloudformation:RoleArn` | ✓ (phase 3) present when `RoleARN` is given; the Deny fired. CloudFormation has since left the policies (phase 4, D8), and the Deny with it |
commands (`ensure_tofu`, `materialize`, `child_env`, the runner, `follow`, `scan`, the refusal
checks, the conditional lock delete); the Tauri commands' own bookkeeping (launch slots, the
progress events) is not exercised.
| Point | Result |
|---|---|
| `s3:CreateBucket` with a request tag and `s3:ResourceAccount` | ✓ both conditions are evaluated and pass for the admin's own account. ✗→fixed: a create with tags also authorizes **`s3:TagResource`**, which the policy lacked (added to `CreateTheStateBucket`, same conditions) |
| `ec2:CreateSecurityGroup` in a VPC | ✗→fixed: denied on the VPC resource, which EC2 does not show the request's tags, so `CreateSecurityGroupsInAnyVpc` lost its request-tag condition. The group itself still needs the tag |
| Tag-on-create (ECS, KMS, Logs, SSM, EFS, EC2, IAM) | ✓ every create passed with the listed actions; none was missing. Not tested one by one whether each is strictly needed |
| EFS mount-target interfaces | ✓ EFS sets `aws:CalledViaLast = elasticfilesystem.amazonaws.com`: both mount targets were created and deleted with `MountTargetInterfacesThroughEfs` as the only grant of `ec2:CreateNetworkInterface`/`DeleteNetworkInterface`. Ruling R9's fallback was not needed |
| EFS file-system policy naming a just-created role | ✓ no invalid-principal error in any onboarding apply (two applies, each created in 4 s, right after the role; whether the provider retried internally is not visible without its debug log); no module change. If it ever fails, applying the onboarding again completes it |
| NAT address on destroy | ✗→fixed: the provider disassociates the address before releasing it, after the NAT gateway (and the association) are gone, and EC2 authorizes that call against the literal `*/*`. `DisassociateGoneAddresses` allows exactly `arn:aws:ec2:*:*:${*}/${*}`; CloudTrail shows the retried call reaching `InvalidAssociationID.NotFound` |
| Conditional unlock | ✓ on the versioned state bucket, `DeleteObject` with `If-Match` and a mismatched ETag gets 412 (the app's "lock changed" answer) and leaves the lock; with the current ETag it deletes it. A fresh foreign lock scans as Deploying with its `Who` |
| After `tofu destroy` | ✗→fixed (app): the state object stays, empty, so a destroyed environment kept scanning as Incomplete (and a removed onboarding as Joined). Detection now reads small state objects (up to 2 KiB, at most 200 per scan) and treats one with no resources as absent; a read that fails counts as a deployment |
and the secret and removes the ECR policy; then the fixture destroys the modules.
| Point | Result |
|---|---|
| `RegisterTaskDefinition` on `task-definition/triple-c-*` | ✓ allowed for the workspace user with the owner request tag and the three keys; the revision carries exactly those tags (`TagResource` with `ecs:CreateAction`) |
| `RunTask`: owner tag on the revision, `iam:PassRole` by `iam:ResourceTag` | ✓ allowed on the user's revision with their own roles; on a revision tagged with another owner, denied |
| `DeregisterTaskDefinition` | ✗→decided (R8): ECS authorizes it against `*` only. `task-definition/triple-c-*`, and `*` with `aws:ResourceTag/triple-c:owner`, are both denied; only an unconditional `*` works (probe). The workspace tier no longer has it (`RetireOwnTaskDefinitions` dropped); removing a project leaves its revisions registered for an admin to clear |
| `DeleteTaskDefinitions` | (probe) resource-level: authorized against the revision's ARN with `aws:ResourceTag` (the owner's tag passes, another owner's is denied), but it only deletes INACTIVE revisions, so without deregistration it is useless to a user. Dropped from the workspace tier with it (R8) |
| `CreateAccessPoint`'s `TagResource` | ✗→fixed: authorized against the **file system**, not the access point (probe: `access-point/*` denied; `file-system/*` allowed; `CreateAction`, `aws:RequestTag` and `aws:TagKeys` all present) |
| Bare `TagResource` on the user's own file system | ✓ denied (no `elasticfilesystem:CreateAction`): `TagOwnAccessPointsAtCreate` tags only at access-point creation |
| `GetSecretValue` | ✓ own secret (an attach reads the token back); another owner's `triple-c/*` secret denied |
| EFS access point with the task role (IAM + TLS) | ✓ mounted at `/mnt/triple-c-home` (`127.0.0.1:/ … nfs4`, the TLS tunnel), `claude:claude 700`; `~/.claude`, `~/.claude.json` and `~/.ssh` link into it |
| Times | first start (register, access point, RunTask, pull of ~1.2 GB, agent, tunnel) 94–104 s; ECS `HEALTHY` 135 s after the start began; attach to a running task 2 s; StopTask to `STOPPED` 42 s; restart 86–92 s |
| Stop guard and WIP push | ✓ `triple-c-wip-push --dry-run` reports the dirty repo; after StopTask the log shows `entrypoint: stopping (sigterm) — pushing work in progress...` and the push failing for lack of GitHub credentials. No push with real credentials was tried |
| Idle stop (5 min) | ✓ with a terminal held open and the auth bridge's background poll running, the task stopped itself 365 s after the last use (`triple-c-idle-watch: idle for 5 minutes`, `entrypoint: stopping (idle) — work in progress already handled by the idle watcher`); ECS reports `EssentialContainerExited` with exit code 75, which the app classifies as an idle stop (re-run 2026-11-15 after the PR #82 fixes) |
| `~/.claude.json` after Claude Code runs | ✓ still a link (Claude Code started without a login: "Not logged in") |
| Bubblewrap (P9) | ✗ `bwrap --unshare-user` fails: "No permissions to create new namespace" (kernel 6.1, `max_user_namespaces` 16384, no `CAP_SYS_ADMIN` on Fargate). The sandbox stays off on AWS |
| A revision per configuration | turning idle stop on adds a secret key, so the next start registers a new revision (by design) |
| Removal (R8) | ✓ final run: `remove_aws_resources` succeeds; the secret is scheduled for deletion, the access point deleted, the revision left ACTIVE. Since R10 the secret is deleted without a recovery window (the test now asserts it is gone) |
### Phase 6: the cost estimate's price reads (2026-11-16)
`cargo test aws::live_tests::a_ -- --ignored --test-threads=1` (the four permission-check tests
plus `a_workspace_role_reads_fargate_prices_and_a_bare_role_cannot`), us-west-2, all passed.
| Point | Result |
|---|---|
| `pricing:GetProducts` on `*` (`ReadFargatePrices`) | ✓ a role holding only the workspace files reads us-west-2's rates from the us-east-1 endpoint (`AmazonECS`; `TERM_MATCH regionCode`, `TERM_MATCH termType=OnDemand`, `CONTAINS usagetype=Fargate`: eight rows, one page). x86 $0.04048/vCPU-h, $0.004445/GB-h; ARM $0.03238, $0.00356; ephemeral storage $0.000111/GB-h |
| Without the permission | ✓ a role with no policy is denied (`AccessDeniedException` naming `pricing:GetProducts`); the app shows "Estimate unavailable" |
| The permission check | ✓ the simulator allows the new check for the workspace tier and denies it for a role with no policy |
Same fixture as phase 5 (`deploy_for_workspace_user`: environment admin deploys, a role holding
only the workspace files is onboarded and drives the app as a profile connection), with the
environment's `max_workspace_hours = 1`. One project, two task starts, 1 vCPU / 2 GiB x86: EFS
storage, one public repo, a setup script, copy-at-connect (a CA file, a git token and a custom
variable — all dummies), a port mapping 127.0.0.1:<free port> → 8099, the gateway sidecar
(OpenAI-compatible backend, one gateway model, a dummy provider key handed in instead of the
keychain via `aws_host::ensure_started_with`), idle stop off, WIP push off. Passed in 600 s,
spend under $0.05.
| Point | Result |
|---|---|
| Environment module v2 + cap | ✓ the record reads `template_version 2`, `max_workspace_hours 1` (as the workspace user); the secret has `TRIPLEC_MAX_LIFETIME_MINUTES=60`, PID 1's environment has it (root exec, that one line grepped), one `triple-c-idle-watch` runs with idle stop off |
| v1 → v2 Update | not exercised: the fixture applies only the embedded modules (unit-tested: an old record shows "Update available") |
| Lifetime cap firing | not exercised live (60 minutes; Task 4's unit tests) |
| Times | cold start (two access points, register, RunTask, pull of both images, agent, tunnel) 115 s; restart 112 s; copy-at-connect push 3 s; gateway `/health/liveliness` 200 at 126 s after the start began |
| EFS `/workspace` | ✓ `127.0.0.1:/ /workspace nfs4` (TLS tunnel); Hello-World cloned onto it; a marker written in task 1 was there in task 2; the clone reported `exists` the second time; both access point ids kept in the store across the restart |
| Hybrid links under EFS | ✓ `~/.claude` and `~/.claude.json` → `/mnt/triple-c-home/…`; `~/.ssh` is a local directory (R6, copy-at-connect) |
| Setup script | ✓ `sudo apt-get install -y jq` (already in the image: "jq is already the newest version"), `jq --version`, marker on `/workspace`; `aws_workspace_status`'s read (`triple-c-workspace-status` through the tunnel) settled with clone `cloned` + setup `ok` (code 0, log tail); same again on the restart |
| Copy-at-connect | ✓ secret keys listed (values never printed): no `TRIPLEC_FILES`, `GIT_TOKEN`, custom variable or `TRIPLE_C_CUSTOM_ENV`, `TRIPLEC_CREDENTIALS` present; neither dummy value anywhere in the secret; after the push `/usr/local/share/ca-certificates/triple-c-e2e-ca.crt` (`subject=CN = triple-c-e2e-ca`) and a git credential helper are set |
| Port mapping | ✓ `python3 -m http.server 8099 --bind 127.0.0.1` (detached exec); `port_forwards::open_for` → `GET /` on the host's loopback port: `HTTP/1.0 200 OK` |
| Gateway sidecar | ✓ from the workspace: `/health/liveliness` 200; `/v1/models` with the master key 200 listing `e2e-model`, without it 401; claude's login shell has `ANTHROPIC_BASE_URL=http://127.0.0.1:4000` and a token; the sidecar's `TRIPLEC_GATEWAY_*` stay in the secret (R1); a new master key each start |
| Keys in the logs | ✓ after a failed `/v1/chat/completions` (dummy key → OpenAI 401) and the successful calls: the provider key, the master key, the git token and the custom value are in **0** lines of the gateway stream (`<prefix>/gateway/<task-id>`, 107 lines) and of the workspace stream. LiteLLM logs the exception and traceback, not request headers; the provider's own error text (also in the HTTP response) carries the key **masked** by OpenAI (`sk-e2e-p…1249`: first 8 and last 4 characters) |
| Cost estimate | ✓ `fetch_rates` as the workspace user + `estimate`: $0.0495/hour for 1 vCPU / 2 GiB / 21 GiB x86, `efs_billed_separately` |
| Removal with discard | ✓ `remove_aws_resources(…, true)` Ok; both access points gone; the secret deleted |
| Cleanup | ✓ nothing `triple-c` left in us-west-2 (the run's environment KMS key pending deletion). The guard's task-definition retirement had never matched anything (ECS's `familyPrefix` is a whole family name); fixed, and 13 revisions earlier runs had left ACTIVE were deregistered and deleted |
Same fixture as phase 5. The account admin applies the current boundary (the account had none,
so it is created and destroyed again). The environment admin role holds all four admin files.
The workspace role carries the role tag `triple-c-user=<tag>`, which an assumed-role session has
as a principal tag. The admin onboards it with `m7i.large`, at most 1 instance, through the app's
own pre-apply step (`prepare_onboarding`: record, choice, name-collision check). The project is
EC2, Hybrid, 1024 CPU units / 4096 MiB reserved, with Docker access, VPN and sandbox mode on, and
no repos. The guard (`ec2_cleanup`, as the account admin) stops the per-user clusters' tasks,
force-deletes their groups (waiting until they are gone), terminates any instance tagged with the
environment, then deletes capacity providers, container instances, clusters (retried while busy),
launch templates, the user record and the instance role and profile. After that the fixture
destroys the modules. `TRIPLEC_E2E_PAUSE_SECS` holds a failed first start for inspection before
the guard runs.
| Point | Result |
|---|---|
| Onboarding with EC2 | ✓ after the `InstanceTypes` fix (the first run's group create was denied, see above). Applied in 93 s: cluster `triple-c-<env>--u-<tag>` ACTIVE with exactly its capacity provider as the default strategy; group min 0, max 1, desired 0, template pinned to version 1, scale-in protection on, tagged with component/environment/owner/version; capacity provider with managed scaling at target 100 and managed termination protection; launch template `m7i.large`, the current ECS-optimized AL2023 AMI, IMDSv2 required, hop limit 1; instance profile holding the instance role; the user record reads `Valid` as the workspace user |
| Collision check | ✓ `DescribeClusters include=TAGS` as the admin tier returns the cluster's `triple-c:owner` tag. A missing name answers `None` for both the cluster (a `failures` entry) and the group. Onboarding another owner with the same `triple-c-user` value is refused: "An ECS cluster named … already belongs to another onboarding" |
| Admin-tier probes | ✓ `$Latest` denied; pinned version allowed and deleted; a `p5.48xlarge` template version created but a group pinned to it denied; a capacity provider over an untagged group denied (see "Phase 7" under Known gaps) |
| **ECS Exec on a cold start** | ✗→fixed (app). ECS turns `enableExecuteCommand`**off** on a RunTask that has to wait for an instance (the task goes PROVISIONING behind the capacity provider). CloudTrail shows `true` in the request and `false` in the answer, and the task keeps it off once placed, so the ExecuteCommandAgent never starts and every cold start timed out ("ECS Exec agent not running yet"). The same RunTask with an instance up and room keeps it `true`, and one that has to wait gets `false` even with an instance up. A cold start now lets that first task bring the instance up. Once the task is placed, the app stops it, waits until it has stopped and runs the task again onto the instance (`rerun_once_placed`). A live task found with ECS Exec off is stopped and replaced |
| Cold start | ✓ 249 s (run 4) and 203 s (run 5) from Start to connected. Run 4: RunTask at +4 s; "Starting an instance" until +186 s (instance launch, ECS registration and placement of the first task, which is then stopped); the second task ready and the tunnel at +248 s |
| Agent tunnel, bridge mode | ✓ the ECS Exec port forward reaches the agent on the container's own loopback (`echo` through the agent as `claude`); the task definition is `bridge`/`EC2` with the `docker-socket` host volume |
| Docker access | ✓ `/var/run/docker.sock` is `root:docker-host 0660`, and `claude` is in `docker-host`; `docker ps` as `claude` lists the workspace and the ECS agent (Docker 25.0.18) |
| VPN | ✓ as root: `ip link add wg0 type wireguard` and `ip tuntap add tun0 mode tun` both work; `/dev/net/tun` is there; `net.ipv4.conf.all.src_valid_mark = 1`; `sudo ip link add … wireguard` works as `claude` |
| E8 bubblewrap | ✗→decided. `bwrap --unshare-user` and `--unshare-all` fail with "No permissions to create new namespace", although the kernel (6.1, AL2023) allows user namespaces (`max_user_namespaces` 30937). Docker's default seccomp profile refuses `unshare` without `CAP_SYS_ADMIN`. The sandbox is kept off on EC2 as on Fargate (`sandbox_allowed`, the Runtime toggle) |
| IMDS / introspection | see "IMDS and Docker access" above: no token (hop limit 1), IMDSv1 401, task-role credentials work, introspection reachable on the bridge gateway (metadata only) |
| Isolation | ✓ `RunTask` on another user's cluster (`triple-c-<env>--u-<other>`, created empty by the admin) as the tagged workspace user is denied, and the app's error is the wrong-triple-c-user one ("This EC2 capacity belongs to a different triple-c-user value than your sign-in's …") |
| Stop | ✓ STOPPED 6 s after `stop_project` |
| Scale-in to zero | ✓ from the group's activity history (run 4). The task STOPPED at 00:55:42Z. At 01:11:08Z managed scaling's low alarm set desired capacity 1 → 0. Scale-in protection first held the instance ("all remaining instances are protected from scale-in"). ECS then removed it from the now-idle instance, which was terminated at 01:11:59–01:12:44Z. That is **about 15.5 minutes to the scale-in decision and 17 minutes until the instance is gone**. The cold start's scale-out is similar: the high alarm fired about 3 minutes after the RunTask, and the instance was running a minute later |
| Second start | ✓ warm, right after stop 1 with the instance still up: 29 s (no instance wait, image cached, ECS Exec on at once). After a scale-in a start is cold again (≈ 3.5–4 min) |
| Removal | ✓ `remove_aws_resources(…, true)` after stop 2: Ok (task, secret, access point) |
| Re-apply without EC2, instance still up | ✓ `prepare_onboarding(…, None)` then the apply as the environment admin, 79 s: "0 added, 0 changed, 9 destroyed". The provider drained the group (the instance was InService, scale-in protected) and deleted it; after the apply no group, no live instance, capacity provider INACTIVE, cluster INACTIVE, launch template gone, instance profile and role gone, the user record Absent (as the workspace user). No denied action |
| Offboard and destroy | ✓ as the environment admin: onboarding destroy (9) and environment destroy (15) with no denied action; the account admin's boundary destroy after |
| Runs and cleanup | Five runs. Run 1: the `InstanceTypes` denial. Run 2: ECS Exec off on the cold start. Run 3: inspection over SSM (Session Manager core attached by hand to the instance role, boundary removed, both undone before the teardown), the ECS Exec diagnosis and the in-task checks. Run 4: everything to the scale-in, which the guard could not finish because the credentials expired. Run 5, `TRIPLEC_E2E_PHASE7_SHORT=1` (life cycle only): passed in 577 s. Run 6 (short, after the review fixes: the rerun's launch through `find_or_run`, exactly one live task after the cold start, `sandbox.enabled = false` in the task's settings): passed in 583 s, with a cold start of 222 s and a warm one of 19 s. Run 7 (short, after the final review's log scoping: no log rights on the instance role, `PutLogEvents` only into `<owner_key>/*` for the task and execution roles): passed in 527 s, cold start 182 s, warm 19 s, and task 1's awslogs stream had its lines (written with the execution role). Every run's guard, or by hand with tofu destroy from the run's work folders once the credentials were renewed, left nothing: the final inventory of us-west-2 has no instance, group, launch template, Triple-C capacity provider, cluster, `triple-c*` role, policy or instance profile, `/triple-c` parameter, log group, ECR repository, file system, secret, task definition, VPC, state bucket or boundary. The environments' KMS keys are pending deletion (7 days). Spend: about 1.5 m7i.large instance-hours plus minutes of EFS and public IPv4, under $0.30 |