Secure-Compliance-Solutions-LLC / GVM-Docker

Greenbone Vulnerability Management Docker Image with OpenVAS
https://securecompliance.gitbook.io/projects/
MIT License
248 stars 91 forks source link

Stop scan ! Could not connect to Scanner #81

Closed kendyblack closed 3 years ago

kendyblack commented 4 years ago

event task:MESSAGE:2020-09-22 14h30.08 +07:1205: Status of task Immediate scan of IP 192.168.11.19 (ac58bdd9-bdc5-4bd3-a866-2deda8573d52) has changed to Requested event task:MESSAGE:2020-09-22 14h30.08 +07:1205: Task Immediate scan of IP 192.168.11.19 (ac58bdd9-bdc5-4bd3-a866-2deda8573d52) has been requested to start by admin md manage:WARNING:2020-09-22 14h30.22 +07:1208: Could not connect to Scanner at /tmp/ospd.sock md manage:WARNING:2020-09-22 14h30.22 +07:1208: OSP start_scan 5a6114a8-e353-4ca5-8947-be6ee0a90ddf: Could not connect to Scanner event task:MESSAGE:2020-09-22 14h30.23 +07:1208: Status of task Immediate scan of IP 192.168.11.19 (ac58bdd9-bdc5-4bd3-a866-2deda8573d52) has changed to Done

markdesilva commented 4 years ago

Did you upgrade and use back the previous database?

If so, the previous database is holding the socket location at /tmp/ospd.sock when it is now at /var/run/ospd/ospd.sock. This is similar to issue #76.

If you need it to run, go into the container, cd /tmp and softlink it.

docker exec -it gvm bash

cd /tmp; ln -s /var/run/ospd/ospd.sock . Then try the scan again.
kendyblack commented 3 years ago

this firt use of gvm , don't have previos database . what can i do ?

kendyblack commented 3 years ago

new bug i see, when i click to the alert status of scan : "An error occurred on this page. Please try again. Show Error Details "

Log :

md manage:WARNING:2020-09-23 10h45.51 +07:1765: run_report_format_script: No generate script found at /usr/local/var/lib/gvm/gvmd/report_formats/generate md manage:WARNING:2020-09-23 10h45.51 +07:1765: run_report_format_script: No generate script found at /usr/local/var/lib/gvm/gvmd/report_formats/generate md manage:WARNING:2020-09-23 10h45.51 +07:1765: run_report_format_script: No generate script found at /usr/local/var/lib/gvm/gvmd/report_formats/generate md manage:WARNING:2020-09-23 10h45.51 +07:1765: run_report_format_script: No generate script found at /usr/local/var/lib/gvm/gvmd/report_formats/generate md manage:WARNING:2020-09-23 10h45.51 +07:1765: run_report_format_script: No generate script found at /usr/local/var/lib/gvm/gvmd/report_formats/generate md manage:WARNING:2020-09-23 10h45.51 +07:1765: run_report_format_script: No generate script found at /usr/local/var/lib/gvm/gvmd/report_formats/generate md manage:WARNING:2020-09-23 10h45.51 +07:1765: run_report_format_script: No generate script found at /usr/local/var/lib/gvm/gvmd/report_formats/generate

pixelsquared commented 3 years ago

That problem sounds like issue #77

kendyblack commented 3 years ago

that so if this firt use of gvm , don't have previos database . what can i do ?this firt use of gvm , don't have previos database . what can i do ?

pixelsquared commented 3 years ago

Do you need any of the data that is in the GVM currently?

If you are ok with deleting all of the scan data you have you could delete the container and volume.

To delete the container do: docker rm -vf gvm

To delete the volume do: docker volume rm gvm-data

If you need to keep the scan data you have then you will have to wait for me to fix this issue.

kendyblack commented 3 years ago

no , i don't need to keep any data . rm container end delete volume to run new container ?

pixelsquared commented 3 years ago

Yes after removing the container and volume just create a new container.

kendyblack commented 3 years ago

now run : docker run --detach --publish 8080:9392 --env PASSWORD="Your admin password here" --volume gvm-data:/data --name gvm securecompliance/gvm:{version}

with gvm version:latest that ok ? or 20.08

pixelsquared commented 3 years ago

latest and 20.08-v1 are the same so either one will work

kendyblack commented 3 years ago

installed gvm but lost something :

2020-09-23 09:06:12.982 UTC [1397] ERROR: relation "scap.cves" does not exist at character 82 2020-09-23 09:06:12.982 UTC [1397] STATEMENT: UPDATE cert.dfn_cert_advs SET max_cvss = (SELECT max (cvss) FROM scap.cves WHERE name IN (SELECT cve_name FROM cert.dfn_cert_cves WHERE adv_id = dfn_cert_advs.id) AND cvss != 0.0); md manage: INFO:2020-09-23 09h06.12 utc:1394: Updating Max CVSS for DFN-CERT md manage:WARNING:2020-09-23 09h06.12 utc:1394: sql_exec_internal: PQexec failed: ERROR: relation "scap.cves" does not exist LINE 1: ...ax_cvss = (SELECT max (cvss) FROM scap.cves ... ^ (7) md manage:WARNING:2020-09-23 09h06.12 utc:1394: sql_exec_internal: SQL: UPDATE cert.dfn_cert_advs SET max_cvss = (SELECT max (cvss) FROM scap.cves WHERE name IN (SELECT cve_name FROM cert.dfn_cert_cves WHERE adv_id = dfn_cert_advs.id) AND cvss != 0.0); md manage:WARNING:2020-09-23 09h06.12 utc:1394: sqlv: sql_exec_internal failed

markdesilva commented 3 years ago

This is already documented.

https://community.greenbone.net/t/gvm-20-08-missing-report-formats-and-scan-configs/6397/3

This new version with the GVMD_DATA feed doesn't have all the ports and various scans. Looks like they decided to do away with it. Even if you were to import it back from v11, it might not work the way it used to work.

This is a GVM issue, nothing to do with Secure Compliance who is only providing the docker image.

installed gvm but lost something :

* " Post list"  dose's have enought
kendyblack commented 3 years ago

in your container have .sh file "add-scanner.sh". i don't understand Scanner ID in add-scanner.sh what is this ? and scanner public key is public key have been for installed gvm or this is ssh public key . i trying to use your docker gvm so i am sorry if have many question for you ! thank you !

markdesilva commented 3 years ago

Have you actually read the instructions on Wiki Table of Contents at the bottom of the main page?

https://github.com/Secure-Compliance-Solutions-LLC/GVM-Docker

It has instructions for almost everything, including the set up of the scanner.

https://github.com/Secure-Compliance-Solutions-LLC/GVM-Docker/wiki/Setup-Remote-scanner

The scanner is a different container typically on a different machine (it makes no sense to run a remote scanner on the same machine). So you will have the main container (called 'gvm') and the scanner container on a different machine (called 'scanner')

It says clearly in step 5:

After the scanner container fully starts check the logs for the "Scanner id" and "Public key"

That means, when the scanner is completely running do:

docker logs scanner

and look for the portion in the logs that looks like this:

> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> + Your OpenVAS Scanner container is now ready to use! +
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
> -------------------------------------------------------
> Scanner id: abchdeujs5ff
> Public key:   ssh-edxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
> Master host key (Check that it matches the public key from the master):
> |1|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> -------------------------------------------------------

I have used "xxxxxxx..." to hide my public and master host keys, you should see a set of numbers and letters and other characters.

Thats the information you need when you go back to your GVM container and run

docker exec -it gvm /add-scanner.sh

The 'scanner name' it asks you for can be any name you choose.