ICTU / openvas-docker

Docker script for OpenVAS with script for scan scan automation
17 stars 10 forks source link

dirname: missing operand #10

Closed andresriancho closed 4 years ago

andresriancho commented 4 years ago

The scan seems to be running, but I see this in the console:

dirname: missing operand
Try 'dirname --help' for more information.
        ERROR: No server certificate file of OpenVAS Scanner found.
        FIX: Run 'openvas-mkcert -f -q'.

 ERROR: Your OpenVAS-9 installation is not yet complete!

The full command and console data:

ubuntu@ip-172-31-34-248:~$ sudo docker run --rm -v $(pwd):/openvas/results/ ictu/openvas-docker /openvas/run_scan.py 35.175.138.101 output
Testing redis status...
Redis not yet ready...
Redis ready.
Checking for empty volume
Restarting services
 * Restarting openvas-scanner openvassd
   ...done.
 * Restarting openvas-manager openvasmd
   ...done.
 * Restarting openvas-gsa gsad
   ...done.
Reloading NVTs
Rebuilding NVT cache... done.
Checking setup
openvas-check-setup 2.3.3
  Test completeness and readiness of OpenVAS-9

  Please report us any non-detected problems and
  help us to improve this check routine:
  http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss

  Send us the log-file (/tmp/openvas-check-setup.log) to help analyze the problem.

  Use the parameter --server to skip checks for client tools
  like GSD and OpenVAS-CLI.

Step 1: Checking OpenVAS Scanner ... 
        OK: OpenVAS Scanner is present in version 5.1.3.
        OK: OpenVAS Scanner CA Certificate is present as .
dirname: missing operand
Try 'dirname --help' for more information.
        ERROR: No server certificate file of OpenVAS Scanner found.
        FIX: Run 'openvas-mkcert -f -q'.

 ERROR: Your OpenVAS-9 installation is not yet complete!

Please follow the instructions marked with FIX above and run this
script again.

If you think this result is wrong, please report your observation
and help us to improve this check routine:
http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss
Please attach the log-file (/tmp/openvas-check-setup.log) to help us analyze the problem.

Configuring postfix
postmap: warning: /etc/postfix/sasl_passwd, line 1: record is in "key: value" format; is this an alias file?
 * Stopping Postfix Mail Transport Agent postfix
   ...done.
 * Starting Postfix Mail Transport Agent postfix
   ...done.
Starting OpenVAS
Starting scan
target_id: 8fc15386-e31b-459f-a65e-5937006dd03e
task_id: 0120174e-4809-44cd-a4c5-e30f1a60d3b2
start_task: a43d75e6-80ca-4746-a386-193bc2f70662

Waiting for task to finish
[2019-11-01 12:20:50] Progress: Running 63%
dicksnel commented 4 years ago

@andresriancho can you try running it again to see if the error persists?

andresriancho commented 4 years ago

Run on a different workstation and got the same error.

Run for a second time in the same workstation and got the same error.

dicksnel commented 4 years ago

@andresriancho

This seems related to this issue: https://github.com/mikesplain/openvas-docker/issues/237

The installation will still run fine with the error so it's no real problem. The base image from Mike Splain does not seem very up-to-date anymore so it probably won't be fixed.

I will consider to changing to https://github.com/Atomicorp/openvas as the base.

andresriancho commented 4 years ago

@dicksnel would be nice to change to https://github.com/Atomicorp/openvas as the base if it is more updated

prav10194 commented 4 years ago

@andresriancho @dicksnel Tried changing the base image to atomicorp/openvas:v9 but I am running into this issue on running the following command -

docker run --rm -v $(pwd):/openvas/results/ pranavbhatia/new-openvas /openvas/run_scan.py 123.123.123.123,www.github.com openvas_scan_report

Traceback (most recent call last): File "/openvas/run_scan.py", line 7, in from lxml import etree ImportError: No module named lxml

dicksnel commented 4 years ago

@prav10194 that is probably because you need to "RUN pip install lxml" in your Dockerfile, because it is not installed in the Atomicorp image.

prav10194 commented 4 years ago

Hi @dicksnel After installing the pip command, I tried doing the docker run but getting this following error -

docker run --rm -v $(pwd):/openvas/results/ pranavbhatia/new-openvas /openvas/run_scan.py www.github.com openvas_scan_report sh: /start: No such file or directory Starting OpenVAS Starting scan with config daba56c8-73ec-11df-a475-002264764cea Traceback (most recent call last): File "/openvas/run_scan.py", line 67, in create_target_response = subprocess.check_output(create_target, stderr=subprocess.STDOUT, shell=True) File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command 'omp -u admin -w admin -h 127.0.0.1 -p 9390 --xml 'www.github.com-74www.github.com'' returned non-zero exit status 1