Skip to main content

Custom Script

Description

The Custom Script connector executes a user-provided script on an On-Premise Agent to scan any system type that OrbisID does not natively support. The script receives connection details as JSON on stdin and must output discovered accounts as JSON on stdout.

This connector enables scanning of custom applications, cloud platforms, SaaS APIs, mainframes, or any other target where you can write code to enumerate accounts.

System Type Classification

The System Type is user-selectable for Custom Script systems. Choose the classification that best describes the target system:

ClassificationUse When
ServerTarget is a server OS
InfrastructureTarget is a database or platform
ApplicationTarget is a business application
Directory ServiceTarget is an identity store

Version Support

OrbisID EditionSupported
CommunityNo
ProNo
EnterpriseYes

Custom Script scanning requires the Enterprise edition.

How It Works

  1. OrbisID creates a scan job and dispatches it to an On-Premise Agent
  2. The agent writes a JSON payload with connection details to the script's stdin
  3. The script executes and returns discovered accounts as JSON on stdout
  4. The agent submits the results to OrbisID

The script runs on the On-Premise Agent host, not on the OrbisID server.

Script Modes

ModeDescription
PathThe script already exists on the On-Premise Agent host at a specified path
UploadThe script is uploaded to OrbisID and pushed to the agent at scan time

Script Interface

Input (stdin)

The script receives a JSON object:

{
"hostname": "target-host.example.com",
"port": 443,
"username": "service-account",
"password": "decrypted-password",
"parameters": {
"custom_param_1": "value1",
"custom_param_2": "value2"
}
}

parameters are the key-value pairs configured on the target system in OrbisID.

Output (stdout)

The script must write a JSON object:

{
"success": true,
"accounts": [
{
"username": "admin",
"displayName": "Administrator",
"accountType": "HUMAN",
"enabled": true,
"groups": ["Administrators", "Remote Desktop Users"],
"lastLogon": "2025-01-10T14:30:00Z",
"attributes": {
"department": "IT",
"custom_field": "value"
}
}
],
"errorMessage": null
}

Account Fields

FieldRequiredTypeDescription
usernameYesStringAccount username or login name
displayNameNoStringFriendly name
accountTypeNoStringHUMAN or NON_HUMAN
enabledNoBooleanWhether the account is active
groupsNoString[]Group or role memberships
lastLogonNoISO 8601Last login timestamp
attributesNoObjectAdditional key-value metadata

Connection Testing

When Test Connection is run in OrbisID, the agent executes the script with a --test argument appended to the command. The script should perform a lightweight connectivity check and exit with:

  • Code 0 — success
  • Non-zero — failure (error message on stderr)

Connection Requirements

On-Premise Agent Required

Custom Script systems must use an On-Premise Agent. The OrbisID server does not execute scripts directly.

  1. Deploy and configure an On-Premise Agent
  2. Assign the agent (or agent group) to the target system
  3. Place the script on the agent host (Path mode) or upload it via OrbisID (Upload mode)

Script Runtime Requirements

The script runtime (Python, Node.js, Bash, PowerShell, etc.) must be installed on the On-Premise Agent host.

Network Requirements

The On-Premise Agent must have network access to the target system on whatever ports the script uses.

Configuration Steps

  1. Navigate to Systems in the sidebar
  2. Click Add System
  3. Set OS Type to Custom Script
  4. Fill in the fields:
FieldValue
NameDescriptive name (e.g., aws-iam-accounts)
Hostname / IPHostname passed to the script as hostname in the JSON input
PortPort passed to the script as port
System TypeChoose the appropriate classification
Script ModePath or Upload
Script Path(Path mode) Full path to the script on the agent host
ParametersKey-value pairs passed to the script as parameters
CredentialThe credential whose username/password are passed to the script
  1. For Upload mode, click Upload Script and select your script file
  2. Click Test Connection — the agent runs the script with --test
  3. Click Save

Example Script

An example Python script is available in OrbisID at Systems → Add System → Custom Script → Download Example Script.

The example demonstrates:

  1. Reading connection details from stdin
  2. Handling the --test flag
  3. Connecting to a hypothetical target system
  4. Enumerating accounts
  5. Writing the result JSON to stdout

See On-Premise Agent — Custom Scripts for the full script specification.

Troubleshooting

SymptomLikely CauseResolution
Scan fails: "Requires Scan Agent"No On-Premise Agent assignedAssign an agent or agent group to the system
Connection test fails: non-zero exitScript connectivity errorTest the script manually on the agent host: echo '{"hostname":"..."}' | python3 script.py --test
No accounts returnedScript outputs empty accounts array or malformed JSONValidate the JSON output format; check script logs
Script not found (Path mode)Path incorrect or permissions wrongVerify the script path on the agent host and ensure it is executable
Upload not availableAgent offlineEnsure the agent is online before uploading; scripts are pushed at scan time