AWS host phase 3: AWS connections and tiered permission check #80

Merged
jknapp merged 23 commits from feat/aws-connection into main 2026-11-15 04:15:00 +00:00
23 Commits
Author SHA1 Message Date
shadowdaoandClaude Opus 5.5 8ec2cfece6 fix(aws): final review wave (incomplete badge, removable bad connections, partition regions, format chars, store modify, docs)
Secret Scan / scan (push) Successful in 11s
Build App (Preview) / compute-version (pull_request) Successful in 14s
Build App (Preview) / create-release (pull_request) Successful in 10s
Build App (Preview) / build-linux (pull_request) Successful in 11m3s
Build App (Preview) / build-macos (pull_request) Successful in 5m33s
Build App (Preview) / build-windows (pull_request) Successful in 11m27s
Build App (Preview) / prune-previews (pull_request) Successful in 21s
Secret Scan / scan (pull_request) Successful in 11s
Build App (Preview) / test (pull_request) Successful in 7m56s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 18:16:19 -08:00
shadowdaoandClaude Opus 5.5 4694ae60c2 fix(aws): narrow principal inspection to SSO and triple-c roles (R18)
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>
2026-11-14 18:04:28 -08:00
shadowdaoandClaude Opus 5.5 b527c82400 test(aws): live IAM verification of the tier policies; docs
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>
2026-11-14 17:45:42 -08:00
shadowdaoandClaude Opus 5.5 01eab26a48 fix(aws): Hosts UI sso_expired dead end, add retry safety, focus, profile errors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 17:04:26 -08:00
shadowdaoandClaude Opus 5.5 1bf9c1c959 feat(aws): Settings → Hosts with AWS connections and permission check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 17:02:26 -08:00
shadowdaoandClaude Opus 5.5 90b10d48d2 fix(aws): settings import keeps imported host connections
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 16:59:52 -08:00
shadowdaoandClaude Opus 5.5 1df7dfc0a8 fix(aws): host connections cannot be changed through update_settings; harden sso login and add path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 16:57:47 -08:00
shadowdaoandClaude Opus 5.5 1afddc0ba9 feat(aws): Tauri commands for AWS connections and permission checks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 16:54:47 -08:00
shadowdaoandClaude Opus 5.5 c82b63f48a fix(aws): permission summary can't be claimed through errors or probes
check_permissions now returns Result: credential errors from any call,
and non-denied failures resolving the principal, are errors rather than
a report. Other per-check failures (throttling, network) make the row
Unverified with a note, and a noted row blocks its tier. A probed run
never claims EnvironmentAdmin (R15), and the own-principal check whose
denial forced probing is reported Denied.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 16:49:34 -08:00
shadowdaoandClaude Opus 5.5 634d1f5a7e feat(aws): tiered permission check with simulation and probe fallback
check_permissions simulates every check of both tiers against the
caller's resolved principal (bounded to 4 in flight), rendering resources
and literal context values, sending OwnerId and aws:userid as the
caller's user id, and grouping repeated context keys into one StringList
entry. An unsimulatable principal, a denied iam:GetRole or a denied first
simulation falls back to four read-only probes. Results are one row per
action (worst verdict wins).

The trait returns Send futures so the check is Send for Tauri commands.
The module-wide dead_code/unused_imports allow is replaced by allows on
the Task 6 entry points and the re-exports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 16:43:35 -08:00
shadowdaoandClaude Opus 5.5 7fdd5dc277 fix(aws): explicitly deny Secrets Manager encryption with non-environment keys
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>
2026-11-14 16:34:35 -08:00
shadowdaoandClaude Opus 5.5 9d1630eb97 fix(aws): user secrets on the environment key; no component tag from workspace users
- 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>
2026-11-14 16:31:38 -08:00
shadowdaoandClaude Opus 5.5 8e6983cf53 fix(aws): close secret claiming, CFN service-role and boundary-reach gaps
- 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>
2026-11-14 16:25:57 -08:00
shadowdaoandClaude Opus 5.5 02d88cb91d fix(aws): bound admin-created roles, tag-scope admin destruction, tighten workspace policy
- 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>
2026-11-14 16:15:57 -08:00
shadowdaoandClaude Opus 5.5 1c337f9198 feat(aws): shipped tier policies and the permission check table
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>
2026-11-14 16:06:33 -08:00
shadowdaoandClaude Opus 5.5 92b27a8e32 fix(aws): hand-built SdkConfig ignores env/profile endpoints and settings; revoked SSO session is SsoExpired
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:59:31 -08:00
shadowdaoandClaude Opus 5.5 4acc36187e feat(aws): SDK config from a connection, caller identity, principal resolution
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:53:47 -08:00
shadowdaoandClaude Opus 5.5 2dea30f4fb feat(aws): fail-closed overwrite check, name local connections, disclose removals in import preview
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:46:05 -08:00
shadowdaoandClaude Opus 5.5 664697b151 feat(aws): disclose imported AWS connections and keys in the import preview
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:43:41 -08:00
shadowdaoandClaude Opus 5.5 e42261bac8 refactor(aws): one definition of the keychain id rule
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:42:28 -08:00
shadowdaoandClaude Opus 5.5 60dad7b6b6 feat(aws): keyring storage for AWS access keys, carried by settings export
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:40:56 -08:00
shadowdaoandClaude Opus 5.5 e8bbe90327 feat(aws): HostConnection model in app settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:37:49 -08:00
shadowdaoandClaude Opus 5.5 7e2800989f Plan: AWS host phase 3, connection and permission check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:27:15 -08:00