Menu Icon
< back to main
 • 3 min read

Importing Pentest Analytics to Google Data Studio with the Cobalt API

Learn how to present your pentest data with Google Data Studio.

Importing Pentest Analytics to Google Data Studio with the Cobalt API
Michał Koźmiński
Michał Koźmiński

Michał Koźmiński is a staff engineer with a passion for developing software. He has experience building scalable systems, designing APIs and frameworks, as well as architecting secure solutions. But in his free time, he likes to dive, play guitar or just spend some quality time with family and friends.

Want to see the platform in action?
get a demoArrow Right
Want to see the platform in action?
get a demoArrow Right

Last time we talked about how to import data into Google spreadsheets. This time let’s focus on something more powerful — Google Data Studio — and learn how to build more sophisticated versions of the dashboard. To learn more about the Cobalt API and how to use it, please check the first article from this series here.

Why Google Data Studio?

Compared to Google Sheets, Google Data Studio allows you to perform a more detailed analysis. You will be able to create highly customizable reports ready to share with whoever you like to. However, the setup process looks a little different than our previous tutorial. For example, Google Data Studio requires us to define data sources. For this example I will show you how to export any data from Cobalt into a CSV file, which later can be used with Data Studio.

Data Preparations & Export

If you read the previous article, you probably already have your tokens prepared. If not, please check out the instructions I’ve listed there. After you have generated Auth Token, as well as Org Token, you can start following this tutorial.

Let’s start creating a format that can be imported into Google Data Studio. As already mentioned, the simplest way would be to create a CSV with all necessary fields. To create it we will use a simple Python script. This script will let us download all of the findings into a single CSV file.

I encourage you to play with the script and add scoping in case you want to download findings only from one asset or pentest.

Side Note: Always export only data necessary for your analysis. You can achieve this by adding a list of columns to the export function in line 40th. For example:

df.to_csv(OUT_FILE, encoding="utf-8", index=None, columns=['resource.title', 'resource.labels','resource.impact','resource.likelihood'])

Python Script for Cobalt API <> GDS integration

To run this script make sure you have Pandas installed which you can set up by running pip command in your console: pip install pandas

As soon as you run the script it will create the file findings.csv. You can then upload it to Google Data Studio as seen on the screenshot.

Cobalt API <> Google Data Studio CSV Import

Using data from findings.csv we can now create all widgets as visible from the screenshot below.

Cobalt API <> Google Data Studio Data Setup

I encourage you to experiment with different graph styles to find the visualizations that work best for you and your reporting needs. The end result might look like the this:

Cobalt API <> Google Data Studio Visualizations

As you can see, using the Cobalt API is really simple. With basic Python knowledge, you can parse and export your data to any tool you’re interested in.

As always if you have any questions or want to tell us about an interesting use case for the Cobalt API, please reach out to us at integrations@cobalt.io.

Pentest as a Service Demo

Modernizing Pentesting

Related Stories

Cobalt API: Import Your Findings to Google Sheets
Cobalt API: Import Your Findings to Google Sheets
Learn how to customize your pentest reports with Google Sheets.
Read moreArrow Right
Cobalt Launches Public API to Further Modernize Pentesting
Cobalt Launches Public API to Further Modernize Pentesting
Learn how our latest feature can give you more flexibility with your pentest data.
Read moreArrow Right
The State of Pentesting 2021: Common Vulnerabilities, Findings, and Why Teams Struggle With Remediation
The State of Pentesting 2021: Common Vulnerabilities, Findings, and Why Teams Struggle With Remediation
Each year, we publish The State of Pentesting report to provide a detailed overview of vulnerabilities and identify the trends and hazards that impact the cybersecurity community.
Read moreArrow Right
On-Demand, Streamlined, Interactive: SANS Reviews Our Pentest as a Service Platform
On-Demand, Streamlined, Interactive: SANS Reviews Our Pentest as a Service Platform
SANS instructor Matt Bromiley describes Cobalt's Pentest as a Service platform as "an information security experience unlike many others."
Read moreArrow Right

Never miss a story

Stay updated about Cobalt news as it happens