Releases: Kastervo/OpenVAS-Installation
Releases · Kastervo/OpenVAS-Installation
v1.0.0
Added
- Versioning: Introduced versioning for the OpenVAS installation script, starting with version v1.0.0.
- Structured Logging: Implemented a comprehensive logging system with
logfunction supporting INFO, WARN, and ERROR levels, with colored console output and logging to/var/log/openvas_install.log. - Error Handling: Added
run_commandfunction to execute commands with logging and error handling, exiting on failure with appropriate status codes. - Environment Setup: Introduced
set_environmentfunction to configure environment variables and validate disk space for installation directories. - Dynamic Version Checking: Added
check_latest_versionfunction to fetch the latest versions of OpenVAS components from GitHub API, ensuring up-to-date installations. - Dedicated User Management: Implemented
create_gvm_userto create agvmuser and group with proper permissions, including adding the current user to thegvmgroup. - Modular Dependency Installation: Split dependency installation into component-specific functions (
install_<component>_dep) for better organization and maintainability. - SSL Certificate Generation: Added
generate_ssl_certto create a self-signed SSL certificate forgsadwith proper permissions and ownership. - Component Installation Functions: Introduced modular functions for building and installing components (
build_install_component,build_install_gsa,build_install_opsd,build_install_openvasd,build_install_py) with GPG signature verification. - System Configuration: Added functions for system setup, including
perform_system_setupfor Redis,adjusting_permissionsfor directory and binary permissions,feed_validationfor GPG feed validation,setting_up_sudo_for_scanning,setting_up_postgresql,setting_up_an_admin_user,setting_the_feed_import_owner,setting_up_services_for_systemd,feed_synchronization,start_openvas, andlogin_info. - Rust and Cargo Support: Added
install_openvasd_depto install Rust and Cargo foropenvasdandscannerctlinstallation. - Systemd Services: Enhanced systemd service configurations for
ospd-openvas,gvmd,gsad, andopenvasdwith proper dependencies and runtime directories. - Login Information Display: Implemented
login_infoto display formatted login details (username, password, URL) in a boxed format with color. - Cleanup: Added
cleanupfunction to remove temporary directories ($SOURCE_DIR,$BUILD_DIR,$INSTALL_DIR) on script completion or error, with error trapping.
Changed
- Script Structure: Refactored the script into modular sections (Environment Setup, Version Management, Logging and Error Handling, System Checks, User and Group Management, Dependency Installation, Directory and Key Setup, Component Installation, System Configuration, Cleanup) for clarity and maintainability.
- Root Check: Replaced simple
ifcondition withcheck_rootfunction for better logging and consistency. - Dependency Installation: Consolidated package installation into modular functions, removing hardcoded package lists and adding optional dependency warnings.
- Version Management: Replaced hardcoded version numbers with dynamic fetching from GitHub API, removing
NOTUS_VERSIONasnotus-scanneris no longer installed. - GPG Key Import: Enhanced
import_signing_keyandfeed_validationwith proper directory creation, ownership, and error handling. - Component Installation: Standardized installation process with reusable functions, adding GPG signature verification for all components and handling special cases (e.g.,
gsa,ospd-openvas,openvasd). - Redis Configuration: Improved
perform_system_setupto copy Redis configuration with proper ownership and validation. - Sudo Configuration: Rewrote
setting_up_sudo_for_scanningto use a dedicated/etc/sudoers.d/gvmfile withvisudovalidation, improving security. - PostgreSQL Setup: Enhanced
setting_up_postgresqlwith specific PostgreSQL version handling and role configuration. - Admin User Setup: Improved
setting_up_an_admin_userto securely store the admin password in a temporary file with restricted permissions. - Systemd Services: Updated service files to remove
notus-scannerandmosquittodependencies, addopenvasdservice, and use SSL forgsad(--ssl-certificateand--ssl-private-key). - Feed Synchronization: Wrapped
greenbone-feed-syncinfeed_synchronizationwith proper error handling. - Service Startup: Consolidated service start and enable operations in
start_openvaswith logging and error handling.
Removed
- Notus Scanner: Removed installation and service configuration for
notus-scanneras it is no longer required in the updated setup. - Mosquitto MQTT Broker: Removed Mosquitto installation and configuration, including related service dependencies and
openvas.confsettings (mqtt_server_uri,table_driven_lsc). - Hardcoded Versions: Eliminated hardcoded version numbers for components, relying on dynamic version fetching.
- Manual
ldconfigCall: Removed explicitldconfig -vcall as it is no longer necessary. - Redundant Sudoers Check: Replaced inline
grepcheck for sudoers with a more robustsetting_up_sudo_for_scanningfunction.
Fixed
- Error Handling: Added comprehensive error handling for all commands, ensuring the script exits on failure with meaningful logs.
- Permission Issues: Ensured proper ownership (
gvm:gvm) and permissions (e.g.,chmod 6750forgvmd,chmod 600for sensitive files) for all directories, binaries, and configuration files. - GPG Verification: Added missing GPG signature verification for all downloaded components.
- Service Dependencies: Corrected systemd service dependencies to reflect the removal of
notus-scannerandmosquitto. - Password Security: Secured admin password handling by storing it in a temporary file with restricted permissions and cleaning it up after use.
Security
- Secure File Handling: Applied strict permissions (
chmod 600,chmod 640) to sensitive files like SSL certificates and password files. - GPG Validation: Enforced GPG signature verification for all downloaded sources to prevent tampering.
- Sudo Configuration: Used a dedicated
/etc/sudoers.d/gvmfile withvisudovalidation to prevent syntax errors and ensure secure sudo access.
Notes
- The new script (
openvas_install.sh) is designed to be more robust, secure, and maintainable. - Users should replace self-signed SSL certificates with trusted ones for production environments, as warned in the
generate_ssl_certfunction. - The script assumes a clean Debian 12 system and may require adjustments for existing OpenVAS installations.
- The admin password is temporarily stored in
/tmp/gvm_admin_passwordduring installation and removed afterward; users should change it post-installation using/usr/local/sbin/gvmd --user=admin --new-password=<new_password>.