PingCastle Executor¶
Category: Identity and Access
Script: pingcastle.py
Integration: CLI
Faraday Plugin: Raw JSON
Website: https://www.pingcastle.com/
Description¶
Runs a PingCastle Active Directory health check against a domain controller and imports the triggered risk rules into Faraday. The domain controller becomes a Faraday host, and each triggered rule becomes a vulnerability.
Prerequisites¶
- PingCastle installed on the agent machine and available as
pingcastlein the agent'sPATH(checked withpingcastle --help). To use a different binary, set thePINGCASTLE_BINenvironment variable on the agent. - Network access from the agent to the domain controller
- Credentials that PingCastle can use. By default it uses the Windows identity of the agent, or you can set
PINGCASTLE_USERandPINGCASTLE_PASSWORD.
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
PINGCASTLE_USER |
No | User name passed to PingCastle. It is used only when PINGCASTLE_PASSWORD is also set. If empty, PingCastle uses the agent's Windows identity. |
PINGCASTLE_PASSWORD |
No | Password for PINGCASTLE_USER |
PINGCASTLE_BIN |
No | Path or name of the PingCastle binary (default: pingcastle) |
These variables are also accepted as execution arguments, so a single run can override them.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
PINGCASTLE_SERVER |
string | Yes | Domain controller to check, as FQDN or IP (e.g., dc1.example.local) |
PINGCASTLE_HEALTHCHECK_LEVEL |
string | No | Depth of the health check: Light, Normal or Full. If empty, PingCastle uses its own default (Normal). |
YAML Configuration Example¶
executors:
pingcastle:
repo_executor: pingcastle.py
max_size: 65536
varenvs:
PINGCASTLE_USER: "<pingcastle_user>"
PINGCASTLE_PASSWORD: "<pingcastle_password>"
params:
PINGCASTLE_SERVER:
mandatory: true
type: string
base: string
PINGCASTLE_HEALTHCHECK_LEVEL:
mandatory: false
type: string
base: string
How It Works¶
- Runs
pingcastle --healthcheck --no-enum-limit --server <PINGCASTLE_SERVER>in a temporary directory, adding--healthcheck-leveland--user/--passwordwhen they are set - Reads the
ad_hc_<domain>.xmlreport that PingCastle writes - Creates one Faraday vulnerability for each triggered risk rule:
- Name:
PingCastle <rule ID> - Severity: from the rule's maturity level (1
critical, 2high, 3medium, 4low, 5info). If the maturity is missing, the rule's points or its category are used. - Details: rationale, category, points and up to 25 affected objects
- References: a link to the rule on pingcastle.com
- Name:
- Groups the vulnerabilities under one host for the domain controller
- Deletes the temporary directory
Notes¶
- The host uses
PINGCASTLE_SERVERas its IP value and as a hostname, together with the domain name from the report, and its operating system is set toWindows. Use an IP address forPINGCASTLE_SERVERif you want a valid IP on the Faraday host. - If PingCastle produces no report, the run imports nothing. A
PINGCASTLE_HEALTHCHECK_LEVELother thanLight,NormalorFullstops the run. - The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor.