Commit 2592c9f
authored
chore(terraform): terraform security hardening (#993)
Two small, independent hardening changes to the reusable `terraform.yml`
workflow.
## 1. Stop leaking `ENCRYPTION_PASSWORD` to every step
Removed `ENCRYPTION_PASSWORD` from the workflow-level `env:` block and
scoped it to only the two steps that actually need it (`Create tarball`
in the plan job, `Extract tarball` in the apply job).
Secrets passed via `secrets:` to a reusable workflow are auto-masked by
GitHub. Promoting them to a workflow-level `env:` widens exposure to
every step (including any third-party actions added later) with no
benefit. The secret's description was updated to note this.
## 2. Make plan-tarball retention configurable (default 5 days, was 35)
Added a new `artifact_retention_days` input (number, default `5`) and
use it for `retention-days` on the `Upload artifact` step.
The artifact contains the full Terraform configuration and plan,
encrypted with `ENCRYPTION_PASSWORD`. It is only consumed by the Apply
job in the same workflow run. 35 days of retention is unnecessary
exposure window if the password ever leaks. Making it an input lets
consumers tune the value to their deployment cadence (e.g. workflows
that span multiple environments over several days can opt for a higher
value).
This is an additive input change — existing consumers get the new 5-day
default automatically without any code changes.
---
The lock-semantics change originally proposed here has been split out
into #997.1 parent 3964f88 commit 2592c9f
2 files changed
Lines changed: 17 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
82 | | - | |
| 88 | + | |
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
| |||
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
117 | | - | |
118 | 123 | | |
119 | 124 | | |
120 | 125 | | |
| |||
246 | 251 | | |
247 | 252 | | |
248 | 253 | | |
| 254 | + | |
| 255 | + | |
249 | 256 | | |
250 | 257 | | |
251 | 258 | | |
| |||
259 | 266 | | |
260 | 267 | | |
261 | 268 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 269 | + | |
266 | 270 | | |
267 | 271 | | |
268 | 272 | | |
| |||
358 | 362 | | |
359 | 363 | | |
360 | 364 | | |
| 365 | + | |
| 366 | + | |
361 | 367 | | |
362 | 368 | | |
363 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| |||
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
118 | | - | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
0 commit comments