$ show greenbone/gvm-tools
The gvm-tools repository provides a Python library and command-line utilities for interacting with Greenbone Vulnerability Management (GVM) systems via the Greenbone Management Protocol (GMP). It consists of a core library (gvmtools) that handles GMP communication, authentication, and data formatting, along with three main CLI tools: gvm-cli for raw command execution, gvm-script for running Python scripts in a GMP context, and gvm-pyshell for an interactive shell. The repository includes approximately 80 example scripts in the scripts/ directory demonstrating common GVM operations such as target management, task control, report generation, and asset discovery. The architecture is library-first, with the CLI tools and scripts built on top of the gvmtools package, which abstracts the underlying GMP/XML complexity. External dependencies include the python-gvm library for protocol handling, with additional dependencies for specific scripts (e.g., terminaltables for output formatting, cpe for CPE processing).
The LLM identified 2 files worth highlighting for reuse:
Provides essential, decoupled utilities for GMP scripting including secure authentication, table-based CLI output formatting, XML parsing/creation helpers, and script execution functions. These components are isolated from specific GMP operations and can be reused in any script interacting with GVM, demonstrating strong separation of concerns and reusable utility design.
Implements a connection factory that creates GMP connections via Unix socket, TLS, or SSH based on user parameters, along with common argument parsing for CLI tools. This component encapsulates connection complexity and provides a consistent interface for adding connection options to new scripts, exemplifying a reusable configuration and factory pattern.