Commit 7e152fb
authored
fix(aws): allow the scoped SAM transform (#185)
## Summary
- let the CloudFormation service role call
`cloudformation:CreateChangeSet` only on the regional AWS-owned
`Serverless-2016-10-31` transform
- keep arbitrary CloudFormation stacks and change sets outside the
service role
- add policy-conformance coverage and document the trust boundary
## Evidence
A real least-privilege deployment from `HayaSendDeploymentOperatorTest`
reached SAM change-set creation but CloudFormation rejected its own
service-role session on the transform ARN. AWS documents this exact
resource-level permission pattern:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/control-access-with-iam.html
The failed stack remained `REVIEW_IN_PROGRESS` with no application
resources. It was deleted through the restricted operator role, and all
seven exact-prefix artifact versions were purged; the stack and prefix
are absent.
## Validation
- `npm run check`
- `npm test -- --run` — 629 passed, 6 skipped
- SAM lint passed
- live CloudFormation template validation passed in account
`330599756148`, `ap-northeast-1`
- GPG-signed commit `aab278aa9d822dfc7eb6f2666551f6d34b95d4ee`
This advances #174 but does not mark its least-privilege or lifecycle
proof complete until an exact-main rerun succeeds.1 parent 3b97e53 commit 7e152fb
4 files changed
Lines changed: 25 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | 115 | | |
106 | 116 | | |
| |||
0 commit comments