@empire-builder-kit/nx 1.0.0-rc.37 → 1.0.0-rc.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/executors.json +5 -0
- package/generators.json +10 -0
- package/package.json +20 -3
- package/src/aws-authority/index.d.ts +1 -0
- package/src/aws-authority/index.js +1 -0
- package/src/aws-authority/lambda-policy-ordering.d.ts +38 -0
- package/src/aws-authority/lambda-policy-ordering.js +56 -0
- package/src/aws-authority/stage-authority.d.ts +11 -3
- package/src/aws-authority/stage-authority.js +615 -29
- package/src/blueprints/external-sandbox.js +21 -9
- package/src/blueprints/manifest.d.ts +1 -1
- package/src/blueprints/resolver.js +28 -15
- package/src/cli/bootstrap.d.ts +1 -1
- package/src/cli/deploy-runtime.d.ts +6 -0
- package/src/cli/deploy-runtime.js +58 -0
- package/src/cli/dev-command.d.ts +16 -4
- package/src/cli/dev-command.js +63 -0
- package/src/cli/main.d.ts +7 -1
- package/src/cli/main.js +128 -20
- package/src/cli/output.d.ts +1 -1
- package/src/developer-agent/context.js +41 -9
- package/src/developer-agent/generator-planning.js +16 -2
- package/src/developer-agent/git-inspection.d.ts +6 -2
- package/src/developer-agent/git-inspection.js +78 -6
- package/src/developer-agent/model.d.ts +4 -2
- package/src/developer-agent/operation-registry.d.ts +5 -0
- package/src/developer-agent/operation-registry.js +179 -23
- package/src/developer-agent/preview-changes.d.ts +2 -0
- package/src/developer-agent/preview-changes.js +14 -2
- package/src/developer-agent/preview-source.js +3 -0
- package/src/developer-agent/validation.js +20 -8
- package/src/developer-agent/workspace-inspection.js +37 -3
- package/src/executors/deployment-plan/deployment-plan.d.ts +2 -0
- package/src/executors/deployment-plan/deployment-plan.js +51 -4
- package/src/executors/dev-doctor/dev-doctor.js +13 -6
- package/src/executors/dev-task-cleanup/dev-task-cleanup.d.ts +23 -0
- package/src/executors/dev-task-cleanup/dev-task-cleanup.js +145 -0
- package/src/executors/dev-task-cleanup/schema.json +9 -0
- package/src/executors/dev-task-cleanup/task-stack-absence.d.ts +27 -0
- package/src/executors/dev-task-cleanup/task-stack-absence.js +281 -0
- package/src/executors/dev-task-cleanup/task-stack-checkpoint.d.ts +12 -0
- package/src/executors/dev-task-cleanup/task-stack-checkpoint.js +92 -0
- package/src/executors/fleet/fleet.js +1 -1
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js +28 -1
- package/src/executors/local-deploy/local-deploy.d.ts +8 -1
- package/src/executors/local-deploy/local-deploy.js +97 -24
- package/src/executors/local-deploy/schema.json +8 -0
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js +30 -18
- package/src/executors/sst-lifecycle/governed-native-operation.d.ts +2 -0
- package/src/executors/sst-lifecycle/governed-native-operation.js +9 -0
- package/src/executors/sst-lifecycle/run-sst-command.d.ts +5 -0
- package/src/executors/sst-lifecycle/run-sst-command.js +220 -32
- package/src/executors/sst-lifecycle/sst-environment-source.d.ts +8 -0
- package/src/executors/sst-lifecycle/sst-environment-source.js +54 -0
- package/src/executors/sst-lifecycle/task-unlock.d.ts +15 -0
- package/src/executors/sst-lifecycle/task-unlock.js +126 -0
- package/src/foundation/capability-plan.d.ts +43 -0
- package/src/foundation/capability-plan.js +168 -0
- package/src/foundation/discovery.d.ts +14 -11
- package/src/foundation/discovery.js +32 -6
- package/src/foundation/index.d.ts +1 -0
- package/src/foundation/index.js +1 -0
- package/src/foundation/local-database-contract.d.ts +20 -0
- package/src/foundation/local-database-contract.js +262 -13
- package/src/foundation/local-private-smoke-access.d.ts +20 -0
- package/src/foundation/local-private-smoke-access.js +197 -0
- package/src/foundation/preflight.js +37 -18
- package/src/foundation/private-smoke-access.js +10 -2
- package/src/foundation/private-smoke-admission.d.ts +3 -1
- package/src/foundation/private-smoke-admission.js +29 -8
- package/src/foundation/private-smoke-control-plane.js +17 -6
- package/src/foundation/provision-database-bindings.d.ts +5 -0
- package/src/foundation/provision-database-bindings.js +41 -8
- package/src/foundation/provision-logical-database.js +13 -8
- package/src/foundation/requirements.d.ts +3 -3
- package/src/foundation/requirements.js +24 -12
- package/src/foundation/router-waf.d.ts +1 -0
- package/src/foundation/router-waf.js +14 -1
- package/src/generators/blueprint/blueprint.d.ts +5 -0
- package/src/generators/blueprint/blueprint.js +102 -0
- package/src/generators/blueprint/files.d.ts +6 -0
- package/src/generators/blueprint/files.js +217 -0
- package/src/generators/blueprint/schema.d.ts +4 -0
- package/src/generators/blueprint/schema.json +18 -0
- package/src/generators/formatting.js +24 -1
- package/src/generators/logging-registry.d.ts +2 -0
- package/src/generators/logging-registry.js +22 -0
- package/src/generators/preset/workspace-files-adopter-skills.d.ts +7 -0
- package/src/generators/preset/workspace-files-adopter-skills.js +301 -0
- package/src/generators/preset/workspace-files-ci-install.d.ts +2 -0
- package/src/generators/preset/workspace-files-ci-install.js +196 -0
- package/src/generators/preset/workspace-files-developer-agent.js +40 -13
- package/src/generators/preset/workspace-files-performance-load.js +8 -0
- package/src/generators/preset/workspace-files-stage-authority.js +40 -1
- package/src/generators/preset/workspace-files-thin-deploy.js +66 -34
- package/src/generators/preset/workspace-files-thin-docs.js +64 -18
- package/src/generators/preset/workspace-files.d.ts +4 -0
- package/src/generators/preset/workspace-files.js +159 -91
- package/src/generators/repository-policy/repository-policy.js +37 -0
- package/src/generators/slice/built-in-plan-api-contract-files.js +42 -7
- package/src/generators/slice/built-in-plan-api-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-api-files.js +47 -389
- package/src/generators/slice/built-in-plan-async-work-files.js +19 -1912
- package/src/generators/slice/built-in-plan-authorization-files.js +92 -329
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +36 -2
- package/src/generators/slice/built-in-plan-authorization-storage.d.ts +3 -0
- package/src/generators/slice/built-in-plan-authorization-storage.js +119 -0
- package/src/generators/slice/built-in-plan-background-work-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-background-work-files.js +15 -5
- package/src/generators/slice/built-in-plan-data-deletion-files.js +2 -830
- package/src/generators/slice/built-in-plan-data-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-data-files.js +61 -1164
- package/src/generators/slice/built-in-plan-data-lifecycle-files.js +53 -28
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +18 -2
- package/src/generators/slice/built-in-plan-data-retention-job-files.js +7 -2446
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +30 -6
- package/src/generators/slice/built-in-plan-data-rights-files.js +6 -4482
- package/src/generators/slice/built-in-plan-database-lifecycle-files.js +4 -15
- package/src/generators/slice/built-in-plan-foundation-files.d.ts +2 -1
- package/src/generators/slice/built-in-plan-foundation-files.js +34 -10
- package/src/generators/slice/built-in-plan-frontend-files.js +2 -2
- package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-infrastructure-files.js +180 -522
- package/src/generators/slice/built-in-plan-key-value-cleanup.d.ts +4 -0
- package/src/generators/slice/built-in-plan-key-value-cleanup.js +100 -0
- package/src/generators/slice/built-in-plan-key-value-consumer.d.ts +4 -0
- package/src/generators/slice/built-in-plan-key-value-consumer.js +151 -0
- package/src/generators/slice/built-in-plan-key-value-deletion.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-deletion.js +377 -0
- package/src/generators/slice/built-in-plan-key-value-delivery.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-delivery.js +120 -0
- package/src/generators/slice/built-in-plan-key-value-export.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-export.js +595 -0
- package/src/generators/slice/built-in-plan-key-value-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-files.js +31 -0
- package/src/generators/slice/built-in-plan-key-value-holds.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-holds.js +189 -0
- package/src/generators/slice/built-in-plan-key-value-infrastructure.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-infrastructure.js +102 -0
- package/src/generators/slice/built-in-plan-key-value-performance.d.ts +5 -0
- package/src/generators/slice/built-in-plan-key-value-performance.js +530 -0
- package/src/generators/slice/built-in-plan-key-value-provider.d.ts +4 -0
- package/src/generators/slice/built-in-plan-key-value-provider.js +366 -0
- package/src/generators/slice/built-in-plan-key-value-records.d.ts +3 -0
- package/src/generators/slice/built-in-plan-key-value-records.js +232 -0
- package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.js +103 -0
- package/src/generators/slice/built-in-plan-key-value-retention-job-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-retention-job-files.js +160 -0
- package/src/generators/slice/built-in-plan-key-value-retention-maintenance.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-retention-maintenance.js +329 -0
- package/src/generators/slice/built-in-plan-key-value-retention-worker.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-retention-worker.js +477 -0
- package/src/generators/slice/built-in-plan-key-value-retention.d.ts +2 -0
- package/src/generators/slice/built-in-plan-key-value-retention.js +184 -0
- package/src/generators/slice/built-in-plan-metadata-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-metadata-files.js +140 -28
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js +36 -19
- package/src/generators/slice/built-in-plan-operations-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-operations-files.js +89 -50
- package/src/generators/slice/built-in-plan-performance-files.js +84 -1010
- package/src/generators/slice/built-in-plan-project-files.js +116 -67
- package/src/generators/slice/built-in-plan-release-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-release-files.js +64 -15
- package/src/generators/slice/built-in-plan-reliability-files.js +54 -28
- package/src/generators/slice/built-in-plan-shared.d.ts +4 -2
- package/src/generators/slice/built-in-plan-shared.js +41 -19
- package/src/generators/slice/built-in-plan-sql-events.d.ts +2 -0
- package/src/generators/slice/built-in-plan-sql-events.js +257 -0
- package/src/generators/slice/built-in-plan-testing-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-testing-files.js +184 -132
- package/src/generators/slice/built-in-plan-testing-persistence-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-testing-persistence-files.js +178 -0
- package/src/generators/slice/built-in-plan-thin-release-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-thin-release-files.js +35 -2
- package/src/generators/slice/built-in-plan-verification-files.js +70 -0
- package/src/generators/slice/built-in-plan-web-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-web-files.js +206 -14
- package/src/generators/slice/built-in-plan-workload-role-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-workload-role-files.js +113 -274
- package/src/generators/slice/built-in-plan.d.ts +9 -1
- package/src/generators/slice/built-in-plan.js +49 -21
- package/src/generators/slice/data-policy-review-seed.d.ts +2 -0
- package/src/generators/slice/data-policy-review-seed.js +22 -0
- package/src/generators/slice/deployed-smoke-readiness.d.ts +2 -0
- package/src/generators/slice/deployed-smoke-readiness.js +214 -0
- package/src/generators/slice/local-source-identity.d.ts +2 -0
- package/src/generators/slice/local-source-identity.js +31 -0
- package/src/generators/slice/persistence-contract.d.ts +14 -0
- package/src/generators/slice/persistence-contract.js +32 -0
- package/src/generators/slice/slice.js +29 -24
- package/src/generators/sql/schema.d.ts +7 -0
- package/src/generators/sql/schema.json +38 -0
- package/src/generators/sql/sql.d.ts +6 -0
- package/src/generators/sql/sql.js +53 -0
- package/src/generators/upgrade/sql-seeded-reconciliation.d.ts +2 -0
- package/src/generators/upgrade/sql-seeded-reconciliation.js +170 -0
- package/src/generators/upgrade/upgrade.d.ts +2 -0
- package/src/generators/upgrade/upgrade.js +136 -9
- package/src/generators/workload/workload.js +51 -2
- package/src/local-dev/browser-verification.d.ts +37 -0
- package/src/local-dev/browser-verification.js +281 -0
- package/src/local-dev/contracts.d.ts +10 -1
- package/src/local-dev/contracts.js +114 -13
- package/src/local-dev/dev-command-core.js +24 -5
- package/src/local-dev/docker-credential-health.d.ts +14 -0
- package/src/local-dev/docker-credential-health.js +94 -0
- package/src/local-dev/environment-inspector.d.ts +7 -0
- package/src/local-dev/environment-inspector.js +42 -15
- package/src/local-dev/environment-state.js +2 -2
- package/src/local-dev/errors.d.ts +1 -1
- package/src/local-dev/errors.js +2 -0
- package/src/local-dev/fleet-client.js +2 -2
- package/src/local-dev/fleet-configuration.js +57 -25
- package/src/local-dev/fleet-inventory.js +46 -18
- package/src/local-dev/fleet-ipc.d.ts +7 -0
- package/src/local-dev/fleet-ipc.js +14 -2
- package/src/local-dev/fleet-launcher.d.ts +6 -0
- package/src/local-dev/fleet-launcher.js +14 -2
- package/src/local-dev/fleet-logs.js +50 -22
- package/src/local-dev/fleet-process.d.ts +20 -1
- package/src/local-dev/fleet-process.js +197 -41
- package/src/local-dev/fleet-runner-evidence.d.ts +5 -0
- package/src/local-dev/fleet-runner-evidence.js +56 -0
- package/src/local-dev/fleet-runtime.js +268 -229
- package/src/local-dev/fleet-session.d.ts +2 -0
- package/src/local-dev/fleet-session.js +28 -11
- package/src/local-dev/fleet-slice-runner-daemon.js +4 -0
- package/src/local-dev/fleet-state.d.ts +5 -2
- package/src/local-dev/fleet-state.js +25 -4
- package/src/local-dev/fleet-supervisor.d.ts +3 -0
- package/src/local-dev/fleet-supervisor.js +66 -11
- package/src/local-dev/fleet-web-start.d.ts +12 -0
- package/src/local-dev/fleet-web-start.js +48 -0
- package/src/local-dev/identity.js +3 -14
- package/src/local-dev/index.d.ts +1 -0
- package/src/local-dev/index.js +1 -0
- package/src/local-dev/native-completion.d.ts +9 -0
- package/src/local-dev/native-completion.js +130 -0
- package/src/local-dev/nx-workspace.d.ts +4 -2
- package/src/local-dev/nx-workspace.js +11 -6
- package/src/local-dev/personal-stage.d.ts +4 -5
- package/src/local-dev/personal-stage.js +6 -54
- package/src/local-dev/port-claims.d.ts +13 -0
- package/src/local-dev/port-claims.js +46 -0
- package/src/local-dev/ports.d.ts +14 -2
- package/src/local-dev/ports.js +78 -3
- package/src/local-dev/private-state.d.ts +6 -0
- package/src/local-dev/private-state.js +126 -34
- package/src/local-dev/process-group.d.ts +4 -0
- package/src/local-dev/process-group.js +29 -0
- package/src/local-dev/process-identity.d.ts +8 -0
- package/src/local-dev/process-identity.js +31 -1
- package/src/local-dev/proxy.js +11 -12
- package/src/local-dev/runtime-paths.js +1 -1
- package/src/local-dev/slice-claim.js +1 -1
- package/src/local-dev/slice-runner.d.ts +15 -6
- package/src/local-dev/slice-runner.js +189 -54
- package/src/local-dev/task-attachment.d.ts +17 -0
- package/src/local-dev/task-attachment.js +73 -0
- package/src/local-dev/task-authority.d.ts +10 -0
- package/src/local-dev/task-authority.js +27 -0
- package/src/local-dev/task-identity.d.ts +33 -0
- package/src/local-dev/task-identity.js +418 -0
- package/src/local-dev/task-native-writer.d.ts +18 -0
- package/src/local-dev/task-native-writer.js +329 -0
- package/src/local-dev/tls.js +3 -1
- package/src/local-dev/web-launch.d.ts +9 -0
- package/src/local-dev/web-launch.js +130 -0
- package/src/ownership/composition.d.ts +2 -1
- package/src/ownership/composition.js +1 -0
- package/src/performance/scenario.d.ts +22 -0
- package/src/performance/scenario.js +100 -92
- package/src/repository-policy/deployment-plan.d.ts +2 -2
- package/src/repository-policy/deployment-plan.js +2 -1
- package/src/repository-policy/policy.js +38 -3
- package/src/schemas/blueprint-v1.json +5 -4
- package/src/schemas/foundation-requirement-v1.json +5 -4
- package/src/schemas/testing-evidence-result-v1.json +1 -1
- package/src/secrets/operator.d.ts +3 -1
- package/src/secrets/operator.js +22 -3
- package/src/sst-environment-source-format.d.ts +3 -0
- package/src/sst-environment-source-format.js +20 -0
- package/src/supply-chain/blueprint-trust-git.js +13 -3
- package/src/supply-chain/build-output.js +15 -0
- package/src/supply-chain/generated-blueprint-trust-command.js +18 -1
- package/src/testing-evidence/fixture-scope.d.ts +2 -1
- package/src/testing-evidence/fixture-scope.js +4 -2
- package/src/testing-evidence/result.d.ts +2 -1
- package/src/testing-evidence/result.js +18 -4
- package/src/workload-roles/standard-slice.js +2 -3
- package/src/api-contract/baseline-update.js.map +0 -1
- package/src/api-contract/compatibility.js.map +0 -1
- package/src/api-contract/contract-graph.js.map +0 -1
- package/src/api-contract/evidence.js.map +0 -1
- package/src/api-contract/index.js.map +0 -1
- package/src/api-contract/model.fixtures.d.ts +0 -2
- package/src/api-contract/model.fixtures.js +0 -81
- package/src/api-contract/model.fixtures.js.map +0 -1
- package/src/api-contract/model.js.map +0 -1
- package/src/api-contract/rollout.js.map +0 -1
- package/src/authorization/compatibility.js.map +0 -1
- package/src/authorization/index.js.map +0 -1
- package/src/aws/child-environment.js.map +0 -1
- package/src/aws/identity.js.map +0 -1
- package/src/aws-authority/index.js.map +0 -1
- package/src/aws-authority/stage-authority.js.map +0 -1
- package/src/blueprints/execution.js.map +0 -1
- package/src/blueprints/external-sandbox.js.map +0 -1
- package/src/blueprints/index.js.map +0 -1
- package/src/blueprints/inputs.js.map +0 -1
- package/src/blueprints/manifest.js.map +0 -1
- package/src/blueprints/resolver.js.map +0 -1
- package/src/blueprints/transitions.js.map +0 -1
- package/src/cli/agent-command.js.map +0 -1
- package/src/cli/agent-runtime.js.map +0 -1
- package/src/cli/blueprint-authority.js.map +0 -1
- package/src/cli/blueprint-command.js.map +0 -1
- package/src/cli/bootstrap.js.map +0 -1
- package/src/cli/dev-command.js.map +0 -1
- package/src/cli/main.js.map +0 -1
- package/src/cli/output.js.map +0 -1
- package/src/cli/personal-secret-runtime.js.map +0 -1
- package/src/cli/secret-terminal.js.map +0 -1
- package/src/container-images.js.map +0 -1
- package/src/data-lifecycle/index.js.map +0 -1
- package/src/data-lifecycle/model.fixtures.d.ts +0 -2
- package/src/data-lifecycle/model.fixtures.js +0 -244
- package/src/data-lifecycle/model.fixtures.js.map +0 -1
- package/src/data-lifecycle/model.js.map +0 -1
- package/src/data-lifecycle/sensitive-artifacts.js.map +0 -1
- package/src/data-lifecycle/validation.js.map +0 -1
- package/src/database-retirement/contract.js.map +0 -1
- package/src/database-retirement/index.js.map +0 -1
- package/src/deterministic-order.js.map +0 -1
- package/src/developer-agent/context.js.map +0 -1
- package/src/developer-agent/generator-planning.js.map +0 -1
- package/src/developer-agent/generator-preview.js.map +0 -1
- package/src/developer-agent/git-inspection.js.map +0 -1
- package/src/developer-agent/handoff.js.map +0 -1
- package/src/developer-agent/index.js.map +0 -1
- package/src/developer-agent/model.js.map +0 -1
- package/src/developer-agent/operation-registry.js.map +0 -1
- package/src/developer-agent/ordering.js.map +0 -1
- package/src/developer-agent/planning.js.map +0 -1
- package/src/developer-agent/preview-changes.js.map +0 -1
- package/src/developer-agent/preview-source.js.map +0 -1
- package/src/developer-agent/validation.js.map +0 -1
- package/src/developer-agent/workspace-inspection.js.map +0 -1
- package/src/developer-agent/workspace-path.js.map +0 -1
- package/src/executors/blueprint-trust/blueprint-trust.js.map +0 -1
- package/src/executors/blueprint-verification/blueprint-verification.js.map +0 -1
- package/src/executors/deploy/deploy.js.map +0 -1
- package/src/executors/deployment-plan/deployment-plan.js.map +0 -1
- package/src/executors/dev/dev.js.map +0 -1
- package/src/executors/dev-doctor/dev-doctor.js.map +0 -1
- package/src/executors/dev-setup/dev-setup.js.map +0 -1
- package/src/executors/developer-context/developer-context.js.map +0 -1
- package/src/executors/fleet/fleet.js.map +0 -1
- package/src/executors/foundation-preflight/foundation-preflight.js.map +0 -1
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js.map +0 -1
- package/src/executors/foundation-profile-preflight/production-database-safeguard.js.map +0 -1
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js.map +0 -1
- package/src/executors/github-bootstrap/github-bootstrap.js.map +0 -1
- package/src/executors/infrastructure-plan/infrastructure-plan.js.map +0 -1
- package/src/executors/local-deploy/federated-credential-transport.js.map +0 -1
- package/src/executors/local-deploy/fixtures/local-deploy-state-machine.mjs +0 -53
- package/src/executors/local-deploy/local-approval.js.map +0 -1
- package/src/executors/local-deploy/local-deploy.js.map +0 -1
- package/src/executors/refresh/refresh.js.map +0 -1
- package/src/executors/remove/remove.js.map +0 -1
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js.map +0 -1
- package/src/executors/secret-guardrails/secret-guardrails.js.map +0 -1
- package/src/executors/secret-initialize/secret-initialize.js.map +0 -1
- package/src/executors/secret-metadata/secret-metadata.js.map +0 -1
- package/src/executors/sst-lifecycle/generated-secret-retirement.js.map +0 -1
- package/src/executors/sst-lifecycle/governed-native-operation.js.map +0 -1
- package/src/executors/sst-lifecycle/logging-preflight.js.map +0 -1
- package/src/executors/sst-lifecycle/run-sst-command.js.map +0 -1
- package/src/executors/sst-lifecycle/secret-preflight.js.map +0 -1
- package/src/executors/sst-lifecycle/sst-environment-source.js.map +0 -1
- package/src/executors/unlock/unlock.js.map +0 -1
- package/src/executors/work-markers/work-markers.js.map +0 -1
- package/src/foundation/discovery.js.map +0 -1
- package/src/foundation/index.js.map +0 -1
- package/src/foundation/local-database-contract.js.map +0 -1
- package/src/foundation/logging-preflight.js.map +0 -1
- package/src/foundation/logging.js.map +0 -1
- package/src/foundation/partial-state.js.map +0 -1
- package/src/foundation/preflight.js.map +0 -1
- package/src/foundation/private-smoke-access.js.map +0 -1
- package/src/foundation/private-smoke-admission.js.map +0 -1
- package/src/foundation/private-smoke-control-plane.js.map +0 -1
- package/src/foundation/provision-database-bindings.js.map +0 -1
- package/src/foundation/provision-logical-database.js.map +0 -1
- package/src/foundation/requirements.js.map +0 -1
- package/src/foundation/router-origin-proof.js.map +0 -1
- package/src/foundation/router-waf-rate-rehearsal.js.map +0 -1
- package/src/foundation/router-waf.js.map +0 -1
- package/src/foundation/stages.js.map +0 -1
- package/src/frontend-security/index.js.map +0 -1
- package/src/frontend-security/security-headers.js.map +0 -1
- package/src/generators/feature-registry.js.map +0 -1
- package/src/generators/formatting.js.map +0 -1
- package/src/generators/function/function.js.map +0 -1
- package/src/generators/job/job.js.map +0 -1
- package/src/generators/logging-registry.js.map +0 -1
- package/src/generators/post-generation-install.js.map +0 -1
- package/src/generators/preset/dependency-overrides.js.map +0 -1
- package/src/generators/preset/generator.js.map +0 -1
- package/src/generators/preset/tool-versions.js.map +0 -1
- package/src/generators/preset/workspace-files-ci-acceptance.js.map +0 -1
- package/src/generators/preset/workspace-files-developer-agent.js.map +0 -1
- package/src/generators/preset/workspace-files-ecr-inspector.js.map +0 -1
- package/src/generators/preset/workspace-files-foundation-workload-roles.js.map +0 -1
- package/src/generators/preset/workspace-files-performance-cost.js.map +0 -1
- package/src/generators/preset/workspace-files-performance-load.js.map +0 -1
- package/src/generators/preset/workspace-files-stage-authority.js.map +0 -1
- package/src/generators/preset/workspace-files-thin-deploy.js.map +0 -1
- package/src/generators/preset/workspace-files-thin-docs.js.map +0 -1
- package/src/generators/preset/workspace-files-thin-release.js.map +0 -1
- package/src/generators/preset/workspace-files-workload-role-baseline.js.map +0 -1
- package/src/generators/preset/workspace-files.js.map +0 -1
- package/src/generators/repository-policy/repository-policy.js.map +0 -1
- package/src/generators/repository-policy/tree-policy.js.map +0 -1
- package/src/generators/service/service.js.map +0 -1
- package/src/generators/slice/built-in-plan-api-contract-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-api-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-async-work-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-authorization-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-background-work-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-data-deletion-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-data-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-data-lifecycle-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-data-retention-job-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-data-rights-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-database-lifecycle-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-foundation-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-frontend-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-infrastructure-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-metadata-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-operations-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-performance-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-project-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-release-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-reliability-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-secret-runtime-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-shared.js.map +0 -1
- package/src/generators/slice/built-in-plan-testing-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-thin-release-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-verification-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-web-files.js.map +0 -1
- package/src/generators/slice/built-in-plan-workload-role-files.js.map +0 -1
- package/src/generators/slice/built-in-plan.js.map +0 -1
- package/src/generators/slice/slice.js.map +0 -1
- package/src/generators/upgrade/upgrade.js.map +0 -1
- package/src/generators/workload/frozen-container.js.map +0 -1
- package/src/generators/workload/performance-registration.js.map +0 -1
- package/src/generators/workload/reliability-registration.js.map +0 -1
- package/src/generators/workload/service-performance-files.js.map +0 -1
- package/src/generators/workload/workload.js.map +0 -1
- package/src/git-policy/action-pins.js.map +0 -1
- package/src/git-policy/github-bootstrap.js.map +0 -1
- package/src/git-policy/index.js.map +0 -1
- package/src/git-policy/routing.js.map +0 -1
- package/src/index.js.map +0 -1
- package/src/infrastructure-change/convergence.js.map +0 -1
- package/src/infrastructure-change/drift.js.map +0 -1
- package/src/infrastructure-change/index.js.map +0 -1
- package/src/infrastructure-change/local-capability.js.map +0 -1
- package/src/infrastructure-change/model.js.map +0 -1
- package/src/infrastructure-change/normalize.js.map +0 -1
- package/src/infrastructure-change/plan.js.map +0 -1
- package/src/infrastructure-change/risk.js.map +0 -1
- package/src/infrastructure-change/summary.js.map +0 -1
- package/src/local-dev/context-discovery.js.map +0 -1
- package/src/local-dev/contract-validation.js.map +0 -1
- package/src/local-dev/contracts.js.map +0 -1
- package/src/local-dev/control-contract.js.map +0 -1
- package/src/local-dev/dev-command-core.js.map +0 -1
- package/src/local-dev/effects.js.map +0 -1
- package/src/local-dev/environment-inspector.js.map +0 -1
- package/src/local-dev/environment-state.js.map +0 -1
- package/src/local-dev/errors.js.map +0 -1
- package/src/local-dev/fleet-client.js.map +0 -1
- package/src/local-dev/fleet-configuration.js.map +0 -1
- package/src/local-dev/fleet-inventory.js.map +0 -1
- package/src/local-dev/fleet-ipc.js.map +0 -1
- package/src/local-dev/fleet-launcher.js.map +0 -1
- package/src/local-dev/fleet-lock.js.map +0 -1
- package/src/local-dev/fleet-logs.js.map +0 -1
- package/src/local-dev/fleet-process.js.map +0 -1
- package/src/local-dev/fleet-runtime.js.map +0 -1
- package/src/local-dev/fleet-session.js.map +0 -1
- package/src/local-dev/fleet-slice-runner-daemon.js.map +0 -1
- package/src/local-dev/fleet-startup.js.map +0 -1
- package/src/local-dev/fleet-state.js.map +0 -1
- package/src/local-dev/fleet-supervisor-daemon.js.map +0 -1
- package/src/local-dev/fleet-supervisor.js.map +0 -1
- package/src/local-dev/gateway-daemon.js.map +0 -1
- package/src/local-dev/gateway.js.map +0 -1
- package/src/local-dev/identity.js.map +0 -1
- package/src/local-dev/index.js.map +0 -1
- package/src/local-dev/local-context.js.map +0 -1
- package/src/local-dev/nx-workspace.js.map +0 -1
- package/src/local-dev/personal-secret-ledger.js.map +0 -1
- package/src/local-dev/personal-stage.js.map +0 -1
- package/src/local-dev/portless.js.map +0 -1
- package/src/local-dev/ports.js.map +0 -1
- package/src/local-dev/private-state.js.map +0 -1
- package/src/local-dev/process-identity.js.map +0 -1
- package/src/local-dev/proxy.js.map +0 -1
- package/src/local-dev/runtime-paths.js.map +0 -1
- package/src/local-dev/secret-slice-claim.js.map +0 -1
- package/src/local-dev/slice-claim.js.map +0 -1
- package/src/local-dev/slice-runner.js.map +0 -1
- package/src/local-dev/tls.js.map +0 -1
- package/src/ownership/composition.js.map +0 -1
- package/src/ownership/foundation-record.js.map +0 -1
- package/src/ownership/hash.js.map +0 -1
- package/src/ownership/index.js.map +0 -1
- package/src/ownership/json-ownership.js.map +0 -1
- package/src/ownership/record.js.map +0 -1
- package/src/ownership/workspace-record.js.map +0 -1
- package/src/performance/cost-collection.js.map +0 -1
- package/src/performance/cost-controls.js.map +0 -1
- package/src/performance/evidence.js.map +0 -1
- package/src/performance/index.js.map +0 -1
- package/src/performance/load-safety.js.map +0 -1
- package/src/performance/model.js.map +0 -1
- package/src/performance/pr-artifact-budget.js.map +0 -1
- package/src/performance/runner.js.map +0 -1
- package/src/performance/scenario-endpoint.js.map +0 -1
- package/src/performance/scenario.js.map +0 -1
- package/src/performance/test-fixtures.d.ts +0 -7
- package/src/performance/test-fixtures.js +0 -167
- package/src/performance/test-fixtures.js.map +0 -1
- package/src/performance/unit-cost.js.map +0 -1
- package/src/release/index.js.map +0 -1
- package/src/release/lifecycle.js.map +0 -1
- package/src/release/manifest.js.map +0 -1
- package/src/release/rollout.js.map +0 -1
- package/src/release/source-authority.js.map +0 -1
- package/src/repository-policy/aurora-preflight.js.map +0 -1
- package/src/repository-policy/capacity-migration.js.map +0 -1
- package/src/repository-policy/deployment-plan.js.map +0 -1
- package/src/repository-policy/foundation-profile.js.map +0 -1
- package/src/repository-policy/index.js.map +0 -1
- package/src/repository-policy/policy.js.map +0 -1
- package/src/secrets/adapters.js.map +0 -1
- package/src/secrets/aws-control-plane.js.map +0 -1
- package/src/secrets/declaration-verification.js.map +0 -1
- package/src/secrets/generated-aws-control-plane.js.map +0 -1
- package/src/secrets/guardrails.js.map +0 -1
- package/src/secrets/index.js.map +0 -1
- package/src/secrets/metadata.js.map +0 -1
- package/src/secrets/model.js.map +0 -1
- package/src/secrets/operator.js.map +0 -1
- package/src/secrets/permissions.js.map +0 -1
- package/src/secrets/personal-command.js.map +0 -1
- package/src/secrets/personal-ledger.js.map +0 -1
- package/src/secrets/registry.js.map +0 -1
- package/src/secrets/verification.js.map +0 -1
- package/src/secrets/workload-access.js.map +0 -1
- package/src/sst-environment-source-format.js.map +0 -1
- package/src/supply-chain/action-pins.js.map +0 -1
- package/src/supply-chain/blueprint-trust-git.js.map +0 -1
- package/src/supply-chain/blueprint-trust-process.js.map +0 -1
- package/src/supply-chain/blueprint-trust.js.map +0 -1
- package/src/supply-chain/blueprint-verification-authority.js.map +0 -1
- package/src/supply-chain/blueprint-verification-execution.js.map +0 -1
- package/src/supply-chain/build-output-bounds.js.map +0 -1
- package/src/supply-chain/build-output.js.map +0 -1
- package/src/supply-chain/common.js.map +0 -1
- package/src/supply-chain/container-artifact-contract.js.map +0 -1
- package/src/supply-chain/container-release.js.map +0 -1
- package/src/supply-chain/ecr-applicability.js.map +0 -1
- package/src/supply-chain/ecr-scanning.js.map +0 -1
- package/src/supply-chain/ecs-deployed-image.js.map +0 -1
- package/src/supply-chain/errors.js.map +0 -1
- package/src/supply-chain/generated-blueprint-trust-command.js.map +0 -1
- package/src/supply-chain/generated-command.js.map +0 -1
- package/src/supply-chain/generated-container-release-command.js.map +0 -1
- package/src/supply-chain/generated-ecr-collector-command.js.map +0 -1
- package/src/supply-chain/generated-files.js.map +0 -1
- package/src/supply-chain/generated-scanner-command.js.map +0 -1
- package/src/supply-chain/index.js.map +0 -1
- package/src/supply-chain/inventory.js.map +0 -1
- package/src/supply-chain/license-expression.js.map +0 -1
- package/src/supply-chain/pnpm-toolchain-authority.js.map +0 -1
- package/src/supply-chain/policy.js.map +0 -1
- package/src/supply-chain/publication.js.map +0 -1
- package/src/supply-chain/sbom.js.map +0 -1
- package/src/supply-chain/scanner.js.map +0 -1
- package/src/supply-chain/vendored-source.js.map +0 -1
- package/src/testing-evidence/fixture-scope.js.map +0 -1
- package/src/testing-evidence/index.js.map +0 -1
- package/src/testing-evidence/quarantine.js.map +0 -1
- package/src/testing-evidence/result.js.map +0 -1
- package/src/testing-evidence/runner-adapter.js.map +0 -1
- package/src/testing-evidence/sensitive-artifacts.js.map +0 -1
- package/src/validation.js.map +0 -1
- package/src/work-markers/index.js.map +0 -1
- package/src/work-markers/work-markers.js.map +0 -1
- package/src/workload-roles/account-baseline.js.map +0 -1
- package/src/workload-roles/authority.js.map +0 -1
- package/src/workload-roles/aws-adapter.js.map +0 -1
- package/src/workload-roles/aws-internal-handler.js.map +0 -1
- package/src/workload-roles/aws-s3-state.js.map +0 -1
- package/src/workload-roles/aws-sdk-control-plane.js.map +0 -1
- package/src/workload-roles/boundary.js.map +0 -1
- package/src/workload-roles/convergence.js.map +0 -1
- package/src/workload-roles/effective-policy.js.map +0 -1
- package/src/workload-roles/handler.js.map +0 -1
- package/src/workload-roles/history.js.map +0 -1
- package/src/workload-roles/index.js.map +0 -1
- package/src/workload-roles/injection.js.map +0 -1
- package/src/workload-roles/manifest.js.map +0 -1
- package/src/workload-roles/provisioner.js.map +0 -1
- package/src/workload-roles/registration.js.map +0 -1
- package/src/workload-roles/stage-boundary.js.map +0 -1
- package/src/workload-roles/standard-slice.js.map +0 -1
- package/src/workspace-deployment/affected-lifecycle.js.map +0 -1
- package/src/workspace-deployment/identity.js.map +0 -1
- package/src/workspace-deployment/index.js.map +0 -1
- package/src/workspace-deployment/migration-evidence.js.map +0 -1
- package/src/workspace-deployment/migration.js.map +0 -1
- package/src/workspace-deployment/ownership.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.STAGE_AUTHORITY_SERVICE_LINKED_ROLES = exports.STAGE_AUTHORITY_UNSUPPORTED_WORKFLOW_EXECUTION_ACTIONS = exports.STAGE_AUTHORITY_NON_DEPLOYMENT_ACCOUNT_AND_DATA_ACTIONS = exports.STAGE_AUTHORITY_UNREVIEWED_PERMISSION_MANAGEMENT_ACTION_PATTERNS = exports.STAGE_AUTHORITY_REVIEWED_PERMISSION_MANAGEMENT_ACTIONS = exports.STAGE_AUTHORITY_S3_BUCKET_POLICY_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_UNTAGGED_DESTRUCTIVE_ACTIONS = void 0;
|
|
3
|
+
exports.STAGE_AUTHORITY_CROSS_ACCOUNT_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_CROSS_ACCOUNT_EC2_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_SST_417_EXTERNAL_AMI_OWNERS_BY_PARTITION = exports.STAGE_AUTHORITY_CLOUDCONTROL_EDGE_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_SCOPE_GUARD_MUTATION_FAMILIES = exports.STAGE_AUTHORITY_WORKLOAD_IDENTITY_POLICY_ACTIONS = exports.STAGE_AUTHORITY_APPROVED_AWS_MANAGED_POLICIES = exports.STAGE_RUNTIME_REGIONAL_SERVICE_FAMILIES = exports.STAGE_AUTHORITY_LOGS_MUTATION_FAMILIES = exports.STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES = exports.STAGE_RUNTIME_GLOBAL_ACTIONS = exports.STAGE_RUNTIME_REGIONAL_ACTIONS = exports.STAGE_AUTHORITY_ACCOUNT_SCOPED_GLOBAL_WRITE_ACTIONS = exports.STAGE_AUTHORITY_GLOBAL_WRITE_ACTIONS = exports.STAGE_AUTHORITY_UNSUPPORTED_REPLICATION_AND_TOPOLOGY_ACTIONS = exports.STAGE_AUTHORITY_WAF_EDGE_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_S3_REGIONAL_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_UNSCOPED_CLOUDFRONT_CREATE_ACTIONS = exports.STAGE_AUTHORITY_REGIONAL_WRITE_ACTIONS = exports.STAGE_AUTHORITY_LAMBDA_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_KMS_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_EC2_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_BACKUP_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_BROAD_REGIONAL_SERVICE_ACTIONS = exports.STAGE_AUTHORITY_EDGE_OBSERVABILITY_READ_ACTIONS = exports.STAGE_AUTHORITY_GLOBAL_READ_ACTIONS = exports.STAGE_AUTHORITY_REGIONAL_READ_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_WRITE_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_RESOURCE_WRITE_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_CREATE_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_READ_ACTIONS = exports.STAGE_AUTHORITY_KMS_ROTATION_ACTIONS = exports.STAGE_AUTHORITY_RDS_EVENT_SUBSCRIPTION_SOURCE_ACTIONS = exports.STAGE_AUTHORITY_BUDGET_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_EDGE_WAF_LOG_DELIVERY_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_EDGE_WAF_LOG_GROUP_ACTIONS = exports.STAGE_AUTHORITY_WAF_LOGGING_ACTIONS = exports.STAGE_AUTHORITY_CLOUDFRONT_INVALIDATION_ACTIONS = exports.STAGE_AUTHORITY_LAMBDA_DEPLOYMENT_INVOKE_ACTIONS = exports.STAGE_AUTHORITY_EVENT_ARCHIVE_RESOURCE_ACTIONS = exports.STAGE_AUTHORITY_EVENT_ARCHIVE_CREATE_ACTIONS = exports.STAGE_AUTHORITY_CLOUDFORMATION_LIFECYCLE_ACTIONS = exports.STAGE_AUTHORITY_BOUND_TEMPLATE_BODY_MINIMUM_HEADROOM = exports.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT = exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_HEADROOM = exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT = exports.STAGE_AUTHORITY_DEPLOYMENT_POLICY_KINDS = exports.STAGE_AUTHORITY_PARTITIONS = exports.STAGE_AUTHORITY_STAGES = exports.STAGE_AUTHORITY_SCHEMA_VERSION = void 0;
|
|
4
|
+
exports.STAGE_AUTHORITY_SERVICE_LINKED_ROLES = exports.STAGE_AUTHORITY_UNSUPPORTED_WORKFLOW_EXECUTION_ACTIONS = exports.STAGE_AUTHORITY_NON_DEPLOYMENT_ACCOUNT_AND_DATA_ACTIONS = exports.STAGE_AUTHORITY_UNREVIEWED_PERMISSION_MANAGEMENT_ACTION_PATTERNS = exports.STAGE_AUTHORITY_REVIEWED_PERMISSION_MANAGEMENT_ACTIONS = exports.STAGE_AUTHORITY_S3_BUCKET_POLICY_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_UNTAGGED_DESTRUCTIVE_ACTIONS = exports.STAGE_AUTHORITY_CROSS_STAGE_DESTRUCTIVE_ACTIONS = void 0;
|
|
5
5
|
exports.createStageAuthorityIdentity = createStageAuthorityIdentity;
|
|
6
6
|
exports.canonicalStageAuthorityTemplate = canonicalStageAuthorityTemplate;
|
|
7
7
|
exports.digestStageAuthorityTemplate = digestStageAuthorityTemplate;
|
|
@@ -37,6 +37,10 @@ exports.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT = 51_200;
|
|
|
37
37
|
exports.STAGE_AUTHORITY_BOUND_TEMPLATE_BODY_MINIMUM_HEADROOM = 1_024;
|
|
38
38
|
const STAGE_AUTHORITY_MAX_AWS_PRINCIPALS = 16;
|
|
39
39
|
const STAGE_AUTHORITY_MAX_AWS_PRINCIPAL_ARN_BYTES = 2_048;
|
|
40
|
+
// IAM glob syntax cannot validate hexadecimal characters. Framework task
|
|
41
|
+
// admission validates exact lowercase hex; this is only a bounded IAM shape.
|
|
42
|
+
const TASK_STAGE_IAM_SHAPE = `personal-${'?'.repeat(24)}`;
|
|
43
|
+
const TASK_PRINCIPAL_STAGE = '${aws:PrincipalTag/ebk:stage}';
|
|
40
44
|
const ACCOUNT_ID = /^\d{12}$/u;
|
|
41
45
|
const REGION = /^(?:(?:af|ap|ca|cn|eu|il|me|mx|sa|us)(?:-(?:gov|iso|isob|isoe|isof))?|eusc-[a-z]{2})-[a-z]+-\d$/u;
|
|
42
46
|
const AWS_PRINCIPAL_ARN = /^arn:(aws|aws-cn|aws-us-gov):iam::(\d{12}):role\/[A-Za-z0-9+=,.@_/-]+$/u;
|
|
@@ -419,10 +423,12 @@ exports.STAGE_RUNTIME_REGIONAL_ACTIONS = Object.freeze([
|
|
|
419
423
|
'dynamodb:BatchWriteItem',
|
|
420
424
|
'dynamodb:ConditionCheckItem',
|
|
421
425
|
'dynamodb:DeleteItem',
|
|
426
|
+
'dynamodb:DescribeStream',
|
|
422
427
|
'dynamodb:DescribeTable',
|
|
423
428
|
'dynamodb:GetItem',
|
|
424
429
|
'dynamodb:GetRecords',
|
|
425
430
|
'dynamodb:GetShardIterator',
|
|
431
|
+
'dynamodb:ListStreams',
|
|
426
432
|
'dynamodb:PutItem',
|
|
427
433
|
'dynamodb:Query',
|
|
428
434
|
'dynamodb:Scan',
|
|
@@ -582,6 +588,11 @@ exports.STAGE_AUTHORITY_SCOPE_GUARD_MUTATION_FAMILIES = Object.freeze([
|
|
|
582
588
|
'wafv2:*',
|
|
583
589
|
]),
|
|
584
590
|
].sort(compareStrings));
|
|
591
|
+
exports.STAGE_AUTHORITY_CLOUDCONTROL_EDGE_MUTATION_ACTIONS = Object.freeze([
|
|
592
|
+
'cloudformation:CreateResource',
|
|
593
|
+
'cloudformation:DeleteResource',
|
|
594
|
+
'cloudformation:UpdateResource',
|
|
595
|
+
]);
|
|
585
596
|
/** SST 4.17.1 resolves the generated nonproduction VPC's EC2 NAT image from
|
|
586
597
|
* this commercial-partition fck-nat publisher. The generated development
|
|
587
598
|
* bastion reuses that NAT instance, while production uses managed NAT. No
|
|
@@ -1002,20 +1013,57 @@ function policy(statements) {
|
|
|
1002
1013
|
Version: IAM_POLICY_VERSION,
|
|
1003
1014
|
};
|
|
1004
1015
|
}
|
|
1005
|
-
function omitPolicyStatementSids(document) {
|
|
1016
|
+
function omitPolicyStatementSids(document, compactActions = false) {
|
|
1006
1017
|
const record = document;
|
|
1007
1018
|
const statements = record['Statement'];
|
|
1008
1019
|
if (!Array.isArray(statements)) {
|
|
1009
1020
|
throw new Error('Stage authority template policy statements are invalid.');
|
|
1010
1021
|
}
|
|
1022
|
+
const rendered = statements.map((entry) => {
|
|
1023
|
+
if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
|
|
1024
|
+
throw new Error('Stage authority template policy statement is invalid.');
|
|
1025
|
+
}
|
|
1026
|
+
return Object.fromEntries(Object.entries(entry).filter(([key]) => key !== 'Sid'));
|
|
1027
|
+
});
|
|
1028
|
+
if (!compactActions)
|
|
1029
|
+
return { ...record, Statement: rendered };
|
|
1030
|
+
// Statements with identical effect, resources and conditions differ only in
|
|
1031
|
+
// their positive Action sets. Their union is exactly equivalent; NotAction
|
|
1032
|
+
// statements are deliberately never merged (union would change semantics).
|
|
1033
|
+
const scopes = new Map();
|
|
1034
|
+
const compacted = [];
|
|
1035
|
+
for (const entry of rendered) {
|
|
1036
|
+
if (!Array.isArray(entry['Action'])) {
|
|
1037
|
+
compacted.push(entry);
|
|
1038
|
+
continue;
|
|
1039
|
+
}
|
|
1040
|
+
const { Action, ...scope } = entry;
|
|
1041
|
+
const key = JSON.stringify(scope);
|
|
1042
|
+
const existing = scopes.get(key);
|
|
1043
|
+
if (existing)
|
|
1044
|
+
existing['Action'] = [
|
|
1045
|
+
...new Set([
|
|
1046
|
+
...existing['Action'],
|
|
1047
|
+
...Action,
|
|
1048
|
+
]),
|
|
1049
|
+
].sort(compareStrings);
|
|
1050
|
+
else {
|
|
1051
|
+
scopes.set(key, entry);
|
|
1052
|
+
compacted.push(entry);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
// IAM accepts a singleton resource as either a string or a one-element
|
|
1056
|
+
// list. Keep the executable model as lists; shorten only the rendered JSON.
|
|
1011
1057
|
return {
|
|
1012
1058
|
...record,
|
|
1013
|
-
Statement:
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1059
|
+
Statement: compacted.map((entry) => Object.fromEntries(Object.entries(entry).map(([key, value]) => [
|
|
1060
|
+
key,
|
|
1061
|
+
['Resource', 'NotResource'].includes(key) &&
|
|
1062
|
+
Array.isArray(value) &&
|
|
1063
|
+
value.length === 1
|
|
1064
|
+
? value[0]
|
|
1065
|
+
: value,
|
|
1066
|
+
]))),
|
|
1019
1067
|
};
|
|
1020
1068
|
}
|
|
1021
1069
|
function replaceExactTemplateString(value, expected, replacement) {
|
|
@@ -1031,11 +1079,13 @@ function replaceExactTemplateString(value, expected, replacement) {
|
|
|
1031
1079
|
replaceExactTemplateString(entry, expected, replacement),
|
|
1032
1080
|
]));
|
|
1033
1081
|
}
|
|
1034
|
-
function compactExactTemplatePolicyStrings(documents, values) {
|
|
1082
|
+
function compactExactTemplatePolicyStrings(documents, values, compactLists = false) {
|
|
1035
1083
|
const constants = {};
|
|
1036
1084
|
const replacements = new Map();
|
|
1037
1085
|
for (const value of [...new Set(values)].sort(compareStrings)) {
|
|
1038
|
-
const key =
|
|
1086
|
+
const key = compactLists
|
|
1087
|
+
? replacements.size.toString(36)
|
|
1088
|
+
: `A${replacements.size}`;
|
|
1039
1089
|
const replacement = Object.freeze({
|
|
1040
1090
|
'Fn::FindInMap': Object.freeze(['A', 'V', key]),
|
|
1041
1091
|
});
|
|
@@ -1044,10 +1094,98 @@ function compactExactTemplatePolicyStrings(documents, values) {
|
|
|
1044
1094
|
}
|
|
1045
1095
|
if (replacements.size === 0)
|
|
1046
1096
|
return Object.freeze({ documents });
|
|
1047
|
-
|
|
1097
|
+
let compactedDocuments = Object.fromEntries(Object.entries(documents).map(([logicalId, document]) => [
|
|
1048
1098
|
logicalId,
|
|
1049
|
-
[...replacements.entries()].reduce((current, [
|
|
1099
|
+
[...replacements.entries()].reduce((current, [literal, replacement]) => replaceExactTemplateString(current, literal, replacement), document),
|
|
1050
1100
|
]));
|
|
1101
|
+
if (compactLists) {
|
|
1102
|
+
const counts = new Map();
|
|
1103
|
+
const collect = (value) => {
|
|
1104
|
+
if (Array.isArray(value) &&
|
|
1105
|
+
value.every((entry) => typeof entry === 'string')) {
|
|
1106
|
+
const key = JSON.stringify(value);
|
|
1107
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
1108
|
+
}
|
|
1109
|
+
else if (Array.isArray(value))
|
|
1110
|
+
value.forEach(collect);
|
|
1111
|
+
else if (value && typeof value === 'object')
|
|
1112
|
+
Object.values(value).forEach(collect);
|
|
1113
|
+
};
|
|
1114
|
+
collect(compactedDocuments);
|
|
1115
|
+
const listReferences = new Map();
|
|
1116
|
+
for (const [literal, count] of [...counts].sort(([a], [b]) => compareStrings(a, b))) {
|
|
1117
|
+
if ((count - 1) * literal.length <= count * 36 + 24)
|
|
1118
|
+
continue;
|
|
1119
|
+
const key = (replacements.size + listReferences.size).toString(36);
|
|
1120
|
+
constants[key] = JSON.parse(literal);
|
|
1121
|
+
listReferences.set(literal, { 'Fn::FindInMap': ['A', 'V', key] });
|
|
1122
|
+
}
|
|
1123
|
+
const replaceLists = (value) => {
|
|
1124
|
+
if (Array.isArray(value)) {
|
|
1125
|
+
const reference = listReferences.get(JSON.stringify(value));
|
|
1126
|
+
return reference ?? value.map(replaceLists);
|
|
1127
|
+
}
|
|
1128
|
+
if (value && typeof value === 'object')
|
|
1129
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
1130
|
+
key,
|
|
1131
|
+
replaceLists(entry),
|
|
1132
|
+
]));
|
|
1133
|
+
return value;
|
|
1134
|
+
};
|
|
1135
|
+
compactedDocuments = replaceLists(compactedDocuments);
|
|
1136
|
+
// Fn::Split is resolved by CloudFormation before IAM evaluates the
|
|
1137
|
+
// document. Long literal lists can omit JSON's repeated quotes without
|
|
1138
|
+
// introducing wildcards, changing order, or changing a single permission.
|
|
1139
|
+
// Mapping values themselves stay literal (intrinsics are not valid there).
|
|
1140
|
+
const encodeLiteralLists = (value) => {
|
|
1141
|
+
if (Array.isArray(value)) {
|
|
1142
|
+
if (value.every((entry) => typeof entry === 'string' && !entry.includes(','))) {
|
|
1143
|
+
let encoded = { 'Fn::Split': [',', value.join(',')] };
|
|
1144
|
+
// Factor only a literal ARN prefix. CloudFormation expands it back
|
|
1145
|
+
// before IAM sees the list; IAM policy variables must stay literal.
|
|
1146
|
+
if (value.length > 1 &&
|
|
1147
|
+
value.every((entry) => entry.startsWith('arn:') && !entry.includes('${'))) {
|
|
1148
|
+
let prefix = value[0];
|
|
1149
|
+
for (const entry of value)
|
|
1150
|
+
while (!entry.startsWith(prefix))
|
|
1151
|
+
prefix = prefix.slice(0, -1);
|
|
1152
|
+
const factored = {
|
|
1153
|
+
'Fn::Split': [
|
|
1154
|
+
',',
|
|
1155
|
+
{
|
|
1156
|
+
'Fn::Sub': [
|
|
1157
|
+
value
|
|
1158
|
+
.map((entry) => '${P}' + entry.slice(prefix.length))
|
|
1159
|
+
.join(','),
|
|
1160
|
+
{ P: prefix },
|
|
1161
|
+
],
|
|
1162
|
+
},
|
|
1163
|
+
],
|
|
1164
|
+
};
|
|
1165
|
+
if (JSON.stringify(factored).length < JSON.stringify(encoded).length)
|
|
1166
|
+
encoded = factored;
|
|
1167
|
+
}
|
|
1168
|
+
if (JSON.stringify(encoded).length < JSON.stringify(value).length)
|
|
1169
|
+
return encoded;
|
|
1170
|
+
}
|
|
1171
|
+
return value.map(encodeLiteralLists);
|
|
1172
|
+
}
|
|
1173
|
+
if (value && typeof value === 'object')
|
|
1174
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
1175
|
+
key,
|
|
1176
|
+
encodeLiteralLists(entry),
|
|
1177
|
+
]));
|
|
1178
|
+
return value;
|
|
1179
|
+
};
|
|
1180
|
+
compactedDocuments = encodeLiteralLists(compactedDocuments);
|
|
1181
|
+
}
|
|
1182
|
+
if (compactLists) {
|
|
1183
|
+
const serialized = JSON.stringify(compactedDocuments);
|
|
1184
|
+
for (const key of Object.keys(constants)) {
|
|
1185
|
+
if (!serialized.includes(JSON.stringify(['A', 'V', key])))
|
|
1186
|
+
delete constants[key];
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1051
1189
|
return Object.freeze({
|
|
1052
1190
|
documents: Object.freeze(compactedDocuments),
|
|
1053
1191
|
// These short, template-private identifiers avoid repeating long exact
|
|
@@ -1058,13 +1196,35 @@ function compactExactTemplatePolicyStrings(documents, values) {
|
|
|
1058
1196
|
}),
|
|
1059
1197
|
});
|
|
1060
1198
|
}
|
|
1199
|
+
function repeatedDevelopmentPolicyStrings(documents) {
|
|
1200
|
+
const counts = new Map();
|
|
1201
|
+
const visit = (value) => {
|
|
1202
|
+
if (typeof value === 'string')
|
|
1203
|
+
counts.set(value, (counts.get(value) ?? 0) + 1);
|
|
1204
|
+
else if (Array.isArray(value))
|
|
1205
|
+
value.forEach(visit);
|
|
1206
|
+
else if (value && typeof value === 'object')
|
|
1207
|
+
Object.values(value).forEach(visit);
|
|
1208
|
+
};
|
|
1209
|
+
visit(documents);
|
|
1210
|
+
// Exact FindInMap substitution only; admit entries whose repeated bytes pay
|
|
1211
|
+
// for both the mapping and references. No IAM statement semantics change.
|
|
1212
|
+
return [...counts]
|
|
1213
|
+
.filter(([value, count]) => (count - 1) * value.length > count * 36 + 24)
|
|
1214
|
+
.map(([value]) => value);
|
|
1215
|
+
}
|
|
1061
1216
|
function statement(input) {
|
|
1217
|
+
if ((input.Action === undefined) === (input.NotAction === undefined)) {
|
|
1218
|
+
throw new Error('Stage authority statements require exactly one Action or NotAction scope.');
|
|
1219
|
+
}
|
|
1062
1220
|
if ((input.Resource === undefined) === (input.NotResource === undefined)) {
|
|
1063
1221
|
throw new Error('Stage authority statements require exactly one Resource or NotResource scope.');
|
|
1064
1222
|
}
|
|
1065
1223
|
return {
|
|
1066
1224
|
...input,
|
|
1067
|
-
|
|
1225
|
+
...(input.Action
|
|
1226
|
+
? { Action: [...input.Action].sort(compareStrings) }
|
|
1227
|
+
: { NotAction: [...(input.NotAction ?? [])].sort(compareStrings) }),
|
|
1068
1228
|
...(input.Resource
|
|
1069
1229
|
? { Resource: [...input.Resource].sort(compareStrings) }
|
|
1070
1230
|
: {}),
|
|
@@ -1177,7 +1337,7 @@ function requireTrust(input, identity) {
|
|
|
1177
1337
|
};
|
|
1178
1338
|
}
|
|
1179
1339
|
function runtimeBoundaryPolicy(options) {
|
|
1180
|
-
|
|
1340
|
+
const statements = [
|
|
1181
1341
|
statement({
|
|
1182
1342
|
Action: exports.STAGE_RUNTIME_REGIONAL_ACTIONS,
|
|
1183
1343
|
Condition: {
|
|
@@ -1251,7 +1411,175 @@ function runtimeBoundaryPolicy(options) {
|
|
|
1251
1411
|
Resource: ['*'],
|
|
1252
1412
|
Sid: 'DenyRuntimePrivilegeConstruction',
|
|
1253
1413
|
}),
|
|
1254
|
-
]
|
|
1414
|
+
];
|
|
1415
|
+
if (options.stage === 'development') {
|
|
1416
|
+
const regionalGuardIndex = statements.findIndex((entry) => entry.Sid === 'DenyRuntimeOutsideStageRegion');
|
|
1417
|
+
const regionalGuard = statements[regionalGuardIndex];
|
|
1418
|
+
if (!regionalGuard?.Action)
|
|
1419
|
+
throw new Error('Runtime Region guard is missing.');
|
|
1420
|
+
// Development has only these global runtime exceptions. Denying every
|
|
1421
|
+
// other action outside the Region preserves all admitted runtime calls
|
|
1422
|
+
// while strengthening the old service-family deny, including AppSync.
|
|
1423
|
+
statements[regionalGuardIndex] = statement({
|
|
1424
|
+
Sid: regionalGuard.Sid,
|
|
1425
|
+
NotAction: [
|
|
1426
|
+
...exports.STAGE_RUNTIME_GLOBAL_ACTIONS,
|
|
1427
|
+
'iam:PassRole',
|
|
1428
|
+
'sts:GetCallerIdentity',
|
|
1429
|
+
],
|
|
1430
|
+
Effect: 'Deny',
|
|
1431
|
+
Resource: ['*'],
|
|
1432
|
+
Condition: regionalGuard.Condition,
|
|
1433
|
+
});
|
|
1434
|
+
const privilegeGuard = statements.find((entry) => entry.Sid === 'DenyRuntimePrivilegeConstruction');
|
|
1435
|
+
if (!privilegeGuard?.Action)
|
|
1436
|
+
throw new Error('Runtime privilege guard is missing.');
|
|
1437
|
+
// These deny-only patterns cover every original privilege action and no
|
|
1438
|
+
// admitted runtime action (notably iam:PassRole). Protected stages retain
|
|
1439
|
+
// their byte-identical explicit inventory.
|
|
1440
|
+
privilegeGuard.Action = [
|
|
1441
|
+
'account:*',
|
|
1442
|
+
'iam:*Boundary',
|
|
1443
|
+
'iam:*Policy*',
|
|
1444
|
+
'iam:Create*',
|
|
1445
|
+
'iam:Delete*',
|
|
1446
|
+
'organizations:*',
|
|
1447
|
+
'sts:AssumeRole',
|
|
1448
|
+
];
|
|
1449
|
+
// Native SST dev uses one untagged account/Region AppSync Events API and
|
|
1450
|
+
// its `sst` namespace. IAM cannot isolate nested task channel paths. This
|
|
1451
|
+
// is a shared development control plane, not an application event bus.
|
|
1452
|
+
// The boundary narrows SST's appsync:* identity grant to transport only.
|
|
1453
|
+
statements.push(...nativeDevelopmentTransportStatements({
|
|
1454
|
+
accountId: options.accountId,
|
|
1455
|
+
partition: options.identity.boundaryArn.split(':')[1],
|
|
1456
|
+
region: options.region,
|
|
1457
|
+
initialize: false,
|
|
1458
|
+
}));
|
|
1459
|
+
const canonicalGuard = statements.find((entry) => entry.Sid === 'DenyRuntimeKnownOtherStageResources');
|
|
1460
|
+
if (!canonicalGuard)
|
|
1461
|
+
throw new Error('Runtime stage guard is missing.');
|
|
1462
|
+
canonicalGuard.Condition = {
|
|
1463
|
+
...canonicalGuard.Condition,
|
|
1464
|
+
StringEquals: { 'aws:PrincipalTag/ebk:stage': 'development' },
|
|
1465
|
+
};
|
|
1466
|
+
const taskPrincipal = {
|
|
1467
|
+
StringLike: { 'aws:PrincipalTag/ebk:stage': TASK_STAGE_IAM_SHAPE },
|
|
1468
|
+
};
|
|
1469
|
+
const partition = options.identity.boundaryArn.split(':')[1];
|
|
1470
|
+
// Native Lambda creates an untagged ENI against existing Foundation
|
|
1471
|
+
// subnets/security groups. Neither VPCs nor existing shared ENIs are
|
|
1472
|
+
// exempted. Task-owned VPC topology is not generated by this contract.
|
|
1473
|
+
const sharedNetwork = ['subnet', 'security-group'].map((resource) => `arn:${partition}:ec2:${options.region}:${options.accountId}:${resource}/*`);
|
|
1474
|
+
const shared = [
|
|
1475
|
+
`arn:${partition}:events:${options.region}:${options.accountId}:event-bus/foundation-development-FoundationEventBusBus-*`,
|
|
1476
|
+
`arn:${partition}:cognito-idp:${options.region}:${options.accountId}:userpool/*`,
|
|
1477
|
+
...sharedNetwork,
|
|
1478
|
+
];
|
|
1479
|
+
const sharedActions = [
|
|
1480
|
+
'ec2:CreateNetworkInterface',
|
|
1481
|
+
'events:PutEvents',
|
|
1482
|
+
...exports.STAGE_RUNTIME_REGIONAL_ACTIONS.filter((action) => action.startsWith('cognito-idp:')),
|
|
1483
|
+
];
|
|
1484
|
+
statements.push(statement({
|
|
1485
|
+
Sid: 'DenyRuntimeMissingOrInvalidPrincipalStage',
|
|
1486
|
+
Action: ['*'],
|
|
1487
|
+
Effect: 'Deny',
|
|
1488
|
+
Resource: ['*'],
|
|
1489
|
+
Condition: {
|
|
1490
|
+
StringNotLike: {
|
|
1491
|
+
'aws:PrincipalTag/ebk:stage': ['development', TASK_STAGE_IAM_SHAPE],
|
|
1492
|
+
},
|
|
1493
|
+
},
|
|
1494
|
+
}), statement({
|
|
1495
|
+
Sid: 'DenyTaskRuntimeOtherTaggedResources',
|
|
1496
|
+
Action: ['*'],
|
|
1497
|
+
Effect: 'Deny',
|
|
1498
|
+
NotResource: shared,
|
|
1499
|
+
Condition: {
|
|
1500
|
+
...taskPrincipal,
|
|
1501
|
+
Null: { 'aws:ResourceTag/ebk:stage': 'false' },
|
|
1502
|
+
StringNotEquals: {
|
|
1503
|
+
'aws:ResourceTag/ebk:stage': TASK_PRINCIPAL_STAGE,
|
|
1504
|
+
},
|
|
1505
|
+
},
|
|
1506
|
+
}), ...['ebk:stage', 'ebk:owner'].map((key) => statement({
|
|
1507
|
+
Sid: `DenyTaskRuntimeUnownedShared${key.split(':')[1]}`,
|
|
1508
|
+
Action: ['*'],
|
|
1509
|
+
Effect: 'Deny',
|
|
1510
|
+
Resource: shared,
|
|
1511
|
+
Condition: {
|
|
1512
|
+
StringNotEquals: {
|
|
1513
|
+
[`aws:ResourceTag/${key}`]: key === 'ebk:stage' ? 'development' : 'foundation',
|
|
1514
|
+
},
|
|
1515
|
+
},
|
|
1516
|
+
})), statement({
|
|
1517
|
+
Sid: 'DenyTaskRuntimeUnlinkedSharedActions',
|
|
1518
|
+
// The boundary is only a ceiling. Existing native link/VPC identity
|
|
1519
|
+
// policies still determine effective permissions. AWS's resource-type
|
|
1520
|
+
// contracts prevent this union from granting cross-service operations.
|
|
1521
|
+
// Shared guards also constrain canonical-development runtime roles to
|
|
1522
|
+
// generated Foundation ownership; protected stages are unchanged.
|
|
1523
|
+
NotAction: sharedActions,
|
|
1524
|
+
Effect: 'Deny',
|
|
1525
|
+
Resource: shared,
|
|
1526
|
+
}), statement({
|
|
1527
|
+
Sid: 'DenyRuntimeUnownedSharedNetworkWorkspace',
|
|
1528
|
+
Action: ['*'],
|
|
1529
|
+
Effect: 'Deny',
|
|
1530
|
+
Resource: sharedNetwork,
|
|
1531
|
+
Condition: {
|
|
1532
|
+
StringNotEquals: {
|
|
1533
|
+
'aws:ResourceTag/ebk:workspace': "${aws:PrincipalTag/ebk:workspace, ''}",
|
|
1534
|
+
},
|
|
1535
|
+
},
|
|
1536
|
+
}));
|
|
1537
|
+
}
|
|
1538
|
+
// Tagless APIs retain their existing exact native-link identity policies;
|
|
1539
|
+
// this boundary does not pretend unsupported ResourceTag keys are present.
|
|
1540
|
+
return policy(statements);
|
|
1541
|
+
}
|
|
1542
|
+
function nativeDevelopmentTransportStatements(options) {
|
|
1543
|
+
const api = `arn:${options.partition}:appsync:${options.region}:${options.accountId}:apis/*`;
|
|
1544
|
+
const Condition = {
|
|
1545
|
+
StringEquals: { 'aws:RequestedRegion': options.region },
|
|
1546
|
+
};
|
|
1547
|
+
return [
|
|
1548
|
+
...(options.initialize
|
|
1549
|
+
? [
|
|
1550
|
+
statement({
|
|
1551
|
+
// SST supplies neither tags nor a logging role. AWS has no API-name
|
|
1552
|
+
// condition for CreateApi, and ListApis requires Resource: *.
|
|
1553
|
+
Action: ['appsync:CreateApi', 'appsync:ListApis'],
|
|
1554
|
+
Condition,
|
|
1555
|
+
Effect: 'Allow',
|
|
1556
|
+
Resource: ['*'],
|
|
1557
|
+
Sid: 'InitializeNativeDevelopmentTransport',
|
|
1558
|
+
}),
|
|
1559
|
+
]
|
|
1560
|
+
: []),
|
|
1561
|
+
statement({
|
|
1562
|
+
Action: [
|
|
1563
|
+
'appsync:EventConnect',
|
|
1564
|
+
...(options.initialize ? ['appsync:GetApi'] : []),
|
|
1565
|
+
],
|
|
1566
|
+
...(options.initialize ? { Condition } : {}),
|
|
1567
|
+
Effect: 'Allow',
|
|
1568
|
+
Resource: [api],
|
|
1569
|
+
Sid: 'ConnectNativeDevelopmentTransport',
|
|
1570
|
+
}),
|
|
1571
|
+
statement({
|
|
1572
|
+
Action: [
|
|
1573
|
+
'appsync:EventPublish',
|
|
1574
|
+
'appsync:EventSubscribe',
|
|
1575
|
+
...(options.initialize ? ['appsync:CreateChannelNamespace'] : []),
|
|
1576
|
+
],
|
|
1577
|
+
...(options.initialize ? { Condition } : {}),
|
|
1578
|
+
Effect: 'Allow',
|
|
1579
|
+
Resource: [`${api}/channelNamespace/sst`],
|
|
1580
|
+
Sid: 'UseNativeDevelopmentNamespace',
|
|
1581
|
+
}),
|
|
1582
|
+
];
|
|
1255
1583
|
}
|
|
1256
1584
|
const SST_4_17_1_PHYSICAL_NAME_RANDOM_SUFFIX_LENGTH = 9;
|
|
1257
1585
|
const FOUNDATION_ROUTER_CLOUDFRONT_FUNCTION_NAMES = [
|
|
@@ -1277,6 +1605,95 @@ function generatedRouterCloudFrontFunctionResources(options, stage) {
|
|
|
1277
1605
|
stage,
|
|
1278
1606
|
})}`).sort(compareStrings);
|
|
1279
1607
|
}
|
|
1608
|
+
/** Expand only existing task-app namespace contracts, never Foundation names. */
|
|
1609
|
+
function taskNamespaceResources(resources) {
|
|
1610
|
+
return [
|
|
1611
|
+
...new Set(resources.flatMap((resource) => {
|
|
1612
|
+
if (/foundation|Foundation|workspace-owner|:rds:|:backup:|:wafv2:|:iam:/u.test(resource))
|
|
1613
|
+
return [resource];
|
|
1614
|
+
let task = resource;
|
|
1615
|
+
if (resource.includes('/sst/passphrase/')) {
|
|
1616
|
+
task = resource.replace(/\/development$/u, `/${TASK_STAGE_IAM_SHAPE}`);
|
|
1617
|
+
}
|
|
1618
|
+
else if (resource.includes(':parameter/*development*')) {
|
|
1619
|
+
// Native task state is not an arbitrary parameter containing "personal".
|
|
1620
|
+
return [
|
|
1621
|
+
resource,
|
|
1622
|
+
resource.replace(':parameter/*development*', `:parameter/sst/passphrase/*/${TASK_STAGE_IAM_SHAPE}`),
|
|
1623
|
+
];
|
|
1624
|
+
}
|
|
1625
|
+
else {
|
|
1626
|
+
task = resource
|
|
1627
|
+
.replace(/-development-/gu, `-${TASK_STAGE_IAM_SHAPE}-`)
|
|
1628
|
+
.replace(/\/ebk\/development\//gu, `/ebk/${TASK_STAGE_IAM_SHAPE}/`)
|
|
1629
|
+
.replace(/:secret:ebk\/development\//gu, `:secret:ebk/${TASK_STAGE_IAM_SHAPE}/`)
|
|
1630
|
+
.replace(/:alias\/ebk-development-/gu, `:alias/ebk-${TASK_STAGE_IAM_SHAPE}-`);
|
|
1631
|
+
}
|
|
1632
|
+
return task === resource ? [resource] : [resource, task];
|
|
1633
|
+
})),
|
|
1634
|
+
].sort(compareStrings);
|
|
1635
|
+
}
|
|
1636
|
+
function admitDevelopmentTaskNamespaces(statements) {
|
|
1637
|
+
const tagged = new Set([
|
|
1638
|
+
'MutateFixedRegionalServiceFamilies',
|
|
1639
|
+
'MutateEdgeCertificates',
|
|
1640
|
+
'DenyExplicitOtherStageRequestTag',
|
|
1641
|
+
'DenyKnownOtherStageResourceMutation',
|
|
1642
|
+
'DescribeOnlyTaggedStageWorkflowExecutions',
|
|
1643
|
+
'DenyWorkflowExecutionReadWithoutStageTag',
|
|
1644
|
+
'StartOnlyTaggedStageWorkflowExecutions',
|
|
1645
|
+
'CreateTaggedMachineAuthorizationStacks',
|
|
1646
|
+
'MutateTaggedMachineAuthorizationStacks',
|
|
1647
|
+
'CreateOnlyAwsResourceKmsGrants',
|
|
1648
|
+
'EnableRotationOnStageKmsKeys',
|
|
1649
|
+
'RetireOnlyTaggedNonProductionKmsKeys',
|
|
1650
|
+
'InvalidateOnlyStageCloudFrontDistributions',
|
|
1651
|
+
'InvokeOnlyStageLambdaFunctions',
|
|
1652
|
+
'AddOnlyReviewedStageLambdaIntegrations',
|
|
1653
|
+
'AddOnlyPublicStageLambdaFunctionUrlAccess',
|
|
1654
|
+
'AddOnlyPublicStageLambdaFunctionUrlInvoke',
|
|
1655
|
+
'RemoveOnlyStageLambdaIntegrations',
|
|
1656
|
+
]);
|
|
1657
|
+
const named = new Set([
|
|
1658
|
+
'SetOnlyStageQueueAttributes',
|
|
1659
|
+
'DenyQueueAttributeMutationOutsideStage',
|
|
1660
|
+
'SetOnlyStageTopicAttributes',
|
|
1661
|
+
'DenyTopicAttributeMutationOutsideStage',
|
|
1662
|
+
'DenyUntaggedMutationOutsideStageAndSstResources',
|
|
1663
|
+
'DenyBucketPolicyMutationOutsideStageAndSstBootstrap',
|
|
1664
|
+
'DenyUnapprovedSsmValueReads',
|
|
1665
|
+
'DenySecretMetadataUpdateOutsideStageContainers',
|
|
1666
|
+
'DenyEdgeLogGroupMutationOutsideGeneratedStageLogs',
|
|
1667
|
+
]);
|
|
1668
|
+
for (const sid of new Set([...tagged, ...named])) {
|
|
1669
|
+
if (statements.filter((entry) => entry.Sid === sid).length !== 1) {
|
|
1670
|
+
throw new Error(`Task authority propagation requires exactly one ${sid} statement.`);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
for (const entry of statements) {
|
|
1674
|
+
if (tagged.has(entry.Sid) && entry.Condition) {
|
|
1675
|
+
const conditions = {};
|
|
1676
|
+
for (const [operator, values] of Object.entries(entry.Condition)) {
|
|
1677
|
+
for (const [key, value] of Object.entries(values)) {
|
|
1678
|
+
const taskTag = ['aws:RequestTag/ebk:stage', 'aws:ResourceTag/ebk:stage'].includes(key) && value === 'development';
|
|
1679
|
+
const taskOperator = taskTag
|
|
1680
|
+
? operator.replace('Equals', 'Like')
|
|
1681
|
+
: operator;
|
|
1682
|
+
(conditions[taskOperator] ??= {})[key] = taskTag
|
|
1683
|
+
? ['development', TASK_STAGE_IAM_SHAPE]
|
|
1684
|
+
: value;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
entry.Condition = conditions;
|
|
1688
|
+
}
|
|
1689
|
+
if (named.has(entry.Sid)) {
|
|
1690
|
+
if (entry.Resource)
|
|
1691
|
+
entry.Resource = taskNamespaceResources(entry.Resource);
|
|
1692
|
+
if (entry.NotResource)
|
|
1693
|
+
entry.NotResource = taskNamespaceResources(entry.NotResource);
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1280
1697
|
function deploymentPolicy(options) {
|
|
1281
1698
|
const edgeRegion = edgeControlRegion(options.partition, options.region);
|
|
1282
1699
|
const managedPolicies = exports.STAGE_AUTHORITY_APPROVED_AWS_MANAGED_POLICIES.map((name) => `arn:${options.partition}:iam::aws:policy/${name}`);
|
|
@@ -1537,7 +1954,23 @@ function deploymentPolicy(options) {
|
|
|
1537
1954
|
// action-specific condition key; reviewed generated source is the control
|
|
1538
1955
|
// for its uninspectable payload, and the request remains edge-Region-bound.
|
|
1539
1956
|
statement({
|
|
1540
|
-
Action:
|
|
1957
|
+
Action: [
|
|
1958
|
+
...exports.STAGE_AUTHORITY_EDGE_WAF_LOG_DELIVERY_MUTATION_ACTIONS,
|
|
1959
|
+
// Cloud Control has no resource-level or TypeName condition support.
|
|
1960
|
+
// Use the caller's temporary session, never a service RoleArn. The
|
|
1961
|
+
// underlying resource operations retain the deployer's guardrails.
|
|
1962
|
+
...exports.STAGE_AUTHORITY_CLOUDCONTROL_EDGE_MUTATION_ACTIONS,
|
|
1963
|
+
// The ordinary regional read grant already covers a same-Region
|
|
1964
|
+
// deployment. CloudFront still needs these exact reads at the edge
|
|
1965
|
+
// endpoint when application resources live elsewhere.
|
|
1966
|
+
...(options.region === edgeRegion
|
|
1967
|
+
? []
|
|
1968
|
+
: [
|
|
1969
|
+
'cloudformation:DescribeType',
|
|
1970
|
+
'cloudformation:GetResource',
|
|
1971
|
+
'cloudformation:GetResourceRequestStatus',
|
|
1972
|
+
]),
|
|
1973
|
+
],
|
|
1541
1974
|
Condition: {
|
|
1542
1975
|
StringEquals: { 'aws:RequestedRegion': edgeRegion },
|
|
1543
1976
|
},
|
|
@@ -2313,7 +2746,10 @@ function deploymentPolicy(options) {
|
|
|
2313
2746
|
Sid: 'DenyEdgeControlMutationOutsideEdgeRegion',
|
|
2314
2747
|
}),
|
|
2315
2748
|
statement({
|
|
2316
|
-
Action:
|
|
2749
|
+
Action: [
|
|
2750
|
+
...exports.STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES.filter((family) => family !== 'cloudformation:*'),
|
|
2751
|
+
...exports.STAGE_AUTHORITY_CLOUDFORMATION_LIFECYCLE_ACTIONS,
|
|
2752
|
+
],
|
|
2317
2753
|
Condition: {
|
|
2318
2754
|
StringNotEquals: { 'aws:RequestedRegion': options.region },
|
|
2319
2755
|
},
|
|
@@ -2548,7 +2984,69 @@ function deploymentPolicy(options) {
|
|
|
2548
2984
|
Sid: 'DenyProtectedProductionRetentionDeletion',
|
|
2549
2985
|
}));
|
|
2550
2986
|
}
|
|
2551
|
-
|
|
2987
|
+
if (options.stage === 'development') {
|
|
2988
|
+
admitDevelopmentTaskNamespaces(statements);
|
|
2989
|
+
const privilege = statements.find(({ Sid }) => Sid === 'DenyAccountAndPrivilegeAdministration');
|
|
2990
|
+
if (!privilege?.Action)
|
|
2991
|
+
throw new Error('Deployment privilege guard is missing.');
|
|
2992
|
+
privilege.Action = privilege.Action.filter((action) => action !== 'sts:AssumeRole');
|
|
2993
|
+
// Native SST EnvFor assumes the SSR dev-server role, not the deployment
|
|
2994
|
+
// identity, for local application code. Preserve every other assumption
|
|
2995
|
+
// deny, protected-stage policy, created-role boundary and trust control.
|
|
2996
|
+
// Native physical names can truncate even the component suffix for long
|
|
2997
|
+
// valid Slice names. Bind purpose by a generated role tag, not that suffix.
|
|
2998
|
+
const nativeWebRoles = [options.identity.workloadRoleArnPattern];
|
|
2999
|
+
statements.push(...Object.entries({
|
|
3000
|
+
Region: ['aws:RequestedRegion', options.region],
|
|
3001
|
+
Session: ['sts:RoleSessionName', 'sst-dev'],
|
|
3002
|
+
Purpose: ['aws:ResourceTag/ebk:dev-runtime', 'web'],
|
|
3003
|
+
}).map(([label, [key, value]]) => statement({
|
|
3004
|
+
Sid: `DenyDevAssume${label}`,
|
|
3005
|
+
Effect: 'Deny',
|
|
3006
|
+
Action: ['sts:AssumeRole'],
|
|
3007
|
+
Resource: nativeWebRoles,
|
|
3008
|
+
// Negated conditions also deny a missing key. Separate statements
|
|
3009
|
+
// encode OR: any invalid attribute blocks an unrelated attached Allow.
|
|
3010
|
+
Condition: { StringNotEquals: { [key]: value } },
|
|
3011
|
+
})), statement({
|
|
3012
|
+
Sid: 'DenyDevAssumeStage',
|
|
3013
|
+
Effect: 'Deny',
|
|
3014
|
+
Action: ['sts:AssumeRole'],
|
|
3015
|
+
Resource: nativeWebRoles,
|
|
3016
|
+
Condition: {
|
|
3017
|
+
StringNotLike: {
|
|
3018
|
+
'aws:ResourceTag/ebk:stage': ['development', TASK_STAGE_IAM_SHAPE],
|
|
3019
|
+
},
|
|
3020
|
+
},
|
|
3021
|
+
}), statement({
|
|
3022
|
+
Sid: 'AssumeNativeDevelopmentWebRuntime',
|
|
3023
|
+
Effect: 'Allow',
|
|
3024
|
+
Action: ['sts:AssumeRole'],
|
|
3025
|
+
Resource: nativeWebRoles,
|
|
3026
|
+
Condition: {
|
|
3027
|
+
StringEquals: {
|
|
3028
|
+
'aws:RequestedRegion': options.region,
|
|
3029
|
+
'sts:RoleSessionName': 'sst-dev',
|
|
3030
|
+
'aws:ResourceTag/ebk:dev-runtime': 'web',
|
|
3031
|
+
},
|
|
3032
|
+
StringLike: {
|
|
3033
|
+
'aws:ResourceTag/ebk:stage': ['development', TASK_STAGE_IAM_SHAPE],
|
|
3034
|
+
},
|
|
3035
|
+
},
|
|
3036
|
+
}), statement({
|
|
3037
|
+
Sid: 'DenyAssumptionOutsideNativeDevelopmentWebRuntime',
|
|
3038
|
+
Effect: 'Deny',
|
|
3039
|
+
Action: ['sts:AssumeRole'],
|
|
3040
|
+
NotResource: nativeWebRoles,
|
|
3041
|
+
}));
|
|
3042
|
+
statements.push(...nativeDevelopmentTransportStatements({
|
|
3043
|
+
accountId: options.accountId,
|
|
3044
|
+
partition: options.partition,
|
|
3045
|
+
region: options.region,
|
|
3046
|
+
initialize: true,
|
|
3047
|
+
}));
|
|
3048
|
+
}
|
|
3049
|
+
let groups = [
|
|
2552
3050
|
{
|
|
2553
3051
|
kind: 'read',
|
|
2554
3052
|
logicalId: 'StageDeploymentReadPolicy',
|
|
@@ -2562,11 +3060,17 @@ function deploymentPolicy(options) {
|
|
|
2562
3060
|
'DenyWorkflowExecutionReadOutsideAccount',
|
|
2563
3061
|
'DenyUnapprovedSsmValueReads',
|
|
2564
3062
|
'CreateOnlyAwsResourceKmsGrants',
|
|
2565
|
-
'ManageEdgeWafLogDeliveryControlPlane',
|
|
2566
3063
|
'ManageOnlyGeneratedEdgeWafLogGroup',
|
|
2567
3064
|
'PutOnlyStageRouterWafLogging',
|
|
2568
3065
|
'ReadFixedGlobalServiceFamilies',
|
|
2569
3066
|
'ReadFixedRegionalServiceFamilies',
|
|
3067
|
+
...(options.stage === 'development'
|
|
3068
|
+
? [
|
|
3069
|
+
'InitializeNativeDevelopmentTransport',
|
|
3070
|
+
'ConnectNativeDevelopmentTransport',
|
|
3071
|
+
'UseNativeDevelopmentNamespace',
|
|
3072
|
+
]
|
|
3073
|
+
: []),
|
|
2570
3074
|
'DenyWorkflowExecutionReadWithoutStageTag',
|
|
2571
3075
|
'DescribeOnlyTaggedStageWorkflowExecutions',
|
|
2572
3076
|
...(options.stage === 'production'
|
|
@@ -2606,6 +3110,9 @@ function deploymentPolicy(options) {
|
|
|
2606
3110
|
'DenyTopicAttributeMutationOutsideStage',
|
|
2607
3111
|
'DenyUnscopedLambdaPermissions',
|
|
2608
3112
|
'ManageStageWorkloadIdentities',
|
|
3113
|
+
...(options.stage === 'development'
|
|
3114
|
+
? ['AssumeNativeDevelopmentWebRuntime']
|
|
3115
|
+
: []),
|
|
2609
3116
|
'PassOnlyStageWorkloadRoles',
|
|
2610
3117
|
'RemoveOnlyStageLambdaIntegrations',
|
|
2611
3118
|
'SetOnlyStageQueueAttributes',
|
|
@@ -2617,6 +3124,15 @@ function deploymentPolicy(options) {
|
|
|
2617
3124
|
logicalId: 'StageDeploymentGlobalResourceMutationPolicy',
|
|
2618
3125
|
sids: [
|
|
2619
3126
|
'DenyCrossAccountMutationWhenResourceAccountIsKnown',
|
|
3127
|
+
...(options.stage === 'development'
|
|
3128
|
+
? ['DenyRuntimeTrustPolicyMutation']
|
|
3129
|
+
: []),
|
|
3130
|
+
...(options.stage === 'development'
|
|
3131
|
+
? ['ReadEdgeCertificateControlPlane']
|
|
3132
|
+
: []),
|
|
3133
|
+
...(options.stage === 'development'
|
|
3134
|
+
? ['ReadEdgeObservabilityControlPlane']
|
|
3135
|
+
: []),
|
|
2620
3136
|
'DenyCrossAccountRunInstancesTargets',
|
|
2621
3137
|
'DenyLogsMutationOutsideStageAndEdgeRegions',
|
|
2622
3138
|
'DenyRunInstancesFromUnapprovedReferenceOwners',
|
|
@@ -2624,6 +3140,7 @@ function deploymentPolicy(options) {
|
|
|
2624
3140
|
'LaunchStageInfrastructureFromApprovedReferences',
|
|
2625
3141
|
'MutateAccountCloudFront',
|
|
2626
3142
|
'MutateCloudFrontScopeWafInEdgeRegion',
|
|
3143
|
+
'ManageEdgeWafLogDeliveryControlPlane',
|
|
2627
3144
|
'MutateFixedGlobalServiceFamilies',
|
|
2628
3145
|
'CreateOnlyTaggedStageAccountBudget',
|
|
2629
3146
|
'DenyStageAccountBudgetStageTagRemoval',
|
|
@@ -2634,6 +3151,9 @@ function deploymentPolicy(options) {
|
|
|
2634
3151
|
kind: 'generated-resource-mutation',
|
|
2635
3152
|
logicalId: 'StageDeploymentGeneratedResourceMutationPolicy',
|
|
2636
3153
|
sids: [
|
|
3154
|
+
...(options.stage === 'development'
|
|
3155
|
+
? ['DenyKnownOtherStageResourceMutation']
|
|
3156
|
+
: []),
|
|
2637
3157
|
'AddOnlyPublicStageLambdaFunctionUrlAccess',
|
|
2638
3158
|
'AddOnlyPublicStageLambdaFunctionUrlInvoke',
|
|
2639
3159
|
'CreateOnlyRequiredServiceLinkedRoles',
|
|
@@ -2670,11 +3190,15 @@ function deploymentPolicy(options) {
|
|
|
2670
3190
|
'DenyBucketPolicyMutationOutsideStageAndSstBootstrap',
|
|
2671
3191
|
'DenyEventArchiveMutationOutsideGeneratedFoundationArchive',
|
|
2672
3192
|
'DenyExplicitOtherStageRequestTag',
|
|
2673
|
-
'
|
|
3193
|
+
...(options.stage === 'development'
|
|
3194
|
+
? []
|
|
3195
|
+
: ['DenyKnownOtherStageResourceMutation']),
|
|
2674
3196
|
...(options.stage !== 'production'
|
|
2675
3197
|
? ['DenyNonProductionDatabaseEventSubscriptionSourceMutation']
|
|
2676
3198
|
: []),
|
|
2677
|
-
'
|
|
3199
|
+
...(options.stage === 'development'
|
|
3200
|
+
? []
|
|
3201
|
+
: ['DenyRuntimeTrustPolicyMutation']),
|
|
2678
3202
|
'DenyUnscopedDatabaseEventSubscriptionSourceMutation',
|
|
2679
3203
|
'DenyUntaggedMutationOutsideStageAndSstResources',
|
|
2680
3204
|
],
|
|
@@ -2741,11 +3265,44 @@ function deploymentPolicy(options) {
|
|
|
2741
3265
|
'DenyS3MutationOutsideStageRegion',
|
|
2742
3266
|
].includes(entry.Sid))
|
|
2743
3267
|
.map((entry) => entry.Sid),
|
|
2744
|
-
'
|
|
2745
|
-
|
|
3268
|
+
...(options.stage === 'development'
|
|
3269
|
+
? []
|
|
3270
|
+
: ['ReadEdgeCertificateControlPlane']),
|
|
3271
|
+
...(options.stage === 'development'
|
|
3272
|
+
? []
|
|
3273
|
+
: ['ReadEdgeObservabilityControlPlane']),
|
|
2746
3274
|
],
|
|
2747
3275
|
},
|
|
2748
3276
|
];
|
|
3277
|
+
if (options.stage === 'development') {
|
|
3278
|
+
// Co-locate equivalent scopes so rendering can union only their Action
|
|
3279
|
+
// sets. Every statement remains in one existing, attached policy.
|
|
3280
|
+
const relocation = {
|
|
3281
|
+
DenyRuntimeBoundarySubstitution: 'permission-guardrails',
|
|
3282
|
+
DenyDevAssumeRegion: 'regional-mutation',
|
|
3283
|
+
DenyDevAssumeSession: 'regional-mutation',
|
|
3284
|
+
DenyDevAssumePurpose: 'regional-mutation',
|
|
3285
|
+
InvokeOnlyStageLambdaFunctions: 'global-iam-mutation',
|
|
3286
|
+
DenyLogsMutationOutsideStageAndEdgeRegions: 'regional-mutation',
|
|
3287
|
+
DenyRuntimeTrustPolicyMutation: 'read',
|
|
3288
|
+
CreateOnlyGeneratedCloudFrontResources: 'global-resource-mutation',
|
|
3289
|
+
MutateStageBucketsInStageRegion: 'global-resource-mutation',
|
|
3290
|
+
};
|
|
3291
|
+
for (const sid of Object.keys(relocation)) {
|
|
3292
|
+
if (groups.flatMap((group) => group.sids).filter((value) => value === sid)
|
|
3293
|
+
.length !== 1)
|
|
3294
|
+
throw new Error(`Task authority compaction requires exactly one ${sid}.`);
|
|
3295
|
+
}
|
|
3296
|
+
groups = groups.map((group) => ({
|
|
3297
|
+
...group,
|
|
3298
|
+
sids: [
|
|
3299
|
+
...group.sids.filter((sid) => !relocation[sid]),
|
|
3300
|
+
...Object.entries(relocation)
|
|
3301
|
+
.filter(([, kind]) => kind === group.kind)
|
|
3302
|
+
.map(([sid]) => sid),
|
|
3303
|
+
],
|
|
3304
|
+
}));
|
|
3305
|
+
}
|
|
2749
3306
|
const assigned = new Set(groups.flatMap((group) => group.sids));
|
|
2750
3307
|
const assignmentCount = groups.reduce((total, group) => total + group.sids.length, 0);
|
|
2751
3308
|
const unassigned = statements.filter((entry) => !assigned.has(entry.Sid));
|
|
@@ -2757,7 +3314,7 @@ function deploymentPolicy(options) {
|
|
|
2757
3314
|
}
|
|
2758
3315
|
return Object.freeze(groups.map((group, index) => {
|
|
2759
3316
|
const document = policy(statements.filter((entry) => group.sids.includes(entry.Sid)));
|
|
2760
|
-
const characters = JSON.stringify(omitPolicyStatementSids(document)).length;
|
|
3317
|
+
const characters = JSON.stringify(omitPolicyStatementSids(document, options.stage === 'development')).length;
|
|
2761
3318
|
if (characters >
|
|
2762
3319
|
exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT -
|
|
2763
3320
|
exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_HEADROOM) {
|
|
@@ -2802,7 +3359,7 @@ function createStageAuthorityPlan(input) {
|
|
|
2802
3359
|
region: target.region,
|
|
2803
3360
|
stage: target.stage,
|
|
2804
3361
|
});
|
|
2805
|
-
const boundaryCharacters = JSON.stringify(omitPolicyStatementSids(boundary)).length;
|
|
3362
|
+
const boundaryCharacters = JSON.stringify(omitPolicyStatementSids(boundary, target.stage === 'development')).length;
|
|
2806
3363
|
if (boundaryCharacters > exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT) {
|
|
2807
3364
|
throw new Error(`Stage runtime boundary has ${boundaryCharacters} characters; the IAM managed-policy limit is ${exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT}.`);
|
|
2808
3365
|
}
|
|
@@ -2814,7 +3371,7 @@ function createStageAuthorityPlan(input) {
|
|
|
2814
3371
|
stage: target.stage,
|
|
2815
3372
|
});
|
|
2816
3373
|
const renderedDeploymentPolicyDocuments = Object.fromEntries(deployment.map((entry) => {
|
|
2817
|
-
let document = replaceExactTemplateString(replaceExactTemplateString(omitPolicyStatementSids(entry.document), identity.boundaryArn, { Ref: 'StageRuntimeBoundary' }), identity.deploymentRoleArn, { 'Fn::GetAtt': ['StageDeploymentRole', 'Arn'] });
|
|
3374
|
+
let document = replaceExactTemplateString(replaceExactTemplateString(omitPolicyStatementSids(entry.document, target.stage === 'development'), identity.boundaryArn, { Ref: 'StageRuntimeBoundary' }), identity.deploymentRoleArn, { 'Fn::GetAtt': ['StageDeploymentRole', 'Arn'] });
|
|
2818
3375
|
if (entry.logicalId === 'StageDeploymentGlobalIamMutationPolicy') {
|
|
2819
3376
|
for (const sibling of deployment) {
|
|
2820
3377
|
if (sibling.logicalId === entry.logicalId)
|
|
@@ -2829,7 +3386,7 @@ function createStageAuthorityPlan(input) {
|
|
|
2829
3386
|
const edgeRegion = edgeControlRegion(target.partition, target.region);
|
|
2830
3387
|
const templatePolicyDocuments = compactExactTemplatePolicyStrings({
|
|
2831
3388
|
...renderedDeploymentPolicyDocuments,
|
|
2832
|
-
StageRuntimeBoundary: omitPolicyStatementSids(boundary),
|
|
3389
|
+
StageRuntimeBoundary: omitPolicyStatementSids(boundary, target.stage === 'development'),
|
|
2833
3390
|
}, [
|
|
2834
3391
|
identity.workloadRoleArnPattern,
|
|
2835
3392
|
`arn:${target.partition}:cloudformation:${target.region}:${target.accountId}:stack/*MachineAuthorization*/*`,
|
|
@@ -2839,7 +3396,13 @@ function createStageAuthorityPlan(input) {
|
|
|
2839
3396
|
`arn:${target.partition}:logs:${edgeRegion}:${target.accountId}:log-group:aws-waf-logs-foundation-${target.stage}-FoundationRouter-*`,
|
|
2840
3397
|
`arn:${target.partition}:secretsmanager:${target.region}:${target.accountId}:secret:foundation-${target.stage}-FoundationDatabaseProxySecret-*`,
|
|
2841
3398
|
`arn:${target.partition}:states:${target.region}:${target.accountId}:execution:*:*`,
|
|
2842
|
-
|
|
3399
|
+
...(target.stage === 'development'
|
|
3400
|
+
? repeatedDevelopmentPolicyStrings({
|
|
3401
|
+
...renderedDeploymentPolicyDocuments,
|
|
3402
|
+
boundary,
|
|
3403
|
+
})
|
|
3404
|
+
: []),
|
|
3405
|
+
], target.stage === 'development');
|
|
2843
3406
|
const deploymentPolicyResources = Object.fromEntries(deployment.map((entry) => [
|
|
2844
3407
|
entry.logicalId,
|
|
2845
3408
|
{
|
|
@@ -2954,11 +3517,34 @@ function installStageIamBoundaryTransforms(input) {
|
|
|
2954
3517
|
input.instanceProfileResource === undefined) {
|
|
2955
3518
|
throw new Error('Stage IAM boundary transforms require the ordinary Pulumi role and instance-profile resource types.');
|
|
2956
3519
|
}
|
|
3520
|
+
const resourceStage = input.resourceStage ?? input.stage;
|
|
3521
|
+
if (resourceStage !== input.stage &&
|
|
3522
|
+
!(input.stage === 'development' &&
|
|
3523
|
+
/^personal-[a-f0-9]{24}$/u.test(resourceStage))) {
|
|
3524
|
+
throw new Error('IAM resource stage must be canonical or the exact development task.');
|
|
3525
|
+
}
|
|
2957
3526
|
const contract = createStageIamBoundaryTransformContract(input);
|
|
2958
3527
|
input.registerTransform(input.roleResource, (value) => {
|
|
2959
3528
|
const args = requireTransformArgs(value, 'IAM role');
|
|
3529
|
+
let stageTags;
|
|
3530
|
+
if (input.stage === 'development') {
|
|
3531
|
+
const tags = args.tags;
|
|
3532
|
+
if (tags !== undefined &&
|
|
3533
|
+
(!tags ||
|
|
3534
|
+
typeof tags !== 'object' ||
|
|
3535
|
+
Array.isArray(tags) ||
|
|
3536
|
+
![Object.prototype, null].includes(Object.getPrototypeOf(tags)) ||
|
|
3537
|
+
Object.values(tags).some((value) => typeof value !== 'string'))) {
|
|
3538
|
+
throw new Error('IAM role stage tags must be a literal string record.');
|
|
3539
|
+
}
|
|
3540
|
+
const literalTags = (tags ?? {});
|
|
3541
|
+
refuseSubstitution(literalTags['ebk:stage'], resourceStage, 'IAM role stage tag');
|
|
3542
|
+
stageTags = { ...literalTags, 'ebk:stage': resourceStage };
|
|
3543
|
+
}
|
|
2960
3544
|
refuseSubstitution(args.permissionsBoundary, contract.boundaryArn, 'IAM role permissions boundary');
|
|
2961
3545
|
refuseSubstitution(args.path, contract.rolePath, 'IAM role path');
|
|
3546
|
+
if (stageTags)
|
|
3547
|
+
args.tags = stageTags;
|
|
2962
3548
|
args.permissionsBoundary = contract.boundaryArn;
|
|
2963
3549
|
args.path = contract.rolePath;
|
|
2964
3550
|
});
|