Skip to content

Commit e6fb8d3

Browse files
committed
Add high level software diagram and scan flowchart to Usage page
1 parent cb15897 commit e6fb8d3

3 files changed

Lines changed: 100 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
run: rustup update stable --no-self-update && rustup default stable
1818
- name: Install mdBook
1919
run: |
20-
cargo install mdbook
20+
cargo install mdbook mdbook-mermaid
2121
cargo install --git https://github.com/Cisco-Talos/mdbook-sitemap-generator.git --branch rename-urls-url
2222
- name: Build book
2323
run: |

book.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ site-url = "/"
1414
theme = "theme"
1515
default-theme = "clamav"
1616
preferred-dark-theme = "clamav"
17+
additional-js = ["mermaid.min.js", "mermaid-init.js"]
1718

1819
[output.html.playground]
1920
editable = true
@@ -27,3 +28,8 @@ boost-hierarchy = 2
2728
boost-paragraph = 1
2829
expand = true
2930
heading-split-level = 2
31+
32+
[preprocessor]
33+
34+
[preprocessor.mermaid]
35+
command = "mdbook-mermaid"

src/manual/Usage.md

Lines changed: 93 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Table Of Contents
44

55
- [Usage](#usage)
66
- [Purpose](#purpose)
7+
- [High-Level Software Diagram](#high-level-software-diagram)
8+
- [Rough Scan Flowchart](#rough-scan-flowchart)
79
- [Daemon](#daemon)
810
- [Scanner](#scanner)
911
- [Signature Testing and Management](#signature-testing-and-management)
@@ -13,12 +15,102 @@ Table Of Contents
1315

1416
This user guide presents an overview of the various ways that *libclamav* can be used through the tools provided by ClamAV. To learn more about how to better use each facet of ClamAV that interests you, please follow the links provided.
1517

18+
## High-Level Software Diagram
19+
20+
```mermaid
21+
flowchart TD
22+
subgraph CLAMAV[ClamAV Programs, Services, Libraries, and Data]
23+
DB[(Virus Databases)]
24+
NET[(ClamAV mirrors / update source)]
25+
26+
LF[libfreshclam<br/>update library]
27+
28+
FC[freshclam<br/>updates databases]
29+
CD[clamd<br/>scanner daemon]
30+
CS[clamscan<br/>standalone scanner]
31+
CDS[clamdscan<br/>client for clamd]
32+
CDT[clamdtop<br/>monitor for clamd]
33+
COA[clamonacc<br/>on-access scanner]
34+
CMI[clamav-milter<br/>mail filter]
35+
ST[sigtool<br/>signature/db utility]
36+
CBC[clambc<br/>bytecode utility]
37+
CCF[clamconf<br/>config/report utility]
38+
CSU[clamsubmit<br/>sample submission tool]
39+
40+
NET --> FC
41+
LF --> FC
42+
FC --> DB
43+
44+
DB --> CD
45+
DB --> CS
46+
DB --> ST
47+
DB --> CBC
48+
49+
CDS --> CD
50+
CDT --> CD
51+
COA --> CD
52+
CMI --> CD
53+
end
54+
55+
```
56+
57+
## Rough Scan Flowchart
58+
59+
```mermaid
60+
flowchart LR
61+
subgraph DIRECT[Direct scan flow]
62+
direction LR
63+
CS[clamscan]
64+
CS_VERDICT[Scan verdicts / alerts]
65+
CS_META[Logs / metadata]
66+
67+
CS -->|report verdict| CS_VERDICT
68+
CS -->|emit logs / metadata| CS_META
69+
end
70+
71+
subgraph CLIENTSERVER[Client/server scan flow]
72+
direction LR
73+
74+
subgraph CLIENTS[ ]
75+
direction TB
76+
CDS[clamdscan]
77+
COA[clamonacc]
78+
CMI[clamav-milter]
79+
end
80+
81+
subgraph DAEMON[ ]
82+
direction TB
83+
CD[clamd]
84+
end
85+
86+
subgraph OUTPUTS[ ]
87+
direction TB
88+
CD_VERDICT[Scan verdicts / alerts]
89+
CD_META[Logs / metadata]
90+
end
91+
92+
CDS -->|request scan| CD
93+
COA -->|request scan| CD
94+
CMI -->|request scan| CD
95+
96+
CDS -->|report verdict| CD_VERDICT
97+
COA -->|report verdict| CD_VERDICT
98+
CMI -->|report verdict| CD_VERDICT
99+
100+
CDS -->|emit logs / metadata| CD_META
101+
COA -->|emit logs / metadata| CD_META
102+
CMI -->|emit logs / metadata| CD_META
103+
end
104+
105+
```
106+
16107
## Daemon
17108

18109
The ClamAV Daemon, or [`clamd`](Usage/Scanning.md#clamd), is a multi-threaded daemon that uses *libclamav* to [scan files for viruses](Usage/Scanning.md). ClamAV provides a number of tools which interface with this daemon. They are, as follows:
19110

20111
- [`clamdscan`](Usage/Scanning.md#clamdscan) - a simple scanning client
21-
- [`on-access scanning`](Usage/Scanning.md#On-access-scanning) - provides real-time protection via a `clamd` instance
112+
- [`clamonacc`](Usage/Scanning.md#On-access-scanning) - provides on-access scanning (aka real-time protection via a `clamd` instance
113+
- [`clamav-milter`](Usage/Scanning.md#On-access-scanning) - a mail filtering plugin for the Sendmail email processing server software to scan emails
22114
- [`clamdtop`](Usage/Scanning.md#clamdtop) - a resource monitoring interface for `clamd`
23115

24116
## Scanner
@@ -40,6 +132,4 @@ The more complex tools ClamAV provides each require some degree of [configuratio
40132
- [`clamd.conf`](Usage/Configuration.md#clamdconf) - for configuring the behavior of the ClamAV Daemon `clamd` and associated tools
41133
- [`freschclam.conf`](Usage/Configuration.md#freshclamconf) - for configuring the behavior of the signature database update tool, `freshclam`
42134

43-
ClamAV also provides a mail filtering tool called [`clamav-milter`](Usage/Configuration.md#clamav-milterconf) which can be attached to a `clamd` instance for mail scanning purposes.
44-
45135
Additionally, a tool called [`clamconf`](Usage/Configuration.md#clamconf) allows users to check the configurations used by each other tool, pulling information from the configuration files listed above, alongside other relevant information.

0 commit comments

Comments
 (0)