Last Updated: 2026-10-28
Purpose
This article shows you how to run authenticated scans for multiple assets that require different sets of credentials, ensuring each asset uses the correct credential. By using Internal Credential References, you can assign the right credential to each asset based on criteria you define (such as tags), so only the matching credential is tried on each target, preventing unnecessary failed login attempts.
This setup is especially useful in environments where different systems use different local administrator, SSH, WinRM, or SMB credentials, but you still want to manage scanning through a single scan policy and scan configuration.
Overview
Credentials can now reference other internal credentials as a credential source. This allows you to dynamically resolve credential values at scan time based on asset-specific criteria such as tags or scan targets.
Instead of assigning many different credentials directly to a scan policy, you create:
-
The actual credentials that contain the real usernames and passwords.
-
A referencing credential that dynamically selects which credential to use during the scan.
-
Asset tags that tell the scanner which credential belongs to which asset.
The scan engine evaluates the asset tags during scan execution and automatically selects the correct credential.
How It Works
When creating or editing a credential, you can select Internal Credential as the credential source. This links the credential to another existing credential within the same account.
At scan time, the system resolves the referenced credential and populates the appropriate fields (username, password, and so on) using Jinja templates.
The process works as follows:
-
An asset is scanned.
-
The scanner checks the asset tags.
-
The Jinja template reads the value of the credential tag.
-
The matching internal credential is resolved.
-
The resolved username/password are injected into the scan authentication process.
This ensures that only the correct credential is attempted against the asset.
Key Rules
-
The referenced credential must be the same account type as the referencing credential (for example, an SSH credential can only reference another SSH credential).
-
The referenced credential must not itself be referential - chaining references is not allowed.
-
At least one of Credential source ID or Credential source name must be populated. If both are provided, Credential source ID takes precedence.
-
The asset tag naming must match exactly. Incorrect tag names or values prevent credential resolution.
-
If no matching credential is found, the credential is skipped or a scan issue is generated depending on the resolution result.
Setup
Select Internal Credential Source
When creating or editing a credential, choose Internal Credential from the credential source drop-down.
Two additional fields is displayed:
|
Field |
Description |
|---|---|
|
Credential source ID |
The ID of the internal credential to reference. |
|
Credential source name |
The name of the internal credential to reference. |
Configure Source Fields with Jinja Templates
The source fields (Credential source ID and Credential source name) use Jinja templates to dynamically resolve which credential to use based on asset tags. The default templates are:
Credential source ID: {{ (asset.tags | selectattr('key', 'eq', 'credentialid') | list | default([{"value":""}], true) | first).value }}
Credential source name: {{ (asset.tags | selectattr('key', 'eq', 'credentialname') | list | default([{"value":""}], true) | first).value }}
This means you can control which internal credential is used per asset by assigning the appropriate tag to each asset:
|
Asset Tag Key |
Purpose |
|---|---|
|
|
Specifies the target credential by its ID |
|
|
Specifies the target credential by its name |
Scan Behavior
-
If the credential reference resolves successfully, the resolved values are used for authentication.
-
If resolution fails (for example, the referenced credential does not exist or is the wrong type), a scan issue is created with details about the failure.
-
If all query fields resolve to empty, the credential is treated as not applicable to the scan and no specific issue is emitted.
Result
Using Internal Credential References allows you to:
-
Maintain a single scan policy for many credential combinations
-
Dynamically assign credentials per asset
-
Reduce failed authentication attempts
-
Simplify credential management
-
Scale authenticated scanning in complex environments
This approach is recommended when different systems require different credentials but should still be scanned through centralized policies and configurations.
Example 1: SSH Credential with Internal Reference
Scenario: You have multiple SSH credentials and want each asset to use the correct one based on a tag.
Step 1: Create base SSH credentials
Create your SSH credentials as normal (for example, ssh-prod-web, ssh-prod-db).
Step 2: Tag your assets
Assign the credentialname tag to each asset with the name of the credential it should use:
|
Asset |
Tag Key |
Tag Value |
|---|---|---|
|
web-server-01 |
|
ssh-prod-web |
|
db-server-01 |
|
ssh-prod-db |
Step 3: Create a Referencing Credential
Create a new SSH credential with Internal Credential as the source. The default Jinja templates automatically resolves the correct credential per asset at scan time.
For example, these value fields are populated from the resolved credential:
username: {{ username }}
password: {{ password }}
For a complete list of available variables, you can click on the "Curly braces" button to activate Jinja editor mode, then click on the "Editor" button to view them
Step 4: Assign to Policy
Add this single referencing credential to your scan policy. During scanning, each asset automatically use the correct underlying credential based on its tag.
Example 2: Create Base Credentials with Internal Reference
Step 1: Create Base Credentials
First create the actual credentials that contain the real authentication details.
You can create credentials for protocols such as:
-
SSH
-
WINRM
-
SMB
These credentials are the credentials that will ultimately be used during scanning.
For example:
-
ssh-prod-web
-
ssh-prod-db
-
windows-admin-east
-
windows-admin-west
When creating the credential:
-
Enter a descriptive Role name.
-
Configure the username/password or key information as normal.
-
Save the credential.
The credential name is important because it can later be referenced by asset tags.
Example:
Role: Production SSH Credentials
Username: username
Password: password123
Step 2: Create an Internal Credential
Next, create another credential of the same protocol type that will act as the dynamic selector credential.
This is the credential that will later be assigned to the scan policy.
-
Go to Configuration > Credentials > Create Credentials
-
Select the same credential type as the credentials created in Step 1:
-
SSH
-
WINRM
-
SMB
-
-
Provide a descriptive name such as:
-
Administration
-
Dynamic SSH Credential
-
Conditional Windows Admin
-
-
Scroll down to the Credential source section and select Internal credential.
-
Two additional fields are displayed under Credential source:
|
Field |
Description |
|
Credential source ID |
The ID of the internal credential to reference. |
|
Credential source name |
The name of the internal credential to reference. |
These fields support Jinja templates and determine which credential should be resolved during scanning.
The source fields, Credential source ID and Credential source name, use Jinja templates to dynamically resolve which credential to use based on asset tags.
The default templates are:
-
Credential source ID:
{{ (asset.tags | selectattr('key', 'eq', 'credentialid') | list | default([{"value":""}], true) | first).value }} -
Credential source name:
{{ (asset.tags | selectattr('key', 'eq', 'credentialname') | list | default([{"value":""}], true) | first).value }}
This means you can control which internal credential is used per asset by assigning the appropriate tag to each asset:
|
Asset Tag Key |
Purpose |
|
credentialid |
Specifies the target credential by its ID |
|
credentialname |
Specifies the target credential by its name |
Example:
|
|
|
All pre-defined jinja templates can be left as is and do not need any customization to work.
Step 3: Create a Tag
To know more about tags and how to create them, see Tags
When creating a tag for Internal Credentials, it’s important that the key of the tag matches the credential source name selectattr key. The value of the tag must match the Role name of the non-internal-credentials credentials.
If you choose to use the Credential source ID instead, the key of the tag must match the selectattr key and the value of the tag must match the ID of the non-internal-credentials credentials.
Example:
Step 4: Create a Scan Policy
To know more about scan policies and how to create them, see Scan Policies
The important part to include in the scan policy for conditional credentials to be enabled is to enable the authentication mechanism by moving the slider and to add your conditional credentials.
Example:
Step 5: Tag your assets
To know more about tags and how to create them, see Tags
The assets to be scanned needs to be tagged with two separate tags:
-
One tag for specifying that they should be included in a specific scan configuration (Step 6).
-
A second tag to specify which conditional credentials to use during scanning.
Example:
Step 6: Configure the Scan Configuration with the correct scan policy
For more information on how to set up a Network Host Assessment, see Network Host Assessment
When creating the network host assessment scan configuration it’s important to select the correct scan policy from Step 4 and to choose the correct tag for the assets to be scanned.
Example:
Example3: Manual Conditional Credentials
Step 1: Create credentials per asset or group
Create your credentials per Asset or per Group
In this example I am creating it on 2 specific assets that are having to separate SSH credentials.
Role: [Enter a name that will be used to tag the assets that are using this credential]
Password: [Enter your password]
Step 2: Create a different credential type
One base component that we need to create is a different credential type that will allow the routine to select the credential that we created in step 1
-
In Configuration > Credentials, click Create credential.
-
Select the Type of credential: SSH, WinRM or SMB.
-
Enter a Credential role, for example “Administration”. This is later used for setting up a scan policy.
-
Open the Credential source dropdown.
-
Select Internal credential. The default option, No source, means the credential values are entered directly. When Internal credential is selected, the fields Credential source ID and Credential source name are displayed.
Step 3: Create a scan policy
-
Once this is done, we are going to create a scan policy where we will be consuming the conditional credential.
Go to the Configuration section on the left side of the screen.
-
Then select Scan policies and click on the PLUS sign (bottom right corner)
Step 4: Select credentials
-
The scan policy screen is displayed and then click on Credentials tab
Now select credentials
-
Here select the credential that you created in step 2 of this manual in my case “Administrator”
Step 5: Assign asset tags
Now that we have done the preparation, we need to assign the appropriate asset tags so that the mechanism knows which credential to use during scanning.
Again we can do this per asset or use our automation and view templates.
In this example I am first doing it per asset.
-
Go to the Assets menu and the Assets option
-
Select one or multiple assets and right click to select Edit Tags menu.
-
Now if a tag with your specific credential name does not exist (step 1) please create this using the following name: credentialname:[your credential name]
Important the naming as described above needs to be correct otherwise it will not work.
Step 6: Setup scan configuration
-
Last step is to setup a scan configuration go to Configuration > Scan Configuration.
-
Open an existing scan configuration or create a new “Network host assessment”.
-
Select the correct Scan Policy that you created in step 4.
-
Select the asset tags on the group of assets that you want to start scanning. This can be any tag does not have to be tag that you created in step 5.
Related Articles
- Generate Azure Credentials
- Google Cloud Platform Credentials
- Microsoft Azure Credentials
- SSH Credentials
- Docker Credentials
- Amazon Web Services Credentials
- VMware vSphere Credentials
- Generate AWS Credentials
- Basic Credentials
- SMB Credentials
- Generate GCP Credentials
- Scan Credentials
- Internal Credential Reference
- Web Credentials