Fix final 10 HIGH integer comparisons in live-attack-monitor and ip-reputation-manager
FIXES:
live-attack-monitor.sh:
- Line 1805: $hits → ${hits:-0} (SSH bruteforce first hit check)
- Line 1859: $score → ${score:-0} (cap at 100)
- Line 2195: $hits → ${hits:-0} (Email bruteforce first hit check)
- Line 2239: $score → ${score:-0} (cap at 100)
- Line 2314: $hits → ${hits:-0} (FTP bruteforce first hit check)
- Line 2358: $score → ${score:-0} (cap at 100)
- Line 2435: $is_new_attack → ${is_new_attack:-0} (DB attack check)
- Line 2479: $score → ${score:-0} (cap at 100)
ip-reputation-manager.sh:
- Line 156: $hit_count → ${hit_count:-0}
- Line 158: $hit_count → ${hit_count:-0}
IMPACT:
- Prevents errors in threat scoring calculations
- Safe defaults for all attack pattern detection
- More robust live monitoring
QA STATUS AFTER THIS COMMIT:
- Security modules: ALL HIGH issues FIXED ✓
- 10 HIGH issues remain in backup/maintenance modules
- Total issues: 30 (0 CRITICAL, 10 HIGH, 9 MEDIUM, 11 LOW)
This commit is contained in:
@@ -153,9 +153,9 @@ view_top_active() {
|
||||
|
||||
# Color code by hit count
|
||||
local color="$NC"
|
||||
if [ $hit_count -gt 10000 ]; then
|
||||
if [ "${hit_count:-0}" -gt 10000 ]; then
|
||||
color="$RED$BOLD"
|
||||
elif [ $hit_count -gt 1000 ]; then
|
||||
elif [ "${hit_count:-0}" -gt 1000 ]; then
|
||||
color="$YELLOW"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user