Nucleus
[!NOTE]
This integration is currently in Beta and subject to change.
The regscale nucleus group has two separate sources of Nucleus data:
- API sync (
sync-assets,sync-findings) reads projects, assets and findings from the Nucleus API. - Explore import (
import-explore) reads Nucleus Explore exports (.xlsxor.csvfiles).
Use one source per plan. Each source has its own asset identity policy, so the asset identifiers differ. If you run both on one security plan, you get two sets of assets.
Commands
regscale nucleus test-connection
regscale nucleus sync-assets --regscale-ssp-id 123
regscale nucleus sync-findings --regscale-ssp-id 123 --project-id 30 --project-id 31
regscale nucleus sync-assets --regscale-ssp-id 123 --no-mop-up
regscale nucleus sync-findings --regscale-ssp-id 123 --no-mop-up --dry-run
regscale nucleus import-explore --folder-path ./explore --regscale-ssp-id 123
regscale nucleus import-explore --folder-path ./explore --component-id 456 --asset-tag-columns "Business Unit,Owner Group"
Every command also accepts the snake_case spelling of its name and options (for example sync_findings and --regscale_ssp_id).
test-connection
Counts the projects the API key can read and prints one line with the count. It prints no URL and no key.
sync-assets and sync-findings
| Option | Meaning |
|---|---|
--regscale-ssp-id (--ssp-id, -id) | Required. The RegScale security plan id. |
--project-id | A Nucleus project id. Repeat it for several. It wins over nucleus.project_ids. |
--dry-run | Fetch and map the data, but write nothing to RegScale. |
--offset, --limit | Process a slice of the data (used by job splitting). |
--mop-up / --no-mop-up | See "Mop-up". |
import-explore
| Option | Meaning |
|---|---|
--folder-path | Folder that holds the .xlsx and .csv exports. |
--s3-bucket, --s3-prefix, --aws-profile | Read the exports from S3 instead of a folder. |
--aws-access-key-id, --aws-secret-access-key, --aws-session-token | Static AWS credentials for the S3 read. They win over the profile and the default credential chain. |
--regscale-ssp-id, --component-id | The target security plan or component. |
--module, --parent-id | The same target, as a module name and an id. |
--scan-date | The scan date of the files. If you omit it, each finding takes the latest Asset Last Seen of its rows, else the import time. |
--mappings-path, --disable-mapping | Use a saved column mapping for the optional and tag columns, or switch mapping off. The five required columns (Asset Name, Finding Source, Finding Name, Severity, Finding Discovered) keep their Explore names: a file without one is refused. |
--upload-file | Upload the file to RegScale. The default is true. |
--asset-tag-columns | Comma-separated Explore columns to store as asset tags. |
--mop-up / --no-mop-up | See "Mop-up". |
Configuration
| Key | Environment variable |
|---|---|
nucleus.url | REGSCALE_NUCLEUS_URL |
nucleus.api_key | REGSCALE_NUCLEUS_API_KEY |
nucleus.page_size | REGSCALE_NUCLEUS_PAGE_SIZE |
nucleus.timeout | REGSCALE_NUCLEUS_TIMEOUT |
nucleus.max_retries | REGSCALE_NUCLEUS_MAX_RETRIES |
nucleus.project_ids | REGSCALE_NUCLEUS_PROJECT_IDS |
The API key can live in the platform secret store, like other sensitive keys. Use a secretstore:// reference or the store by name. Use an example host such as https://nucleus.example.test/nucleus/api/ for nucleus.url in documents.
Set every key in the nested nucleus block, or every key as a legacy flat key (for example nucleusUrl). If any flat nucleus* key is present, the whole nested block is ignored, and the keys you did not set flat take their defaults.
TLS comes from the top-level sslVerify and customCaCert settings. The API key never appears in output, logs or --help.
Mop-up
sync-findings: mop-up is on by default. It switches off automatically when a row was skipped, a project failed, or the vendor total does not match the rows received.sync-assets: asset mop-up is on by default for a complete run that names no projects. It retires theNucleusassets that the run did not see. Use--no-mop-up, or name the projects (--project-idornucleus.project_ids), to avoid it. It switches off in the same cases as for findings, and when no asset was read.- The scope of a run decides mop-up for both findings and assets. A run limited to some projects (
--project-idornucleus.project_ids) never mops up, so the findings and assets of other projects are never closed. A project that fails (HTTP 5xx or 429, a transport error, or a bad body) is skipped, counted as a partial failure, and switches mop-up off. Only a 401 stops the run. To close resolved findings, run once without a project filter. - An empty answer also switches mop-up off: no projects, no assets, or a project with no findings and no vendor total. Invalid dates are counted and logged once per run.
import-explore: mop-up is off by default. Each default import prints a framework warning.
Danger: do not use --mop-up with a filtered Explore export. A row that is missing from the file (a subset of the data) closes its finding.
Limits
- A finding keeps at most 50,000 asset identifiers (
maxAssetIdentifiersPerVulnerability, 0 means no cap). Above the cap, the handler keeps the first 50,000 identifiers in string (sorted) order and logs a warning that names the finding. - CSV files have no column types. Use
.xlsxabove 10,000 rows when a column changes type late. - Compliance results are not imported.
- A finding whose
epss_scoreis not a number (for example text such asabc) is skipped and counted, and mop-up is off for that run.
Failures and exit codes
Every runtime failure prints one line and exits with code 1. A usage error (a bad option value or a missing required option) exits with code 2. A partial failure exits with 0, or with 3 when REGSCALE_STRICT_EXIT_CODES=1.
Updated about 13 hours ago
