Forum Discussion
Tenable Security Center connectivity from Power BI
Has anyone been able to connect Power BI to Tenable SC either via the API or another method? I currently export Tenable data to a csv and then import into Power BI. There must be an easier way.
7 Replies
- MohamedFowzan1Super User
Hi Rnaval
Are you using Tenable Security Center (on-prem) or Tenable.io
In either case, wouldn't the relevant REST API be the better option- RnavalPost Partisan
Security Center is on-prem
- Ritaf1983Super User
Hi Rnaval
Tenable Security Center provides a REST API, so you do not have to continue exporting CSV files manually. API-key authentication is supported using the `x-apikey` request header:
`x-apikey: accesskey=ACCESS_KEY; secretkey=SECRET_KEY;`
For vulnerability data, the usual endpoint is:
`POST https://<your-tenable-server>/rest/analysis`
The request can use a vulnerability query such as `listvuln`, and the results can be paged using `startOffset` and `endOffset`.
A simplified Power Query example would look like this:
```powerquery
let
BaseUrl = "https://your-tenable-server",RequestBody =
Json.FromValue(
[
type = "vuln",
sourceType = "cumulative",
startOffset = 0,
endOffset = 1000,
query = [
type = "vuln",
tool = "listvuln",
filters = {}
]
]
),Response =
Json.Document(
Web.Contents(
BaseUrl,
[
RelativePath = "rest/analysis",
Headers = [
#"x-apikey" =
"accesskey=YOUR_ACCESS_KEY; secretkey=YOUR_SECRET_KEY;",
#"Content-Type" = "application/json"
],
Content = RequestBody
]
)
),Results = Response[response][results],
Output = Table.FromRecords(Results)
in
Output
```Because this is a POST request with a custom authentication header, configure the Power BI Web data source as **Anonymous**; the API authentication is supplied by the header. Power Query supports POST requests through `Web.Contents`, although POST requests can only use the Anonymous credential mode.
A few important considerations:
* Do not leave production API keys hard-coded inside a PBIX file.
* Add pagination, because one request will probably not return the complete vulnerability dataset.
* If Tenable Security Center is hosted inside your network, scheduled refresh in Power BI Service will require an on-premises data gateway with network access to the Tenable server.
* The gateway machine must trust the Tenable HTTPS certificate.
* For a large environment, the more reliable architecture is a scheduled API extraction into SQL, a lakehouse, or another staging layer, and then connect Power BI to that storage. Direct API access from Power BI is reasonable for a proof of concept, but it can become slow and difficult to maintain at scale.Therefore, yes—the API is the alternative to CSV. I would first test `/rest/currentUser` to verify the API keys, then build the required `/rest/analysis` query and pagination.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- RnavalPost Partisan
Thank you, I will go thru this in detail.
- RnavalPost Partisan
Hi Rita,
Could you please take me thru step by step in using power query to connect to tenable security center? I've setup a new data source in power query and used the web connection to security center - https://tensc01bwytap.nyct.com
- However, I can only see the following, see screenshot below. I am not that technical so I don't quite follow when or where I would use the code you pasted in your response.
Thanks...Rohit
- v-aatheequeCommunity Support
Hi Rnaval
I'd recommend starting with the official Microsoft guide for the supported approach: Tenable data connector documentation.
Useful links : https://docs.tenable.com/security-center/api/Hope this helps !!