BeyondTrust Password Safe Executor¶
Category: Identity and Access
Script: beyondtrust_passwordsafe.py
Integration: REST API
Faraday Plugin: Raw JSON
Website: https://www.beyondtrust.com/password-safe
Description¶
Imports the vaulted asset inventory, managed accounts and privileged-session history from a BeyondTrust Password Safe (PAM) deployment into Faraday. Use it to cross-reference which hosts have vaulted privileged credentials and recent privileged-session activity against the findings of your other scanners.
Prerequisites¶
- A BeyondTrust Password Safe deployment reachable from the agent
- An API registration (API key) with a
runasuser that has permission to read assets, managed accounts and session reports requestsavailable in the agent's Python environment
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
BT_HOST |
Yes | BeyondTrust Password Safe appliance host (e.g., btvault.mycorp.com). https:// is added if missing. |
BT_API_KEY |
Yes | Password Safe API key, created in the console under Configuration > General > API Registrations |
BT_RUN_AS |
Yes | BeyondTrust user account the API key impersonates. Required for almost every read endpoint. |
These variables are also accepted as execution arguments, so a single run can override them.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
BT_FILTER |
string | No | Narrow the import to one name, account or user ID. Applied as the asset name filter on assets, the account name filter on managed accounts, and the user ID filter on session reports. Default: no filter. |
YAML Configuration Example¶
executors:
beyondtrust_passwordsafe:
repo_executor: beyondtrust_passwordsafe.py
max_size: 65536
varenvs:
BT_HOST: "https://btvault.mycorp.com"
BT_API_KEY: "<bt_api_key>"
BT_RUN_AS: "<bt_run_as>"
params:
BT_FILTER:
mandatory: false
type: string
base: string
How It Works¶
- Signs in with
POST /BeyondTrust/api/public/v3/Auth/SignAppinusing thePS-Auth key=<BT_API_KEY>; runas=<BT_RUN_AS>;header (continues even if this call is not supported by the appliance) - Reads three surfaces, 100 records per page, each optionally narrowed by
BT_FILTER:GET /Assets: the vaulted asset inventoryGET /ManagedAccounts: the vaulted privileged accountsGET /Sessions/Reports: the privileged-session history
- Creates one host per asset, using its IP address when present (
0.0.0.0otherwise) and its name, DNS name, workgroup and domain as hostnames - Creates one host per managed account and one host per session report, both on the synthetic IP
0.0.0.0, since these records are not tied to a network endpoint - Adds one informational vulnerability to each host with all the record's fields in its description and references (for example the account's rotation dates, or the session's protocol and duration)
- Signs out at the end of the run
Notes¶
- BeyondTrust Password Safe data is inventory and audit trail, not vulnerabilities. Every vulnerability has
infoseverity. - Use this data to cross-check which hosts have vaulted privileged credentials, and whether recent privileged sessions touch a host that other agents flagged.
- By default the executor reads at most 500 assets, 500 managed accounts and 500 session reports per run. Raise
BT_PAGESfor larger tenants. BT_HOSTcan be given with or withouthttps://. Without it,https://is assumed.- The run stops if authentication is rejected (HTTP 401). If BeyondTrust rate-limits or denies a later request, or an endpoint does not exist on that appliance version, the executor keeps what it has already read.
- The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor.