Topic
This article discusses how to set up automation for the Vulnerability Import process in NinjaOne.
Environment
NinjaOne Endpoint Management
Description
Vulnerability management for networks and systems is an ongoing process that requires continuous attention and adaptation to emerging threats and vulnerabilities. In an effort to support customers in this process, we created a series of APIs to meet your needs for automating the vulnerability import process.
The Vulnerability Import API
The API allows you to:
- Get a list of existing scan groups.
- Import comma-separated values (CSV) to an existing scan group.
- Check the status of a CSV import.
While each vulnerability tool exports Common Vulnerabilities and Exposures (CVE) or endpoint results slightly differently, nearly all allow export to CSV with a machine identifier (hostname, IP address, or operating system address) and a CVE identification (ID) number. This set of Application Programming Interfaces (APIs) will enable you to import from any third-party tools that support CSV export.
To accelerate the adoption of automation capability, we provide sample PowerShell functions and a sample script in our Custom Script: Vulnerability Importer article. The following sample functions exist in the script, and you can use them in other, more custom scripts:
- Get-NinjaToken
- Get-BaseSettings
- Get-VulScanGroups
- New-VulScanImport
In the sample PowerShell script, you can use these functions to check a shared or local folder for new Vulnerability Export CSV files, import to NinjaOne, check the status until complete, and write logs.
Note that you must perform the initial creation and import of a scan group inside NinjaOne to leverage the scan group later via API. Refer to Vulnerability Management in NinjaOne: Import Scan Data to learn more.
Description Script Variable Example
| Function name | Script variable | Example |
|---|---|---|
| NinjaOne environment URL | $BaseURL | ca.ninjarmm.com |
| Folder path | $PathtoCSV | "C:vulndata" or "\servernamevuln" |
| CSV file naming convention | $CSVName | $CSVName "VulnExport_" |
| Scan Group ID | $ScanGroupID | 2 |
Additional Resources
To create or download your own vulnerability importer script, refer to our Custom Script: Vulnerability Importer article.