fix: redact secret env values in stall diagnostics inspect output
CI / validate (pull_request) Successful in 1m9s
CI / molecule-tests (1) (pull_request) Successful in 5m23s
CI / molecule-tests (3) (pull_request) Successful in 7m5s
CI / molecule-tests (2) (pull_request) Successful in 7m27s
CI / molecule-tests (4) (pull_request) Successful in 7m31s
CI / auto-merge (pull_request) Successful in 7m50s
CI / validate (pull_request) Successful in 1m9s
CI / molecule-tests (1) (pull_request) Successful in 5m23s
CI / molecule-tests (3) (pull_request) Successful in 7m5s
CI / molecule-tests (2) (pull_request) Successful in 7m27s
CI / molecule-tests (4) (pull_request) Successful in 7m31s
CI / auto-merge (pull_request) Successful in 7m50s
docker inspect captures the container Env block, which for CI job containers carries CI_GITEA_API_TOKEN and similar secrets — the diag bundle must not become a secret artifact (OBL-INFRA-548 S02). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
a61075ebde
commit
8cd0d4dd57
@@ -57,7 +57,11 @@ now_epoch=$(date +%s)
|
||||
echo "=== stall diagnostics for $cname ($cid), age ${age_min}m ==="
|
||||
echo "--- exec probe: TIMEOUT (>10s) ---"
|
||||
echo "--- docker inspect ---"
|
||||
timeout 15 docker inspect "$cid" 2>/dev/null
|
||||
# Implements: REQ-3 — full inspect, but redact the Env block:
|
||||
# job containers carry CI tokens in env vars; the bundle must
|
||||
# not become a secret-material artifact.
|
||||
timeout 15 docker inspect "$cid" 2>/dev/null \
|
||||
| sed -E 's/("[^"]*(TOKEN|PASSWORD|SECRET|KEY)[^=]*=)[^",]*/\1<redacted>/Ig'
|
||||
echo "--- docker top ---"
|
||||
timeout 15 docker top "$cid" 2>/dev/null
|
||||
echo "--- docker stats --no-stream ---"
|
||||
|
||||
@@ -36,7 +36,11 @@ because GNU date rejects `+0000 UTC` together. The age gate then
|
||||
compares real minutes.
|
||||
|
||||
REQ-3: Remove the `head -200` truncation on `docker inspect` output so
|
||||
the full State block is captured in the diagnostics bundle.
|
||||
the full State block is captured — but pipe through a `sed` filter that
|
||||
redacts the value of any env entry whose name contains TOKEN, PASSWORD,
|
||||
SECRET, or KEY. Job containers carry CI tokens in their Env block; the
|
||||
diagnostics bundle must not become a secret-material artifact
|
||||
(OBL-INFRA-548 S02).
|
||||
|
||||
REQ-4: Diagnostics-only constraint unchanged — no kills, no restarts.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user