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

Problem with api/v2/import-scan #11339

Open
altikamel opened this issue Nov 27, 2024 · 4 comments
Open

Problem with api/v2/import-scan #11339

altikamel opened this issue Nov 27, 2024 · 4 comments

Comments

@altikamel
Copy link

Hello

I have an issue with using api/v2/import-scan from one pod (gitlab-runner) to defectdojo django pod in the same namespace.
I have installation of defect-dojo from helm chart, added my domain values to ingress to access the web interface and everything was successfull but i can't load my reports in json using API using service inside kubernetes namespace, but loading files from remote machine via ingress name is successful.

For example my service name is defectdojo-django, and i added it to DD_ALLOWED_HOSTS, so trying to use this service via cURL from inside of a gitlab runner pod is successful,connection successfully established, but when i try to use cURL to load my report json file with the service_name (not ingress name) i have an errors such :
expecting value: line 1 column 1 , bad request
Bad Request - /api/v2/import-scan

when i try to load this file with all the same parameters via cURL from remote machine, using ingress, loading is successfull.

Also other methods of API work properly when i use cURL from gitlab runner pod via service inside namespace, only /apy/v2/import-scan doesnt work.

Does it mean that i should use only ingress name to load the peport to defectdojo , not service?

Thanks!

@testaccount90009
Copy link
Contributor

Have you tried reimport-scan instead of import-scan? Assuming you are using the same scan, of course.. Import =/= Reimport, but Reimport = Import.

@altikamel
Copy link
Author

Have you tried reimport-scan instead of import-scan? Assuming you are using the same scan, of course.. Import =/= Reimport, but Reimport = Import.

i tried it , reimport-scan returns same error -

dojo.importers.base_importer - Expecting value: line 1 column 1 (char 0)
django.request - Bad request - api/v2/reimport-scan

@testaccount90009
Copy link
Contributor

I can confirm import-scan and reimport-scan does work. I'm using them as we speak for other tests I'm running on my Dev Dojo stack. I don't use Helm, so it sounds like you have something else going on. If it works with the ingress name and not service name, I'd use ingress name.

@altikamel
Copy link
Author

I can confirm import-scan and reimport-scan does work. I'm using them as we speak for other tests I'm running on my Dev Dojo stack. I don't use Helm, so it sounds like you have something else going on. If it works with the ingress name and not service name, I'd use ingress name.

Yes, my problem depends on restrictions of my k8s cluster when i cant use ingress inside the cluster between pods in the same namespace, only services..

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