Skip to content

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 (pwsh or powershell) available in the agent's PATH, with the WSUS administration tools (UpdateServices module) installed. This usually means running the agent on a Windows host.
  • Network access to the WSUS server (default ports 8530, or 8531 with SSL)
  • An account that is a member of the WSUS Administrators group. Either run the agent under that account, or set WSUS_USER and WSUS_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

  1. Generates a PowerShell script and runs it with pwsh -NoProfile -NonInteractive. When WSUS_USER and WSUS_PASSWORD are set, the script runs under those credentials.
  2. Connects to the WSUS server in WSUS_HOST and lists its managed computers
  3. Reads the missing updates of each computer and resolves their details, limited to WSUS_CLASSIFICATIONS when set
  4. 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
  5. 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_HOST is a host name such as wsus.example.com. Add :port to use a custom port, or an https:// 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_SEVERITY falls back to info.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor. Use WSUS_MIN_SEVERITY to filter by severity.