Automating MISP installation with Ansible

An Ansible role can turn a MISP build into a repeatable, reviewable process. This page covers what to template, how to keep upgrades idempotent, and when misp-docker is the simpler automation target.

On this page

Automating MISP installation with Ansible: when a repeatable build pays off

If you run several MISP instances, such as a community-facing hub, an internal analyst instance, endpoint instances feeding detection and a test instance, the costly problem is drift. Each server is built a little differently, settings change by hand, and nobody can show an auditor which configuration was live on a given date. An Ansible role makes the build repeatable and reviewable: the server definition lives in version control, every change arrives as a reviewed diff, and the same playbook can rebuild a test instance that matches production. The MISP download page lists Ansible roles among its installation options alongside the installer, Docker images, Puppet and RPM packages, so this is a supported direction rather than a community workaround.

Confirm before you commit to a role that it targets the MISP 2.5 line and the Ubuntu 24.04 installer path your team plans to use. The MISP project recommends 2.5 for new deployments and 2.4 is end of life, so a role that still builds 2.4 is a risk on its own. Check the role's last release date, its supported operating system list, which PHP, MariaDB and Redis versions it installs, and whether it runs the upgrade steps the project documents. Ask the role maintainer or your partner to show a clean build from an empty host and a second run that reports no changes, because that second run is the test of idempotence.

Expect the effort to sit in the decisions the role leaves to you: which settings, users, feeds and sync servers are templated, where secrets such as database passwords and API keys come from, and how the upgrade order is reviewed across instances. Ansible does not remove the need for MISP operations skills. A one-time build saves little, while several instances that must match and be re-audited each quarter usually justify the work. Ask any partner quoting this for the written list of templated items, the secrets approach and the upgrade runbook, and confirm which parts of the build need an analyst sign-off in your change process.

What to template in an Ansible-built MISP server

A MISP server is configured in several layers: core settings, accounts, intelligence sources, sharing partners, identity and supporting services. Each layer drifts in a different way when it is changed by hand, so each one needs a clear decision about what lives in the playbook and what stays out of version control.

Core server settings

Codify the instance settings that define how MISP behaves, including the base URL, the sync and correlation options, and the attachment and logging paths. Set by hand, these values differ between staging and production and are often forgotten after an upgrade, which changes how links, sync and API responses behave. Keep the role's defaults in version control and review each change through a pull request. Confirm which settings the installed release exposes through its settings interface before you template them, since names change between versions.

Roles, users and API keys

Template the role definitions and the baseline accounts, but never the API keys or passwords. Hand-edited roles drift from the access model the security team approved, and a user who was granted publishing rights during an incident often keeps them. Store secrets in an external vault and let the role create or rotate them at run time. Ask your team to confirm how each role maps to real responsibilities before the first run, because the playbook will enforce whatever it lists.

Feeds and warning lists

Describe which feeds are enabled, their pull schedules and their caching choices in the playbook, so every instance ingests the same intelligence sources. Feed drift is easy to miss: a feed disabled during troubleshooting stays off, and an analyst may enable an unreviewed source on one server only. Keep feed credentials and any custom URLs out of the repository. Review license terms for each feed before enabling it, since some sources restrict redistribution.

Sync servers and distribution

Define sync partners as data, including their remote URLs, the distribution levels they receive and any tag filters. Partner connections are the most sensitive part of the build, because a hand-added server can receive events that were meant to stay internal. Keep the sync API keys in a secrets store, not in the template. Confirm each partner's agreed filters with its owner, and treat any change to them as a reviewed change in version control.

OidcAuth role mapping

Template the OpenID Connect settings and the mapping from identity provider groups to MISP roles. The OidcAuth plugin assigns the first matching role by priority, so the order of mappings changes who gets administrator rights. A manual edit to that order is an access control change that often goes unreviewed. Keep the client secret out of the repository and confirm the group names with your identity team. Test the mapping with a non-privileged account before the change reaches production.

OidcAuth README

Supporting service settings

Codify the settings for the database, Redis, PHP, the web server and the background workers, since these determine how MISP performs under load. Hand-tuned values for memory limits or worker counts are rarely recorded, so a rebuild quietly loses them. Keep database and Redis passwords in the vault and template only the connection layout. Document which values the installer sets so the playbook overrides them deliberately rather than by accident.

Ansible role or misp-docker: choosing the automation target

A native deployment installs MISP directly on a Linux host, with the web server, PHP, the database, Redis and background workers all managed by the operating system. The MISP project lists Ansible roles among its installation options alongside the installer, Docker images, Puppet and RPM packages, and the official installer is the supported path for MISP 2.5 on Ubuntu 24.04. An Ansible role for this model manages packages, service configuration, the MISP configuration file, the database and the file permissions that MISP depends on, so the role has to track the same layout the installer produces.

  • Host configuration: The role manages packages, PHP settings, the web server and the services that run the MISP workers.
  • Application settings: Values such as the base URL, the MISP configuration file and the database connection are rendered from variables and kept in version control.
  • Upgrades: Upgrade steps depend on the version in use, so the role needs a defined path for each release line rather than a single run of the installer.
  • Operating system coupling: Role tasks are tied to the distribution and PHP version they were written for, so changing the base image changes the role.
  • Secrets: Database and API secrets should come from a vault or secrets store, not plain variables in the repository.

Before relying on any role, confirm which MISP version, operating system and PHP version it targets, and check its coverage of the settings you need to template.

How to structure the Ansible build sequence

The sequence moves a MISP server from a pinned release choice to a verified, version-controlled configuration that can be rebuilt or upgraded the same way each time. Each step ends with a check, so a failed stage is caught before the next one builds on it.

  1. Pin the target MISP 2.5 release

    Choose the exact MISP 2.5 release the role will install and record it in version control before any host is touched. MISP 2.5 is the recommended line for new deployments, and MISP 2.4 is end of life with security fixes only, so new instances should not start on 2.4. Confirm the current 2.5 release on the project's download and releases pages and check its upgrade notes. The check is a committed version variable that the team has reviewed and approved.

  2. Provision the base operating system

    Prepare a clean host that matches the platform the role and the official installer support, which the project recommends as Ubuntu 24.04 for MISP 2.5. Set the hostname, time synchronization, DNS, patch baseline, administrative access and the network path for outbound feeds and sync partners. Ansible or your provisioning tool should own this layer, and the platform team should confirm the image source. The check is a host that passes a connectivity test and reports the expected OS release.

  3. Run the role against the host

    Apply the Ansible role to the provisioned host with the pinned version and environment-specific variables. The role should install the web server, PHP, the database, Redis and background workers in the layout the project documents, so the result matches what a manual install produces. Run it in check mode first, then apply it, and keep the output in your change record. The check is a second run that reports no changes, which confirms the role is idempotent.

  4. Apply settings and user accounts

    Template the instance settings, organisation identity, roles, sharing defaults and user accounts from variables, with secrets pulled from your vault rather than stored in the repository. Create the admin and service accounts first, then the analyst accounts mapped to the roles your team uses. Confirm the API key handling and multi-factor authentication policy before any real user logs in. The check is a login test with each role and a review of the applied settings against the approved values.

  5. Configure feeds and sync servers

    Add feeds and sync server connections only after the trust and filtering decisions for each partner are documented. Feed enablement, distribution settings and sync credentials should come from reviewed variables, and outbound certificates for partners must be trusted by the host. Enable one connection at a time so a bad partner setting does not hide behind others. The check is a successful test pull or sync from each connection and a log entry that shows the expected event counts.

  6. Verify the instance with diagnostics

    Run the MISP diagnostics page and the project's command-line checks to confirm that the database schema, workers, cache, file permissions and outbound connectivity are healthy. Record the results and clear every warning that affects security or sync before the instance is announced to users. Confirm the exact diagnostic commands and expected output against the installed release, because they can change between versions. The check is a clean diagnostics report saved with the build record.

  7. Gate every change through version control

    Store the role, variables, inventory and pinned version in a repository protected by review, and require a pull request for every change. Run the role in check mode in a staging environment before production, and use the same pinned version for each upgrade test. Plan upgrades as a new pinned release followed by the same verification steps, so the rebuild path stays tested. The check is a staged run that passes the diagnostics steps before the change reaches production.

Keeping MISP upgrades idempotent across the 2.5 line

Idempotent means that running the role a second time against a server it has already converged changes nothing. For upgrades, that property has to hold in two different situations. The first is a routine re-run, where the role should report no changes and make no database or configuration writes. The second is a version bump, where the role should apply exactly the steps the project documents for that move and stop there. Keep these apart in the role design. Settings templating and user or feed tasks can be asserted on every run, but the upgrade path should be a separate, explicitly triggered play that runs only when the target version variable changes. Gate it on the installed version, read from the instance itself, so a stale variable never causes an unplanned migration.

The 2.5 line has changed in ways that affect automation. Release 2.5.47, published on 17 September 2026, introduced a new database migration system with PostgreSQL support, and 2.5.50 followed on 9 October 2026. Those two facts alone mean a role written against earlier 2.5 behavior may run migration steps that no longer match the project's process. Before automating any migration, read the release notes for every version between your current and target release on the MISP releases page. Confirm whether the migration runs as part of the normal update, whether it needs a separate command, and whether PostgreSQL is a supported choice for your deployment or only a new-install option. Do not assume that a database engine chosen at install time can be changed later by a playbook.

Treat the first upgrade of any new role as a rehearsal. Clone a production-like server, run the role against an older pinned version, then run the version bump, and confirm the second full run reports no changes. Record which tasks report changed on that second pass, because each one is a idempotency defect or a missing guard. Keep a rollback plan that includes a verified database backup taken by the playbook before the migration step, and confirm with the project which downgrade paths, if any, are supported. Ask your team to write down, for each 2.5 point release, whether the change was reviewed and whether the role was updated, so the upgrade history stays traceable.

Configuration options and when each fits

This table compares four ways to build a MISP server: an Ansible role on native hosts, Ansible driving misp-docker, the direct installer scripts, and manual configuration. Read each row as a question you must answer for your team, then match the column that fits your skills and change control. The main takeaway is that the automation layer does not remove the need to confirm upgrade behavior and secret handling for the MISP release you choose.

OptionWhat is templated or scriptedUpgrade and secrets handlingTeam skills required
Ansible role on native hostsPackages, web server, PHP, database, Redis, MISP settings, users and sync server entries, as defined by the role you adoptUpgrades depend on the role version; confirm it handles the MISP 2.5 upgrade path and idempotent reruns. Secrets must come from a vault you controlAnsible, Linux administration, PHP and MISP configuration knowledge
Ansible driving misp-dockerHost preparation, Docker Compose files, the .env file, volumes and image tags pinned by the playbookImage tag changes are explicit in version control; confirm the pinned tags and how persistent volumes survive a rebuild. Keep Redis and database passwords out of plain inventory filesAnsible, Docker and Compose, container storage and networking
Direct installer scriptsInstaller script runs with its own defaults; post-install settings are usually applied by hand or by a wrapper script you writeRe-running the installer is not a substitute for a tested upgrade; confirm the upgrade script for your release. Secrets are handled by your wrapper, so review where they are writtenLinux administration and shell scripting, with MISP post-install configuration knowledge
Manual configurationNothing is templated; each setting, user and sync server is entered through the MISP interface or CLIUpgrades are manual and easy to drift between environments; confirm change records for each step. Secrets are typically stored outside the platform by staff, which is hard to auditSolid MISP administration and Linux skills, with no automation tooling required
Drift and repeatabilityAutomation keeps config, users and feeds in code, so a rebuilt server matches the last reviewed stateManual and wrapper approaches are where drift most often appears; confirm how each option detects and corrects changed settingsVersion control discipline and review habits for infrastructure code
Feeds and sync server entriesFeed definitions and sync partner records can be templated, but partner keys are secrets and must be injected at run timeConfirm that partner API keys are never committed to the repository and are rotated through your processSharing community administration and secrets management
Fit for a small single instanceA single endpoint instance may not justify a full role; a documented manual or installer path can be enoughConfirm the cost of maintaining the automation against the frequency of changes you expectWhoever already runs the server day to day
Fit for multi-instance estatesTemplating lets hub, analyst and endpoint instances share one reviewed base with per-host variablesConfirm the role or playbook is tested against each instance type before a production rolloutDedicated platform engineering with review and test pipelines

Securing secrets, credentials and API keys in the playbook

A MISP playbook touches more secrets than most server builds: database and Redis passwords, automation API keys, GnuPG keys, OpenID Connect client secrets and sync server keys. Each one needs a defined home, a defined owner and a defined way into the run, or the automation becomes the weakest point in the deployment.

Database and Redis credentials

The MariaDB and Redis passwords are generated or supplied at install time and then referenced by the web tier, workers and any maintenance jobs. Keep them out of inventory files and templates committed to Git, and render them into configuration only at run time. Check that the role sets restrictive file ownership on rendered config files and that a rotation changes the value in one place and restarts the dependent services in order. Confirm the Redis password setting is applied on both the server and every client that connects.

API keys for automation users

Playbooks that create users or import feeds need a MISP API key, and that key carries the permissions of the account it belongs to. Create a dedicated automation user with a role limited to the tasks the playbook performs, rather than reusing an administrator account. Store the key in a vault, set an expiry where your MISP version supports it, and rotate it on a schedule the playbook can follow without manual edits.

GnuPG keys for signing and encryption

Where MISP uses GnuPG for event signing or email notifications, the private key and its passphrase are high-value material. The playbook should import public keys and place private keys from a vault with strict permissions on the GnuPG home directory, never from a plain file in the repository. Decide who holds the master copy and how a key is revoked and replaced, and confirm that the restored instance can still verify signatures made before the change.

OpenID Connect client secrets

If the OidcAuth plugin is used, the identity provider client secret lets MISP exchange authorization codes for tokens. Template the client ID and secret from the vault into the plugin configuration, and keep the redirect URI and role mapping under version control so reviews can see changes. Ask your identity team how the secret is rotated at the provider and whether a rotation can be applied by re-running the role without breaking active sessions.

OidcAuth plugin README

Sync server keys

Synchronization with partner instances uses keys issued for each connection, and a leaked key lets someone pull or push intelligence under that partner's identity. Keep each sync server's key in its own vault entry, name it after the partner, and never let the playbook print it to logs. When a partner is removed from the template, the role should also remove the server entry so the old key stops working on this instance.

Vault injection, audit logs and pinned versions

Treat the vault as the single source of secrets, grant playbook runners only the paths they need, and keep audit logs of every run that records who started it and which change was applied, without recording secret values. Pin the MISP version in the role and review the project's security advisories before each bump, because a pinned version that a new advisory affects must be fixed on a schedule, not left in place.

MISP download page

Questions teams ask before automating MISP with Ansible

What drives the effort and cost of automating a MISP install with Ansible?

The main drivers are how many environments the role must build (lab, staging, production, and any air-gapped or community-facing instance), how much of MISP's configuration you want templated, and how many integrations such as feeds, sync servers, SSO and modules must be configured. Each extra environment and each templated setting adds testing work. Costs split into one-time work (role design, variable model, test pipeline, documentation) and recurring work (updating the role for each MISP release, rerunning tests, and reviewing security advisories). Ask any provider for a written scope that lists environments, settings to template, and the upgrade test plan before agreeing a quote.

Can our team build a MISP Ansible role without outside help?

Yes, if you have engineers who already run Linux servers with Ansible and understand MISP's dependencies: a PHP web stack, MariaDB or MySQL, Redis and background workers. The hard parts are not the first install but idempotent upgrades, safe handling of the MISP encryption and API settings, and testing the role against the MISP 2.5 release you run. MISP publishes its own Ansible role among its installation options, so review that work before writing your own. If your team lacks this experience, an implementation partner can build the role while your engineers take ownership of it.

What does the work need from our team?

Plan for access and decisions before engineering starts. You need test and production environments with the operating system your standard requires, an inventory of who owns which MISP settings, a secrets store for database passwords, API keys and SSO client secrets, and a change process that approves role runs against production. Your security team should decide which users, roles and sync partners are defined in code and which are managed in the UI. Expect review time from the people who own identity, networking and the community connections MISP will use.

How quickly will automation pay off, and what slows it down?

Time to value depends on how many MISP instances you run and how often you upgrade. A single instance with a stable configuration gains little from automation, while several instances, frequent releases or rebuilds after failure gain a lot. Delays usually come from unresolved decisions about which settings belong in code, missing secrets handling, and tests that need a realistic database and Redis. Check the release history on the MISP GitHub releases page before you plan an upgrade cadence, because recent 2.5 releases included database migration changes that the role must handle.

How should we handle MISP upgrades in an Ansible role?

Treat each upgrade as a tested change: run the role against a copy of production data in staging, review the changelog, back up the database and files first, and only then run it in production. The role should be idempotent, so a repeat run makes no changes when nothing has drifted. Check for version-specific steps, since MISP 2.4 is end of life and the project advises against new 2.4 instances, and the MISP download page lists the upgrade script for Ubuntu. Verify feeds, sync and API access after each run.

When should we choose misp-docker instead of Ansible?

Choose misp-docker when your platform team already runs container workloads, you want image-based rollbacks, and you do not need to manage the host operating system through the same automation. Ansible is the better target when your standard is native packages on virtual machines, when your operations team manages hosts with Ansible already, or when you must follow an installer-based build for regulated change control. Both paths need the same decisions on secrets, backups and TLS. The MISP support page lists paid support options if you want a vendor to review the choice.

Which paid support options does the MISP project offer?

The MISP project offers paid support services, and a number of third-party providers also offer commercial support. Check the MISP support page for the current list of services and the terms each one covers. Ask any provider which MISP versions they support, whether they review Ansible roles, and how they handle upgrades and security advisories, and get the answers in writing.

How the playbook, secrets and MISP servers fit together

The flow starts in a version-controlled playbook and role, which the Ansible control node runs against the target MISP server inside the production trust boundary. Secrets come from a separate secret store at run time, so credentials never sit in the repository. The target server pulls from its supporting services and exchanges synchronization traffic with partners. Check that the control node sits outside the production boundary and that no secret values appear in the playbook history.

Control plane, secrets and production MISP servers, with the trust boundary between them.

How DeployOpen scopes an Ansible-driven MISP build

DeployOpen scopes an Ansible-driven MISP build as a fixed-scope engagement with the scope, deliverables and timeline agreed in writing before any work starts. For this topic, the written scope names the target environments, the MISP release line the role will install, the settings, users, feeds and sync servers the role will template, and the points where the role stops and manual configuration begins. Because MISP 2.5 is the recommended line for new deployments and MISP 2.4 is end of life, the scope should state which MISP 2.5 release the role pins and how that pin changes over time. Ask for the scope document to list each template as a named deliverable so you can check it against your own requirements before a quote is finalized.

The handover covers the Ansible role itself, a runbook that explains how to run it against each environment, and a written upgrade procedure that describes how to move between MISP releases without re-creating the server. The runbook should cover inventory layout, variable precedence, how secrets are supplied at run time, and how to confirm an idempotent run leaves no changes behind. The upgrade procedure should name the checks to run before and after an upgrade, the rollback path, and any release that needs more planning than a routine update. Confirm with DeployOpen whether the handover includes test runs against your environments or only against an agreed lab build.

The client provides the environments, a secrets process and change approvals. Ask your team which hosts, networks and DNS names the role may touch, who owns the vault or secrets store that holds database passwords, API keys and sync credentials, and which change board must approve each production run. Decide early how secrets reach the role, since a template that embeds them in plain text will fail review. Also confirm who holds administrator access to the MISP instance after handover and who signs off the first production run. The scope is only as accurate as these inputs, so agree them in writing alongside the deliverables.

How DeployOpen works on this

DeployOpen plans and builds Ansible automation for MISP inside infrastructure you control, from the settings and users you template through to the upgrade runbook your team keeps. Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we scope

  • Agree which MISP settings, users, feeds and sync servers the role will template, and which stay manual.
  • Confirm target operating system, MISP 2.5 version line and whether the role or misp-docker fits your environment.
  • Record secrets handling, inventory layout and upgrade approval steps in the written scope before any build starts.

How we build

  • Build an idempotent Ansible role that re-runs cleanly against an existing MISP server without unintended changes.
  • Keep credentials out of templates by wiring them to your approved secrets store, and test every variable default.
  • Test the role against a staging server, including a repeat run and an upgrade from one pinned MISP release to the next.

How we hand over

  • Deliver the role, inventory examples, variable reference and a runbook for upgrades, rollback and drift checks.
  • Walk your platform and security teams through the code, the change process and the verification steps.
  • Document what the automation does not cover, such as manual sync approvals, so ownership stays clear after handover.

How we support

  • Offer ongoing support, role upgrades for new MISP releases and continuous testing as a retainer.
  • Review the role against each MISP security advisory and release note that affects your deployment.
  • Agree response and change handling in the retainer scope, so your team knows how fixes reach production.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.