Why MISP's Python dependencies must move with every release
An administrator who upgraded MISP and now sees failed imports, failed exports or PyMISP calls that error out is often looking at a Python problem, not a MISP problem. MISP runs PyMISP from a Python 3 virtualenv, and that environment must match the PHP release it sits beside. The two halves are versioned together, so an upgrade that moves the PHP code forward while the virtualenv stays behind creates a mismatch that the web interface may not report on day one.
PyMISP is the official Python library for the MISP API, and MISP uses it for work the PHP layer does not do itself, including some format conversions and scripted interactions. misp-stix is the companion library that handles conversion between MISP events and STIX formats. Both are pinned in the virtualenv, and both can drift. The requirements page in the MISP user guide pinned PyMISP to version 2.5.34.1 at the time of writing, so the pin you should compare against is the one in the requirements page for your own release, not that number. Confirm the current pin before you change anything. MISP user guide: Requirements is the place to check it.
Version drift is easy to miss because misp-modules are optional. An instance that does not use the modules may never exercise the code paths that break, so the first symptom appears weeks later during a scheduled export or an automated import. Treat the virtualenv as part of the upgrade change record: note the PyMISP and misp-stix versions before and after, and run a small export and import test on a non-production copy. Ask your installer or partner to confirm which Python packages their release expects, so the check is based on your version and not on memory.
How the PHP application, virtualenv and optional services connect
The diagram starts at the MISP PHP application, which hands work to the Python virtualenv holding PyMISP and misp-stix for API and format tasks. The application also reads and writes the database and Redis, which sit beside it on the same host or service layer. misp-modules is optional and only reached when enabled. Before an update, check that the PHP code and the virtualenv come from the same release, since mismatched versions are a common cause of import and export failures.
Components whose versions must match after each MISP release.
Which update approach fits your installation method
This table compares four ways to bring MISP's Python virtualenv, PyMISP and misp-stix in line with the PHP code after an update. Read each row against the way your instance was originally installed, because that choice decides who controls the Python versions. The main takeaway is that the installer, image, configuration role and manual build can each leave a different set of packages behind, so confirm what each one pins before you assume the update covered them.
| Approach | Who controls Python versions | Main risk and what to verify afterward |
|---|---|---|
| Project installer or upgrade script | The installer sets the virtualenv and package versions it targets. Confirm the pinned PyMISP version for your release in the requirements guide. | Upgrade script may skip packages you installed by hand. Verify the PyMISP import works and the diagnostics page reports no Python errors. |
| Rebuilt Docker image | The image maintainer chooses the base Python and bundled PyMISP. Confirm the image tag and its pinned dependency versions before you deploy. | Stale images keep old PyMISP and misp-stix versions. Verify the running container matches the release you intended and that imports and exports complete. |
| Ansible or Puppet role | The role's variables and defaults set Python packages and the MISP version. Check which variables pin the virtualenv and PyMISP and whether they are overridden. | Role updates can change package versions across many hosts at once. Verify each host's virtualenv, run a test import and export, and review the role changelog. |
| RPM package | The package spec determines the Python dependencies installed. Confirm which PyMISP version the package ships and whether it is isolated from the system Python. | System Python updates can break a packaged virtualenv. Verify the MISP and PyMISP versions reported after each OS patch cycle. |
| Manually built virtualenv | You choose every Python and package version. Record the requirements file and the PyMISP version used for each release. | Missed packages or skipped pins cause import and export failures. Verify with a PyMISP test call, a sample export and a review of worker logs. |
What to check first, by how MISP was installed
The official installer builds the Python virtualenv for MISP, so the first question is whether that virtualenv is still the one the web application uses. A code update that moves MISP forward does not refresh PyMISP on its own, which is how the PHP code and the Python library drift apart. The MISP requirements page pins PyMISP to 2.5.34.1 at the time of writing, so use that as the reference point.
- Installed PyMISP version: Activate the virtualenv the installer created and run
pip show pymisp. Compare the result with 2.5.34.1. - Virtualenv ownership: Confirm that the web server user can read the virtualenv and that the path in the MISP configuration points to the same environment you checked.
- Post-update step: Confirm whether your upgrade runbook includes a dependency refresh or only a code pull.
- Most likely failure: A newer MISP code path calls a PyMISP function that the installed package lacks, so one import or export format fails while others still work.
Check the installed version before you investigate an import or export error, because a version mismatch is the cheapest cause to rule out.
In a Docker deployment, the image carries its own Python environment, so the first question is which PyMISP version the image ships with and whether anything on the host overrides it. Container images are replaced as a unit, which means a fix made inside a running container disappears when the container is recreated. Confirm the image tag, the compose file and any volume mounts before you change anything.
- Image tag and release: Confirm that the image tag matches the MISP release you are running and that the PyMISP version inside the image matches the 2.5.34.1 pin on the requirements page for the release you target.
- Host-side overrides: Check whether the compose file or a startup script installs or upgrades PyMISP at container start.
- Persistent volumes: Check whether a mounted volume holds a Python environment from an earlier image, which can shadow the packages in the new image.
- Most likely failure: The image tag was advanced while an old volume kept a previous virtualenv, so the application loads an older PyMISP than the one the image was built to use.
When you troubleshoot, compare the version inside the running container with the version the image tag documents, since the two should agree after a clean recreate.
Configuration management tools record the desired state of the host, so the first question is where the PyMISP version is set and who controls that setting. The MISP code and the Python packages are often updated by different parts of the same playbook or manifest, which can leave them out of step. Find the variable or parameter that sets the PyMISP version and the path of the virtualenv before you run the role again.
- Pinned version source: Identify the role default, inventory variable or module parameter that sets PyMISP, and compare it with the 2.5.34.1 pin on the requirements page for your target release.
- Virtualenv path ownership: Confirm which role or module creates the virtualenv and which one manages the MISP checkout, and make sure both refer to the same path.
- Idempotence behavior: Confirm whether the task only checks that the package exists or actually enforces a version. A check for presence skips the upgrade on later runs.
- Most likely failure: The MISP checkout moves to a new tag, but the dependency task sees an installed package and reports no change, so the PyMISP version stays behind.
Before you rerun a change, read the role or manifest and confirm which task owns the PyMISP version, since a successful playbook run does not prove that the package was upgraded.
RPM-based installs and hand-built instances often mix operating system packages with Python packages installed by pip, which creates more than one place where PyMISP can live. The first question is which Python interpreter the web application calls for MISP tasks and which site-packages directory that interpreter reads. The MISP documentation on the requirements page describes a virtualenv for PyMISP, so compare your build against that model.
- Interpreter in use: Confirm which Python binary the PHP worker and background jobs invoke, and check that it is the interpreter where PyMISP is installed.
- Operating system packages: Check whether a system package also provides PyMISP or a dependency it needs. Operating system updates can change those packages without a MISP change.
- Hand-built virtualenv drift: Confirm that the virtualenv was created from the MISP requirements file and has not been changed by ad hoc pip installs.
- Most likely failure: Two Python environments exist, and the web application imports the older one, so a fix applied with pip in the other environment has no effect.
Before you change any package, identify the interpreter the application actually runs, because the version you see in a shell may differ from the one MISP calls.
How to update the virtualenv after a MISP upgrade
This sequence brings the MISP Python virtualenv, PyMISP and misp-stix back into step with the PHP code after an upgrade, with a check at each stage and a rollback path if imports or exports fail. It is written so the database and Python changes land in one planned window.
Record the current Python package versions
Before touching anything, the administrator activates the MISP virtualenv and lists the installed PyMISP and misp-stix versions with pip, then records the MISP version shown in the web interface and the Git tag or commit of the checkout. Keep this record with the change ticket. Done means you have a written baseline of the current MISP release, PyMISP and misp-stix versions that you can compare against later and restore to if needed.
Confirm target versions from release notes
Read the release notes for the target MISP release on the project's GitHub releases page, and check the requirements page in the MISP user guide for the Python dependency expectations. Write down the required PyMISP and misp-stix versions for the target release. Note that MISP 2.5.47 introduced a new database migration system with PostgreSQL support, so if your upgrade crosses that release, the database changes and the Python changes must be planned in the same window. Done means you have a target version list approved by the person who owns the change.
Back up the database and the virtualenv
Take a verified database dump and a copy of the virtualenv directory and the MISP configuration files before any update runs. Store them outside the MISP host. Confirm the dump restores on a scratch system if your process allows it. Done means the backup files exist, their sizes look plausible, and the restore procedure has been written down for the rollback step.
Update the dependencies inside the virtualenv
With the virtualenv active, run pip against the MISP requirements file for the target release, and install the PyMISP and misp-stix versions from your target list where the requirements file does not pin them. Run the installation as the service account MISP uses, not as root, so file ownership stays correct. Done means pip completes without resolver errors, and the installed versions match the target list.
Verify installed versions against the target list
Run pip list or pip show for PyMISP and misp-stix and compare the output line by line with the target list from the second step. Also run a pip check to confirm there are no conflicting dependencies. Any mismatch should be resolved before services restart. Done means every package matches the approved list and pip check reports no broken requirements.
Restart the services that call Python
Restart the processes that load the virtualenv so they pick up the new packages. This normally includes the background job workers and any scheduled tasks, and misp-modules if it uses the same Python environment on your host. Check the worker status and the worker logs for import errors immediately after the restart. Done means every Python-dependent service is running and its log shows no import or traceback messages.
Run test imports and exports
Using a test API key on a non-production or dedicated test event, run a small PyMISP script that creates or fetches an event, adds an attribute, and exports the event in MISP JSON and STIX formats through the export path. Compare the output with the expected structure. Done means the test import and export complete without errors, and the exported STIX output validates in your usual tooling.
Keep the rollback path ready until sign-off
If imports, exports or workers fail, restore the saved virtualenv copy, reinstall the baseline PyMISP and misp-stix versions from the first step, restart the services, and rerun the test import. If the failure is in the database migration, follow the restore procedure you wrote during the backup step. Keep the backups until the change owner signs off that the test passes and production traffic behaves normally. Done means either the target versions are confirmed working or the baseline is restored and the failure is documented.
Symptoms that point to a version mismatch
After a MISP upgrade, the PHP code and the Python packages it calls can drift apart in ways that surface as failures in different places. The symptoms below look unrelated at first, but each one points the administrator toward the same first checks: which versions are installed, which virtualenv the application actually uses, and what the job log says.
Failed PyMISP calls after upgrade
Scripts, sync helpers or automation that worked before an upgrade now raise errors on simple calls such as searching events or adding attributes. Start by confirming the installed PyMISP version in the virtualenv your scripts use, then compare it with the version the MISP requirements page pins for the release you are running. Note the exact exception text, since a missing method and a changed response format point to different causes.
Requirements pageSTIX exports that error or come out empty
An export to STIX that throws an exception or writes a zero-byte file after an upgrade often depends on the Python libraries that build STIX output. Check the installed misp-stix version and confirm that the export job runs under the same interpreter as the web application. Then run one export from the command line and compare the result with a known good event.
Imports that fail only for certain formats
When a single import format fails while JSON imports succeed, the parser for that format is the likely suspect. Confirm which module handles the format, check its version against the rest of the Python stack, and reproduce the import with a small sample file. A failure limited to one format narrows the search far more than a general error across all imports.
Errors that appear only in background jobs
Some tasks run without problems from the web interface but fail when the background workers pick them up. This often means the workers run under a different Python path, an older environment, or a Supervisor configuration that still points at a previous install. Compare the interpreter path in the worker configuration with the virtualenv you updated, and read the job log for the first traceback rather than the last one.
Import errors after a Python change
A message such as a module that cannot be found, or a function that is missing from a package, usually means the virtualenv is incomplete or the package set was partly updated. Check that the packages listed in the MISP requirements are installed in the environment MISP uses, and confirm the Python version is the one the release supports. Reinstalling into a clean environment is often quicker than patching a damaged one.
How to tell a dependency problem from a data problem
Start by confirming which Python interpreter and virtualenv the failing process actually uses. A web request, a background job and a shell session can each resolve python3 differently, so a library that works in your terminal may be missing from the process that failed. Check the interpreter path the failing component invokes, then list the installed PyMISP and misp-stix versions inside that same virtualenv. Only after that comparison should you look at the MISP event itself. Then compare those versions with the targets in the release notes and the requirements page, which list the expected PyMISP version for each MISP release. Confirm the targets there for your release rather than relying on a version remembered from an earlier upgrade.
Next, reproduce the failure with one event in a test call. Choose an event that fails, run the export or import for that single event from the same virtualenv, and capture the full traceback instead of the summary in the web interface. If the same event exports cleanly in one format and fails in another, the problem is probably format-specific, which points at the converter library (misp-stix for the STIX formats) or at the mapping code that feeds it. If every format fails for every event, the cause is more likely a broken environment, a mismatched PyMISP against the MISP code, or a shared configuration problem. Keep a record of which formats and events were tested so the result can be compared after the fix.
Be careful with one common conclusion: a failed export of one format can come from a stale library while the stored data is fine. An outdated misp-stix may reject attributes that the current MISP release writes correctly, so the event looks corrupt when it is not. Before editing or deleting any event, export the same event in a format that does not depend on misp-stix, such as MISP JSON or CSV. If that succeeds, the data is intact and the fix belongs in the dependencies. Treat a failure in every format, or a failure that follows the event to a different instance, as a data problem to investigate separately.
Security and operational controls for Python updates
Python dependency changes in MISP touch the virtualenv, PyMISP and the code that calls them, so a mistake can break imports, exports and automation at once. The six controls below cover how versions are pinned, who can change the environment, where changes are tested, how to recover, what to read before each update and how to record the work.
Pin and record dependency versions
Pin PyMISP and the other packages in the MISP virtualenv to explicit versions, and write the full list down before each change. Compare the pinned PyMISP version against the version the MISP requirements page gives for the release you are running, which is 2.5.34.1 at the time of writing. Keep the recorded list with the change record so you can roll back to a known set of packages if an import or export breaks.
MISP requirementsRestrict who changes the virtualenv
Limit write access to the virtualenv to the named administrators who own the MISP host, and keep the web server and application service accounts out of the write path. Dependency installs run code from package indexes, so a silent change to PyMISP can alter how events are imported and exported. Confirm who can run pip in the MISP environment and review that list whenever staff change.
Test updates on a non-production copy
Apply the new MISP release and its Python dependencies to a copy of the production instance before touching production. Run a sample import, an export in each format your partners use, and a PyMISP script that your automation depends on. Record which checks passed so the production change has a clear go or no-go basis.
Back up before dependency changes
Take a database backup and a copy of the virtualenv directory and configuration files before any dependency change. Confirm the backup restores on a separate host, because a file copy that cannot be restored gives no recovery path. Keep the backup until the post-change checks have passed and the diagnostics page reports no new issues.
Review advisories and release notes first
Read the MISP release notes and security advisories for every version between your current release and the target before changing anything. Check the GitHub releases page for database migration notes, since recent 2.5 releases introduced a new migration system and PostgreSQL support. Note any dependency or PyMISP compatibility warning and plan the test run around it.
MISP release notesLog every update for change records
Record who ran each update, the date, the old and new package versions, the test results and the backup location in your change system. Keep the shell history or command log for the install session, and tie it to the ticket that approved the change. These entries let auditors and the next administrator see why a PyMISP version is in place and when it changed.
Questions teams ask before updating MISP dependencies
How much effort does a routine MISP dependency update take compared with a full MISP upgrade?
A dependency-only update is usually a narrower job than a full MISP upgrade, because it touches the Python virtualenv, PyMISP and misp-stix while the PHP application and database stay where they are. The work is still real: the pinned PyMISP version in the release requirements must match the MISP code, and any module that imports PyMISP has to be retested. A full upgrade adds application code changes, database migrations, settings review and a diagnostics pass. Effort rises with the number of custom scripts, scheduled jobs and sync or import tools that depend on PyMISP, so inventory those before you start. Ask any partner to separate the two in its quote.
How long does a test cycle for a MISP dependency update usually need?
No fixed duration applies, because the cycle depends on your environment. The main drivers are the number of PyMISP consumers, how many import and export formats your team uses (for example STIX, Suricata, Zeek or CSV), whether you run misp-modules, and how quickly you can get a representative staging copy. Plan for a pass over each consumer script, a round of test imports and exports against sample events, and a check of the diagnostics page after the change. Teams with one simple automation usually finish faster than teams that feed several SIEMs or sharing communities. Ask for the test plan and its exit criteria in writing before agreeing a timeline.
What does our team need to provide before a dependency update starts?
You need to provide access, a staging copy and a change window. Access means administrator rights on the MISP host, read access to the virtualenv and the scripts that call PyMISP, and a named contact who can approve changes. A staging copy should match production's MISP version, PHP and Python setup, and should not be a fresh install, because mismatches often only appear against real data. Sample events are important: include events with STIX, galaxy and attribute types your teams actually import or export. Agree a change window and a rollback point, such as a database and virtualenv backup, before any work begins.
Can our internal team update MISP Python dependencies without outside help?
Yes, if your team already runs MISP on Linux, can read Python tracebacks and has someone who owns the PyMISP scripts. The official requirements page says Python 3 is used with a virtualenv for PyMISP, so the work is within reach of a competent platform or security engineer. Outside help becomes more useful when several installation methods are in use, when no staging copy exists, or when the team has no one who knows the consuming scripts. Before deciding, check the MISP requirements page in the MISP user guide and match the pinned PyMISP version to your current MISP release.
What does a fixed-scope engagement for MISP dependency updates cover?
A fixed-scope engagement covers the work named in a written scope, with deliverables and timelines agreed before work starts. For this topic that usually means an inventory of PyMISP and misp-stix consumers, a planned update to the virtualenv and pinned packages, a staging test against agreed sample events, a production change with a rollback plan, and a short handover note. It does not normally include changes to unrelated MISP features unless they are written into scope. DeployOpen does not publish a price list, so a quote follows from the written scope and the environment described. Ask for each deliverable and each environment assumption to be listed.
When should we bring in outside help for a MISP dependency problem?
Bring in outside help after repeated failed updates, when import or export failures recur after a rollback, or when several installation methods are mixed on one host. Mixed methods, such as an installer-based host with hand-edited Docker or RPM components, make it hard to tell which Python packages are actually in use. Other signals include no staging copy, no one who knows the consuming scripts, or a deadline that leaves no room for a test cycle. Ask a partner to diagnose the version mismatch first and to write down what it found before changing anything. Retainers are available when you want continuing upgrade and testing support instead of a one-off fix.
Limits to confirm in your environment
The Python layer of a MISP instance moves with the PHP code, but the exact versions, install method and host details differ from one deployment to the next. The cards below list what to confirm against the official sources before you change anything, because each one can turn a routine update into an import or export failure.
Exact PyMISP and misp-stix versions
Each MISP release expects specific PyMISP and misp-stix versions. Confirm the pair that matches your target release on the release notes and the download page before you plan the update, rather than assuming the version you installed last year still fits. Record both versions in your change ticket so you can compare them after the upgrade.
MISP download pagePinned or floating installation
Find out whether your installer, Docker image, Ansible role or package pins these libraries or lets pip pull the latest compatible release. A floating install can change PyMISP during an unrelated rebuild, so check the pins in your requirements file before and after every change window.
misp-modules dependencies
If your instance runs misp-modules, those modules have their own Python dependencies that are separate from the core virtualenv. Confirm whether the modules are in use and test each enabled module after the update, since the optional service is not covered by a core dependency check.
MISP requirementsApplicability of the PostgreSQL migration system
The release notes describe a new database migration system with PostgreSQL support in a 2.5 release from September 2026. Confirm whether your target release and your database engine fall under that change, because the migration path differs for MySQL or MariaDB instances. Plan database steps separately from the Python update.
MISP releasesHost Python interpreter compatibility
The virtualenv is built on the Python 3 interpreter on your host OS, so confirm that the PyMISP and misp-stix versions you target support that interpreter. An OS upgrade or a different interpreter package can break a working environment even when MISP itself is unchanged. Check the interpreter version with the virtualenv's own python binary, not the system default.
Custom scripts using older PyMISP calls
Scheduled jobs, import scripts and SIEM connectors that call PyMISP may depend on method names or return shapes from an older release. Inventory every script that imports pymisp, run each one against a test instance on the target versions, and fix failures before production cutover.
How DeployOpen works on this
DeployOpen plans and delivers MISP dependency updates inside infrastructure you control, starting from your current virtualenv, PyMISP and misp-stix versions. Each engagement is fixed-scope, with the deliverables agreed in writing before work begins, and the same written scope governs the handover and any follow-on support.
How we scope
- We record the MISP version, Python 3 virtualenv and installed PyMISP and misp-stix versions before any change is proposed.
- The written scope names which packages move, which MISP release line they must match, and which import and export paths get tested.
- Scope states whether misp-modules is in or out, since those services are optional and change the test surface.
How we build
- We rebuild the virtualenv in a staging copy of your instance and pin each dependency to the version your MISP release expects.
- We run PyMISP scripts and sample imports and exports against the staged instance, covering the formats your teams actually use.
- We keep the working dependency set and a rollback path recorded so the change can be reversed if a test fails.
How we hand over
- You receive a written record of the final package versions, the MISP release they were matched to, and the tests that passed.
- Runbook steps cover the order of upgrades, the commands used and the checks to run after each future MISP release.
- We walk your administrators through the test scripts so your team can repeat the checks without us.
How we support
- Engagements are fixed-scope, and ongoing support, upgrades and continuous testing are available as a retainer.
- A retainer can cover re-testing of the virtualenv after each MISP release you adopt, under terms agreed in writing.
- Ask any provider, including DeployOpen, to confirm in writing what happens when a future release changes a PyMISP interface.

