Performing Threat Intelligence Sharing with MISP
Overview
MISP (Malware Information Sharing Platform) is an open-source threat intelligence platform designed for collecting, storing, distributing, and sharing cybersecurity indicators and threat information. PyMISP is the official Python library for interacting with MISP instances via the REST API, enabling programmatic event creation, attribute management, tag assignment, galaxy cluster attachment, and feed synchronization. This skill covers using PyMISP to create events with structured IOCs (IP addresses, domains, file hashes, URLs), enrich events with MITRE ATT&CK tags, manage sharing groups and distribution levels, search for existing intelligence, and export in STIX 2.1 format for interoperability with other platforms.
When to Use
Trigger phrases:
"performing threat intelligence sharing with misp"
"Use PyMISP to create, enrich, and share threat intelligence events on a MISP pla"
When conducting security assessments that involve performing threat intelligence sharing with misp
When following incident response procedures for related security events
When performing scheduled security testing or auditing activities
When validating security controls through hands-on testing
Prerequisites
- MISP instance (v2.4+) with API access enabled
- Python 3.9+ with
pymisp (pip install pymisp)
- MISP API key (Settings > Auth Keys)
- Understanding of MISP data model (Events, Attributes, Objects, Tags, Galaxies)
- Knowledge of TLP marking and sharing protocols
Steps
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Install PyMISP:
pip install pymisp
- Initialize
ExpandedPyMISP(url, key, ssl=True) connection
- Create a
MISPEvent with info, distribution level, threat level, and analysis status
- Add attributes via
event.add_attribute(type, value) for IPs, domains, hashes
- Apply TLP tags and MITRE ATT&CK technique tags
- Publish the event with
misp.publish(event)
- Search existing events with
misp.search(controller='events', value=..., type_attribute=...)
- Enable and configure threat feeds for automatic IOC ingestion
- Export events in STIX 2.1 format for cross-platform sharing
- Validate sharing group configuration and sync server settings
Expected Output
A JSON report summarizing events created, attributes added, tags applied, feed sync status, and any correlation hits against existing intelligence, with event IDs and distribution metadata.
When NOT to Use
- You don't have explicit written authorization to test
- Task is about defense/detection, not offense (use detection skills)
- You need to implement security controls (use implementing-* skills)
- Task requires compliance auditing (use auditing-* skills)
- You're investigating an incident (use incident response skills)
- Target is out of scope for your engagement
- Task is about vulnerability scanning only (use scanning tools)
Red Flags
- Performing actions without explicit written authorization from the asset owner
- Testing against production systems without a defined scope and rules of engagement
- Acting on threat intelligence without validating source reliability
- Sharing classified or sensitive indicators without proper handling procedures
- Alerting threat actors to detection capabilities through visible response actions
Process
- Design — Define interface, identify patterns, plan implementation
- Implement — Write code following existing conventions, add tests
- Verify — Run tests, check integration, validate behavior
Verification
- All steps executed successfully against a test environment before production use
- Output documented with screenshots or logs demonstrating expected behavior
- Results validated against known-good baselines or reference implementations
- Documentation complete enough for another analyst to reproduce findings
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: performing-threat-intelligence-sharing-with-misp3description: Use when use PyMISP to create, enrich, and share threat intelligence events on a MISP platform, including IOC management, feed integration, STIX export, and community sharing workflows. Use when working with performing threat intelligence sharing with misp.4license: Apache-2.05---67# Performing Threat Intelligence Sharing with MISP89## Overview1011MISP (Malware Information Sharing Platform) is an open-source threat intelligence platform designed for collecting, storing, distributing, and sharing cybersecurity indicators and threat information. PyMISP is the official Python library for interacting with MISP instances via the REST API, enabling programmatic event creation, attribute management, tag assignment, galaxy cluster attachment, and feed synchronization. This skill covers using PyMISP to create events with structured IOCs (IP addresses, domains, file hashes, URLs), enrich events with MITRE ATT&CK tags, manage sharing groups and distribution levels, search for existing intelligence, and export in STIX 2.1 format for interoperability with other platforms.121314## When to Use15**Trigger phrases:**16- "performing threat intelligence sharing with misp"17- "Use PyMISP to create, enrich, and share threat intelligence events on a MISP pla"181920- When conducting security assessments that involve performing threat intelligence sharing with misp21- When following incident response procedures for related security events22- When performing scheduled security testing or auditing activities23- When validating security controls through hands-on testing2425## Prerequisites2627- MISP instance (v2.4+) with API access enabled28- Python 3.9+ with `pymisp` (`pip install pymisp`)29- MISP API key (Settings > Auth Keys)30- Understanding of MISP data model (Events, Attributes, Objects, Tags, Galaxies)31- Knowledge of TLP marking and sharing protocols3233## Steps3435```python36# Example: IOC detection37import re3839IOC_PATTERNS = {40 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",41 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",42 "hash_md5": r"\b[a-f0-9]{32}\b",43 "hash_sha256": r"\b[a-f0-9]{64}\b",44}4546def extract_iocs(text: str) -> dict:47 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}48```49501. Install PyMISP: `pip install pymisp`512. Initialize `ExpandedPyMISP(url, key, ssl=True)` connection523. Create a `MISPEvent` with info, distribution level, threat level, and analysis status534. Add attributes via `event.add_attribute(type, value)` for IPs, domains, hashes545. Apply TLP tags and MITRE ATT&CK technique tags556. Publish the event with `misp.publish(event)`567. Search existing events with `misp.search(controller='events', value=..., type_attribute=...)`578. Enable and configure threat feeds for automatic IOC ingestion589. Export events in STIX 2.1 format for cross-platform sharing5910. Validate sharing group configuration and sync server settings6061## Expected Output6263A JSON report summarizing events created, attributes added, tags applied, feed sync status, and any correlation hits against existing intelligence, with event IDs and distribution metadata.64## When NOT to Use6566- You don't have explicit written authorization to test67- Task is about defense/detection, not offense (use detection skills)68- You need to implement security controls (use implementing-* skills)69- Task requires compliance auditing (use auditing-* skills)70- You're investigating an incident (use incident response skills)71- Target is out of scope for your engagement72- Task is about vulnerability scanning only (use scanning tools)737475## Red Flags7677- Performing actions without explicit written authorization from the asset owner78- Testing against production systems without a defined scope and rules of engagement79- Acting on threat intelligence without validating source reliability80- Sharing classified or sensitive indicators without proper handling procedures81- Alerting threat actors to detection capabilities through visible response actions8283## Process84851. **Design** — Define interface, identify patterns, plan implementation861. **Implement** — Write code following existing conventions, add tests871. **Verify** — Run tests, check integration, validate behavior8889## Verification9091- All steps executed successfully against a test environment before production use92- Output documented with screenshots or logs demonstrating expected behavior93- Results validated against known-good baselines or reference implementations94- Documentation complete enough for another analyst to reproduce findings9596## Anti-Rationalization Table9798| Rationalization | Reality |99|---|---|100| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |101| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |102| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |