HomeGuidesChangelog
Guides

Axonius

RegScale CLI — Axonius V2 Integration

Overview

The Axonius V2 integration syncs assets (endpoints) and vulnerabilities from Axonius into RegScale using the Axonius V2 API. It features incremental delta sync to minimize API usage, saved query support for predefined filters, and tag-based filtering for targeted synchronization.


Prerequisites

  • RegScale CLI installed and configured (regscale init)
  • An Axonius V2 API key and secret (generated from Axonius Settings > API Keys)
  • Network access to your Axonius instance
  • An existing RegScale Security Plan or Component to sync into

Configuration

Add the following variables to your init.yaml file (created by regscale init):

VariableTypeRequiredDefaultDescription
axoniusUrlstringYesAxonius instance URL
axoniusApiKeystringYesV2 API key
axoniusApiSecretstringYesV2 API secret
axoniusVerifySslboolNotrueVerify SSL certificates
axoniusTimeoutintNo120Request timeout in seconds
axoniusPageSizeintNo2000Page size for API requests (max 2000)

Example Configuration

axoniusUrl: "https://axonius.mycompany.com"
axoniusApiKey: "your-v2-api-key"
axoniusApiSecret: "your-v2-api-secret"
axoniusVerifySsl: true
axoniusTimeout: 120
axoniusPageSize: 2000

Environment Variable Support

All configuration values can also be set via environment variables with the AXONIUS_ prefix:

export AXONIUS_HOST="https://axonius.mycompany.com"
export AXONIUS_API_KEY="your-v2-api-key"
export AXONIUS_API_SECRET="your-v2-api-secret"

Commands

Sync Assets

Sync Axonius devices into RegScale as assets.

regscale axonius_v2 sync_assets --regscale-ssp-id <ID> [OPTIONS]

Parameters:

ParameterRequiredDefaultDescription
--regscale-ssp-idYesID of the RegScale Security Plan
--tags, -tNoComma-separated Axonius tags to filter by
--mode, -mNo"hybrid"Sync strategy: "hybrid" or "saved-query"
--config-file, -cNoPath to saved query YAML config file
--offsetNo0Number of records to skip
--limitNoMaximum number of records to process
--dry-runNofalseCount records without syncing to RegScale

Examples:

# Sync all Axonius devices to a Security Plan
regscale axonius_v2 sync_assets --regscale-ssp-id 42

# Sync only devices with specific tags
regscale axonius_v2 sync_assets --regscale-ssp-id 42 --tags "production,web-servers"

# Preview how many assets would be synced
regscale axonius_v2 sync_assets --regscale-ssp-id 42 --dry-run

# Use saved query mode with config file
regscale axonius_v2 sync_assets --regscale-ssp-id 42 --mode saved-query --config-file queries.yaml

# Paginate: skip first 1000, process next 500
regscale axonius_v2 sync_assets --regscale-ssp-id 42 --offset 1000 --limit 500

What gets synced:

Each Axonius device is mapped to a RegScale asset with the following fields:

Axonius FieldRegScale Asset Field
HostnameAsset Name
IP AddressesIP Address
IPv6 AddressesIPv6 Address
MAC AddressesMAC Address
Serial NumberSerial Number
OS Type + VersionOperating System
AWS/Azure/GCP IDsCloud identifiers
Device TypeAsset Type

Asset type detection:

ConditionAsset Type
Cloud instance (AWS/Azure/GCP)Virtual Machine (VM)
OS indicates serverServer
OS indicates workstation/desktopWorkstation
DefaultOther

Sync Findings

Sync Axonius vulnerabilities into RegScale.

regscale axonius_v2 sync_findings --regscale-ssp-id <ID> [OPTIONS]

Parameters: Same as sync_assets.

Examples:

# Sync all vulnerabilities
regscale axonius_v2 sync_findings --regscale-ssp-id 42

# Sync vulnerabilities for tagged assets only
regscale axonius_v2 sync_findings --regscale-ssp-id 42 --tags "dmz,external"

# Preview vulnerability count
regscale axonius_v2 sync_findings --regscale-ssp-id 42 --dry-run

Vulnerability Mapping

Axonius FieldRegScale Field
CVE IDCVE
TitleTitle
DescriptionDescription
SeveritySeverity
CVSS v3 ScoreCVSS Score
SolutionRemediation
First SeenDate First Found
Last SeenDate Last Found
Plugin IDPlugin ID
Plugin NamePlugin Name
Associated Device IDLinked Asset

Severity Mapping

The integration uses a multi-tier severity resolution:

1. Explicit Axonius severity string (preferred):

Axonius SeverityRegScale Severity
criticalCritical
highHigh
mediumModerate
lowLow
info / informationalNot Assigned
noneNot Assigned

2. CVSS v3 score fallback (if no explicit severity):

CVSS v3 ScoreRegScale Severity
9.0 - 10.0Critical
7.0 - 8.9High
4.0 - 6.9Moderate
0.1 - 3.9Low
0.0Not Assigned

3. CVSS v2 score fallback (if no v3 score available, same thresholds apply).


Sync All

Run both asset sync and vulnerability sync in sequence with a single command.

regscale axonius_v2 sync_all --regscale-ssp-id <ID> [OPTIONS]

Parameters: Same as sync_assets.

Examples:

# Full sync: assets then vulnerabilities
regscale axonius_v2 sync_all --regscale-ssp-id 42

# Full sync with tag filtering
regscale axonius_v2 sync_all --regscale-ssp-id 42 --tags "production"

# Full dry run
regscale axonius_v2 sync_all --regscale-ssp-id 42 --dry-run

Execution order:

  1. sync_assets — creates/updates all matching Axonius devices as RegScale assets
  2. sync_findings — creates vulnerabilities linked to those assets

List Tags

List all available tags from your Axonius instance.

regscale axonius_v2 list_tags

Example output:

production (type=custom)
web-servers (type=custom)
pci-scope (type=custom)
aws-ec2 (type=adapter)

Use the tag names with --tags on other commands to filter results.


Count

Count matching assets in Axonius without syncing.

regscale axonius_v2 count [OPTIONS]

Parameters:

ParameterRequiredDefaultDescription
--tags, -tNoComma-separated tags to filter by
--asset-type, -aNo"devices"Asset type to count

Examples:

# Count all devices
regscale axonius_v2 count

# Count devices with specific tags
regscale axonius_v2 count --tags "production,pci-scope"

# Count vulnerabilities
regscale axonius_v2 count --asset-type vulnerabilities

Sync Saved Queries

Sync assets and vulnerabilities using predefined saved queries from a YAML configuration file.

regscale axonius_v2 sync_saved_queries [OPTIONS]

Parameters:

ParameterRequiredDefaultDescription
--config-file, -cNoPath to saved query YAML config (reads axoniusSavedQueryConfig from init.yaml if omitted)
--offsetNo0Pagination offset
--limitNoMaximum records to process
--dry-runNofalseCount without syncing

Examples:

# Sync using config from init.yaml
regscale axonius_v2 sync_saved_queries

# Sync using external config file
regscale axonius_v2 sync_saved_queries --config-file /path/to/queries.yaml

# Preview counts
regscale axonius_v2 sync_saved_queries --dry-run

Saved Query Configuration Format

YAML config file:

- savedQueryName: "Production Servers"
  regscaleSspId: 42
  queryDescription: "All production server assets"
  type: "devices"

- savedQueryName: "Production Vulnerabilities"
  regscaleSspId: 42
  queryDescription: "Vulnerabilities on production servers"
  type: "vulnerabilities"

- savedQueryName: "DMZ Assets"
  regscaleSspId: 100
  type: "devices"

Or configure in init.yaml:

axoniusSavedQueryConfig:
  queryName: "RegScale Default Query"
  queryDescription: "Default query for asset retrieval"
  regscaleSspId: 42
  type: "devices"

Each entry maps a saved Axonius query to a specific RegScale Security Plan, allowing you to route different query results to different plans.


Sync Strategies

The Axonius V2 integration supports two sync strategies, controlled by the --mode option.

Hybrid Delta Strategy (Default)

Mode: --mode hybrid

The hybrid delta strategy performs incremental syncs after the initial full sync:

  1. First run: Full sync — fetches all matching records
  2. Subsequent runs: Delta sync — fetches only records with last_seen >= previous_sync_time

This dramatically reduces API calls and data transfer for large environments.

How it works:

  • After each successful sync, the timestamp is persisted to ./artifacts/axonius/axonius_v2_last_sync.json
  • On the next run, only records modified since that timestamp are fetched
  • State is tracked per Security Plan ID, so different plans can have independent sync schedules

State file example:

{
  "42": "2026-03-26T14:30:00.123456+00:00",
  "100": "2026-03-25T09:15:00.654321+00:00"
}

Saved Query Strategy

Mode: --mode saved-query

Uses predefined Axonius saved queries for precise control over which assets and vulnerabilities are synced. Always performs a full fetch (no incremental state tracking).

Best for:

  • Environments with complex filtering requirements
  • Multi-plan setups where different queries route to different Security Plans
  • Scenarios where Axonius admins maintain query definitions

Tag-Based Filtering

Filter synced data by Axonius tags using the --tags option. Tags are combined into an AQL (Axonius Query Language) filter:

# Single tag
regscale axonius_v2 sync_assets --regscale-ssp-id 42 --tags "production"

# Multiple tags (OR logic - matches any tag)
regscale axonius_v2 sync_assets --regscale-ssp-id 42 --tags "production,staging,development"

Generated AQL filter:

("specific_data.data.tags" in ["production", "staging", "development"])

When combined with incremental sync, both the tag filter and date filter are applied:

("specific_data.data.tags" in ["production"]) AND ("specific_data.data.last_seen" >= date("2026-03-25T14:30:00+00:00"))

Architecture

┌──────────────────────────────┐
│  regscale axonius_v2 <cmd>   │
└──────────────┬───────────────┘
               │
               v
┌──────────────────────────────┐
│   AxoniusV2ScannerIntegration│
│   (ScannerIntegration)       │
└──────────────┬───────────────┘
               │
       ┌───────┴───────┐
       v               v
┌─────────────┐  ┌──────────────┐
│   Hybrid    │  │  Saved Query │
│   Delta     │  │  Strategy    │
│  Strategy   │  │              │
└──────┬──────┘  └──────┬───────┘
       │                │
       v                v
┌──────────────────────────────┐
│      Axonius SDK Client      │
│  (httpx + tenacity retry)    │
└──────────────┬───────────────┘
               │
               v
┌──────────────────────────────┐
│     Axonius V2 API           │
│  - Assets (devices)          │
│  - Vulnerabilities           │
│  - Tags                      │
│  - Saved Queries             │
└──────────────────────────────┘
               │
               v
┌──────────────────────────────┐
│       Data Mappers           │
│  - Asset Mapper              │
│  - Finding Mapper            │
└──────────────┬───────────────┘
               │
               v
┌──────────────────────────────┐
│       RegScale API           │
│  - Assets                    │
│  - Vulnerabilities           │
│  - Issues                    │
└──────────────────────────────┘

Troubleshooting

IssueCauseSolution
AuthenticationError on syncInvalid API key or secretVerify axoniusApiKey and axoniusApiSecret in init.yaml
ConnectionError on syncCannot reach Axonius hostCheck axoniusUrl and network connectivity
SSL certificate errorsSelf-signed or internal certificatesSet axoniusVerifySsl: false (not recommended for production)
No assets returnedTags filter too restrictiveRun list_tags to verify tag names, or remove --tags
Saved query not foundQuery name mismatchVerify the saved query exists in Axonius with the exact name
Rate limit errors (429)Too many requestsThe SDK retries automatically with exponential backoff
Timeout on large environmentsDefault timeout too lowIncrease axoniusTimeout to 300 or higher
Stale incremental dataState file out of syncDelete ./artifacts/axonius/axonius_v2_last_sync.json to force full sync
Placeholder credential errorConfig still has default valuesReplace YOUR_AXONIUS_V2_API_KEY with actual credentials

Quick Start

# 1. Configure your Axonius credentials
regscale init
# Edit init.yaml with your Axonius URL, API key, and API secret

# 2. Verify connectivity by counting assets
regscale axonius_v2 count

# 3. List available tags (optional)
regscale axonius_v2 list_tags

# 4. Preview what will be synced
regscale axonius_v2 sync_all --regscale-ssp-id 42 --dry-run

# 5. Run the full sync
regscale axonius_v2 sync_all --regscale-ssp-id 42

# 6. Subsequent runs will only sync changes (incremental)
regscale axonius_v2 sync_all --regscale-ssp-id 42