Skip to content

Commit 2bdec5d

Browse files
committed
[New] Documentation convention: level-2 README, banners, companion files
[New] README restructured to rfxn documentation convention (level-2) [New] SVG banners (dark/light) with scan beam glyph in assets/ [New] SECURITY.md and CONTRIBUTING.md from RDF templates [New] What's New, Integration, and Exit Codes sections in README [Change] Badge row updated to flat-square style
1 parent 4b9d09a commit 2bdec5d

7 files changed

Lines changed: 226 additions & 13 deletions

File tree

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
v2.0.1 | Mar 23 2026:
2+
[New] README restructured to rfxn documentation convention (level-2)
3+
[New] SVG banners (dark/light) with scan beam glyph in assets/
4+
[New] SECURITY.md and CONTRIBUTING.md companion files
5+
[New] What's New, Integration, and Exit Codes sections in README
6+
[Change] Badge row updated to flat-square style with centered layout
7+
18
v2.0.1 | Mar 10 2026:
29

310
-- New Features --

CHANGELOG.RELEASE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
v2.0.1 | Mar 23 2026:
2+
[New] README restructured to rfxn documentation convention (level-2)
3+
[New] SVG banners (dark/light) with scan beam glyph in assets/
4+
[New] SECURITY.md and CONTRIBUTING.md companion files
5+
[New] What's New, Integration, and Exit Codes sections in README
6+
[Change] Badge row updated to flat-square style with centered layout
7+
18
v2.0.1 | Mar 10 2026:
29

310
-- New Features --

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributing to linux-malware-detect
2+
3+
## How to Contribute
4+
5+
- **Bug reports**: Open a GitHub Issue with steps to reproduce
6+
- **Feature requests**: Open a GitHub Issue with use case and rationale
7+
- **Security vulnerabilities**: See [SECURITY.md](SECURITY.md)
8+
9+
## Development Setup
10+
11+
```bash
12+
git clone https://github.com/rfxn/linux-malware-detect.git
13+
cd linux-malware-detect
14+
# Project-specific setup instructions
15+
```
16+
17+
## Code Standards
18+
19+
- All shell scripts pass `bash -n` and `shellcheck`
20+
- Tests use the BATS framework: `make -C tests test`
21+
- Commit messages follow project conventions (see CHANGELOG for format)
22+
23+
## Pull Requests
24+
25+
1. Fork the repository
26+
2. Create a feature branch from the current release branch
27+
3. Make your changes with tests
28+
4. Ensure all tests pass: `make -C tests test`
29+
5. Submit a pull request with a clear description
30+
31+
## License
32+
33+
By contributing, you agree that your contributions will be licensed
34+
under the GNU GPL v2.

README.md

Lines changed: 86 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# Linux Malware Detect (LMD)
22

3-
[![Version](https://img.shields.io/badge/version-2.0.1-blue.svg)](CHANGELOG)
4-
[![License: GPL v2](https://img.shields.io/badge/license-GPL_v2-green.svg)](COPYING.GPL)
5-
[![CI](https://github.com/rfxn/linux-malware-detect/actions/workflows/smoke-test.yml/badge.svg?branch=master)](https://github.com/rfxn/linux-malware-detect/actions/workflows/smoke-test.yml)
3+
<p align="center">
4+
<picture>
5+
<source media="(prefers-color-scheme: dark)" srcset="assets/banner-dark.svg">
6+
<source media="(prefers-color-scheme: light)" srcset="assets/banner-light.svg">
7+
<img alt="Linux Malware Detect" src="assets/banner-dark.svg" width="830">
8+
</picture>
9+
</p>
10+
11+
<p align="center">
12+
<a href="https://github.com/rfxn/linux-malware-detect/actions/workflows/smoke-test.yml"><img src="https://github.com/rfxn/linux-malware-detect/actions/workflows/smoke-test.yml/badge.svg?branch=master" alt="CI"></a>
13+
<a href="CHANGELOG"><img src="https://img.shields.io/badge/version-2.0.1-blue.svg?style=flat-square" alt="Version"></a>
14+
<a href="COPYING.GPL"><img src="https://img.shields.io/badge/license-GPL_v2-green.svg?style=flat-square" alt="License: GPL v2"></a>
15+
<a href="#1-introduction"><img src="https://img.shields.io/badge/platform-Linux-orange.svg?style=flat-square" alt="Platform: Linux"></a>
16+
</p>
617

718
**Malware scanner for Linux** — multi-stage threat detection (MD5, SHA-256, HEX, YARA,
819
statistical analysis), ClamAV integration, real-time inotify monitoring,
@@ -13,7 +24,9 @@ Discord).
1324
> (C) 2026, Ryan MacDonald &lt;ryan@rfxn.com&gt;<br>
1425
> Licensed under [GNU GPL v2](COPYING.GPL)
1526
16-
### What's New in 2.0.1
27+
---
28+
29+
## What's New in 2.0.1
1730

1831
**43x faster native scan engine** — the native scanning pipeline has been completely
1932
rewritten with batch parallel processing. Real-world benchmark on ~10,000 files:
@@ -50,7 +63,7 @@ See [CHANGELOG](CHANGELOG) for full details.
5063
- [3.8 Remote ClamAV](#38-remote-clamav)
5164
- [3.9 ELK Integration](#39-elk-integration)
5265
- [3.10 Configuration Loading Order](#310-configuration-loading-order)
53-
- [4. CLI Usage](#4-cli-usage)
66+
- [4. Usage](#4-usage)
5467
- [5. Ignore Options](#5-ignore-options)
5568
- [6. Cron Daily](#6-cron-daily)
5669
- [7. Inotify Monitoring](#7-inotify-monitoring)
@@ -59,9 +72,10 @@ See [CHANGELOG](CHANGELOG) for full details.
5972
- [8.2 Custom Signatures](#82-custom-signatures)
6073
- [9. Quarantine & Cleaning](#9-quarantine--cleaning)
6174
- [9.1 Cleaner Rules](#91-cleaner-rules)
62-
- [10. Hook Scanning & Service Integration](#10-hook-scanning--service-integration)
63-
- [11. License](#11-license)
64-
- [12. Support Information](#12-support-information)
75+
- [10. Hook Scanning](#10-hook-scanning)
76+
- [Integration](#integration)
77+
- [License](#license)
78+
- [Support](#support)
6579

6680
---
6781

@@ -94,6 +108,8 @@ maldet -u
94108

95109
## 1. Introduction
96110

111+
LMD's architecture, detection stages, and supported platforms.
112+
97113
Linux Malware Detect (LMD) is a malware scanner for Linux released under the GNU GPLv2 license, designed around the threats faced in shared hosted environments. It uses threat data from network edge intrusion detection systems to extract malware that is actively being used in attacks and generates signatures for detection. In addition, threat data is derived from user submissions with the LMD checkout feature and from malware community resources.
98114

99115
LMD focuses on the malware classes that traditional AV products frequently miss: PHP shells, JavaScript injectors, base64-encoded backdoors, IRC bots, and other web-application-layer threats that target shared hosting user accounts rather than operating system internals.
@@ -151,6 +167,8 @@ LMD runs on any Linux distribution with bash and standard GNU utilities. Tested
151167

152168
## 2. Installation
153169

170+
Installing, upgrading, and removing LMD from a system.
171+
154172
The included `install.sh` script handles all installation tasks. Previous installations are automatically backed up.
155173

156174
```bash
@@ -177,6 +195,8 @@ Previous installs are saved to `/usr/local/maldetect.bk{PID}` with a `maldetect.
177195

178196
## 3. Configuration
179197

198+
All user-facing settings and their defaults. See `man maldet`(1) for the complete reference.
199+
180200
The main configuration file is `/usr/local/maldetect/conf.maldet`. All options are commented for ease of configuration. Options use `0`/`1` for disable/enable unless otherwise noted.
181201

182202
Configuration can also be overridden at runtime using the `-co` flag:
@@ -356,7 +376,9 @@ Later sources override earlier values:
356376

357377
---
358378

359-
## 4. CLI Usage
379+
## 4. Usage
380+
381+
Command-line interface, exit codes, and common examples. See `man maldet`(1) for the complete option reference.
360382

361383
```
362384
usage: maldet [OPTION] [ARGUMENT]
@@ -407,7 +429,13 @@ OTHER:
407429
-h, --help show detailed help
408430
```
409431

410-
**Exit codes:** `0` = success / no hits, `1` = error or all scan paths non-existent, `2` = malware hits found.
432+
### 4.1 Exit Codes
433+
434+
| Code | Meaning |
435+
|------|---------|
436+
| `0` | Success, no malware hits |
437+
| `1` | Error or all scan paths non-existent |
438+
| `2` | Malware hits found |
411439

412440
**Examples:**
413441

@@ -451,6 +479,8 @@ enriched fields (hash, size, owner, etc.) as `null`.
451479

452480
## 5. Ignore Options
453481

482+
Excluding paths, file types, and signatures from scans and monitoring.
483+
454484
Four ignore files control what is excluded from scanning:
455485

456486
| File | Format | Purpose |
@@ -486,6 +516,8 @@ base64.inject.unclassed
486516

487517
## 6. Cron Daily
488518

519+
Automated daily scanning, data pruning, and signature updates.
520+
489521
The cron job installed at `/etc/cron.daily/maldet` performs three tasks:
490522

491523
1. **Prune** quarantine, session, and temp data older than `cron_prune_days` (default: 21)
@@ -518,6 +550,8 @@ A weekly watchdog script (`/etc/cron.weekly/maldet-watchdog`) provides independe
518550

519551
## 7. Inotify Monitoring
520552

553+
Real-time file monitoring with kernel inotify, digest alerts, and supervisor management.
554+
521555
Real-time file monitoring uses the kernel inotify subsystem to detect file creation, modification, and move events. Requires a kernel with `CONFIG_INOTIFY_USER` (standard on all modern kernels).
522556

523557
```bash
@@ -559,6 +593,8 @@ When using the `users` mode, only subdirectories matching `inotify_docroot` (def
559593

560594
## 8. Signature System
561595

596+
Signature types, naming conventions, updates, and custom rule files.
597+
562598
LMD ships with five signature types:
563599

564600
| Type | File | Format | Count |
@@ -628,6 +664,8 @@ Remote import URLs can be configured for automatic download during signature upd
628664

629665
## 9. Quarantine & Cleaning
630666

667+
Isolating, restoring, and cleaning malware-infected files.
668+
631669
Quarantined files are stored under `/usr/local/maldetect/quarantine/` with permissions set to `000`. Original path, owner, permissions, and modification time are recorded in `/usr/local/maldetect/sess/quarantine.hist` for full restoration.
632670

633671
```bash
@@ -662,7 +700,9 @@ The cleaner is a sub-function of quarantine — files must be quarantined (or us
662700

663701
---
664702

665-
## 10. Hook Scanning & Service Integration
703+
## 10. Hook Scanning
704+
705+
Service hook API for ModSecurity, FTP, Exim, and custom integrations.
666706

667707
LMD provides real-time file scanning for multiple services via the unified `hookscan.sh` API. A single script handles mode dispatch for ModSecurity, pure-ftpd, ProFTPD, Exim, and generic (custom) integrations.
668708

@@ -801,7 +841,40 @@ For administrators replacing CXS with LMD:
801841

802842
---
803843

804-
## 11. License
844+
## Integration
845+
846+
Connecting LMD with external tools, automation pipelines, and third-party scanners.
847+
848+
### ClamAV
849+
850+
LMD signatures are automatically symlinked to ClamAV data directories by `install.sh`, providing dual-engine coverage. Set `scan_clamscan=auto` (default) for automatic ClamAV detection. See [3.7 ClamAV Integration](#37-clamav-integration) for engine selection and signature validation.
851+
852+
### ELK Stack
853+
854+
Enable `enable_statistic=1` with `elk_host`, `elk_port`, and `elk_index` to stream scan events to Elasticsearch. See [3.9 ELK Integration](#39-elk-integration).
855+
856+
### Alerting Channels
857+
858+
LMD supports four alert delivery channels beyond email: Slack (Block Kit), Telegram (MarkdownV2), Discord (webhook embeds), and SMTP relay for environments without a local MTA. See [3.2 Alerting](#32-alerting) for configuration.
859+
860+
### JSON Reports
861+
862+
Machine-readable scan output for CI/CD and automation:
863+
864+
```bash
865+
maldet --format json -e SCANID # JSON report to stdout
866+
maldet --json-report list # list all scans as JSON
867+
```
868+
869+
See `man maldet`(1) for the v1.0 JSON schema.
870+
871+
### Hosting Panel Detection
872+
873+
The daily cron auto-detects 12+ hosting control panels and adjusts scan paths. See [6. Cron Daily](#6-cron-daily) for the full panel matrix.
874+
875+
---
876+
877+
## License
805878

806879
LMD is developed and supported on a volunteer basis by Ryan MacDonald [ryan@rfxn.com].
807880

@@ -812,7 +885,7 @@ required under GNU GPL.
812885

813886
---
814887

815-
## 12. Support Information
888+
## Support
816889

817890
The LMD source repository is at: https://github.com/rfxn/linux-malware-detect
818891

SECURITY.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Security Policy — linux-malware-detect
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
|---------|-----------|
7+
| latest release | Yes |
8+
| previous minor | Security fixes only |
9+
| older | No |
10+
11+
## Reporting a Vulnerability
12+
13+
**Do not open a public issue for security vulnerabilities.**
14+
15+
Email: proj@rfxn.com
16+
17+
Include:
18+
- Description of the vulnerability
19+
- Steps to reproduce
20+
- Affected version(s)
21+
- Impact assessment (if known)
22+
23+
## Response Timeline
24+
25+
- **Acknowledgment**: within 48 hours
26+
- **Initial assessment**: within 5 business days
27+
- **Fix or mitigation**: best-effort, typically within 30 days for
28+
confirmed vulnerabilities
29+
30+
## Scope
31+
32+
This policy covers the linux-malware-detect codebase. For vulnerabilities in
33+
dependencies, please report to the upstream maintainer and notify us
34+
if the dependency is bundled.

assets/banner-dark.svg

Lines changed: 29 additions & 0 deletions
Loading

assets/banner-light.svg

Lines changed: 29 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)