Managing midPoint encryption keys and the keystore

midPoint uses a keystore to hold the keys that encrypt sensitive values in its repository. This page explains how to protect that keystore, rotate keys with Ninja and back up midPoint home safely.

On this page

Why the midPoint keystore decides whether your identity data stays protected

The midPoint keystore is the store that holds the encryption keys midPoint uses to protect sensitive values it keeps, such as credentials and connector secrets. If those keys are lost, the encrypted values in the repository cannot be read back, and if they are copied or mishandled by someone who should not hold them, the protection on those values is gone. For a production midPoint that provisions accounts into target systems, both outcomes reach directly into who can sign in where. The keystore is only as protected as the host and the file system permissions around it, so the question to answer before go-live is who can read it, who can back it up, and where those backups go.

According to Evolveum's encryption and keys documentation, the keystore sits in midPoint home, the directory that holds the server configuration. Ninja, the command-line utility for midPoint maintenance, can list the keys present in the keystore and re-encrypt stored objects with a new encryption key. That second capability is what makes rotation possible without rebuilding data by hand. Confirm in the Evolveum documentation which midPoint version and Ninja build you run, because the commands and options can change between releases, and check the exact procedure against your version before you touch a production repository. Review the Evolveum encryption and keys documentation for the reference behavior.

Plan this work at four points: before go-live, when an auditor asks how encryption keys are controlled and rotated, after administrators or operators with host access change roles, and whenever you suspect the keystore or its backups were exposed. Each trigger needs a decision: whether to rotate, who runs the Ninja steps, and how you prove the outcome. Ask your team or your implementation partner to document the current key inventory, the keystore location in your deployment, and the backup path before any rotation is scheduled. Also confirm with your infrastructure team how midPoint home is mounted in containers or virtual machines, since that determines who can reach the file.

Key management options and when each fits

The simplest option keeps the keystore file in midPoint home on the host that runs midPoint and relies on operating system permissions to limit access. It fits a single virtual machine deployment that one small platform team administers, because there are few moving parts and nothing extra to start the service. The trade-off is that anyone with root on the host, or with read access to midPoint home, can read the keystore, so the protection is only as strong as the host itself.

  • Operational fit: Works well for a single node with a small administrator group and clear host hardening standards.
  • Recovery: Whoever holds host root or the file owner account can restore it, so recovery depends on the people who already control the server.
  • Permissions: Restrict the keystore file and the midPoint home directory to the service account and to named administrators only.
  • Copies: Every copy of the file, including snapshots and configuration backups, carries the same exposure and must be protected equally.
  • Confirm with Evolveum: Check the keystore location and file handling in the encryption documentation for your midPoint version and install method.

Before choosing this option, confirm with your security team that host access reviews already cover the service account and root users.

How to set up and verify keystore protection

This sequence moves the midPoint keystore from an unmanaged file to a documented, access-restricted asset, and confirms that rotation and re-encryption leave protected values readable. Each step ends with a check you can record as evidence.

  1. Inventory the keystore and midPoint home

    The platform team lists where the keystore file sits inside midPoint home, which service account runs midPoint, and which copies exist on backup media, snapshots and build pipelines. Record the file path, owner, group, and the location of every backup that contains it. Confirm with your infrastructure team whether any copy sits outside the environment you control. Done when the inventory names every copy and every party with read access, and the team has signed off on it.

  2. Restrict filesystem permissions to the service account

    An administrator changes ownership and file modes so that only the midPoint service account can read the keystore and the midPoint home configuration directory, and removes group or world read access that was inherited from the install process. Operators who need to run maintenance tools should do so through the service account or a controlled sudo path, not by copying the file. Check the result by running a read test as an ordinary administrator account, which should fail, and as the service account, which should succeed. Record both results in the change ticket.

  3. Record the keys with Ninja key listing

    The operator runs Ninja's key listing command against the current keystore so that the set of encryption keys is captured in writing before anything changes. Store the output with the change record and note the date and the environment it came from. Compare the listing with the inventory from the first step, since a key that appears in the listing but in no documented process is a finding to resolve. Done when the listing is saved, reviewed, and attached to the change record.

  4. Plan a rotation test environment

    The team sets up a non-production midPoint that uses a restored copy of the production repository and a copy of the keystore, with the same midPoint version and connector set. The plan names the connectors to test, the users and objects whose protected values will be checked, and who approves moving the change to production. Confirm that the test environment is isolated from production target systems so that connector tests do not change live accounts. Done when the test plan is written and the isolation is confirmed by the operator who owns the connectors.

  5. Re-encrypt objects with Ninja on the restored copy

    On the restored copy, the operator runs Ninja to re-encrypt objects with the new encryption key, following the procedure in the Evolveum documentation for the midPoint version in use. Keep the command output and the start and end times in the change record. Because re-encryption changes stored data, do not run it against the production repository until the test run has passed every check in the following steps. Done when Ninja reports completion without errors and the output is saved.

  6. Verify midPoint starts and protected values resolve

    After pointing the test node at the re-encrypted repository and keystore, the operator starts midPoint and checks the log for startup errors related to decryption. Then the operator confirms the key listing now shows the expected keys and that a sample of users with stored credentials can log in, and that at least one connector test succeeds for each connector that holds protected settings. Any decryption failure at this stage means the change does not move forward. Done when the startup log is clean and each check is recorded with its result.

  7. Repeat the verification on production and keep evidence

    The same procedure is run on production in a maintenance window agreed in advance, with a verified backup taken immediately before the change and a rollback plan that restores the previous keystore and repository. After the change, the operator reruns the key listing, the login and connector checks, and saves the results with the earlier evidence. Store the backup and the keystore copies in access-controlled locations, and schedule the next review. Done when the production checks match the test results and the evidence package is filed with the change record.

How a key rotation moves through midPoint home, Ninja and the repository

The rotation starts outside midPoint, with a verified backup of midPoint home (which holds the keystore) and the repository database, both kept in a separate backup store. Inside the trust boundary, Ninja lists the keys in the keystore, the new key is added and selected, and Ninja re-encrypts stored objects before midPoint restarts. Verification comes before anything else: confirm that objects decrypt and that midPoint runs normally. Only then is the old key retired, and the old key should stay recoverable until that check passes.

Key rotation steps across midPoint home, Ninja, the repository and the backup store.

Protecting the keystore, backups and midPoint home

The keystore and the midPoint home directory decide who can decrypt the data midPoint stores. The cards below cover the access, backup, tooling and recovery decisions that determine whether the encryption keys stay protected and recoverable. Work through them together, since a well-guarded keystore does little good if its only copy sits next to the database dump it was meant to protect.

Restrict read access to midPoint home

The midPoint home directory holds the keystore and its configuration, so anyone who can read the keystore file can decrypt protected values in a database dump. Limit read access to the account that runs the midPoint service and to a small set of named administrators. Check file ownership and permissions after every upgrade, package install or container rebuild, because these steps can recreate the directory with looser defaults. Confirm the exact file names and paths for your release in the Evolveum documentation.

Encryption and keys docs

Separate keystore backups from database backups

A database backup without the keystore cannot be decrypted, and a keystore copy next to the database backup defeats the separation. Store keystore copies in a different location with its own access list and retention rules. Test that a restore of the database plus the separately stored keystore brings midPoint back to a working state. Record who holds each copy and where it is kept.

Limit who can run Ninja

Ninja is the command line tool that lists keys in the keystore and re-encrypts objects with a new encryption key. Anyone able to run it on the host can change how stored values are protected, so treat it as a privileged tool. Restrict execution to a short list of administrators, run it under a named account rather than a shared login, and require a change record for each run. Confirm the Ninja commands and options that match your installed version.

Ninja docs

Log and review host administrative access

Administrative sessions on the midPoint host can read the keystore, so host-level access needs the same visibility as application administration. Enable login and privileged command logging on the operating system, forward those logs to a store the midPoint administrators cannot edit, and review them on a fixed schedule. Compare recorded sessions against the approved administrator list and investigate any access that has no change record behind it.

Handle keystore copies in test environments

Test environments are often restored from production backups, which can carry a copy of the production keystore. Decide before the restore whether the test system receives a new keystore or the production one, and document that choice. Using production keys in a less controlled environment widens the set of people who can decrypt production data. Where a test system needs realistic data, ask whether masked or synthetic data can serve the test instead.

Plan for loss of the keystore

If the keystore is lost or corrupted, encrypted values in the database may become unreadable, and no backup of the database alone will fix that. Write a recovery procedure that names the custodians of the keystore copies, the steps to restore it, and the test that proves the restored keystore decrypts existing objects. Ask your midPoint support provider or Evolveum how they expect this scenario to be handled for your version and configuration before an incident occurs.

Questions teams ask before rotating midPoint keys

What does rotating a midPoint encryption key cost in effort?

Rotation effort is driven mostly by how many objects hold encrypted values and how much verification the change needs, not by the key operation itself. The work usually covers inventorying the keys in the keystore, planning the re-encryption run, taking a verified backup, running the re-encryption, and checking that connectors and stored credentials still work afterward. Cost comes from the people doing that work and the test environment needed to rehearse it. Ask any partner to split a quote into planning, rehearsal, production run and verification, and to state which parts are one-time and which recur at each rotation. Confirm the exact Ninja steps for your midPoint version against the Evolveum encryption and keys documentation.

How long does a midPoint keystore rotation take?

Duration depends on the size of the repository, the number of encrypted objects, how many environments need the change, and whether a maintenance window is required. A small deployment with a single test environment moves faster than a multi-node production system with several connected environments and sign-off steps. The re-encryption run itself is often the shortest part; rehearsal, backup validation and post-change checks take longer. Ask for a timeline that lists each gate and who signs it off, and confirm the expected run time by rehearsing on a copy of your production database before you commit to a window.

What does the internal team need to provide for a rotation?

The internal team needs to supply access and decisions that only the organization can give. Typically that includes administrative access to the midPoint host and its midPoint home directory, read access to the database for backups, a named owner for the change window, and someone who can confirm which connectors and target systems depend on stored credentials. Security or compliance staff should approve the rotation plan and where the new key material is stored. Ask the partner to list these inputs in the written scope so that gaps are visible before work starts, not during the change window.

Can a small team rotate midPoint keys without outside help?

A small team with midPoint administration experience can often perform a rotation alone, provided it has a rehearsed runbook, a tested backup and enough time to verify results. The risks lie in the less frequent parts of the job: restoring from backup if something fails, confirming that every encrypted value decrypts after the run, and handling connector credentials that a midPoint administrator may not routinely touch. Teams with one or two people who understand the keystore should consider a second reviewer. Whether outside help is worth it depends on how often the team expects to rotate and how much of the process it has already practiced.

How does keystore work relate to a midPoint upgrade?

Keystore changes and upgrades should be planned together because both touch the same data and both can leave a deployment unusable if they are done out of order. Upgrades move midPoint through supported releases, and each step may require a fresh backup and a tested restore path. Rotating keys in the middle of that sequence doubles the number of things that can fail. The safer pattern is to confirm the target release, complete the upgrade in a non-production copy, then decide whether the rotation belongs before or after it. Check the midPoint releases page for supported versions before you set the order.

What should we ask a partner to include in a written quote?

Ask for a written scope that names the midPoint version, the environments covered, and the keystore and repository layout the work will touch. The quote should list deliverables such as a rotation runbook, a rehearsal record, a backup and restore check, and a post-change verification checklist. It should state what the organization must provide, what is excluded, such as connector changes or upgrades, and what happens if the rehearsal finds a problem. Ask how the work is priced, whether it is fixed-scope, and which items recur at each future rotation. A quote without these details is hard to compare with an internal plan.

Where should the keystore and its backups be kept?

The keystore and its backups should be stored separately from the database backups they protect, with access limited to the administrators who need them. If the keystore and the encrypted data are stolen together, the encryption protects little, so the storage plan should be reviewed by the security team. Restrict read access to the midPoint home directory on the host, record who can copy keystore material, and test that a restored keystore can decrypt a sample object. Confirm your exact storage and key-handling requirements with your security team and the Evolveum encryption and keys documentation.

What DeployOpen delivers for midPoint keystore work

DeployOpen plans and implements keystore protection for midPoint inside your own infrastructure, from where the keystore file lives and who can reach the midPoint home directory to how it is backed up and restored. The work is delivered under a written scope agreed before anything changes, so the protection model, the systems in scope and the handover items are settled in advance. Typical deliverables include a documented keystore location and permission model, a backup design that keeps the keystore and the database recoverable together, and access rules for the people and service accounts that can read the key material.

Rotation is where most of the operational risk sits, so DeployOpen writes a rotation runbook rather than leaving it to memory. The runbook covers the order of steps, how Ninja is used to list the keys held in the keystore and to re-encrypt stored objects under a new encryption key, how the old key is retained until re-encryption is verified, and how a failed run is rolled back. Each step is tested in a non-production copy of your environment before it is run on production data. Before the work starts, confirm with DeployOpen which midPoint version and database platform are in use, because the procedure and the supported Ninja commands depend on them.

Ownership after the engagement matters as much as the build. Your team receives the runbook, the backup and restore procedure, and a record of who holds administrative access to the keystore and midPoint home. Ask DeployOpen to state in the written scope which items are one-time deliverables and which need ongoing support, such as periodic rotation drills or retesting after an upgrade. DeployOpen prepares these controls and evidence for your compliance and security reviewers, but it does not issue audit reports or certifications; independent auditors perform those assessments. Read the Evolveum encryption and keys documentation alongside the scope so both sides work from the same vendor description.

How DeployOpen scopes and supports midPoint key management

DeployOpen plans and carries out midPoint keystore and encryption key work inside your own infrastructure, from the current key inventory through to a documented rotation runbook. Engagements are fixed-scope, so the systems, keys, backups and access paths covered are agreed in writing before any change is made to a production deployment.

How we scope

  • We inventory the midPoint home, the keystore location and the key aliases in use before agreeing any change.
  • The written scope names which environments, backups and repository objects a key rotation will touch.
  • We confirm who holds access to midPoint home and the keystore, and which of those holders stay in scope.

How we build

  • We rehearse the Ninja key listing and re-encryption steps against a restored copy of your repository first.
  • Keystore handling is set up so key material stays out of shared file shares, tickets and chat channels.
  • Each step of the rotation has a recorded check so the team can confirm objects decrypt under the new key.

How we hand over

  • You receive a runbook covering key listing, re-encryption, rollback and the order of backup restores.
  • Access rules for midPoint home and the keystore are documented so your security team can review them.
  • Your operators are walked through the procedure so that future rotations can be run by your own staff.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Retainers can cover rotation reviews that follow a midPoint upgrade or a change to your backup platform.
  • Ask us to confirm the support terms, response expectations and included activities in the written quote.

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.