Implementing Vulnerability Management with Greenbone
Overview
Greenbone Vulnerability Management (GVM) is the open-source framework behind OpenVAS, providing comprehensive vulnerability scanning with over 100,000 Network Vulnerability Tests (NVTs). The python-gvm library provides a Python API to interact with GVM through the Greenbone Management Protocol (GMP), enabling programmatic creation of scan targets, task management, scan execution, and report retrieval. This skill covers connecting to GVM via Unix socket or TLS, authenticating, creating scan configs and targets, launching scans, and parsing XML-based vulnerability reports to produce actionable findings.
When to Use
Trigger phrases:
"implementing vulnerability management with greenbone"
"Deploy and operate Greenbone/OpenVAS vulnerability management using the python-g"
When deploying or configuring implementing vulnerability management with greenbone capabilities in your environment
When establishing security controls aligned to compliance requirements
When building or improving security architecture for this domain
When conducting security assessments that require this implementation
Prerequisites
- Greenbone Community Edition or Greenbone Enterprise Appliance installed
- Python 3.9+ with
python-gvm (pip install python-gvm)
- GMP access credentials (username/password)
- Network connectivity to GVM daemon (Unix socket or TCP/TLS)
- Understanding of CVSS scoring and vulnerability classification
Steps
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Install python-gvm:
pip install python-gvm
- Establish a GMP connection via
UnixSocketConnection or TLSConnection
- Authenticate with
gmp.authenticate(username, password)
- Create a target with
gmp.create_target(name, hosts=[...], port_list_id=...)
- Create a scan task with
gmp.create_task(name, config_id, target_id, scanner_id)
- Start the scan with
gmp.start_task(task_id)
- Monitor scan progress with
gmp.get_task(task_id)
- Retrieve results with
gmp.get_report(report_id, report_format_id=...)
- Parse the XML report for vulnerabilities, CVSS scores, and affected hosts
- Generate a JSON summary report with severity distribution and remediation priorities
Expected Output
A JSON report containing total vulnerabilities found, severity breakdown (critical/high/medium/low), per-host findings with CVE references and CVSS scores, and scan metadata including duration and NVT feed version.
When NOT to Use
- You need to test the implementation (use performing-* skills)
- Task is about configuring existing tools (use configuring-* skills)
- You need to analyze security events (use analyzing-* skills)
- Task is about building detection rules (use building-* skills)
- You don't have access to the target environment
- Task requires vendor-specific expertise (consult vendor docs)
Red Flags
- Performing actions without explicit written authorization from the asset owner
- Testing against production systems without a defined scope and rules of engagement
- Sharing sensitive findings or credentials in unencrypted communications
- Failing to properly scope and contain the assessment before starting
Process
- Reconnaissance — Gather target information, identify attack surface, enumerate services
- Analysis/Exploitation — Execute the technique, analyze results, document findings
- Reporting — Document IOCs, write findings, provide remediation recommendations
Verification
- All steps executed successfully against a test environment before production use
- Output documented with screenshots or logs demonstrating expected behavior
- Results validated against known-good baselines or reference implementations
- Documentation complete enough for another analyst to reproduce findings
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: implementing-vulnerability-management-with-greenbone3description: Use when deploy and operate Greenbone/OpenVAS vulnerability management4 using the python-gvm library to create scan targets, execute vulnerability scans,5 and parse scan reports via GMP protocol. Use when deploying and operate greenbone/openvas6 vulnerability management using the python-gvm library.7domain: cybersecurity8subdomain: vulnerability-management9tags:10- openvas11- greenbone12- vulnerability-scanning13- gmp14- python-gvm15- vulnerability-management16- compliance17version: '1.0'18author: oyi7719license: Apache-2.020nist_csf:21- ID.RA-0122- ID.RA-0223- ID.IM-0224- ID.RA-0625category: cybersecurity26metadata:27 source: https://skillmd.com/skills/oyi77/implementing-vulnerability-management-with-greenbone28---2930# Implementing Vulnerability Management with Greenbone3132## Overview3334Greenbone Vulnerability Management (GVM) is the open-source framework behind OpenVAS, providing comprehensive vulnerability scanning with over 100,000 Network Vulnerability Tests (NVTs). The python-gvm library provides a Python API to interact with GVM through the Greenbone Management Protocol (GMP), enabling programmatic creation of scan targets, task management, scan execution, and report retrieval. This skill covers connecting to GVM via Unix socket or TLS, authenticating, creating scan configs and targets, launching scans, and parsing XML-based vulnerability reports to produce actionable findings.353637## When to Use38**Trigger phrases:**39- "implementing vulnerability management with greenbone"40- "Deploy and operate Greenbone/OpenVAS vulnerability management using the python-g"414243- When deploying or configuring implementing vulnerability management with greenbone capabilities in your environment44- When establishing security controls aligned to compliance requirements45- When building or improving security architecture for this domain46- When conducting security assessments that require this implementation4748## Prerequisites4950- Greenbone Community Edition or Greenbone Enterprise Appliance installed51- Python 3.9+ with `python-gvm` (`pip install python-gvm`)52- GMP access credentials (username/password)53- Network connectivity to GVM daemon (Unix socket or TCP/TLS)54- Understanding of CVSS scoring and vulnerability classification5556## Steps5758```python59# Example: IOC detection60import re6162IOC_PATTERNS = {63 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",64 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",65 "hash_md5": r"\b[a-f0-9]{32}\b",66 "hash_sha256": r"\b[a-f0-9]{64}\b",67}6869def extract_iocs(text: str) -> dict:70 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}71```72731. Install python-gvm: `pip install python-gvm`742. Establish a GMP connection via `UnixSocketConnection` or `TLSConnection`753. Authenticate with `gmp.authenticate(username, password)`764. Create a target with `gmp.create_target(name, hosts=[...], port_list_id=...)`775. Create a scan task with `gmp.create_task(name, config_id, target_id, scanner_id)`786. Start the scan with `gmp.start_task(task_id)`797. Monitor scan progress with `gmp.get_task(task_id)`808. Retrieve results with `gmp.get_report(report_id, report_format_id=...)`819. Parse the XML report for vulnerabilities, CVSS scores, and affected hosts8210. Generate a JSON summary report with severity distribution and remediation priorities8384## Expected Output8586A JSON report containing total vulnerabilities found, severity breakdown (critical/high/medium/low), per-host findings with CVE references and CVSS scores, and scan metadata including duration and NVT feed version.87## When NOT to Use8889- You need to test the implementation (use performing-* skills)90- Task is about configuring existing tools (use configuring-* skills)91- You need to analyze security events (use analyzing-* skills)92- Task is about building detection rules (use building-* skills)93- You don't have access to the target environment94- Task requires vendor-specific expertise (consult vendor docs)959697## Red Flags9899- Performing actions without explicit written authorization from the asset owner100- Testing against production systems without a defined scope and rules of engagement101- Sharing sensitive findings or credentials in unencrypted communications102- Failing to properly scope and contain the assessment before starting103104## Process1051061. **Reconnaissance** — Gather target information, identify attack surface, enumerate services1071. **Analysis/Exploitation** — Execute the technique, analyze results, document findings1081. **Reporting** — Document IOCs, write findings, provide remediation recommendations109110## Verification111112- All steps executed successfully against a test environment before production use113- Output documented with screenshots or logs demonstrating expected behavior114- Results validated against known-good baselines or reference implementations115- Documentation complete enough for another analyst to reproduce findings116117## Anti-Rationalization Table118119| Rationalization | Reality |120|---|---|121| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |122| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |123| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |