This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
forked from o20ne/clamav-rest
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ajilaag/develop
HTTPS & malware signature database
- Loading branch information
Showing
8 changed files
with
95 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,10 +36,12 @@ The following image tags are available: | |
|
||
Run clamav-rest docker image: | ||
```bash | ||
docker run -p 9000:9000 -itd --name clamav-rest ajilaag/clamav-rest | ||
docker run -p 9000:9000 -p 9443:9443 -itd --name clamav-rest ajilaag/clamav-rest | ||
``` | ||
|
||
Test that service detects common test virus signature: | ||
|
||
**HTTP** | ||
```bash | ||
$ curl -i -F "[email protected]" http://localhost:9000/scan | ||
HTTP/1.1 100 Continue | ||
|
@@ -52,7 +54,22 @@ Content-Length: 56 | |
{ Status: "FOUND", Description: "Eicar-Test-Signature" } | ||
``` | ||
**HTTPS** | ||
```bash | ||
$ curl -i -k -F "[email protected]" https://localhost:9443/scan | ||
HTTP/1.1 100 Continue | ||
|
||
HTTP/1.1 406 Not Acceptable | ||
Content-Type: application/json; charset=utf-8 | ||
Date: Mon, 28 Aug 2017 20:22:34 GMT | ||
Content-Length: 56 | ||
|
||
{ Status: "FOUND", Description: "Eicar-Test-Signature" } | ||
``` | ||
Test that service returns 200 for clean file: | ||
**HTTP** | ||
```bash | ||
$ curl -i -F "[email protected]" http://localhost:9000/scan | ||
|
||
|
@@ -65,6 +82,21 @@ Content-Length: 33 | |
|
||
{ Status: "OK", Description: "" } | ||
``` | ||
**HTTPS** | ||
```bash | ||
$ curl -i -k -F "[email protected]" https://localhost:9443/scan | ||
|
||
HTTP/1.1 100 Continue | ||
|
||
HTTP/1.1 200 OK | ||
Content-Type: application/json; charset=utf-8 | ||
Date: Mon, 28 Aug 2017 20:23:16 GMT | ||
Content-Length: 33 | ||
|
||
{ Status: "OK", Description: "" } | ||
``` | ||
## Status Codes | ||
- 200 - clean file = no KNOWN infections | ||
|
@@ -94,6 +126,7 @@ Below is the complete list of available options that can be used to customize yo | |
| `MAX_ICONSPE` | How many Icons in PE to scan - Default `100` | | ||
| `PCRE_MATCHLIMIT` | Maximum PCRE Match Calls - Default `100000` | | ||
| `PCRE_RECMATCHLIMIT` | Maximum Recursive Match Calls to PCRE - Default `2000` | | ||
| `SIGNATURE_CHECKS` | Check times per day for a new database signature. Must be between 1 and 50. - Default `24` | | ||
## Networking | ||
|
@@ -108,7 +141,7 @@ Below is the complete list of available options that can be used to customize yo | |
For debugging and maintenance purposes you may want access the containers shell. | ||
```bash | ||
docker exec -it (whatever your container name is e.g. clamav) bash | ||
docker exec -it (whatever your container name is e.g. clamav-rest) /bin/sh | ||
``` | ||
# Developing | ||
|
@@ -118,7 +151,7 @@ Build golang (linux) binary and docker image: | |
```bash | ||
# env GOOS=linux GOARCH=amd64 go build | ||
docker build . -t clamav-go-rest | ||
docker run -p 9000:9000 -itd --name clamav-rest clamav-go-rest | ||
docker run -p 9000:9000 -p 9443:9443 -itd --name clamav-rest clamav-go-rest | ||
``` | ||
# References | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ services: | |
mem_limit: 1048576000 | ||
image: ajilaag/clamav-rest | ||
ports: | ||
- "9000:9000" | ||
- "9000:9000" | ||
- "9443:9443" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIB2TCCAV8CCQDifaD7KfcXjzAKBggqhkjOPQQDBDBWMQswCQYDVQQGEwJDSDEQ | ||
MA4GA1UECAwHTHVjZXJuZTEPMA0GA1UEBwwGU3Vyc2VlMREwDwYDVQQKDAhhamls | ||
YSBBRzERMA8GA1UECwwIYWppbGEgQUcwHhcNMjAwMjA1MTI1MTQzWhcNMzAwMjAy | ||
MTI1MTQzWjBWMQswCQYDVQQGEwJDSDEQMA4GA1UECAwHTHVjZXJuZTEPMA0GA1UE | ||
BwwGU3Vyc2VlMREwDwYDVQQKDAhhamlsYSBBRzERMA8GA1UECwwIYWppbGEgQUcw | ||
djAQBgcqhkjOPQIBBgUrgQQAIgNiAARqaWNMhncO9fc3bhLHNvcpT+Oml4yXEMX3 | ||
gUXb3SNeyW5dE74x6hxQQ04qIB/UmC5zi+USJmvrbUwm+nFehqBvn5S8aZgeXklL | ||
MpKFzXepzsgHIisYG3U943+7Fj6m67cwCgYIKoZIzj0EAwQDaAAwZQIxAKatG/Zw | ||
TR2yYRPExR8bFalQYle1JqNbHcfv8p2bqb9+ISqIaXmJde5S+5gvez0VOwIwKIpE | ||
gteclRk6IQy9NKxCsoflcMwXI4r45Tffi3PV7x2O4rMbPGVwyk4IGms9hb+S | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-----BEGIN EC PARAMETERS----- | ||
BgUrgQQAIg== | ||
-----END EC PARAMETERS----- | ||
-----BEGIN EC PRIVATE KEY----- | ||
MIGkAgEBBDBZM2J/UKtGWJ5iu/VWRb5tUt2G41EcQKrgmrJT473hackaLP0C1peI | ||
ubjs6qbBmaigBwYFK4EEACKhZANiAARqaWNMhncO9fc3bhLHNvcpT+Oml4yXEMX3 | ||
gUXb3SNeyW5dE74x6hxQQ04qIB/UmC5zi+USJmvrbUwm+nFehqBvn5S8aZgeXklL | ||
MpKFzXepzsgHIisYG3U943+7Fj6m67c= | ||
-----END EC PRIVATE KEY----- |