Auto Light Dark
Auto Light Dark

Using a PAM Tool for Agentless Data Collector Passwords

Overview

If your security policy requires discovery account passwords to be kept in a privileged access management (PAM) tool, such as CyberArk or BeyondTrust Password Safe, the Cloudamize Agentless Data Collector (ADC) can get each password from that tool instead of storing it. ADC 2.0.186 and newer support this for Windows, Linux and NetApp hosts.

You set up one command on the ADC machine that prints a password. For every host set to use it, ADC:

  • runs the command when it needs the account's password;

  • keeps the password in memory only, and never writes it to disk;

  • runs the command again when the cache time (TTL) expires or a login fails, so collection continues after the vault rotates the password, with no change needed in ADC.

Hosts that use the PAM command and hosts with a stored password or SSH key can be added to the same ADC.

Requirements

  • A command that prints the password. Your PAM tool's command-line client (for example, CyberArk's CLIPasswordSDK.exe) or your own script, installed on the ADC machine. The command must:

    • exit with code 0 and print the password on the first line of its standard output;

    • exit with a non-zero code when it can't get the password;

    • never print the password on its error output. ADC writes error output to its log.

  • Access for two identities. The command runs as LocalSystem in the two ADC services, and as the logged-on user in the ADC window when you add hosts or test the command. Your PAM tool must allow both, for example in the allowed machines and OS users of a CyberArk application ID.

  • Password lifetime. A password must stay valid for at least the cache TTL (60 minutes by default). Passwords that work only once aren't supported.

  • Passwords only. Linux hosts that log in with an SSH key keep using the SSH Key option.

  • Administrator rights. Only local administrators on the ADC machine can change the PAM command. Keep any script the command runs in a folder that only administrators can change, because the ADC services run it as LocalSystem.

Each ADC has its own PAM command. If you use more than one ADC, set up the command on each one.

Step 1: Set Up the PAM Command

  1. Open the ADC window, then select Parameter Setup > PAM Credential Command.

    image-20261117-232514.png


  2. In Program, enter the full path of the program, or click Browse....

  3. In Arguments, enter the program's arguments. Use the placeholders below where the command needs a value from the host. Put quotes around placeholders that may contain spaces.

  4. Change Timeout, Cache TTL or Lockout backoff if needed.

  5. Test the command (see Step 2), then click Save. The ADC services start using it within a minute.

Placeholder

Replaced with

Example

{account}

The account name as entered for the host

CORP\svc_adc

{user}

The account name without the domain

svc_adc

{domain}

The domain part of the account name

CORP

{os}

Windows, Linux or NetApp

Linux

{ref}

The host's Credential reference, for example a vault object name. This is set by you when adding hosts via the UI or CSV.

ADC-Linux-Discovery

{host}

The host's IP address. Use it only if your vault stores a different password for each host: ADC then queries the vault for every host instead of once per account.

10.1.1.20

The {host} placeholder only fills an IP address (not DNS) and will cause a vault query for each host at every TTL expiration.

Values put into placeholders can contain only letters, digits, spaces and . _ - @ \ / : , = + #, and can't end with \.

Setting

Default

Range

What it does

Timeout (seconds)

30

5 to 300

ADC stops the command if it hasn't finished in this time.

Cache TTL (minutes)

60

5 to 1440

How long ADC keeps a password in memory before running the command again.

Lockout backoff (minutes)

15

0 to 240

How long ADC stops logging in after a host rejects the password. See How ADC Protects the Account from Lockout.

Examples

Click to expand...

Example: CyberArk Credential Provider

  • Program: C:\Program Files (x86)\CyberArk\ApplicationPasswordSdk\CLIPasswordSDK.exe

  • Arguments: GetPassword /p AppDescs.AppID=CloudamizeADC /p "Query=Safe=ADC-Discovery;Object={ref}" /o Password

Replace CloudamizeADC and ADC-Discovery with your application ID and safe, and set each host's Credential reference to the name of its account object in the safe.

Example: BeyondTrust Password Safe or Another Tool, with Your Own PowerShell Script

  • Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

  • Arguments: -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "C:\ADC\Get-PamPassword.ps1" -Account "{account}" -System "{ref}"

The script must follow the rules under Requirements. You can start from this outline and add the call to your PAM tool:

PowerShell
param([string]$Account, [string]$System)
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
try {
    $password = ...   # Get the password from your PAM tool here.
    Write-Output $password
    exit 0
} catch {
    # Error output goes to the ADC log: never include the password.
    [Console]::Error.WriteLine("Could not get the password for ${Account}: $($_.Exception.Message)")
    exit 1
}

Step 2: Test the Command

The Test section of the same window runs the command once with the Program and Arguments on screen, even if they aren't saved.

  1. Under Fill from host, pick a host to copy its values, or type an Account, OS, Reference and Host IP. Only the values used in Arguments matter.

  2. Click Test.

ADC shows the command it ran and then either Success. The command returned a password of N characters. or the error. It never shows the password.

Test runs as you, not as LocalSystem. If Test works but hosts report a PAM error, check that your PAM tool also allows LocalSystem on the ADC machine.

Step 3: Set Hosts to Use the PAM Command

New Hosts

  1. Click Add Host and select Add Windows Host, Add Linux Host or Add NetApp Host.

  2. Enter the IP addresses and the Account Name.

  3. Select Get the password from the PAM command.

  4. Optionally, enter a Credential reference. It is passed to the command as {ref}.

  5. Click Add Host(s). ADC runs the command once per account and checks the connection to each host.

Existing Hosts

Select the hosts, click Change Credentials, select Get the password from the PAM command, and click Change. ADC deletes the passwords it had stored for those hosts.

CSV File

Load the file with Add Host > Load Host from CSV File. Each line is one host, with these columns in this order and no header row. Columns 5 to 7 are optional and can be left off the end of a line.

CSV Format

#

Column

What to enter

1

IP Address

The host's IP address, for example 10.0.1.40. Ranges aren't accepted in a CSV file.

2

OS Type

Windows, Linux or NetApp, spelled exactly like this.

3

Account Name

The account ADC logs in with. For Windows, include the domain or host name, for example CORP\svc_discovery or .\Administrator.

4

Password

PAM hosts: leave empty. Other hosts: the password. Required for Windows and NetApp; for Linux, enter a password or an SSH key path.

5

SshKeyPath

PAM hosts: leave empty. Linux hosts that log in with an SSH key: the path of the private key on the ADC machine.

6

CredentialSource

PAM to get the password from the PAM command. Leave empty for a stored password or SSH key.

7

CredentialRef

PAM hosts only, optional: the host's Credential reference, passed to the command as {ref}.

In these examples, the two empty fields after the account name are Password and SshKeyPath. The first host has no credential reference; the second uses Linux-Discovery-Account:

10.0.1.40,Windows,CORP\svc_discovery,,,PAM,
10.0.1.41,Linux,discovery,,,PAM,Linux-Discovery-Account

When the Vault Rotates a Password

You don't need to do anything in ADC. ADC gets the new password:

  • when the cache TTL expires, or

  • when a login fails. ADC runs the command again and, if it returns a different password, retries with it straight away.

Collection usually resumes by the next connection check, which runs every 10 minutes, so a few minutes of data may be missing.

If the command itself fails, ADC waits 5 minutes before running it again for the same account, so the vault isn't queried repeatedly.

Lockout Protection, Troubleshooting and FAQ

How ADC protects discovery accounts from lockout, what each PAM error message means and what to do about it, and answers to common questions are on PAM Passwords in the Agentless Data Collector: Lockout Protection, Troubleshooting and FAQ.

Stop Using the PAM Command

  1. Change the hosts to a password or SSH key with Change Credentials.

  2. Open Parameter Setup > PAM Credential Command, clear Program and click Save.

Hosts still set to use the PAM command show an error until they are changed.

If you have any queries, please get in touch with the helpdesk via our Helpdesk Portal or by email at helpdesk@cloudamize.com.