https://github.com/psypherpunk/clamav-api
HTTP API to ClamAV.
https://github.com/psypherpunk/clamav-api
Last synced: 4 months ago
JSON representation
HTTP API to ClamAV.
- Host: GitHub
- URL: https://github.com/psypherpunk/clamav-api
- Owner: PsypherPunk
- License: mpl-2.0
- Created: 2020-03-18T19:23:37.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-01-14T14:05:44.000Z (over 1 year ago)
- Last Synced: 2025-03-24T12:03:57.268Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 150 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `clamav-api`
HTTP API on a `clamd` instance.
## `docker build`
To build a Docker image:
```bash
docker build --tag clamav-rest .
```
## `docker run`
To run the service:
```bash
docker run \
--rm \
--interactive \
--tty \
--publish 8000:8000 \
clamav-rest
```
After which, the service will start the `clamd` daemon and in turn,
the API:
```bash
[ ok ] Starting ClamAV daemon: clamd .
[2020-03-18 13:35:58 +0000] [1] [INFO] Starting gunicorn 20.0.4
[2020-03-18 13:35:58 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2020-03-18 13:35:58 +0000] [1] [INFO] Using worker: sync
[2020-03-18 13:35:58 +0000] [371] [INFO] Booting worker with pid: 371
```
## OpenAPI
The OpenAPI definition will be available at .
This should be largely functional, though the `/instream` endpoint
expects binary data and may not work with the web interface. However,
you can verify the behaviour with `curl` and the
[EICAR Anti-Virus Test File](https://en.wikipedia.org/wiki/EICAR_test_file):
```bash
curl --include \
--request POST \
--header 'Content-Type: application/octet-stream' \
--header 'Accept: application/json' \
--data @eicar_test_file.txt \
http://0.0.0.0:8000/instream
```
You should then receive a positive response:
```bash
{
"output": "stream: Win.Test.EICAR_HDB-1 FOUND"
}
```