Microsoft SCCM / MECM Executor¶
Category: Patch Management
Script: sccm.py
Integration: REST API (AdminService)
Faraday Plugin: Raw JSON
Website: https://learn.microsoft.com/en-us/mem/configmgr/develop/adminservice/usage
Description¶
Imports missing Windows updates from Microsoft Configuration Manager (SCCM / MECM) into Faraday. Each managed system becomes a host and each missing update becomes a vulnerability prefixed with [PATCH-MGMT].
Prerequisites¶
- A Configuration Manager site with the AdminService REST endpoint published (on the SMS Provider, usually the primary site server)
- A service account that can read the Configuration Manager WMI classes through AdminService. Use
DOMAIN\useroruser@DOMAINformat for domain accounts. - Network access from the agent to
SCCM_HOST - Optional: the
requests_ntlmPython package in the agent environment, for servers that require NTLM authentication
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
SCCM_HOST |
Yes | AdminService server URL including scheme (e.g., https://sccm.example.com) |
SCCM_USER |
Yes | Service account name (e.g., DOMAIN\svc_faraday or svc_faraday@domain.local) |
SCCM_PASSWORD |
Yes | Service account password |
These variables are also accepted as execution arguments, so a single run can override them.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
SCCM_SITE_CODE |
string | No | 3-character site code (e.g., PRI) to import only the systems assigned to that site. Default: all sites the account can see. |
SCCM_COLLECTION_ID |
string | No | 8-character collection ID (e.g., SMS00001 for All Systems) to import only the members of that collection. Default: all systems. |
SCCM_MIN_SEVERITY |
string | No | Minimum severity of updates to import: info, low, medium, high or critical (default: info) |
YAML Configuration Example¶
executors:
sccm:
repo_executor: sccm.py
max_size: 65536
varenvs:
SCCM_HOST: "https://sccm.example.com"
SCCM_USER: "DOMAIN\\svc_faraday"
SCCM_PASSWORD: "<sccm_password>"
params:
SCCM_SITE_CODE:
mandatory: false
type: string
base: string
SCCM_COLLECTION_ID:
mandatory: false
type: string
base: string
SCCM_MIN_SEVERITY:
mandatory: false
type: string
base: string
How It Works¶
- Authenticates with
SCCM_USERandSCCM_PASSWORDusing HTTP Basic, and also with NTLM whenrequests_ntlmis installed - When
SCCM_COLLECTION_IDis set, reads the collection members from/AdminService/wmi/SMS_FullCollectionMembership - Reads the managed systems from
/AdminService/wmi/SMS_R_System, optionally limited toSCCM_SITE_CODEand the collection members - Reads the missing updates of each system from
/AdminService/wmi/SMS_UpdateComplianceStatus, then resolves their details from/AdminService/wmi/SMS_SoftwareUpdate - Creates one vulnerability per missing update, with the update title as name (prefixed with
[PATCH-MGMT]), severity from the update's severity or CVSS score, and its CVEs and KB articles as references
Notes¶
- Each system becomes a host with its first reported IP (or
0.0.0.0when none), hostname, MAC address and operating system. Systems with no missing updates are still imported as hosts. - If no systems are found, a single placeholder host named after the collection, site code or
sccmis created. - The executor queries the compliance status of each system separately, so large sites take longer.
SCCM_HOSTmust start withhttp://orhttps://(e.g.,https://sccm.example.com).SCCM_SITE_CODEandSCCM_COLLECTION_IDare validated and the run stops when they are malformed.- An unrecognized
SCCM_MIN_SEVERITYfalls back toinfo. - The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor. UseSCCM_MIN_SEVERITYto filter by severity.