From a906a149e8ea80782e61ee4c8c9ef79e29d49c22 Mon Sep 17 00:00:00 2001 From: cschantz Date: Tue, 11 Nov 2025 21:45:43 -0500 Subject: [PATCH] Add consolidated scanner results summary at end of scan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- modules/security/malware-scanner.sh | 45 ++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/modules/security/malware-scanner.sh b/modules/security/malware-scanner.sh index 47bad9e..a37f685 100755 --- a/modules/security/malware-scanner.sh +++ b/modules/security/malware-scanner.sh @@ -740,7 +740,7 @@ for scanner in "${AVAILABLE_SCANNERS[@]}"; do fi done -# Finalize report +# Finalize report with consolidated summary { echo "==========================================" echo "Scan Session Complete" @@ -748,13 +748,50 @@ done 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 - echo "INFECTED FILES DETECTED:" + echo "⚠️ INFECTED FILES DETECTED:" echo "" sort -u "$INFECTED_LIST" + echo "" + echo "ACTION REQUIRED: Review and quarantine/remove infected files" else - echo "No infected files detected by automated scan." - echo "Review individual scanner logs for details." + echo "✓ No infected files detected by automated scan." + 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 } >> "$SUMMARY_FILE"