Skip to content
Notifications
Clear all

Just built a CLI tool to export findings to CSV.

4 Posts
4 Users
0 Reactions
1 Views
(@cloud_watcher_99)
Reputable Member
Joined: 2 months ago
Posts: 278
Topic starter   [#22678]

Hey everyone, been diving deep into Orca Security for the past few months for our containerized workloads on AWS. Really liking the posture management and the way it normalizes findings across accounts.

But I kept hitting a wall when I needed to share filtered findings with our finance team for their cloud cost/risk analysis, or even just to do some bulk manipulation outside the UI. The API is powerful, but I needed a quicker way to get a snapshot of, say, all high-severity issues in a specific AWS region into a spreadsheet.

So I spent a weekend and built a simple CLI tool in Python. It uses the Orca API to fetch findings based on a few filters you can set (like severity, asset type, cloud account) and exports them directly to a CSV. It's been a game-changer for our weekly FinOps sync-ups.

Here's the basic usage. You'll need an API key from Orca set as an environment variable (`ORCA_API_KEY`).

```python
# orca_export.py - simplified version
import requests
import csv
import os
import sys

BASE_URL = "https://api.orcasecurity.io/api"
HEADERS = {"Authorization": f"Bearer {os.environ.get('ORCA_API_KEY')}"}

def fetch_findings(severity="high", asset_type="aws_ec2"):
params = {"severity": severity, "asset_type": asset_type}
response = requests.get(f"{BASE_URL}/findings", headers=HEADERS, params=params)
return response.json().get('data', [])

def write_to_csv(findings, filename="orca_findings.csv"):
if not findings:
print("No findings to export.")
return
fieldnames = findings[0].keys()
with open(filename, 'w', newline='') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
writer.writerows(findings)

if __name__ == "__main__":
findings_data = fetch_findings(severity=sys.argv[1] if len(sys.argv) > 1 else "high")
write_to_csv(findings_data)
print(f"Exported {len(findings_data)} findings.")
```

Run it with `python orca_export.py medium` to get all medium findings, for example. The full version I'm using has more filters for cloud account IDs and date ranges.

Has anyone else built similar tooling around Orca's data? I'm thinking of adding a feature to map findings to estimated cost implications (like unattached EBS volumes or over-provisioned RDS instances). Would love to compare notes or hear about other workflows people have set up.


cost first, then scale


   
Quote
(@clarak2)
Eminent Member
Joined: 2 weeks ago
Posts: 41
 

Nice! That CSV export sounds super handy for automating those reports. I've run into the same issue with other security tools where the dashboard is great for viewing, but pulling data for a wider team is a pain.

Have you thought about adding a timestamp column by default? We often need to track remediation progress over time, so we automatically append a snapshot date to the filename and inside the CSV. Makes it easier to compare week over week.


Docs save time


   
ReplyQuote
(@alexgarcia)
Estimable Member
Joined: 2 weeks ago
Posts: 156
 

Nice solution for bridging that gap. We often hit a similar wall between security dashboards and business reporting needs. The timestamp suggestion from user1371 is a good one, we ended up needing a `first_detected` field in ours as well for tracking aging issues.

You might consider adding a simple filter for the finding status, like `open` vs. `in_progress`. Finance usually wants to see the unresolved exposure, but our DevOps team needs the in-progress items for their sprint planning. Could save you a manual filter step later.



   
ReplyQuote
(@infra_architect_rebel)
Reputable Member
Joined: 3 months ago
Posts: 203
 

Timestamp columns are a band-aid. Why are you tracking progress in a CSV snapshot instead of forcing the vendor's dashboard to do it?

You're solving the wrong problem. You shouldn't need to write scripts to get basic historical views. That's the tool's job. You're just automating their failure.


Simplicity is the ultimate sophistication


   
ReplyQuote