Rapid7 API to Power BI: Secure Reporting Automation
Automated the reporting pipeline from the Rapid7 InsightIDR REST API through PowerShell and AD/LDAP enrichment to shared CSV datasets used in Power BI, with scheduled execution and a Windows DPAPI-encrypted API secret.
Implemented in production
A colleague uses Power BI reports fed by scheduled CSV exports, replacing manual file handover while protecting the stored API key.
The task
Preparing recurring Power BI security reports required running separate export and enrichment scripts, cleaning CSV data and manually handing files to the report owner. The workflow also needed to keep API credentials out of script source and shared reporting files.
My contribution
Developed an orchestration workflow around the existing Rapid7 API reporting scripts, automated data preparation and publication, configured scheduled execution, and replaced hardcoded API credentials with an encrypted local secret loaded at runtime. A colleague successfully uses the resulting reporting workflow in production.
Implementation
- Orchestrated Rapid7 InsightIDR REST API extraction, account enrichment through Active Directory/LDAP, investigation-priority enrichment, CSV post-processing and publication as a repeatable PowerShell pipeline.
- Produced separate alert-level and investigation-level CSV outputs, including investigation alert counts, for downstream Power BI reporting. Configurable reporting windows support recurring exports.
- Automated CSV preparation, including cleanup of duplicate enrichment columns, to replace the previous manual file-preparation and handover steps.
- Configured Windows Task Scheduler to run the pipeline daily and publish reporting outputs through the OneDrive-synchronised SharePoint location used by the report owner. Power BI consumes the shared CSV datasets rather than requiring the colleague to run the Rapid7 scripts.
- Removed hardcoded API keys from the export and priority-enrichment scripts. Stored the API secret in a local Windows DPAPI-encrypted file outside the shared reporting location and loaded it with ConvertTo-SecureString under the execution account, retrieving the credential only at runtime for API authentication.
- Validated secret decryption and pipeline execution, checked refreshed CSV outputs, and documented setup and operation. The report owner successfully uses the workflow, as confirmed by the project owner.
Result
Implemented in production and successfully used by a colleague. Scheduled, enriched CSV outputs support Power BI reporting without the earlier manual CSV handover, while the API secret is protected at rest with Windows DPAPI and kept separate from script source and shared report datasets.
Project scope
The deployed pipeline uses Windows Task Scheduler and OneDrive/SharePoint synchronisation on a Windows computer. Execution depends on the configured Windows account/session, API and directory access, and successful file synchronisation. DPAPI protects the stored secret; it must still be decrypted for API authentication. An always-on VM, service-account migration and direct Microsoft Graph publication were considered as future work and are not claimed as deployed. No measured time-saving or availability figures are asserted.