Skip to content
Notifications
Clear all

Sharing my Python script for enriching tickets with Intel context.

2 Posts
2 Users
0 Reactions
3 Views
(@procurement_cynic_ray)
Eminent Member
Joined: 4 months ago
Posts: 9
Topic starter   [#1552]

Finally caved and wrote a script to actually *use* CrowdStrike Intel in our workflow. Because, shockingly, having a billion-dollar threat intel platform doesn't magically make context appear in Jira. Who knew?

The premise is simple: take new ticket IOCs or threat actor names, ping the CrowdStrike API, and dump a summary back into the ticket description. It's the automation their sales team implied would be "easy with our robust API" but somehow never materializes in a usable form. The docs are, charitably, a labyrinth of marketing-speak.

Here's the core of it. You'll need the `falconpy` SDK. This isn't a full solution—you need to handle your own ticketing system API and error checking, because I'm not your free consultant.

```python
import json
from falconpy import Intel

def enrich_with_crowdstrike(ioc_value, ioc_type="domain"):
client = Intel(client_id='YOUR_ID', client_secret='YOUR_SECRET')

# First, get the indicator ID
indicator_response = client.get_indicator_entities(ids=[ioc_value], type=ioc_type)
if not indicator_response['body']['resources']:
return f"No CrowdStrike Intel found for {ioc_value}"

indicator_id = indicator_response['body']['resources'][0]['id']

# Get report details linked to this indicator
report_response = client.get_intel_report_entities(ids=[indicator_id])

summary = f"**CrowdStrike Intel Context for {ioc_value}:**n"
if report_response['body']['resources']:
for report in report_response['body']['resources'][:3]: # Limit to 3 reports
summary += f"- {report['name']}: {report['description'][:200]}...n"
summary += f" Actors: {', '.join(report.get('actors', []))}n"
summary += f" Malware families: {', '.join(report.get('malware_families', []))}n"
else:
summary += "No detailed reports available.n"

return summary
```

The output gets slapped into our ticketing system. It's not pretty, but it saves the analysts from tabbing over to the Falcon portal and doing six clicks for a basic summary. Of course, the API rate limits are laughably low for any real volume, so prepare for that "enterprise-grade" throttling.

Biggest pitfall? The indicator-to-report mapping feels arbitrary half the time. And good luck getting consistent actor or malware family tags. You'll see.


null


   
Quote
(@Anonymous 176)
Joined: 1 week ago
Posts: 12
 

The intent is good, but that code snippet is going to explode the second it runs. You're passing the IOC value as the `ids` parameter to `get_indicator_entities`. That method expects an *indicator ID* (a UUID), not the IOC value. You need to query indicators using the search endpoint first.

The falconpy pattern you actually want is something like:
```python
query_result = client.query_indicator_entities(filter=f"value:'{ioc_value}'")
if query_result['body']['resources']:
indicator_id = query_result['body']['resources'][0]
# Then get_indicator_entities with that ID
```
Otherwise, nice to see someone else trying to operationalize the thing we actually paid for. The docs really are a maze.



   
ReplyQuote