Go to file
Yvan Janssens e717674f45
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Implement first revision of malware scanning microservice.
2023-04-07 14:53:38 +02:00
config Initial commit. 2023-04-06 10:27:37 +02:00
.gitignore Add go.sum to repo 2023-04-06 10:28:16 +02:00
.woodpecker.yml Initial commit. 2023-04-06 10:27:37 +02:00
Dockerfile Fix dockerfile go build command 2023-04-07 12:26:05 +02:00
env.osx Initial commit. 2023-04-06 10:27:37 +02:00
go.mod Stub malscan API service 2023-04-07 13:57:58 +02:00
go.sum Stub malscan API service 2023-04-07 13:57:58 +02:00
malscan.go Implement /status API endpoint 2023-04-07 14:22:47 +02:00
README.md Implement first revision of malware scanning microservice. 2023-04-07 14:53:38 +02:00
rest.go Implement first revision of malware scanning microservice. 2023-04-07 14:53:38 +02:00
scanner.go Implement /status API endpoint 2023-04-07 14:22:47 +02:00
updater.go Add freshclam goroutine. 2023-04-06 11:35:59 +02: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"