Commit 397a51b
jenkins: envsubst allowlists, chmod 600 .env, tighten Django defaults
Three Copilot findings from the thirteenth pass on PR #330:
- harbor/deploy.sh: pass an explicit allowlist to every `envsubst`
call. Without it, envsubst expands every `$VAR` sequence in the
template, so any future secret containing a `$`-prefixed substring
(HARBOR_ADMIN_PASSWORD, PULL_PASS) could be silently mangled. Now
each call lists just the variables it actually templates.
- setup.sh: `chmod 600 .env` after persisting config. Once
HARBOR_ADMIN_PASSWORD lands here it's secret material; a default
umask of 022 would leave it group/world-readable.
- python312-pip-django/app.py: read SECRET_KEY from DJANGO_SECRET_KEY
with a demo-only fallback, and narrow ALLOWED_HOSTS from `["*"]`
to `["localhost", "127.0.0.1", "testserver"]`. The Test stage's
Django Client uses Host: testserver, so the smoke test still
passes (verified locally against an in-memory venv).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8977a1b commit 397a51b
3 files changed
Lines changed: 30 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| |||
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
95 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
96 | 107 | | |
97 | 108 | | |
98 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
361 | 366 | | |
362 | 367 | | |
363 | 368 | | |
| |||
0 commit comments