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 intelligence4 events on a MISP platform, including IOC management, feed integration, STIX export,5 and community sharing workflows. Use when working with performing threat intelligence6 sharing with misp.7domain: cybersecurity8subdomain: threat-intelligence9tags:10- misp11- pymisp12- threat-intelligence13- ioc-sharing14- stix15- taxii16- threat-feeds17- information-sharing18version: '1.0'19author: oyi7720license: Apache-2.021nist_csf:22- ID.RA-0123- ID.RA-0524- DE.CM-0125- DE.AE-0226category: cybersecurity27metadata:28 source: https://skillmd.com/skills/oyi77/performing-threat-intelligence-sharing-with-misp29---3031# Performing Threat Intelligence Sharing with MISP3233## Overview3435MISP (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.363738## When to Use39**Trigger phrases:**40- "performing threat intelligence sharing with misp"41- "Use PyMISP to create, enrich, and share threat intelligence events on a MISP pla"424344- When conducting security assessments that involve performing threat intelligence sharing with misp45- When following incident response procedures for related security events46- When performing scheduled security testing or auditing activities47- When validating security controls through hands-on testing4849## Prerequisites5051- MISP instance (v2.4+) with API access enabled52- Python 3.9+ with `pymisp` (`pip install pymisp`)53- MISP API key (Settings > Auth Keys)54- Understanding of MISP data model (Events, Attributes, Objects, Tags, Galaxies)55- Knowledge of TLP marking and sharing protocols5657## Steps5859```python60# Example: IOC detection61import re6263IOC_PATTERNS = {64 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",65 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",66 "hash_md5": r"\b[a-f0-9]{32}\b",67 "hash_sha256": r"\b[a-f0-9]{64}\b",68}6970def extract_iocs(text: str) -> dict:71 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}72```73741. Install PyMISP: `pip install pymisp`752. Initialize `ExpandedPyMISP(url, key, ssl=True)` connection763. Create a `MISPEvent` with info, distribution level, threat level, and analysis status774. Add attributes via `event.add_attribute(type, value)` for IPs, domains, hashes785. Apply TLP tags and MITRE ATT&CK technique tags796. Publish the event with `misp.publish(event)`807. Search existing events with `misp.search(controller='events', value=..., type_attribute=...)`818. Enable and configure threat feeds for automatic IOC ingestion829. Export events in STIX 2.1 format for cross-platform sharing8310. Validate sharing group configuration and sync server settings8485## Expected Output8687A 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.88## When NOT to Use8990- You don't have explicit written authorization to test91- Task is about defense/detection, not offense (use detection skills)92- You need to implement security controls (use implementing-* skills)93- Task requires compliance auditing (use auditing-* skills)94- You're investigating an incident (use incident response skills)95- Target is out of scope for your engagement96- Task is about vulnerability scanning only (use scanning tools)979899## Red Flags100101- Performing actions without explicit written authorization from the asset owner102- Testing against production systems without a defined scope and rules of engagement103- Acting on threat intelligence without validating source reliability104- Sharing classified or sensitive indicators without proper handling procedures105- Alerting threat actors to detection capabilities through visible response actions106107## Process1081091. **Design** — Define interface, identify patterns, plan implementation1101. **Implement** — Write code following existing conventions, add tests1111. **Verify** — Run tests, check integration, validate behavior112113## Verification114115- All steps executed successfully against a test environment before production use116- Output documented with screenshots or logs demonstrating expected behavior117- Results validated against known-good baselines or reference implementations118- Documentation complete enough for another analyst to reproduce findings119120## Anti-Rationalization Table121122| Rationalization | Reality |123|---|---|124| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |125| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |126| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |