Interrupted-start notice gets its own toast topic and headline; the launch-type switch note only shows after a successful save and is dropped by later saves; README states the CreateLogStream scoping limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The instance role (reachable from a Docker-access project's host-network
container) could PutLogEvents into any user's streams. It now has no log
rights: awslogs writes with the execution role
(ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE=true). The task and execution
roles create streams in the environment's group but write only into
log-stream:<owner_key>/* (every awslogs stream's prefix); the Fargate
fingerprint moves deliberately. The live test asserts task logs are
written. README: per-user logs, orphan clock skew, verdict wording;
boundary version comments no longer mention Session Manager.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spec: phase 7 done, rulings (E1-E11 as built, R1-R4, cold-start rerun),
data model, feature table. CLAUDE.md: EC2 rules and the docker-socket
step; sandbox is off on all AWS. aws/README.md: triple-c-user admin
setup and caveats, measured sizes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The guard paginates Auto Scaling groups and treats a failed read as not
yet gone; the test asserts exactly one live task after a cold start,
the sandbox off in the task's settings and bwrap failing (E8). README:
updating a group to an unsupported template version is denied by the
launch check (live probe); run 6 after the review fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a_phase7_ec2_workspace_round_trips: onboarding with per-user EC2
capacity through prepare_onboarding (tagged workspace role, all four
admin files), its collision check and refusal, admin-tier scaling
probes, a cold and a warm EC2 start (Docker access, VPN, ECS Exec into
the bridge task), in-container checks (docker ps, wg/tun,
src_valid_mark, bwrap, IMDS, introspection), RunTask on another user's
cluster, stop and scale-in, removal, re-apply without EC2 with an
instance up, offboard and destroy. The guard (ec2_cleanup) force-deletes
any per-user EC2 capacity. Results in aws/README.md and the spec.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A CreateAutoScalingGroup that names only a launch template sends no
autoscaling:InstanceTypes (verified live), so the scaling file's
Null:false on it denied every per-user group. Drop it; the type is held
by the caller's own ec2:RunInstances launch check on the template, which
also refuses MixedInstancesPolicy overrides of unsupported types.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Self-onboarding and the onboarding bundle take an EC2 capacity choice:
none, or an instance type from the app's table (grouped x86/ARM, default
m7i.large), 1-4 instances and the user's triple-c-user value. A re-apply
keeps the recorded capacity unless changed (the record gains
max_instances). Before any self-onboarding apply with EC2 the app refuses
per-user names (ACTIVE cluster or Auto Scaling group) that this owner's
record doesn't name (R3). OnboardingState carries the user's compute from
their record; the panel shows it. The bundle README's collision check now
comes before the apply step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task 3 fix round 1 (rulings R2, R3):
- Onboarding admin bundles' README gains an "EC2 capacity" step: before
applying with ec2_instance_type, check with describe-clusters /
describe-auto-scaling-groups that triple-c-<env>--u-<tag> is unused
unless this owner's /triple-c/users/<env>/<owner key> record names it
(exact names; <tag> when the bundle has none). Tested.
- User data for bridge tasks (R2): ECS_ENABLE_TASK_IAM_ROLE=true instead
of ECS_AWSVPC_BLOCK_IMDS; IMDSv2 hop limit 1 kept, comment corrected;
the test asserts no ECS_ENABLE_TASK_ENI / awsvpc settings.
- Reverted unrelated rustfmt churn in tofu_modules/tests.rs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 7 Task 3 (E1-E4, E11; onboarding module version 2):
- ec2.tf: with ec2_instance_type set, the user's own cluster
triple-c-<env>--u-<ec2_user_tag> with exactly one capacity provider
(managed termination protection, managed scaling 100% one instance at
a time, 60 s warm-up), an Auto Scaling group of 0..ec2_max_instances
(desired left to ECS, protect_from_scale_in, force_delete off so the
provider drains before deleting, fixed launch-template version, default
tags + AmazonECSManaged), a launch template on the ECS-optimized AL2023
AMI by architecture (IMDSv2 hop 1, 50 GiB gp3 encrypted root, the
environment's tasks group, public IP as the environment's tasks get
one, ECS_CLUSTER + ECS_AWSVPC_BLOCK_IMDS), the instance role
triple-c-<env>-<owner key>-instance (bounded, tagged triple-c:cluster,
ECS agent on its cluster only, ECR pull, logs; no SSM core) and its
instance profile, and the user record /triple-c/users/<env>/<owner key>.
Empty type (the default): count 0 everywhere, Fargate plan unchanged.
- Variables ec2_instance_type (the app's 30 types), ec2_max_instances
(1-4), ec2_user_tag (as validate_ec2_user_tag, required with a type);
onboarding_vars takes Option<&Ec2Compute> and validates the same.
- The environment record's assign_public_ip is now format-checked.
- tofu_modules.rs: ONBOARD_MODULE_VERSION 2, user_record_parameter_name,
USER_RECORD_FIELDS, Ec2Compute, EC2_MAX_INSTANCES, ec2.tf embedded.
- Tests: EC2 calls merged into MODULE_CALLS under real types
(all_module_calls removed); gating + version-1 resource fingerprint;
launch template, group, capacity provider, instance role, AMI by arch,
record fields, names, variable rules; the instance role inside the
boundary with its cluster principal tag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix round 2 for the phase 7 policies (amends plan E1):
- Per-user EC2 names: triple-c-<env>--u-<user tag> for the cluster,
capacity provider, Auto Scaling group and launch template
(user_ec2_stem, validate_ec2_user_tag; `--` can't occur in environment
names or user tags, so the patterns are unambiguous); the instance
role/profile stay owner-key named (user_instance_role_name, <= 64).
- workspace-user-tasks.json: RunTask/StartTask on a triple-c-*--u-*
cluster is denied unless it is the caller's own
(${aws:PrincipalTag/triple-c-user}), and denied without the tag.
- Admin: capacity providers and groups narrowed to triple-c-*--u-*; the
boundary's agent cluster tag must match triple-c-*--u-*.
- Instance-type fail-open closed: ec2:InstanceType required (StringEquals,
volumes in their own statement); group create requires
autoscaling:InstanceTypes present.
- The compute file is split: environment-admin-scaling.json (groups,
instance profiles, service-linked roles) is the admin tier's fourth file.
- Evaluator learns ArnNotLike. README: triple-c-user setup, sizes,
still-open probes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fix round 1 for the phase 7 admin compute file and boundary:
- Auto Scaling groups: create needs autoscaling:LaunchTemplateVersionSpecified
(update BoolIfExists), no target groups / load balancers, supported
instance types; CreateOrUpdateTags only on already-tagged groups.
ModifyLaunchTemplate dropped (the default version never moves).
- RunInstances: instance and volume need the component request tag,
the instance a supported type (the app's ec2_instance_spec table,
pinned by a test); the security group must be the template's own and
component-tagged, the image Amazon's and the template's.
- Boundary: the ECS agent only on the cluster its role's
triple-c:cluster principal tag names (must be triple-c-*); Session
Manager / ec2messages dropped (plan E4 amended).
- Evaluator learns Bool/BoolIfExists; the simulator sends the Boolean
keys typed Boolean.
- README: instance types, pinning, -instance suffix is not an admin
fence, RunInstances wording, still-open probes, IMDS/Docker note.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 7 Task 2 (E4, E5, E11):
- New third admin file environment-admin-compute.json (3,705 chars):
capacity providers (triple-c-*), component-tagged launch templates,
triple-c-* Auto Scaling groups (request tag to create, resource tag to
change/protect/delete), RunInstances only from a tagged launch template
with Amazon images, tags only at create, instance profiles (triple-c-*),
PassRole of triple-c-*-instance roles to ec2.amazonaws.com only,
service-linked roles for Auto Scaling and ECS only, the public
ECS-optimized AMI parameter, autoscaling/capacity-provider reads.
- Boundary v2 (2,625 chars): the ECS agent's calls on triple-c-* clusters
and container instances, TagResource only at RegisterContainerInstance,
DiscoverPollEndpoint and Session Manager core. BOUNDARY_MODULE_VERSION=2
with a template_version local and default tag, pinned by a test.
- Checks for every new action; tests for tag/name scoping, launch-only-
through-templates, PassRole to EC2 only for instance roles, the
workspace tier changing no compute, the boundary's agent fence.
- EC2_COMPUTE_CALLS in tofu_modules/tests.rs: the onboarding module's
expected calls, evaluated against the admin tier and in the write drift
test until Task 3 moves them into MODULE_CALLS.
- README: third file, sizes, boundary re-apply, resource table rows,
scoping notes and "still open" points for the live run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a_phase6_workspace_round_trips: one environment (max_workspace_hours 1)
and one project with EFS storage, a setup script, copy-at-connect with a
CA file, a port mapping and the gateway sidecar, two task starts, then
removal with discard. Passed live in us-west-2 (results in aws/README.md
and the spec). The phase-5 setup moves into deploy_for_workspace_user;
aws_host::ensure_started_with takes the sidecar's provider key from the
caller (the live tests have no keychain). scripts/aws-e2e-workspace.sh
runs TRIPLEC_E2E_TEST when set. The guard's task-definition retirement
listed nothing (ECS familyPrefix is a whole family name); it now filters
the full list by prefix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Q5: aws/pricing.rs reads on-demand Fargate rates (x86 and ARM vCPU-hours,
GB-hours, ephemeral storage GB-hours) from the Price List API in us-east-1
(AmazonECS; regionCode, termType=OnDemand, usagetype CONTAINS Fargate),
caches them per region for 24 h under <data_dir>/triple-c/aws-pricing/,
and estimates a config's hourly cost (ephemeral storage billed above
20 GiB; the gateway sidecar adds nothing). aws_cost_estimate(connection_id,
region, config) never errors: denied, offline or slow (8 s) is None,
shown as "Estimate unavailable"; a failed region is not re-asked for
5 minutes and a stale cache still answers.
pricing:GetProducts on * joins workspace-user-tasks.json with its check,
a policy test, the README and a live test (passed). HostSection shows the
estimate while configuring, Overview while running, with the Spot and EFS
notes. Fixture: a recorded us-west-2 GetProducts answer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It unsets every caller AWS_* variable (keeping only where the profile's
files are, now documented), sets AWS_PROFILE explicitly, attempts the ECR
delete in the EXIT trap unconditionally (RepositoryNotFound tolerated,
bounded at 120 s), and exits 130/143 on INT/TERM (M21).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removing a project's AWS resources now deletes its secret with
ForceDeleteWithoutRecovery (R10) so the next start can create it again,
and the EFS option is renamed: it removes the access point, while the
files stay on the user's own file system until offboarding (R9).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 1 of Task 9:
- the phase-5 body runs under a 45-minute timeout and each exec under
180 s, so a hang becomes a panic the guard catches; the body future is
boxed (moved into the timeout it overflowed the test thread's stack,
which aborts without any guard);
- scripts/aws-e2e-workspace.sh builds and pushes the image to a throwaway
ECR repository, runs the test and deletes the repository in an exit
trap; the test's guard deletes it too (TRIPLEC_E2E_ECR_REPO);
- the guard survives a poisoned lock, closes the tunnel and restores
AWS_CONFIG_FILE;
- new live probe: a bare elasticfilesystem:TagResource on the user's own
file system is denied; README records it and the final run (R8 removal
end state), and the admin command uses xargs -r.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruling R8. ECS authorizes ecs:DeregisterTaskDefinition against * only,
with no tag condition (verified live), so the workspace tier's
RetireOwnTaskDefinitions could never match, and allowing it on * would
let any user deregister any revision in the account. DeleteTaskDefinitions
is resource-level but deletes only INACTIVE revisions, so it goes too.
Removing an AWS project now stops the task, schedules the secret and
(with discard) deletes the access point, and leaves the task definition
revisions registered, saying so in the log: they hold no secret values,
cost nothing, and RunOwnTasks still needs the owner tag. aws/README.md
tells admins how to deregister them. The policy statement, its checks and
owner-scoped rows, the RuntimeApi methods, the fakes, the removal UI copy
and the live test's final assertion follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aws::live_tests::environment::a_fargate_workspace_round_trips (ignored):
a public environment deployed by the environment admin, a role holding
only the workspace-user files onboarded to it and driving ProjectHost::Aws
through a profile connection: start (Hybrid, 1 vCPU / 2 GB, one public
repo), exec, background clone, ~/.claude persistence across stop/start,
attach without a second RunTask, the stop guard's dry run, the SIGTERM
WIP path, idle stop at 5 minutes, bubblewrap, denials on another owner's
revision and secret, and project removal. TRIPLEC_E2E_IMAGE names the
image; a private ECR image gets a test-only pull policy on the exec role.
A guard stops tasks, retires revisions, deletes access points and the
secret before the fixture destroys the modules.
aws/README.md gains the phase 5 results; the spec's To verify items are
answered. Open: DeregisterTaskDefinition is authorized against * only,
so the workspace tier cannot retire revisions (the test's last assertion
fails until that is decided).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EFS authorizes the elasticfilesystem:TagResource that a tagged
CreateAccessPoint needs against the parent file system's ARN, not the new
access point's: a workspace user's first Hybrid start was denied
("not authorized to perform: elasticfilesystem:TagResource on the
specified resource"). Verified live with a probe role: access-point/*
is denied; file-system/* is allowed, as is * with each of
elasticfilesystem:CreateAction, aws:RequestTag and aws:TagKeys.
TagOwnAccessPointsAtCreate now names file-system/* with the same
conditions (CreateAction = CreateAccessPoint, owner request tag, the
three tag keys); its check and owner-scoped test follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Critical
- Owner key is sha256("<region>:<aws:userid>") (12 hex): IAM role names are
account-global and environments regional, so the same user and env name
in two regions no longer collide. Every caller, the onboarding module's
owner_key validation, docs and a two-region test.
Important
- A failed onboarding is Incomplete, not Joined: Joined needs the task role
and, where the bucket is readable, the state's new onboarding_complete
output (depends_on every resource); a failed or errored local run or a
stale lock is Incomplete. Join stays as the retry; Follow, Unlock (own
key only, stale, conditional delete) and Push saved state work on the
caller's own onboarding.
- errored.tfstate: the runner logs an Error line naming it, follow's
summary says so, materialize refuses while it exists, and the new
push_aws_saved_state command runs `tofu state push errored.tfstate`
through the same runner (file set aside once pushed); UI on the row.
- Bundle README: the bucket is created with the component tag in
--create-bucket-configuration (the policy's RequestTag condition), plus
the TLS-only bucket policy; the boundary bundle names an account admin
WITHOUT the environment-admin files.
- Destroy-incomplete refuses while any users/<env>/ state remains.
- existing network: data.aws_subnet lookups and a precondition (same VPC,
different AZs) on the task security group.
Minor
- The TLS statement is added to an existing bucket policy, never put over it.
- Deploy progress is emitted to the main window only.
- materialize checks and writes under start.lock.
- UI: managed-elsewhere label and explanation, Incomplete explained,
Repair/Destroy disabled under a held lock ("Unlock first").
- Cargo.toml libc comment; README: Cancel unavailable on Windows, session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Live tests never delete a boundary or bucket they did not create: the
boundary goes only through its module's destroy (no direct-delete
fallback), ownership is taken only on NoSuchEntity, and the bucket is
deleted only if this run created it.
- Detection reads at most 200 state objects of up to 2 KiB to find empty
ones, and a failed read keeps the entry instead of failing the scan.
- Docs: DisassociateAddress on a live association is expected-denied, not
verified (probe listed); the e2e admin role carries no boundary, and
why; the spec's tenancy text follows D2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- s3:TagResource with s3:CreateBucket: a create with tags authorizes it
(same request-tag and in-account conditions).
- ec2:CreateSecurityGroup on the VPC: EC2 shows the VPC no request tags,
so that side is unconditioned; the group itself still needs the tag.
- ec2:DisassociateAddress on the literal */* only (${*}/${*}): destroying
the NAT gateway's address disassociates it after the association is
gone. The evaluator learns ${*}.
Checks, MODULE_CALLS and aws/README.md (including the Environments
section and the phase-4 live results) change with them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
InspectOwnPrincipal allowed iam:GetRole and iam:SimulatePrincipalPolicy on
role/*, letting any workspace user enumerate and simulate every role. IAM
refuses ${aws:PrincipalArn} as a Resource and has no role-name variable, so
the role part is now SSO permission-set roles
(role/aws-reserved/sso.amazonaws.com/*) and triple-c-* roles; IAM users stay
limited to themselves. Callers on other roles are probed and reported
Insufficient; the README says how an admin can add their sign-in roles.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Real IAM contradicted the policies in five places, now fixed:
- IAM refuses ${aws:PrincipalArn} as a Resource, so neither tier policy
could be attached. Self-inspection is user/${aws:username} for IAM users
and role/* for role sessions (no role-name variable exists).
- ecs:ExecuteCommand is authorized against the cluster as well as the task;
added an unconditioned cluster statement (the owner rule stays on the task).
- Secrets Manager needs kms:Decrypt with GenerateDataKey on a customer key.
- elasticfilesystem:CreateFileSystem has no resource type (Resource "*").
- ssmmessages:OpenDataChannel on the caller's own sessions (AWS docs).
The permission check now uses adaptive retries for IAM (SimulatePrincipalPolicy
throttled a full check), and the UI no longer says the simulator ignores
permission boundaries (it applies the principal's own; verified).
aws::live_tests (ignored, env-gated) repeats the verification with throwaway
triple-c-e2e-* roles, secrets and keys. New drift tests: every Resource is an
ARN or *, and every policy fits a 6,144-character managed policy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The AWS-managed aws/secretsmanager key (or a customer key whose key policy
grants account principals) needs no identity-policy Allow, so the tagged-key
Allow alone did not keep user secrets on environment keys. An explicit Deny
on kms:Encrypt / kms:GenerateDataKey* via secretsmanager when the key lacks
triple-c:component does. README claim corrected; verify-live entry added.
Check.context doc now states the StringList rule as a requirement on the
simulation builder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CreateOwnSecrets requires secretsmanager:KmsKeyId to be a key ARN, and a
workspace user's kms:Encrypt/GenerateDataKey (via Secrets Manager) only
works on component-tagged keys, so secrets can't land on the default
aws/secretsmanager key that the boundary can't decrypt.
- Every workspace statement that sets the owner tag limits aws:TagKeys to
triple-c:owner/project/environment (ForAllValues:StringEquals), so a user
can never set triple-c:component.
- Evaluator: multi-valued context keys and ForAllValues (vacuous when
absent); Check documents repeated keys as one StringList entry.
- README: environment-key invariant and new verify-live entries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- workspace-user: TagOwnSecrets refuses component-tagged secrets, plus an
explicit Deny on Tag/Untag/Put/Delete of component-tagged secrets;
CreateAccessPoint only on the component-tagged file system.
- environment-admin: Deny PutRolePermissionsBoundary on triple-c-* roles to
anything but the triple-c boundary; Deny Create/UpdateStack and
CreateChangeSet on triple-c-* stacks with a service role.
- permissions boundary: kms:Decrypt and EFS client access only on
component-tagged keys and file systems; ClientRootAccess dropped (access
points fix the POSIX user).
- README: invariants for phase 4 templates, the actions that are on *, the
phase-6 access-point root note, and the list to verify live.
- Tests: negated operators in the evaluator, both tiers evaluated together,
secret claiming, service-role and boundary-reach cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Ship aws/policies/permissions-boundary.json (triple-c-permissions-boundary):
the most any Triple-C role may hold, nothing in IAM.
- environment-admin: role writes require iam:PermissionsBoundary = the
boundary; explicit Denies keep the boundary on roles and the boundary
policy unchanged. Security groups, EFS file systems and KMS keys need
triple-c:component on create and to be modified or destroyed; tagging only
at create or on already-tagged resources.
- workspace-user: RunTask needs an owner-tagged task definition; EFS access
points create/delete by owner tag.
- Both tiers: iam:GetRole and iam:SimulatePrincipalPolicy on the caller's own
${aws:PrincipalArn} only, so SSO callers can be simulated.
- Checks carry the matching context; render() gains {principal}. The test
evaluator resolves policy variables and applies explicit Denies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aws/policies/{workspace-user,environment-admin}.json are the IAM policies
for the two tiers; aws::policies embeds them and holds one representative
simulator check per action. Tests keep table and JSON in lock-step and run
each check through a small IAM-style evaluator, including the isolation
rule: owner-scoped actions are denied for someone else's resource.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>