Microsoft WSUS Executor¶
Category: Patch Management
Script: wsus.py
Integration: CLI (PowerShell UpdateServices)
Faraday Plugin: Raw JSON
Website: https://learn.microsoft.com/en-us/windows-server/administration/windows-server-update-services/get-started/windows-server-update-services-wsus
Description¶
Imports the missing Windows updates reported by a Microsoft WSUS server into Faraday. Each computer managed by WSUS becomes a host and each missing update becomes a vulnerability prefixed with [PATCH-MGMT].
Prerequisites¶
- PowerShell (
pwshorpowershell) available in the agent'sPATH, with the WSUS administration tools (UpdateServicesmodule) installed. This usually means running the agent on a Windows host. - Network access to the WSUS server (default ports
8530, or8531with SSL) - An account that is a member of the WSUS Administrators group. Either run the agent under that account, or set
WSUS_USERandWSUS_PASSWORD.
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
WSUS_HOST |
Yes | WSUS server host name, optionally with port (e.g., wsus.example.com or wsus.example.com:8531) |
WSUS_USER |
No | WSUS administrator account (DOMAIN\user or user@DOMAIN). Leave empty to use the account running the agent. |
WSUS_PASSWORD |
No | Password for WSUS_USER. Both must be set for the credentials to be used. |
These variables are also accepted as execution arguments, so a single run can override them.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
WSUS_CLASSIFICATIONS |
string | No | Comma-separated WSUS update classifications to import (e.g., Critical Updates,Security Updates). Default: all. |
WSUS_MIN_SEVERITY |
string | No | Minimum severity of updates to import: info, low, medium, high or critical (default: info) |
YAML Configuration Example¶
executors:
wsus:
repo_executor: wsus.py
max_size: 65536
varenvs:
WSUS_HOST: "wsus.example.com"
WSUS_USER: "<wsus_user>"
WSUS_PASSWORD: "<wsus_password>"
params:
WSUS_CLASSIFICATIONS:
mandatory: false
type: string
base: string
WSUS_MIN_SEVERITY:
mandatory: false
type: string
base: string
How It Works¶
- Generates a PowerShell script and runs it with
pwsh -NoProfile -NonInteractive. WhenWSUS_USERandWSUS_PASSWORDare set, the script runs under those credentials. - Connects to the WSUS server in
WSUS_HOSTand lists its managed computers - Reads the missing updates of each computer and resolves their details, limited to
WSUS_CLASSIFICATIONSwhen set - Creates one vulnerability per missing update, named after the update title, with severity from the Microsoft severity (Critical, Important, Moderate, Low), KB articles and CVEs as references
- Sends the computers as hosts with their IP address, name and operating system
Notes¶
- Computers without missing updates (after the severity filter) are still imported as hosts.
- If no computers are returned, a single placeholder host named after the WSUS server is created. This also happens when PowerShell fails, so check the agent log if the result is empty.
WSUS_HOSTis a host name such aswsus.example.com. Add:portto use a custom port, or anhttps://prefix to use the SSL port. The run stops if the value is not a valid host name.- The PowerShell run times out after 10 minutes, so very large WSUS catalogs may need to be split with
WSUS_CLASSIFICATIONS. - An unrecognized
WSUS_MIN_SEVERITYfalls back toinfo. - The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor. UseWSUS_MIN_SEVERITYto filter by severity.