Add consolidated scanner results summary at end of scan

Added comprehensive summary table showing what each scanner found,
making it easy to see all results at a glance.

New Summary Section:
- Consolidated results table for all scanners
- Shows counts: threats, infected files, warnings
- Formatted table with aligned columns
- Scanner-specific result types
- Log file locations for detailed review

Example Output:
  SCANNER RESULTS SUMMARY:
  ----------------------------------------
  ImunifyAV:           2 threats detected
  ClamAV:              0 infected files
  Maldet:              Scan complete (check logs)
  Rootkit Hunter:      3 warnings
  ----------------------------------------

Improvements:
- Quick overview without reading all logs
- Clear indication if threats found
- Easy comparison across scanners
- Shows which scanners ran
- Provides log paths for deeper investigation

Clean presentation with:
- ✓ checkmark for clean scans
- ⚠️  warning icon for infected files
- Action-oriented messaging
- Helpful next steps
This commit is contained in:
cschantz
2025-11-11 21:45:43 -05:00
parent 399181dd7b
commit 03998172bc
+41 -4
View File
@@ -740,7 +740,7 @@ for scanner in "${AVAILABLE_SCANNERS[@]}"; do
fi fi
done done
# Finalize report # Finalize report with consolidated summary
{ {
echo "==========================================" echo "=========================================="
echo "Scan Session Complete" echo "Scan Session Complete"
@@ -748,13 +748,50 @@ done
echo "==========================================" echo "=========================================="
echo "" echo ""
# Consolidated Scanner Results Table
echo "SCANNER RESULTS SUMMARY:"
echo "----------------------------------------"
# ImunifyAV results
if echo "${AVAILABLE_SCANNERS[*]}" | grep -q "imunify"; then
IMUNIFY_COUNT=$(grep -o "ImunifyAV scan complete - Found: [0-9]*" "$SUMMARY_FILE" | grep -o "[0-9]*$" || echo "N/A")
printf "%-20s %s\n" "ImunifyAV:" "$IMUNIFY_COUNT threats detected"
fi
# ClamAV results
if echo "${AVAILABLE_SCANNERS[*]}" | grep -q "clamav"; then
CLAM_COUNT=$(grep -o "ClamAV scan complete - Found: [0-9]*" "$SUMMARY_FILE" | grep -o "[0-9]*$" || echo "N/A")
printf "%-20s %s\n" "ClamAV:" "$CLAM_COUNT infected files"
fi
# Maldet results
if echo "${AVAILABLE_SCANNERS[*]}" | grep -q "maldet"; then
printf "%-20s %s\n" "Maldet:" "Scan complete (check logs)"
fi
# RKHunter results
if echo "${AVAILABLE_SCANNERS[*]}" | grep -q "rkhunter"; then
RKH_COUNT=$(grep -o "RKHunter scan complete - Warnings: [0-9]*" "$SUMMARY_FILE" | grep -o "[0-9]*$" || echo "N/A")
printf "%-20s %s\n" "Rootkit Hunter:" "$RKH_COUNT warnings"
fi
echo "----------------------------------------"
echo ""
if [ -f "$INFECTED_LIST" ] && [ -s "$INFECTED_LIST" ]; then if [ -f "$INFECTED_LIST" ] && [ -s "$INFECTED_LIST" ]; then
echo "INFECTED FILES DETECTED:" echo "⚠️ INFECTED FILES DETECTED:"
echo "" echo ""
sort -u "$INFECTED_LIST" sort -u "$INFECTED_LIST"
echo ""
echo "ACTION REQUIRED: Review and quarantine/remove infected files"
else else
echo "No infected files detected by automated scan." echo "No infected files detected by automated scan."
echo "Review individual scanner logs for details." echo ""
echo "Review individual scanner logs for detailed information:"
echo " • ImunifyAV: $LOG_DIR/imunify.log"
echo " • ClamAV: $LOG_DIR/clamav.log"
echo " • Maldet: $LOG_DIR/maldet.log"
echo " • RKHunter: $LOG_DIR/rkhunter.log"
fi fi
} >> "$SUMMARY_FILE" } >> "$SUMMARY_FILE"