🎁 GenAI x Sec Advent #9
Today I want to talk about two things: context in threat intelligence and LLM structured outputs.
What is the relation? Let me explain 🤔
🔍 Threat Intel is all about context—understanding an information and making it usable. Without context, most IOCs are just noise. Context tells us why an IP address is flagged, how a threat actor operates, and what actions to take next.
Threat intel reports are all about providing the context of why a specific indicator is malicious. However, most of the time, you have to dig through the report to understand the context of an IOC and why it is considered malicious.
This is where LLMs and structured outputs come in. 👇
👨💻 Structured Outputs is a feature that allow to keep the model consistently generates responses based on a supplied JSON Schema. This removes concerns about missing required keys or invalid values. We can define a structured JSON schema to extract the exact data we need from a report.
I built a basic example where I extract all kinds of IOCs from a threat report.
The output includes:
- Type of IOC
- Value of IOC
- Context of the IOC
- MITRE ID
- Recommended Action
You can find my code in my gist, along with the execution details below! 👇
➡️ Code: https://gist.github.com/fr0gger/3acd7d8235421c3ca12be2b2d0dfbc26
➡️ OpenAI Structured Output: https://platform.openai.com/docs/guides/structured-outputs
Of course, if you have a structured and consistent output, you can do whatever you want with it. But that is a topic for another day! 😉
#genai #threatIntel #llm #iocs #mitre #infosec #cybersecurity