@@ -68,19 +68,24 @@ Override the quarantine directory for this run.
6868May appear anywhere in the command line.
6969.SS Reporting
7070.TP
71- \fB \- e \fR , \fB \-\- report \fR [\fI SCANID \fR |\fB list \fR |\fB latest \fR |\fB hooks \fR ]
71+ \fB \- e \fR , \fB \-\- report \fR [\fI SCANID \fR |\fB list \fR |\fB latest \fR |\fB hooks \fR | \fB active \fR ]
7272View a scan report.
7373Use \fB latest \fR for the most recent scan, \fB list \fR for all reports,
74- \fB hooks \fR for hook scan activity (see HOOK SCANNING).
74+ \fB hooks \fR for hook scan activity (see HOOK SCANNING),
75+ \fB active \fR for running scans (equivalent to \fB \- L \fR ).
7576Combine with \fB \-\- format \fR and \fB \-\- mailto \fR for output control.
7677.TP
7778\fB \-\- all \fR
7879Show full scan history when used with \fB \- e list \fR .
7980Without \fB \-\- all \fR , \fB \- e list \fR shows only recent sessions.
8081May appear anywhere in the command line.
8182.TP
82- \fB \-\- format \fR \fB text \fR |\fB json \fR |\fB html \fR
83- Set report output format for \fB \- e \fR /\fB \-\- report \fR (default: text).
83+ \fB \-\- verbose \fR
84+ Show additional detail with \fB \- L \fR (workers, signature version, progress).
85+ May appear anywhere in the command line.
86+ .TP
87+ \fB \-\- format \fR \fB text \fR |\fB json \fR |\fB html \fR |\fB tsv \fR
88+ Set report output format for \fB \- e \fR /\fB \-\- report \fR and \fB \- L \fR (default: text).
8489May appear anywhere in the command line.
8590.TP
8691\fB \-\- mailto \fR \fI ADDRESS \fR
@@ -287,6 +292,40 @@ Managed independently of
287292See
288293.B monitor_paths_extra
289294in the CONFIGURATION section.
295+ .TP
296+ .I $sessdir/scan.meta.$scanid
297+ Scan lifecycle metadata. Contains process info, state, engine type,
298+ scan options, and timestamps. Updated throughout the scan lifecycle
299+ as state transitions occur.
300+ .TP
301+ .I $sessdir/session.index
302+ Append\- only session index for O(1) scan listing. Each line records
303+ the scan ID, start time, path, and completion status. Used by
304+ \fB \-\- report list \fR and \fB \- L \fR for fast enumeration without
305+ scanning the session directory.
306+ .TP
307+ .I $sessdir/scan.checkpoint.$scanid
308+ Stage checkpoint file for \fB \-\- continue \fR . Written by \fB \-\- stop \fR
309+ with the \fB #LMD_CHECKPOINT:v1 \fR format. Contains the last completed
310+ stage, accumulated hits, config options, and signature version at the
311+ time of stop.
312+ .TP
313+ .I $tmpdir/.abort.$scanid
314+ Abort sentinel. Created by \fB \-\- kill \fR or \fB \-\- stop \fR . Workers
315+ check for this file at stage boundaries and during scan loops for
316+ cooperative shutdown.
317+ .TP
318+ .I $tmpdir/.pause.$scanid
319+ Pause sentinel with epoch timestamp and optional duration. Created by
320+ \fB \-\- pause \fR . Workers enter a sleep loop while this file exists.
321+ Removed by \fB \-\- unpause \fR or when the duration expires.
322+ .TP
323+ .I $sessdir/session.archive.YYMM.tsv.gz
324+ Monthly session archive created by \fB \-\- maintenance \fR . Consolidates
325+ all session TSV files from the given month (YYMM) into a single
326+ gzip\- compressed archive. The \fB \-\- report \fR command transparently
327+ resolves sessions from archives when the original session file has
328+ been archived.
290329.SH CONFIGURATION
291330Configuration is loaded from
292331.I conf.maldet
@@ -703,6 +742,29 @@ sets the minimum malware hit count to trigger the hook.
703742Set to 0 to fire on every scan including clean ones.
704743Default: 1.
705744.PP
745+ .B Scan Lifecycle:
746+ .BR scan_progress_log_interval ,
747+ .BR scan_meta_cleanup_age ,
748+ .BR maint_compress_age ,
749+ .BR maint_archive_age .
750+ .PP
751+ .B scan_meta_cleanup_age
752+ sets the number of hours to retain completed/killed/stale scan.meta files
753+ before cleanup.
754+ Meta files for active/paused/stopped scans are never cleaned.
755+ Set 0 to disable automatic cleanup. Default: 48.
756+ .PP
757+ .B maint_compress_age
758+ sets the number of days before completed session files are compressed (gzipped).
759+ Sessions younger than this age are never compressed.
760+ Set 0 to disable automatic compression. Default: 30.
761+ .PP
762+ .B maint_archive_age
763+ sets the number of days before compressed session files are bundled into
764+ monthly archives.
765+ Sessions younger than this age are never archived.
766+ Set 0 to disable automatic archival. Default: 90.
767+ .PP
706768See
707769.I conf.maldet
708770for the full list with descriptions.
@@ -907,60 +969,6 @@ Filter by time: \fBNh\fR (hours), \fBNd\fR (days), \fBNm\fR (minutes).
907969\fB maldet \-\- report hooks \-\- mode \fR \fI MODE \fR
908970Filter by hook mode: \fB modsec \fR , \fB ftp \fR , \fB proftpd \fR , \fB exim \fR ,
909971or \fB generic \fR .
910- .SH EXAMPLES
911- .TP
912- Scan all files under user web roots:
913- .B maldet \- a /home/?/public_html
914- .TP
915- Scan recent files with auto\- quarantine and YARA:
916- .B maldet \- co quarantine_hits=1,scan_yara=1 \- r /home/?/public_html 2
917- .TP
918- View the most recent scan report:
919- .B maldet \- e
920- .TP
921- List all scan reports:
922- .B maldet \- e list
923- .TP
924- Output a scan report as JSON:
925- .B maldet \-\- json\-report SCANID
926- .TP
927- List all reports as JSON:
928- .B maldet \-\- json\-report list
929- .TP
930- Quarantine all hits from a scan:
931- .B maldet \- q SCANID
932- .TP
933- Start real\- time inotify monitoring (foreground):
934- .B maldet \- m users
935- .TP
936- Start real\- time inotify monitoring (background daemon):
937- .B maldet \- b \- m users
938- .TP
939- Scan a file via the generic hook API:
940- .B hookscan.sh generic /path/to/file
941- .TP
942- Batch scan files from a list:
943- .B hookscan.sh generic \-\- list /tmp/filelist.txt
944- .TP
945- View hook scan activity (last 24 hours):
946- .B maldet \-\- report hooks
947- .TP
948- View hook scan activity filtered by mode:
949- .B maldet \-\- report hooks \-\- mode modsec
950- .TP
951- Fire an on\- demand digest alert:
952- .B maldet \-\- digest
953- .TP
954- Test email alerting with a synthetic scan report:
955- .B maldet \-\- test\-alert scan email
956- .TP
957- Test Slack digest delivery:
958- .B maldet \-\- test\-alert digest slack
959- .SH SEE ALSO
960- .BR clamdscan (1),
961- .BR clamscan (1),
962- .BR yara (1),
963- .BR inotifywait (1)
964972.SH SCAN MANAGEMENT
965973Scan lifecycle commands allow controlling running scans without terminating
966974the maldet process. Scans transition through a state machine:
@@ -1064,64 +1072,60 @@ The checkpoint file uses a simple key=value format with a
10641072\fB sig_version \fR , \fB workers \fR , \fB total_files \fR , \fB hits_so_far \fR ,
10651073and \fB options \fR (original \fB \- co \fR values). The session hits file is
10661074preserved across stop/continue so that accumulated detections are retained.
1067- .SH CONFIGURATION
1068- The configuration of LMD is handled through \fI $inspath/conf.maldet \fR
1069- and all options are well commented for ease of configuration. System\- level
1070- overrides can be placed in \fI /etc/sysconfig/maldet \fR or
1071- \fI /etc/default/maldet \fR . Runtime overrides via \fB \- co \fR take
1072- highest precedence.
1073- .PP
1074- The following configuration options relate to scan lifecycle management:
1075+ .SH EXAMPLES
10751076.TP
1076- .B scan_meta_cleanup_age
1077- Hours to retain completed/killed/stale scan.meta files before cleanup.
1078- Meta files for active/paused/stopped scans are never cleaned.
1079- Set 0 to disable automatic cleanup. Default: 48.
1077+ Scan all files under user web roots:
1078+ .B maldet \- a /home/?/public_html
10801079.TP
1081- .B maint_compress_age
1082- Days before completed session files are compressed (gzipped).
1083- Sessions younger than this age are never compressed.
1084- Set 0 to disable automatic compression. Default: 30.
1080+ Scan recent files with auto\- quarantine and YARA:
1081+ .B maldet \- co quarantine_hits=1,scan_yara=1 \- r /home/?/public_html 2
10851082.TP
1086- .B maint_archive_age
1087- Days before compressed session files are bundled into monthly archives.
1088- Sessions younger than this age are never archived.
1089- Set 0 to disable automatic archival. Default: 90.
1090- .SH FILES
1083+ View the most recent scan report:
1084+ .B maldet \- e
10911085.TP
1092- .I $sessdir/scan.meta.$scanid
1093- Scan lifecycle metadata. Contains process info, state, engine type,
1094- scan options, and timestamps. Updated throughout the scan lifecycle
1095- as state transitions occur.
1086+ List all scan reports:
1087+ .B maldet \- e list
10961088.TP
1097- .I $sessdir/session.index
1098- Append\- only session index for O(1) scan listing. Each line records
1099- the scan ID, start time, path, and completion status. Used by
1100- \fB \-\- report list \fR and \fB \- L \fR for fast enumeration without
1101- scanning the session directory.
1089+ Output a scan report as JSON:
1090+ .B maldet \-\- json\-report SCANID
11021091.TP
1103- .I $sessdir/scan.checkpoint.$scanid
1104- Stage checkpoint file for \fB \-\- continue \fR . Written by \fB \-\- stop \fR
1105- with the \fB #LMD_CHECKPOINT:v1 \fR format. Contains the last completed
1106- stage, accumulated hits, config options, and signature version at the
1107- time of stop.
1092+ List all reports as JSON:
1093+ .B maldet \-\- json\-report list
11081094.TP
1109- .I $tmpdir/.abort.$scanid
1110- Abort sentinel. Created by \fB \-\- kill \fR or \fB \-\- stop \fR . Workers
1111- check for this file at stage boundaries and during scan loops for
1112- cooperative shutdown.
1095+ Quarantine all hits from a scan:
1096+ .B maldet \- q SCANID
11131097.TP
1114- .I $tmpdir/.pause.$scanid
1115- Pause sentinel with epoch timestamp and optional duration. Created by
1116- \fB \-\- pause \fR . Workers enter a sleep loop while this file exists.
1117- Removed by \fB \-\- unpause \fR or when the duration expires.
1098+ Start real\- time inotify monitoring (foreground):
1099+ .B maldet \- m users
11181100.TP
1119- .I $sessdir/session.archive.YYMM.tsv.gz
1120- Monthly session archive created by \fB \-\- maintenance \fR . Consolidates
1121- all session TSV files from the given month (YYMM) into a single
1122- gzip\- compressed archive. The \fB \-\- report \fR command transparently
1123- resolves sessions from archives when the original session file has
1124- been archived.
1101+ Start real\- time inotify monitoring (background daemon):
1102+ .B maldet \- b \- m users
1103+ .TP
1104+ Scan a file via the generic hook API:
1105+ .B hookscan.sh generic /path/to/file
1106+ .TP
1107+ Batch scan files from a list:
1108+ .B hookscan.sh generic \-\- list /tmp/filelist.txt
1109+ .TP
1110+ View hook scan activity (last 24 hours):
1111+ .B maldet \-\- report hooks
1112+ .TP
1113+ View hook scan activity filtered by mode:
1114+ .B maldet \-\- report hooks \-\- mode modsec
1115+ .TP
1116+ Fire an on\- demand digest alert:
1117+ .B maldet \-\- digest
1118+ .TP
1119+ Test email alerting with a synthetic scan report:
1120+ .B maldet \-\- test\-alert scan email
1121+ .TP
1122+ Test Slack digest delivery:
1123+ .B maldet \-\- test\-alert digest slack
1124+ .SH SEE ALSO
1125+ .BR clamdscan (1),
1126+ .BR clamscan (1),
1127+ .BR yara (1),
1128+ .BR inotifywait (1)
11251129.SH BUGS
11261130Report bugs at \fI https://github.com/rfxn/linux \- malware \- detect/issues \fR .
11271131.SH AUTHORS
0 commit comments