malscan/README.md

48 lines
1.0 KiB
Markdown
Raw Normal View History

2023-04-07 12:00:14 +00:00
# malscan
REST-based API to consume ClamAV as a microservice.
## API endpoints
This microservice exposes the following API endpoints:
- `/status`
- `/scan`
### `/status` endpoint
This endpoint provides the status of the malware engine used as well as the amount of signatures in the database. It also carries out a basic sanity check on the antimalware software being used.
Methods accepted: `GET`
Parameters: none
Example output:
```
{
"scanning_engine": "clamav",
"signature_count": 8659701,
"sanity_check": true
}
```
### `/scan` endpoint
Methods accepted: `POST`
Parameters: file to be scanned needs to be supplied as the body of the request. Maximum file upload size is 20MB.
Example output:
```
{
"malware_detected": true,
"malware_name": "Win.Test.EICAR_HDB-1",
"engine": {
"scanning_engine": "clamav",
"signature_count": 8659701,
"sanity_check": true
}
}
```
You can use this endpoint using eg `curl -X POST http://localhost:8080/scan --data "@eicar.com"`