<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->

# API Reference — Implementing Patch Management Workflow

## Nessus Patch Correlation API

| Endpoint | Description |
|---|---|
| `GET /scans/{id}/hosts/{host_id}` | Host vulnerabilities with patch info |
| `POST /scans/{id}/launch` | Launch rescan for verification |
| `GET /scans/{id}/export` | Export results for patch tracking |

## Ansible Modules

| Module | Description |
|---|---|
| `ansible.builtin.apt` | Debian/Ubuntu package management |
| `ansible.builtin.dnf` | RHEL/Fedora package management |
| `ansible.builtin.reboot` | Managed reboot with timeout |
| `ansible.builtin.stat` | Check reboot-required flag |

## Package Manager Commands

| Command | Description |
|---|---|
| `apt list --upgradable` | List available Debian updates |
| `dnf check-update --security` | List RHEL security updates |
| `dpkg -l <pkg>` | Verify installed Debian package |
| `rpm -q <pkg>` | Verify installed RPM package |
| `dnf history undo <id>` | Rollback RHEL transaction |

## Agent Script

```bash
# Check available patches
node agent.js check openssl --os debian

# Verify patch installed
node agent.js verify openssl --version 3.0.13

# Run patch playbook
node agent.js playbook patch_linux.yml -i inventory.ini --limit patch_test

# Rollback package
node agent.js rollback openssl --version 3.0.11-1ubuntu1
```
