Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Endpoints /version works /scan doesn't #58

Closed
ChadCarroll opened this issue Jun 16, 2024 · 2 comments
Closed

Testing Endpoints /version works /scan doesn't #58

ChadCarroll opened this issue Jun 16, 2024 · 2 comments

Comments

@ChadCarroll
Copy link

Running inside of Kubernetes. The pods are running and I'm able to access the endpoint to retrieve the version but I'm unable scan a file.

Working

http --form GET http://clamav-rest-service.default.svc.cluster.local:3000/api/v1/version
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 83
Content-Type: application/json; charset=utf-8
Date: Sun, 16 Jun 2024 23:17:38 GMT
ETag: W/"53-ih6cCd8a32HdUVUvezFSoGXOtCE"
Keep-Alive: timeout=5
X-Powered-By: Express

{
"data": {
"version": "ClamAV 1.3.1/27308/Sun Jun 16 08:28:55 2024\n"
},
"success": true
}

Not working

http --form POST http://clamav-rest-service.default.svc.cluster.local:3000/api/v1/scan FILES@/tmp/testfile.txt
HTTP/1.1 400 Bad Request
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 79
Content-Type: application/json; charset=utf-8
Date: Sun, 16 Jun 2024 23:21:47 GMT
ETag: W/"4f-PIl2ikdI5Iaf4TJBR0V5ATKtLss"
Keep-Alive: timeout=5
X-Powered-By: Express

{
"data": {
"error": "The request should have only undefined key"
},
"success": false
}

cat /tmp/testfile.txt
This is a test file for ClamAV scanning.

env from clamav pod

$ env
KUBERNETES_PORT=tcp://10.96.0.1:443
KUBERNETES_SERVICE_PORT=443
CLAMAV_REST_SERVICE_SERVICE_PORT=3000
CLAMAV_REST_SERVICE_PORT=tcp://10.108.68.111:3000
CLAMAV_SERVICE_PORT_3310_TCP_ADDR=10.103.127.244
API_GATEWAY_SERVICE_PORT=80
API_GATEWAY_PORT=tcp://10.106.133.31:80
NODE_VERSION=18.20.3
HOSTNAME=clamav-rest-6fd98596c6-gmlmk
CLAMAV_SERVICE_PORT_3310_TCP_PORT=3310
YARN_VERSION=1.22.19
CLAMD_HOST=clamav-service
CLAMAV_SERVICE_PORT_3310_TCP_PROTO=tcp
HOME=/home/node
OLDPWD=/
API_GATEWAY_PORT_80_TCP_ADDR=10.106.133.31
CLAMAV_SERVICE_SERVICE_HOST=10.103.127.244
API_GATEWAY_PORT_80_TCP_PORT=80
CLAMD_PORT=3310
API_GATEWAY_PORT_80_TCP_PROTO=tcp
CLAMAV_SERVICE_PORT_3310_TCP=tcp://10.103.127.244:3310
CLAMAV_SERVICE_PORT=tcp://10.103.127.244:3310
CLAMAV_SERVICE_SERVICE_PORT=3310
TERM=xterm
KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
CLAMAV_REST_SERVICE_PORT_3000_TCP_ADDR=10.108.68.111
API_GATEWAY_PORT_80_TCP=tcp://10.106.133.31:80
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
KUBERNETES_PORT_443_TCP_PORT=443
CLAMAV_REST_SERVICE_PORT_3000_TCP_PORT=3000
KUBERNETES_PORT_443_TCP_PROTO=tcp
CLAMAV_REST_SERVICE_PORT_3000_TCP_PROTO=tcp
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443
CLAMAV_REST_SERVICE_PORT_3000_TCP=tcp://10.108.68.111:3000
CLAMAV_REST_SERVICE_SERVICE_HOST=10.108.68.111
KUBERNETES_SERVICE_HOST=10.96.0.1
PWD=/tmp
API_GATEWAY_SERVICE_HOST=10.106.133.31

@benzino77
Copy link
Owner

Can you provide env information from CRA pod?

@ChadCarroll
Copy link
Author

Something was definitely with my env. I redeployed using the example yml you provided and it's working now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants