From Fedora Project Wiki

Revision as of 15:54, 26 June 2015 by Rebus (talk | contribs)

This test case is meant of OpenVAS-8. The version in Fedora 22 (OpenVAS-7) is known to not work well so please install the openvas-8 packages from updates/updates-testing repository or rebuild the openvas-8 packages from rawhide.

Description

This test case tests the ability of OpenVAS to scan a host or network for vulnerabilities.

Setup

  • For tests you will need some remote host with various network services (SSH, HTTP, DNS, SMTP ...) is required. For example: a Linux server with OpenSSH, Apache HTTPd, ISC BIND, Postfix or Sendmail.
  • Open ports of the scanned services on the remote host firewall.
  • If unsure about the past OpenVAS configuration, it is recommended to bootstrap the environment by removing all openvas* packages, removing all the application files, reinstalling the packages back and start configuring the suite from scratch:
    • OV_RPMS=`rpm -qa|grep openvas`
    • rpm -e $OV_RPMS
    • rm -rf /etc/openvas /etc/pki/openvas /usr/share/openvas /var/log/openvas /var/lib/openvas /var/cache/openvas
  • Ensure that openvas-libraries, openvas-scanner, openvas-manager, openvas-cli, openvas-gsa packages are installed:
    • yum -y install openvas-libraries openvas-scanner openvas-manager openvas-cli openvas-gsa
  • At each step you can verify the current progress with openvas-check-setup script:
    • openvas-check-setup
  • Openvas-8 requires redis-server to be configured and running in order to work as expected:
    • yum install redis

How to test

  1. Try to start OpenVAS scanner (probably unsuccessfully without configuration):
    • service openvas-scanner start
  2. Check the logs on what is happening (as there is no server certificate it should fail to start):
    • tail -f /var/log/openvas/openvassd.log
  3. Create a new certificate, press "Enter" to use the defaults:
    • openvas-mkcert
  4. Add user certificate for the openvas-manager to be able to connect to scanner:
    • openvas-mkcert-client -n -i
  5. Download the NVTs signatures:
    • openvas-nvt-sync --wget
  6. Install the redis-server and configure redis-server for use with openvas:
    • yum install redis
    • sed -i -e 's
    • service redis restart
  7. Restart OpenVAS scanner (it will take a while for the first time):
    • service openvas-scanner restart
  8. Test that the OpenVAS scanner process openvassd is running. Wait untill NVT signatures loaded and process is awaiting connections:
    • ps aux | grep [o]penvassd
  9. Test that the OpenVAS scanner listens on configured port:
    • sudo lsof -i -nP | grep openvassd
  10. Connect using the gnutls client to scanner port:
    • gnutls-cli --insecure -p 9391 127.0.0.1 .
  11. Connect using the gnutls client to scanner port, this time passing the correct client certificate:
    • {{{1}}}
Start the communication with < OTP/1.0 >. Try to login with the user created above.
  1. Start OpenVAS manager: service openvas-manager start
  2. Generate a new client certificate for manager to connect to scanner openvas-mkcert-client -n om -i
  3. Rebuild the NVT cache database openvasmd --rebuild
  4. Start OpenVAS manager: service openvas-manager start
  5. Test that the OpenVAS manager process openvasmd is running: ps aux | grep [o]penvasmd
  6. Test that the OpenVAS manager listens on configured port: sudo lsof -i -nP | grep [o]penvasmd
  7. Connect using the gnutls client to manager port: gnutls-cli --insecure -p 9390 127.0.0.1 .
  8. Connect using the gnutls client to manager port: gnutls-cli --insecure -p 9390 127.0.0.1 .

Start the communication with < OTP/2.0 >.

  1. Start OpenVAS client: openvas-client (or System Tools > OpenVAS Client)
  2. Connect to OpenVAS server with the user created above.
  3. Create a new scan using the client and wait until it finishes.
  4. Export the report to HTML or PDF.

Expected Results

  1. Start of openvas-scanner without previous configuration will most probably fail. Syslog should display hint about generating certificates.
  2. Logs should give hints on what is wrong.
  3. Certificate should be created in /etc/pki/openvas/CA/cacert.pem, /etc/pki/openvas/CA/servercert.pem with private keys in /etc/pki/openvas/private/CA/
  4. Adding of the user certificate will create certificate in /etc/pki/openvas/CA/clientcert.pem and key in /etc/pki/openvas/private/CA/
  5. openvas-nvt-sync will download plugins to /var/lib/openvas/plugins
  6. Redis server should be running now with unix socket ready in /tmp/redis.sock. The openvas-check-setup should no longer complain about issues with redis server.
  7. Restart of the service should result with OK. It takes longer for the first time. On Fedora 16 it is possible that the systemd will timeout thinking that the service failed to start, while actually it is still starting. Give it a while and try stop/start again. Process list shows the progress of the loading of the database of signatures - for example "openvassd: Reloaded 5750 of 39422 NVTs (14% / ETA: 00:58)"
  8. Process list should show openvassd process running as root "openvassd: waiting for incoming connections"
  9. lsof for openvassd should show it is listening on port 9391
  10. Connecting to a port 9391 without passing the user certificate should result in connection being rejected by the server. For troubleshooting the network connection gnutls-serv can be used instead of the openvas-scanner:
    • {{{1}}}
  11. When passing the right client certificate you should be able to get response from the openvas-server. Response will be either "< OTP/2.0 >" meaning scanner is ready or it will be something like "SCANNER_LOADING <