Commit 20e3dc7
authored
Redact plaintext MySQL password from superset entrypoint logs (#168)
* Redact plaintext MySQL password from superset entrypoint logs
entrypoint.sh's set -euxo pipefail traced the fully-substituted
superset test_db command, including the plaintext mysql_superset_password
secret, to stderr. Separately, superset test_db itself prints the full
SQLAlchemy connection URI (with password) to stdout. Both ended up in
docker logs / docker service logs superset, and persisted indefinitely
in the host's json-file log driver.
Build the DB URI in a variable with -x off, and pipe test_db's combined
output through a literal-string redaction filter before it reaches
Docker's log driver. -x tracing resumes for the rest of the script.
* Move password-redaction filter to a standalone script
Inline python3 -c couldn't be indented to match entrypoint.sh's style
without breaking Python's indentation-sensitive syntax. Move it to
redact_secret.py (picked up by the existing COPY . /app/ in the
Dockerfile) so both files keep normal, consistent indentation.1 parent a459eb7 commit 20e3dc7
3 files changed
Lines changed: 18 additions & 5 deletions
| 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 | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
4 | 11 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments