Installing OpenVAS on Ubuntu might seem daunting at first, but I’ll walk you through every step of the process. Whether you’re a cybersecurity professional or someone looking to enhance your system’s security posture, this comprehensive guide will help you get OpenVAS up and running on your Ubuntu system.
What is OpenVAS and Why You Need It
OpenVAS (Open Vulnerability Assessment System) is a powerful, open-source vulnerability scanner that helps you identify security weaknesses in your network infrastructure. Think of it as your digital security guard that never sleeps – constantly watching for potential threats and vulnerabilities that could compromise your systems.
Understanding OpenVAS (GVM) Architecture
OpenVAS is now part of the Greenbone Vulnerability Management (GVM) framework. This evolution represents a more comprehensive approach to vulnerability management, offering:
- Scanner Engine: The core vulnerability detection component
- Manager Daemon: Coordinates scans and manages results
- Web Interface: User-friendly dashboard for managing scans
- Database Backend: Stores vulnerability data and scan results
Key Benefits of Using OpenVAS
Why should you invest time in learning how to install OpenVAS on Ubuntu? Here are compelling reasons:
- Cost-Effective: Being open-source, OpenVAS provides enterprise-level scanning capabilities without licensing fees
- Regular Updates: Vulnerability feeds are updated regularly, ensuring you’re protected against the latest threats
- Comprehensive Coverage: Scans for over 50,000 known vulnerabilities
- Detailed Reporting: Generates professional reports suitable for compliance requirements
System Requirements for OpenVAS Installation
Before diving into the installation process, let’s ensure your Ubuntu system meets the necessary requirements.
Minimum Hardware Requirements
Your Ubuntu system should have:
- RAM: Minimum 4GB (8GB recommended for better performance)
- Storage: At least 20GB free space (more if you plan extensive scanning)
- CPU: 2+ cores recommended
- Network: Stable internet connection for vulnerability feed updates
Supported Ubuntu Versions
OpenVAS works well on:
- Ubuntu 20.04 LTS (Focal Fossa)
- Ubuntu 22.04 LTS (Jammy Jellyfish)
- Ubuntu 24.04 LTS (Noble Numbat)
I recommend using the latest LTS version for the best stability and support.
Network Prerequisites
Ensure your system can:
- Access external repositories for package downloads
- Connect to Greenbone’s feed servers
- Allow inbound connections on port 9392 (default web interface port)
Pre-Installation Preparation
Let’s prepare your Ubuntu system for OpenVAS installation.
Updating Your Ubuntu System
First, update your system to ensure you have the latest packages:
sudo apt update && sudo apt upgrade -y
This command ensures your system has the latest security patches and package information.
Installing Required Dependencies
Install essential dependencies:
sudo apt install -y software-properties-common curl wget
These packages will help us add repositories and download necessary components.
Setting Up User Permissions
While OpenVAS can run with default permissions, ensure your user account has sudo privileges for the installation process.
Method 1: Installing OpenVAS Using GVM Package (Recommended)
This is the easiest and most straightforward method to install OpenVAS on Ubuntu.
Adding the OpenVAS Repository
Add the official OpenVAS repository:
sudo add-apt-repository ppa:mrazavi/gvm
sudo apt update
This repository contains the latest stable version of GVM/OpenVAS.
Installing GVM Package
Now, install the GVM package:
sudo apt install -y gvm
The installation process will download and install all necessary components, including the scanner engine, manager daemon, and web interface.
Initial Setup and Configuration
After installation, initialize OpenVAS:
sudo gvm-setup
Important: This process can take 30-60 minutes as it downloads vulnerability definitions and sets up the database. Be patient – this step is crucial for OpenVAS functionality.
Method 2: Docker-Based OpenVAS Installation
For those who prefer containerized solutions, Docker offers an alternative installation method.
Installing Docker on Ubuntu
First, install Docker:
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
Pulling OpenVAS Docker Image
Pull the OpenVAS Docker image:
docker pull mikesplain/openvas
This image contains a pre-configured OpenVAS installation.
Running OpenVAS Container
Start the OpenVAS container:
docker run -d -p 443:443 --name openvas mikesplain/openvas
The container will be accessible via HTTPS on port 443.
Post-Installation Configuration
Regardless of your installation method, you’ll need to complete these configuration steps.
Initializing OpenVAS Database
If you used the package installation method, the database should already be initialized. For Docker installations, the container handles this automatically.
Downloading Vulnerability Feeds
For production use, ensure you have the latest vulnerability feeds:
sudo greenbone-nvt-sync
sudo greenbone-scapdata-sync
sudo greenbone-certdata-sync
Note: This process can take several hours for the initial download.
Creating Admin User Account
The default credentials are typically:
- Username: admin
- Password: admin
I strongly recommend changing these default credentials immediately after first login.
Starting and Managing OpenVAS Services
Starting OpenVAS Services
Start OpenVAS services:
sudo gvm-start
This command starts all necessary OpenVAS components.
Enabling Auto-Start on Boot
To ensure OpenVAS starts automatically after system reboot:
sudo systemctl enable openvas
sudo systemctl enable gvm
Checking Service Status
Verify that services are running:
sudo gvm-check-setup
This command provides a comprehensive status report of your OpenVAS installation.
Accessing OpenVAS Web Interface
Web Interface Login Process
Open your web browser and navigate to:
https://localhost:9392
You’ll encounter a security warning due to the self-signed certificate. Click “Advanced” and proceed to the site.
Initial Dashboard Overview
After logging in, you’ll see the OpenVAS dashboard featuring:
- Scan overview: Recent scan activities
- Vulnerability summary: High-level security status
- Task management: Current and scheduled scans
- Reports section: Detailed vulnerability reports
Basic Navigation Guide
The main navigation includes:
- Scans: Create and manage vulnerability scans
- Assets: View discovered systems and services
- SecInfo: Browse vulnerability database
- Configuration: Manage scanners and policies
Essential OpenVAS Configuration
Setting Up Scan Targets
To create your first scan target:
- Navigate to Configuration > Targets
- Click the star icon to create a new target
- Enter target details (IP range, hostname, or subnet)
- Configure authentication if needed
- Save the target configuration
Configuring Scan Policies
Scan policies determine what vulnerabilities to check:
- Full and fast: Comprehensive scan for all vulnerabilities
- Discovery: Basic host and service discovery
- System Discovery: Identify operating systems and services
Managing User Accounts
For multi-user environments:
- Go to Administration > Users
- Create new user accounts with appropriate roles
- Assign specific scanning permissions
- Configure notification settings
Common Installation Issues and Troubleshooting
PostgreSQL Version Conflicts
If you encounter PostgreSQL version issues:
- Check current PostgreSQL version:
sudo -u postgres psql -c "SELECT version();"
- Modify port configurations if needed:
sudo nano /etc/postgresql/14/main/postgresql.conf
Resolving Port Configuration Issues
Change the default port from 5432 to 5433 for older versions, ensuring the latest PostgreSQL version uses the default port 5432.
Memory and Performance Problems
If OpenVAS runs slowly:
- Increase system RAM (minimum 8GB recommended)
- Optimize database settings
- Limit concurrent scan tasks
- Schedule scans during off-peak hours
Network Connectivity Issues
Common network problems and solutions:
- Firewall blocking: Configure UFW to allow port 9392
- DNS resolution: Ensure proper hostname resolution
- SSL certificate errors: Accept self-signed certificates or install custom CA
OpenVAS Security Best Practices
Securing Web Interface Access
Enhance security by:
- Changing default passwords immediately
- Implementing strong password policies
- Enabling two-factor authentication if available
- Restricting access to specific IP ranges
Regular Updates and Maintenance
Maintain your OpenVAS installation:
- Update vulnerability feeds weekly
- Apply system security patches regularly
- Monitor log files for unusual activity
- Review and update scan policies quarterly
Backup and Recovery Procedures
Protect your OpenVAS configuration:
sudo tar -czf openvas-backup.tar.gz /opt/gvm/
Regular backups ensure you can quickly recover from system failures.
Optimizing OpenVAS Performance
Memory Allocation Tips
Optimize memory usage:
- Allocate at least 2GB RAM to OpenVAS processes
- Configure swap space for systems with limited RAM
- Monitor memory usage during large scans
Database Optimization
Improve database performance:
- Regular vacuum operations on PostgreSQL
- Index optimization for frequently queried tables
- Archive old scan results periodically
Scan Scheduling Strategies
Efficient scanning practices:
- Schedule intensive scans during maintenance windows
- Use incremental scanning for regular monitoring
- Implement scan templates for different asset types
- Balance scan frequency with system resources
Based on industry statistics, organizations that implement regular vulnerability scanning reduce their security incident response time by an average of 60%. OpenVAS provides this capability without the high costs associated with commercial solutions.
The installation process might seem complex initially, but the security benefits far outweigh the setup effort. Once configured, OpenVAS becomes an invaluable tool in your cybersecurity arsenal, providing continuous monitoring and early warning of potential security threats.
Remember that vulnerability scanning is just one component of a comprehensive security strategy. Combine OpenVAS with other security tools, regular security audits, and employee training for maximum protection.
Frequently Asked Questions (FAQs)
1. How long does it take to install OpenVAS on Ubuntu?
The installation process typically takes 1-2 hours, including the initial vulnerability feed download. The actual package installation is quick (10-15 minutes), but downloading and processing vulnerability definitions can take 30-90 minutes depending on your internet connection speed.
2. Can I run OpenVAS on a virtual machine?
Yes, OpenVAS works excellently in virtual environments. Ensure your VM has at least 4GB RAM (8GB recommended) and sufficient storage space. Virtual machines are actually preferred for testing environments as they provide isolation and easy snapshot capabilities.
3. What’s the difference between OpenVAS and commercial vulnerability scanners?
OpenVAS provides enterprise-level scanning capabilities at no cost, making it ideal for small to medium businesses. Commercial scanners often offer better support, more polished interfaces, and additional features like compliance frameworks. However, OpenVAS covers the core vulnerability scanning needs effectively.
4. How often should I update OpenVAS vulnerability feeds?
I recommend updating vulnerability feeds at least weekly, with daily updates for high-security environments. You can automate this process using cron jobs to ensure your scanner always has the latest vulnerability signatures.
5. Is it safe to scan production systems with OpenVAS?
OpenVAS includes safe scanning options that minimize the risk of disrupting production systems. However, always test scans in development environments first, schedule scans during maintenance windows, and inform relevant teams before scanning critical systems. Start with discovery scans before progressing to full vulnerability assessments.