Skip to content

Commit 1a331c0

Browse files
committed
doc: update clamav docs
1 parent 3c69c0d commit 1a331c0

File tree

1 file changed

+48
-18
lines changed

1 file changed

+48
-18
lines changed

docs/services/antivirus.md

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ tags: [explanation, services]
55

66
# Anti-Virus Scanning
77

8-
## Getting started
8+
## What is ClamAV
99

1010
[ClamAV][clamav] is an open source antivirus engine for detecting trojans, viruses, malware and other malicious threats.
1111
It is used in a variety of situations including file scanning, email scanning, web scanning and end point security.
1212

13-
This feature is installed on all Nais clusters.
14-
ClamAV runs with one daemon pod and one pod running the REST api the applications use.
15-
There is a service set up so all applications will be able to talk to the REST api using [http://clamav.nais-system/scan](http://clamav.nais-system/scan).
16-
The REST api supports PUT or POST and can be tested using curl as well:
13+
## Where is it available
14+
This feature is installed on all nais clusters if the feature is enabled in the tenant.
15+
ClamAV has a REST API applications in the cluster can use for scanning files and urls.
1716

18-
ClamAV has a REST API applications can use for scanning files and urls.
17+
There is a service set up so all applications will be able to talk to the REST api using either
18+
- V1 API: http://clamav.nais-system/scan
19+
- V2 API: http://clamav.nais-system/api/v2/scan
1920

20-
The REST API has one endpoint `/scan` that supports PUT or POST with form-data. It can be tested using curl as well:
21+
The service can only be used from inside the cluster and the APIs support PUT with a request body or POST with form-data.
22+
23+
It can be tested using curl:
2124

2225
```bash
2326
# Example
@@ -26,13 +29,7 @@ curl -v -X PUT --data-binary @/tmp/file_to_test http://clamav.nais-system.svc.n
2629
curl -v http://clamav.nais-system.svc.cluster.local/scan?url=url_to_file
2730
```
2831

29-
See [ClamAV documentation][clamav-docs] and [ClamAV REST API][clamav-api] for more information.
30-
31-
[clamav]: https://www.clamav.net/
32-
[clamav-docs]: https://docs.clamav.net/
33-
[clamav-api]: https://github.com/navikt/muescheli
34-
35-
## Access Policy
32+
### Access Policy
3633

3734
When using ClamAV on GCP, remember to add an [outbound access policy](../workloads/how-to/access-policies.md):
3835

@@ -43,21 +40,54 @@ metadata:
4340
name: myapp
4441
...
4542
spec:
46-
...
4743
accessPolicy:
4844
outbound:
4945
rules:
5046
- application: clamav
5147
namespace: nais-system
5248
```
5349
54-
## Support
50+
## What is returned from the API
51+
52+
The response returns a JSON result that differs slightly based on which version of the API you're using:
53+
54+
V1 (will return HTTP/500 if any error occurs):
55+
```
56+
[
57+
{
58+
"Filename": "yourfile.txt",
59+
"Result": "OK"
60+
}
61+
]
62+
```
5563

56-
If you have any questions about ClamAV please contact the Nais team on Slack, [#nais](https://nav-it.slack.com/messages/C5KUST8N6) or contact [@Sten.Ivar.Røkke](https://nav-it.slack.com/archives/D5KP2068Z) directly.
64+
V2 (will return HTTP/200 with error message):
65+
```
66+
[
67+
{
68+
"filename": "yourfile.txt",
69+
"result": "OK",
70+
"virus": "",
71+
"error": ""
72+
}
73+
]
74+
```
75+
76+
77+
See [ClamAV documentation][clamav-docs] and [ClamAV REST API][clamav-rest] for more information.
78+
79+
[clamav]: https://www.clamav.net/
80+
[clamav-docs]: https://docs.clamav.net/
81+
[clamav-rest]: https://github.com/nais/clamav-rest
5782

5883
## Examples
5984

60-
Code example can be found here:
85+
Code examples can be found here:
6186

6287
- [foreldrepenger-api](https://github.com/navikt/foreldrepengesoknad-api/blob/master/domene/src/main/java/no/nav/foreldrepenger/selvbetjening/vedlegg/virusscan/VirusScanConfig.java)
6388
- [pale-2](https://github.com/navikt/pale-2/blob/main/src/main/kotlin/no/nav/syfo/client/clamav/ClamAvClient.kt)
89+
-
90+
## Support
91+
92+
If you have any questions about ClamAV please contact the Nais team on Slack, [#nais](https://nav-it.slack.com/messages/C5KUST8N6).
93+

0 commit comments

Comments
 (0)