back to home

MISP / PyMISP

Python library using the MISP Rest API

482 stars
285 forks
108 issues
Python

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing MISP/PyMISP in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/MISP/PyMISP)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

PyMISP - Python Library to access MISP PyMISP is a Python library to access MISP platforms via their REST API. PyMISP allows you to fetch events, add or update events/attributes, add or update samples or search for attributes. Install from pip **It is strongly recommended to use a virtual environment** If you want to know more about virtual environments, python has you covered Only basic dependencies: And there are a few optional dependencies: • fileobjects: to create PE/ELF/Mach-o objects • openioc: to import files in OpenIOC format (not really maintained) • virustotal: to query VirusTotal and generate the appropriate objects • docs: to generate te documentation • pdfexport: to generate PDF reports out of MISP events • url: to generate URL objects out of URLs with Pyfaup • email: to generate MISP Email objects • brotli: to use the brotli compression when interacting with a MISP instance Example: Install the latest version from repo from development purposes **Note**: poetry is required; e.g., "pip3 install poetry" Running the tests If you have a MISP instance to test against, you can also run the live ones: **Note**: You need to update the key in to the automation key of your admin account. Samples and how to use PyMISP Various examples and samples scripts are in the examples/ directory. In the examples directory, you will need to change the keys.py.sample to enter your MISP url and API key. The API key of MISP is available in the Automation section of the MISP web interface. To test if your URL and API keys are correct, you can test with examples/last.py to fetch the events published in the last x amount of time (supported time indicators: days (d), hours (h) and minutes (m)). last.py Debugging You have two options here: • Pass to and it will enable logging.DEBUG to stderr on the whole module • Use the python logging module directly: Or if you want to write the debug output to a file instead of stderr: Test cases • The content of is tested on every commit • The test cases that require a running MISP instance can be run the following way: Documentation The documentation is available here. Jupyter notebook A series of Jupyter notebooks for PyMISP tutorial are available in the repository. Everything is a Mutable Mapping ... or at least everything that can be imported/exported from/to a json blob is the master class, and inherits from which means the class can be represented as a python dictionary. The abstraction assumes every property that should not be seen in the dictionary is prepended with a , or its name is added to the private list (accessible through and . This master class has helpers that make it easy to load, and export to, and from, a json string. , , , , and are subclasses of AbstractMISP, which mean that they can be handled as python dictionaries. MISP Objects Creating a new MISP object generator should be done using a pre-defined template and inherit . Your new MISPObject generator must generate attributes and add them as class properties using . When the object is sent to MISP, all the class properties will be exported to the JSON export. Installing PyMISP on a machine with no internet access This is done using poetry and you need to have this repository cloned on your machine. The commands below have to be run from inside the cloned directory. • From a machine with access to the internet, get the dependencies: • Prepare the PyMISP Package • Copy the content of to the machine with no internet access. • Install the packages: License PyMISP is distributed under an open source license. A simplified 2-BSD license.