Skip to content

CLI Commands

All config.yaml values can be overridden or replaced entirely at the command line.


Usage

Terminal window
python sfhound.py [OPTIONS]

Run from the sf-opengraph/ directory.


Options reference

General

FlagDescriptionDefault
--helpPrint help and exit
--config PATHPath to the YAML configuration fileconfig.yaml

Salesforce credentials

FlagDescriptionDefault
--client-id TEXTConnected App Consumer KeyFrom config
--client-secret TEXTConnected App Consumer Secret (if not using JWT)From config
--username TEXTSalesforce username of the integration userFrom config
--private-key PATHPath to the PEM private key for JWT authenticationFrom config
--login-url URLSalesforce login endpointhttps://login.salesforce.com
--api-version TEXTSalesforce API version stringv56.0

Output

FlagDescriptionDefault
--output-path PATHDirectory where the output JSON is written./opengraph_output

BloodHound CE auto-ingest

FlagDescriptionDefault
--auto-ingestUpload graph to BloodHound CE after exportOff
--bh-url URLBloodHound CE base URLhttp://127.0.0.1:8080
--bh-username TEXTBloodHound CE admin usernameFrom config
--bh-password TEXTBloodHound CE admin passwordFrom config

Examples

Minimal — use config.yaml for everything

Terminal window
python sfhound.py

Override Salesforce credentials only

Terminal window
python sfhound.py \
--client-id YOUR_CLIENT_ID \
--username user@example.com \
--private-key /path/to/salesforce_jwt.key

Sandbox org

Terminal window
python sfhound.py --login-url https://test.salesforce.com

Auto-ingest with all credentials on the command line (no config.yaml required)

Terminal window
python sfhound.py \
--client-id YOUR_CLIENT_ID \
--username user@example.com \
--private-key ./salesforce_jwt.key \
--login-url https://login.salesforce.com \
--auto-ingest \
--bh-url http://127.0.0.1:8080 \
--bh-username admin \
--bh-password YOUR_BLOODHOUND_PASSWORD

Custom output directory

Terminal window
python sfhound.py --output-path /tmp/sfhound_$(date +%Y%m%d)

Override API version

Terminal window
python sfhound.py --api-version v60.0

Exit codes

CodeMeaning
0Success
1Configuration or authentication error
2Extraction error (partial data may have been written)
3Auto-ingest failure (data was extracted but not uploaded)

Environment variable support

All --flag arguments can optionally be read from environment variables using the SFHOUND_ prefix:

FlagEnvironment variable
--client-idSFHOUND_CLIENT_ID
--usernameSFHOUND_USERNAME
--private-keySFHOUND_PRIVATE_KEY
--login-urlSFHOUND_LOGIN_URL
--bh-passwordSFHOUND_BH_PASSWORD

Subcommands

examples/post_custom_icons.py

Registers custom BloodHound node icons for all SFHound node types.

Terminal window
python examples/post_custom_icons.py \
--bh-url http://127.0.0.1:8080 \
--bh-username admin \
--bh-password YOUR_BLOODHOUND_PASSWORD

Must be run once after BloodHound CE is started. Safe to re-run (idempotent).