fix(security): filter docker exec errors and include finding details in 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
- a container stopping mid-scan produced 'cannot exec in a stopped state' as a false-positive finding; such exec errors are now filtered out - the ntfy notification body now carries the actual alert lines, not just a counter
This commit is contained in:
@@ -28,17 +28,20 @@ alert() {
|
||||
}
|
||||
|
||||
# ntfy push — a helyi ntfy szerverre (127.0.0.1:2586), az si_17t_pro user
|
||||
# tokenjével (a credential fájlból, sosem kerül kimenetre).
|
||||
# tokenjével (a credential fájlból, sosem kerül kimenetre). A body a konkrét
|
||||
# találatokat is tartalmazza, ne csak egy számlálót.
|
||||
notify() {
|
||||
[ -f "$NTFY_CRED" ] || return 0
|
||||
local token
|
||||
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}"
|
||||
curl -s -o /dev/null --max-time 10 \
|
||||
-H "Authorization: Bearer $token" \
|
||||
-H "Title: mozdIT biztonsági riasztás" \
|
||||
-H "Priority: high" \
|
||||
-d "🛡 mozdIT monitoring: ${FINDINGS} eltérés — $(date '+%F %T')" \
|
||||
-d "$body" \
|
||||
"$NTFY_URL/$NTFY_TOPIC" || true
|
||||
}
|
||||
|
||||
@@ -62,7 +65,7 @@ for cid in $(docker ps -q 2>/dev/null); do
|
||||
fi
|
||||
[ -n "$decoys" ] && alert "container $name decoy: $(printf '%s' "$decoys" | tr '\n' ' ')"
|
||||
|
||||
arts="$(docker exec "$cid" sh -c 'ls /tmp/.kworkerd /tmp/.redis-server.pid 2>/dev/null' 2>/dev/null || true)"
|
||||
arts="$(docker exec "$cid" sh -c 'ls /tmp/.kworkerd /tmp/.redis-server.pid 2>/dev/null' 2>&1 | grep -vE 'cannot exec|is not running|No such container|Error response' || true)"
|
||||
[ -n "$arts" ] && alert "container $name /tmp artifacts: $(printf '%s ' $arts)"
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user