Agent-based policies - Bulk Export API
Introduction
Using Bulk Export API, you can bulk export your Agent-Based Policy data using a GraphQL API. The data is returned in Parquet format and can be downloaded for use in your business intelligence tools.
To bulk export API data to Parquet files, complete the following:
- Choose the endpoint for your region.
- Initiate the generation of export files.
- Query the ID returned.
- Download the parquet files.
Authorization
Permissions
You require Platform Administrator permissions to carry out API Bulk Export.
Authorization is performed by passing your API user key via a single HTTP header: X-Api-Key
. The user key must be passed to all requests. This can be generated from the Insight Platform key management page. For information on generating and managing API keys, see Managing Platform API Keys.
Endpoints
Region | URI |
---|---|
United States - 1 | https://us.api.insight.rapid7.com/export/graphql |
United States - 2 | https://us2.api.insight.rapid7.com/export/graphql |
United States - 3 | https://us3.api.insight.rapid7.com/export/graphql |
Europe | https://eu.api.insight.rapid7.com/export/graphql |
Canada | https://ca.api.insight.rapid7.com/export/graphql |
Australia | https://au.api.insight.rapid7.com/export/graphql |
Japan | https://ap.api.insight.rapid7.com/export/graphql |
Initiating the export
Complete these steps to create and retrieve the export files in Parquet.
Step 1: Mutation to initiate export
The mutations initiate the generation of the export files for Policy and Vulnerability data, respectively:
Policy:
1mutation CreatePolicyExport {2createPolicyExport(input:{}) {3id4}5}
Step 2: Export query
To retrieve the URLs to download the Parquet files, you must query the ID returned when initiating the export. The results will return a URL where you can download the Parquet files.
Export considerations
The data is refreshed by the system once a day. You can make multiple export requests, however overuse of this method may result in throttling.
1query GetExport {2export(id: "YzY1ODk5YzQtNjkwNi00MDRjLTk3NDQtNjRhOGNkNWFkNDIx"){3id4status5dataset6timestamp7result {8prefix9urls10}11}12}13
Parquet files
These schemas provide an overview of the fields returned in the files at the URLs provided:
Agent-Based Policy Export
asset
Field | Type | Definition | Example |
---|---|---|---|
orgId | String | Organization ID | a08de390-bb6a-4297-b1df-9ee58c7beb7a |
assetId | String | Asset ID | 2b2b6a57-9136-4874-8af1-3f9f0a6de60a-default-asset-1 |
agentId | String | Agent ID | 586d68c92af55c27b7bfecf7f6df0cb4 |
awsInstanceId | String | The Amazon Web Services instance ID of the asset, if applicable | i-0e1cc483957bc29d8 |
azureResourceId | String | The Azure resource identifier of the asset, if applicable | |
gcpObjectId | String | The Google Cloud Platform identifier of the asset, if applicable | |
mac | String | The primary MAC address of the asset | 0050568A103C |
ip | String | The primary IP address of the asset | 0.0.0.0 |
hostName | String | The primary hostname of the asset | testhost.us |
osArchitecture | String | Architecture of the OS on the asset | x86_64 |
osFamily | String | Family of the OS on the asset | Windows |
osProduct | String | Product of the OS on the asset | Windows Server 2016 Standard Edition |
osVendor | String | Vendor of the OS on the asset | Microsoft |
osVersion | String | The OS version on the asset | 1607 |
osType | String | Type of OS on the asset | Server |
sites | List | Array of sites the asset belongs to | [site1, site2] |
asset_policy
Field | Type | Definition | Example |
---|---|---|---|
orgId | String | Organization ID |
|
assetId | String | Asset ID |
|
benchmarkNaturalId | String | The natural ID of the XCCDF benchmark |
|
profileNaturalId | String | The natural profile of the XCCDF benchmark |
|
benchmarkVersion | String | The version of the XCCDF benchmark |
|
ruleNaturalId | String | The natural ID of the XCCDF rule |
|
ruleTitle | String | The title of the XCCDF rule |
|
finalStatus | String | The final status of the rule finding, after applying overrides |
|
proof | String | Text describing how the status was determined |
|
lastAssessmentTimestamp | The last time the policy was assessed |
| |
benchmarkTitle | String | The title of the XCCDF benchmark |
|
profileTitle | String | The title of the XCCDF profile |
|
publisher | String | The publisher of the policy |
|
fixTexts | List | Data describing how to bring a target system into compliance with the rule |
|
rationales | List | Descriptive text giving rationale or motivations for abiding by the rule |
|
Downloading the Parquet files
- Each time URLs are generated to download the files, the URLs are valid for 15 minutes. The files can be downloaded as many times as needed within the 15 minute time frame.
- These files are retained for 30 days only. Attempting to query the exports after 30 days will return an error message.