fix(security): real newlines in alert details for the ntfy body
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Blocked by required conditions
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Blocked by required conditions
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Waiting to run
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Blocked by required conditions
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Blocked by required conditions
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Blocked by required conditions
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Waiting to run
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Blocked by required conditions
The \n in the accumulated alert text was a literal backslash-n, so the details would have rendered as one garbled line. printf -v now appends real newlines; the notification body joins header + details with a real line break.
This commit is contained in:
@@ -23,7 +23,7 @@ ALERTS=""
|
||||
|
||||
alert() {
|
||||
printf '[%s] %s\n' "$(date '+%F %T')" "$*" | tee -a "$LOG" >&2
|
||||
ALERTS="${ALERTS}${*}\n"
|
||||
printf -v ALERTS '%s%s\n' "$ALERTS" "$*"
|
||||
FINDINGS=$((FINDINGS + 1))
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ notify() {
|
||||
token="$(grep '^NTFY_SI_TOKEN=' "$NTFY_CRED" 2>/dev/null | cut -d= -f2- | tr -d '"' | tr -d '[:space:]')"
|
||||
[ -n "$token" ] || return 0
|
||||
local body
|
||||
body="🛡 mozdIT monitoring: ${FINDINGS} eltérés — $(date '+%F %T')\n${ALERTS}"
|
||||
body="🛡 mozdIT monitoring: ${FINDINGS} eltérés — $(date '+%F %T')"$'\n'"${ALERTS}"
|
||||
curl -s -o /dev/null --max-time 10 \
|
||||
-H "Authorization: Bearer $token" \
|
||||
-H "Title: mozdIT biztonsági riasztás" \
|
||||
|
||||
Reference in New Issue
Block a user