Keyfactor Command Connector User Guide

Instructions for deploying the Keyfactor Connector to scan for cryptographic assets and deliver findings to the AgileSec Platform for processing and analysis.

Overview

The Keyfactor Command Connector integrates Keyfactor Command with Keyfactor's AgileSec Platform. This Connector allows users to discover, inventory, and analyze X.509 certificate metadata and other relevant cryptographic attributes.

What Gets Scanned

The Keyfactor Command Sensor can discover the following cryptographic assets:

  • X.509 Certificates: SSL/TLS certificates, code signing certificates, client authentication certificates, and any other certificates in Command.

Prerequisite Requirements

Ensure you meet the following requirements to enable scanning.

Network Access

Ensure HTTPS network connectivity from AgileSec platform or remote execution machine to Keyfactor Command endpoints.

Supported Authentication Methods

The Keyfactor Command Connector supports three authentication methods.

1. Basic Auth

  • Available for Platform, API, and Remote scan executions.

  • Uses username and password to access Command API.

  • In the configuration file, set only the username and password.

2. OAuth2

  • Available for Platform, API, and Remote scan executions.

  • State the OAuth Client ID, Client Secret, and Scope.

3. Kerberos

  • Only available for Remote scan execution.

  • Authenticate using AD/Windows Integrated Auth for Command On-Prem.

Required Access Rights

The Keyfactor authentication credentials must have /certificates/collections/read/ permissions.

Running the Sensor

AgileSec Keyfactor Command scans can be executed using the following methods:

  1. Platform Scan Execution: Configure and execute scans directly through the Keyfactor AgileSec web UI with on-demand or scheduled execution options.

  2. API Scan Execution: Programmatically trigger scans through REST API calls, enabling integration with CI/CD pipelines and automation workflows.

  3. Remote Scan Execution: Deploy and run the connector via CLI on customer-managed infrastructure for scenarios such as:

    1. Scanning air-gapped or internal instances the platform cannot directly reach

    2. Customers wanting to manage their own scheduling and execution environment.

Refer to Scan Execution Flows for additional scan execution information.

Connectors/Sensors Note: Connectors are considered a subset of Sensors. Sensors and Connectors utilize the same Unified Sensor Framework, but Sensors use the Host Sensor for additional scanning depth.

“Sensor”-labeled variables for API and Remote execution are common to both Sensors and Connectors. Unless specified, do NOT update these with “Connector”.

Configuration Fields

The following parameters are used to configure AgileSec Keyfactor Command scans.

Field Name

UI Display Name

Type

Required

Description

url

API URL

String

✅ Yes

API URL of the Keyfactor Command instance to connect to (e.g., https://keyfactor.company.com/KeyfactorAPI).

username

Basic Auth Username

String

Required for basic auth

Username for basic authentication.

password

Basic Auth Password

String

Required for basic auth

Password for basic authentication.

token_url

OAuth2 token url

String

Required for OAuth2

OAuth token endpoint URL to obtain an access token (e.g. https://login.microsoftonline.com/%7Btenant_id%7D/oauth2/v2.0/token ).

client_id

OAuth2 client id

String

Required for OAuth2

Client ID issued by the authorization server for OAuth authentication.

client_secret

OAuth2 client secret

String

Required for OAuth2

Client Secret used to securely authenticate the application with the authorization server.

scope

OAuth2 token scope

String

Required for OAuth2

OAuth scopes defining the level of access requested. For example, api://<UUID>/.default

query_filter

Query filter

String

❌ No

Optional filter to limit which certificates are scanned (e.g., by name, status, expiration, or metadata attributes).

Supports Keyfactor query syntax to define a base set of certificates for collection.

Query filter examples:

  • IssuedDate -gt '2025-01-01'

  • field1 -eq value1 AND field2 -gt value2

See https://software.keyfactor.com/Core-OnPrem/Current/Content/ReferenceGuide/Certificate%20Search%20Page.htm#AdvancedSearches for more details.

incrementalScan

Incremental Scan

Boolean

✅ Yes

Note: for Platform Scan Executions via UI, incremental scan defaults to Yes.

Enable to scan only updates since last run. See Incremental Scanning.

autoResolutionInterval

Auto-Resolution Interval

Number

✅ Yes


Only used when incrementalScanis enabled. Number of incremental scans to perform before running a full scan. See Incremental Scanning.

Kerberos Auth Parameters

Kerberos authentication is permitted for Remote Scan executions only.

Field Name

Type

Required

Description

upn

String

❌ No

Required when using keytab_path or password auth.

User Principal Name

spn

String

❌ No

Service Principal Name

Defaults to HTTP/ if left empty

realm

String

✅ Yes

Name of Kerberos realm

krb5_conf_path

String

✅ Yes

Path to krb5.conf.

Defaults to /etc/krb5.conf

password

String

❌ No

Either password, keytab_path, or cache_path must be set.

Kerberos password.

keytab_path

String

❌ No

Either password, keytab_path, or cache_path must be set.

Path to keytab.

cache_path

String

❌ No

Either password, keytab_path, or cache_path must be set.

Path to credentials cache.

prefer_curl

Boolean

❌ No

If enabled (true), requests will use the curl binary for certificate inventory requests.

If disabled (false), requests for certificate inventory will be performed by the Connector without curl.

Defaults to false.

Platform Scan Execution

Running scans through the user interface is the simplest and fastest way to get started. The platform enables running on-demand or scheduled scans in a dedicated environment.

Platform Scan Configuration

  1. Open your browser and navigate to the Keyfactor AgileSec Platform Web URL

  2. Log in with your credentials

  3. Click on "Sensors" in the left navigation menu under Scan

    image-20260616-210209.png
  4. Click "+ New Sensor".

    image-20260616-210325.png
  5. Click on the correct card to open the configuration interface.

Configure Parameters and Start Scan
  1. Fill in the required configuration parameters.

  2. Click Save.

  3. Click Action then Scan to begin a scan.
    Note: Click Edit to reconfigure parameters.

    image-20260616-214857.png

Scan Execution Using API

Scans may be programmatically triggered through REST API calls, enabling seamless integration with CI/CD pipelines, automation workflows, and custom applications. API execution provides flexibility for developers to incorporate cryptographic scanning into their existing development and deployment processes.

Note: For complete API reference, see API.

Generate AgileSec API Access Token

  1. Open your browser and navigate to AgileSec Platform UI

  2. Log in with your Keyfactor credentials

  3. Click "Access Tokens" in the main navigation menu

  4. Click "Generate Token" button

  5. Set Token Type to API Token and provide the required details

  6. Click "Generate" and copy the generated token

    image-20260616-212437.png

AgileSec API Endpoint

POST https://<platform-url>/v3/scan/create/

Request Format

Headers
Content-Type: application/json
isg-api-token: <your-api-token>
Request Body
JSON
  {
    "sensorName": "<sensor name>",
    "sensorType": "Keyfactor Command",
    "sensorConfig": {
       "url": "<keyfactor command api url>",
       "token_url": "<oauth2 token url>",
       "client_id": "<oauth2 client id>",
       "client_secret": "<oauth 2 client secret>"
       "scope": "<oauth 2 scope"
       "query_filter": "<keyfactor command query filter string>"
    },
    "callbackId": "<callback id>",
    "labels": [
        {
            "<label name>": "<label value>"
        }
    ],
    "priority": "<priority>"
  }

Remote Scan Execution

Scans may be run on remote host machines with the AgileSec Remote Sensor Package.

Download Remote Sensor Package
  1. Open your browser and navigate to the Keyfactor AgileSec Platform Web URL

  2. Log in with your credentials

  3. Click on "Sensors" in the left navigation menu under Scan

    image-20260616-210209.png
  4. Click Remote Scan.

    image-20260616-220921.png
  5. Click + Download Remote Sensor.

    image-20260616-221015.png
  6. Download the sensor binary for your remote machine’s operating system

    image-20260616-221050.png
Generate Platform Token
  1. In the Download Remote UI, click "Generate Token"

  2. Copy the generated token

  3. Store securely in an environment variable such as SENSOR_TOKEN:

     export SENSOR_TOKEN="your-generated-token"
    
Create Configuration File

Create a YAML configuration file (e.g., keyfactor-command-config.yml) with your scan settings. An example configuration can be found in config/sample-configs/keyfactor.yml.

Step 4: Run the Sensor

Execute the sensor with your configuration file:

  • Linux/macOS

    # Set environment variables
    export SENSOR_TOKEN="your-sensor-token"
    # Run sensor
    ./unified_sensor_linux -c keyfactor-command-config.yml
    
  • Windows (PowerShell)

    # Set environment variables
    $env:SENSOR_TOKEN = "your-sensor-token"
    # Run sensor
    .\unified_sensor_windows.exe -c .\keyfactor-command-config.yml
    

Remote Scan Execution Configuration Examples

  • OAuth 2 authentication

    scan_config:
      plugins:
        - keyfactor
        - export
      config:
        keyfactor:
          name: keyfactor
          plugin_config:
            url: "https://command.example.com/KeyfactorAPI"
            token_url: "https://login.microsoftonline.com/xxxxxxxxxxx/oauth2/v2.0/token"
            client_id: "xxxxxxxxxxxxxx"
            client_secret: "xxxxxxxxxxxx"
            scope: "api://xxxxxxxxxx/.default"
        local_export:
          name: local_export
          plugin_config:
            <<: *local_export_config
        export:
          name: export
          plugin_config:
            <<: *export_config
            sensor_name: "Remote Keyfactor Scan"
            sensor_type: "Keyfactor Command" # Do not edit this value.
            ran_by: "${env:USER}"
            url: "${env:INGESTION_URL}"
            token: "${env:SENSOR_TOKEN}"
    

Known Limitations

Incremental Scanning Modified Certificates

Incremental scanning will catch new certificates. If a previously-scanned certificate is modified, the modifications will not be discovered by AgileSec until a full scan happens.

Troubleshooting Common Errors

  • KF-404 Invalid Keyfactor URL

    • Fix: Review and update the Keyfactor URL or ensure network access is configured correctly.

  • KF-500 Failed to send request.

    • Fix: Check Network/TLS connectivity to Command or ensure firewall/proxy is not blocking HTTP API requests.

  • KF-502 Unexpected status code from Keyfactor

    • Fix: Review and Correct Keyfactor credentials.

  • KERB-401 Wrong keytab_path or file permissions

    • Fix: Review and update keytab_path or check if file permissions are blocking access.

  • KERB-402 Failed to load krb5.conf

    • Fix: If using Kerberos, review and update krb5_conf_path or give another Kerberos auth parameter.

  • KERB-403 Kerberos login failed

    • Fix: Review Kerberos login and update credentials.

  • CONFIG-404 interval is less than 0

    • Fix: Update incremental scanning interval parameter to a positive number.

Getting Support

Collect diagnostic information:

  • Sensor version

  • Configuration file (redact tokens)

  • Log output

  • Keyfactor Command config details (url, auth type, version)

Contact Support: