Why encrypting Redmine's stored LDAP and SCM passwords matters
A production Redmine keeps two kinds of secrets in its database: the bind password for each LDAP authentication source, and the credentials for repositories it fetches from, such as Subversion, Git or Mercurial. These are service credentials, not user passwords, and a single account may be able to read a whole directory or clone a whole codebase. The database dump alone should not be enough to recover them. Redmine's encryption step, run through the db:encrypt task, stores these values encrypted using a cipher key kept outside the database, so a copy of the database by itself does not reveal them.
The protection has clear limits. The cipher key lives in the Redmine configuration, so anyone who can read configuration.yml together with a database copy can decrypt the stored values. The same applies to someone with shell access to the running application, who can read the key from memory or the file system, and to any backup that contains both the database and the key. Encryption also does not replace least-privilege design for the bind account or the repository user. Confirm the exact cipher key setting, the task behavior and any upgrade caveats for your Redmine version in the Redmine installation guide before you plan the change.
Teams need this step when Redmine authenticates against a directory, or fetches private repositories, and when the database is copied outside a tightly controlled environment, for example to a backup provider, a test environment or a vendor support workflow. It also matters during audits that ask where service credentials are stored. Before you begin, list every LDAP source and repository credential in the administration screens, record who owns each account, and decide where the cipher key will be kept separately from backups. Plan the work as a change with a tested restore, because a lost key can leave stored credentials unreadable.
How the cipher key, database and application fit together
The diagram starts with Redmine reading the cipher key from configuration.yml at boot. The application uses that key to encrypt LDAP bind and repository passwords before writing them to the database, and to decrypt them when it connects to a directory or repository. The database holds only ciphertext, but a backup taken from the same host can carry both the database dump and the configuration file. Check that backups of the two sit under separate access controls.
Where the cipher key, encrypted credentials and backups sit across trust boundaries.
Which encryption setup fits your environment
On a single host, the cipher key usually sits in configuration.yml next to the rest of the Redmine settings, readable by the account that runs the application. Custody is simple because one team controls the server, the database and the file, so there is little to coordinate. The trade-off is that a copy of the database and a copy of the configuration file together are enough to recover the stored credentials, so the key and the data tend to leak together.
- Key custody: the key lives beside the data it protects, so limit read access to the configuration file to the Redmine service account and named administrators.
- Operational effort: this is the lightest model because no secret store has to run, but a key change means a manual edit and a controlled restart.
- Backup handling: back up the database and the configuration directory under the same encryption and access rules, and confirm during a test restore that the key matches the restored data.
- Recovery risk: if the configuration file is lost and no separate copy exists, the encrypted LDAP bind and repository passwords cannot be decrypted and must be re-entered by hand.
Check who can read the configuration file today, and whether your most recent backup contains a copy of the key.
In a container or orchestrated deployment, the image should stay free of secrets and the cipher key should arrive at start-up from a secret store, such as the platform's secret objects or an external vault. Custody moves from a file on a server to access policies in that platform, which is easier to audit and to restrict by role. The trade-off is that Redmine now depends on the secret store being reachable whenever a pod or container starts, and the secret store becomes part of your recovery path.
- Key custody: access to the secret is governed by the platform's role and policy model, so grant read access to the Redmine workload and to a small named group of operators only.
- Operational effort: expect to maintain the manifests or chart values, the sync between the vault and the platform, and a rotation process that is coordinated with a rolling restart.
- Backup handling: back up the secret store on its own schedule and keep it separate from database backups, so a database restore never silently depends on an unrecorded key version.
- Recovery risk: if the secret store is unavailable during a cluster rebuild, Redmine may fail to start, so confirm the bootstrap order before you need it.
Confirm how your platform stores secret values at rest and whether the secret store itself is covered by backup and restore testing.
When policy forbids the key from being stored on disk or in a platform secret, it can be supplied only when the process starts, by an operator or a deployment pipeline that holds it for that purpose. This gives the strongest control over custody, because the key exists only in the start-up step and the memory of the running process. The trade-off is that every restart, reboot or scaling event needs the key again, which makes the procedure the most demanding of the three models and the easiest to get wrong under pressure.
- Key custody: define who may hold the key, where the authorized copy is kept, and how a holder is replaced when they leave the team.
- Operational effort: the highest of the three, because automatic restarts and autoscaling stop working unless the injection step is automated safely.
- Backup handling: store a sealed break-glass copy under dual control so the database can still be read after a loss of the injector or its holder.
- Recovery risk: if the key holder is unavailable or the injector fails, Redmine cannot start and the stored credentials stay unreadable until the key is recovered.
Confirm with your Redmine version how the cipher key is loaded at start-up, and rehearse a full restart using only the documented procedure before you rely on it.
How to run db:encrypt and protect the cipher key
This sequence encrypts the LDAP bind and repository passwords Redmine stores in its database, while keeping the cipher key separate from the data it protects. Each step ends with a check, so you know the encryption is working before you change anything else.
Back up the database and configuration
Before you change anything, take a full database backup and copy config/configuration.yml to a safe location outside the application directory. Record the Redmine version and the Ruby version the instance runs on. Someone on the platform team should do this, with a database administrator available if the database is large. You know this step is done when you can restore the database backup to a scratch environment and the copied configuration file opens without errors. Keep the backup until the encryption is verified, because a failed migration is far easier to recover from with a known-good copy.
Confirm the task name and key format
Open the Redmine installation guide for your exact version and find the section on encrypting stored credentials. Confirm the rake task name, the configuration key that holds the cipher key, the accepted key format and length, and any Ruby or Rails requirements for that release. Do not rely on memory or on older blog posts, because task names and key handling can change between releases. You know this step is done when you have written down the exact task name and key format from the guide for your version and reviewed them with the person who will run the task.
Set the cipher key in configuration.yml
Generate a random cipher key of the format the installation guide specifies, using a cryptographically secure generator on a trusted host. Add it to config/configuration.yml under the key the guide names, and keep the file out of version control. Store a second copy of the key in your secrets vault or sealed backup, separate from the database backup. You know this step is done when Redmine starts and loads the configuration without errors, and the key is recorded in the vault with an owner and a retrieval procedure.
Run the db:encrypt task
Stop writes to the instance or schedule the run in a quiet window, then run the encryption task from the Redmine root directory in the production environment, using the task name you confirmed. The task reads existing LDAP bind passwords and repository credentials and rewrites them in encrypted form. Capture the console output for your change record. You know this step is done when the task completes without errors and the output reports the records it processed, which you should compare with the count of LDAP authentication sources and repositories you recorded earlier.
Verify LDAP and repository connections
Sign in as a test LDAP user and confirm authentication succeeds, then open the LDAP authentication source in the administration area and use its test function. For each configured repository, open the repository page and confirm the revisions load or fetch as expected. Check the log for decryption or cipher errors. Someone who can read the logs should review them with the administrator who ran the task. You know this step is done when every LDAP source and repository works and the logs show no cipher or decryption failures.
Restrict permissions on the configuration file
Change ownership of config/configuration.yml so only the dedicated Redmine service account can read it, and remove read access for other local users and groups. Confirm the web server and application processes still start and can read the file. Check that the file is excluded from public paths and version control. You know this step is done when a listing of the file shows owner-only read access, the application restarts cleanly, and a second check from a non-service account shows the file cannot be read.
Document the key location and rotation owner
Write a short runbook entry that states where the cipher key is stored, who can retrieve it, how the backup that contains the key is protected, and who approves a rotation. Include the steps to restore the key alongside the database, since a backup without the key cannot decrypt the stored credentials. Ask your security team to confirm the runbook meets your key management policy. You know this step is done when the runbook has been reviewed, and a restore test on a scratch environment has successfully decrypted the LDAP and repository credentials.
Backups, key custody and access risks
Redmine encrypts LDAP bind and repository passwords with a cipher key kept in configuration.yml, so the protection is only as strong as the place that key lives. The cards below cover the paths that most often put the key next to the encrypted values, and the checks that show whether each path is closed.
Backup that holds both halves
A database dump with encrypted LDAP and SCM passwords, copied alongside a configuration backup, gives anyone who reads the backup everything needed to recover the credentials. Store database backups and key material in separate locations with separate access rights. Verify that the restore runbook fetches the key from a different system than the dump, and that the backup job does not archive the whole config directory by default.
Upgrade guideKey copies in deployment repositories
Configuration management repositories, Docker build contexts and shared drives often receive a copy of configuration.yml during setup or troubleshooting. Once committed, the key stays in history even after the file is deleted. Treat configuration.yml as a secret and keep it out of version control. Search the repositories and container images you own for the key value, and confirm that CI variables or a secrets manager supply it at deploy time.
Key exposure in logs and shell history
Commands that print configuration, rake task output, process listings and copied terminal sessions can reveal the key. Shell history on the admin workstation is a common place for it to persist. Avoid passing the key on the command line and check what your tooling logs. Verify that application and deployment logs do not echo configuration values, and that administrators clear or exclude history files that contain key material.
Administrators with both read paths
Anyone who can read the production database and the application server filesystem can decrypt every stored LDAP and repository password. This is a separation of duties question, not a Redmine setting. Limit the combination of database read access and file access to a small named group. Review who holds shell access to the Redmine host, who has database credentials, and whether those accounts are reviewed on a schedule you can show.
Key rotation and retained copies
Rotating the cipher key requires re-encrypting stored values, and old backups keep the previous key alive for as long as they exist. Plan rotation so that every retained backup of the old key is also retired or re-protected. Confirm the rotation procedure with your Redmine version's documentation, record when each key was in use, and check how long backups with the old key remain in your retention schedule.
Host and filesystem permissions
Readable configuration files, world-readable backup directories and temporary copies left by editors or deployment scripts widen the exposure beyond the application account. Restrict configuration.yml to the Redmine service user and remove stray copies. Check the file mode and owner on the live host, look for editor backup files and exported archives, and confirm that the service account is the only account that needs to read the file at runtime.
How to rotate the cipher key without locking out integrations
Rotating the cipher key is a planned change, not a configuration tweak. Redmine stores the LDAP bind password and repository credentials encrypted with the key in configuration.yml. Changing that key without first decrypting the stored values leaves them unreadable, so LDAP sign-in can fail for every user who depends on the bind and repository fetching can stop for every linked project. Before scheduling anything, confirm with the installed version's documentation whether it provides a supported rotation method that decrypts with the old key and re-encrypts with the new one. Do not assume that editing the key and running the encryption task again will convert existing values.
Build the runbook around a rehearsal. First, restore a recent backup of the database and the configuration.yml file that matches it into a separate environment, then run the rotation there and check that LDAP authentication and a repository fetch still work. Choose a maintenance window long enough to roll back, and agree in advance who approves the change and who can make the call to revert. Record where the old key and the new key are held, who can read them, and how the key is kept separate from the database backups, because a backup that contains the old key and the old ciphertext is only as protected as the key custody around it.
After the change, verify each integration instead of relying on the restart succeeding. Run an LDAP test login with a standard user account, confirm group synchronization still works, and fetch a changeset from each repository that uses stored credentials. Check the application log for decryption errors. Keep the old key available for the agreed rollback period, then retire it under your key management process. Ask any partner or internal team doing the work to show the rehearsal result and the rollback steps in writing before the production window.
Limits to confirm before you rely on encryption
Encrypting stored credentials only helps if the Redmine version, the key handling and the scope of encrypted fields match what you assume. The cards below cover the checks that connect the encryption task to your real configuration, from the version you run to the backups that hold the key.
Confirm the Redmine version
Check that your installed release includes the db:encrypt task and that the behavior you plan around is documented for that exact line. The supported lines are 7.0.x for full support, 6.1.x for fixes and security updates, and 6.0.x for important security updates only. Lines 5.1.x and older are unsupported, so encryption work on them should start with an upgrade plan. Read the version-specific notes before you rely on any behavior.
Confirm how the cipher key is generated
Establish who generated the key in configuration.yml, how long it is, and whether it was created on the server or copied from a template. A weak, shared or default key provides little protection for the bind password stored in the database. Record the generation method and the person responsible so the key can be rotated later without guesswork.
Confirm where the key is stored
The key in configuration.yml must not sit in the same place as an unprotected database dump. Check file permissions on the configuration file, who can read the application server's deployment directory, and whether configuration is pulled into version control or CI logs. Treat any location where the key and the encrypted values meet as one secret store to protect.
Confirm which fields are encrypted
Verify, from the release notes and your own test database, which fields Redmine encrypts. The LDAP bind password and repository credentials are the intended targets, but other fields may hold secrets too, such as webhook or integration settings from plugins. List every place a credential is typed into the administration screens and check each one against the encrypted set.
Review how plugins store secrets
Plugins that keep tokens, passwords or API keys in their own tables are outside the core encryption scope unless the plugin author uses the same mechanism. Ask each plugin vendor or maintainer whether secrets are encrypted, where they are stored and whether they are included in the upgrade process. Plugins that cannot answer should be tested against your backup and rotation plan before going live.
Confirm the migration of plaintext values
Check that every existing plaintext LDAP bind password and repository credential has been re-saved or encrypted, then query the database to confirm no readable copies remain in those tables. Also check that old unencrypted values were not left in logs, exports or earlier backups. Keep a record of the check so an auditor or a later upgrade can repeat it.
Confirm backups and rotation
Decide whether backups include the key, and what happens to restored data if the key is lost or changed. A backup of the database without the matching key cannot recover the stored credentials, while a backup that includes the key exposes them if it leaks. Test a restore in a separate environment, then document a rotation procedure that covers re-encrypting values after the key changes.
Questions teams ask before encrypting Redmine credentials
Does encrypting Redmine's stored LDAP and SCM passwords need outside help?
Not always. The core change is small: run the encryption task, store the cipher key in configuration.yml, and confirm that LDAP binds and repository connections still work. Outside help is most useful when the environment is complex, such as several LDAP directories, many repositories with stored credentials, a separate staging and production pair, or a backup and key custody process that must be reviewed by your compliance team. A written scope lets you compare your own effort with a partner's before any work starts.
How long does it take to plan and verify this change?
The effort depends on your environment and scope, so no fixed duration applies. Planning time grows with the number of LDAP sources, repositories and backup copies that hold the key. Verification time depends on how many integrations you must test after the change, such as LDAP sign-in, repository browsing and changeset fetching. Ask for a breakdown of planning, change execution, testing and documentation in any quote, and confirm the schedule against your own change calendar.
What does the work need from our team?
Plan for four inputs. First, database access sufficient to run the Redmine encryption task in a non-production copy and then in production. Second, a backup window and a verified backup taken before the change, since the key and the encrypted data must stay consistent. Third, write access to the configuration file on the application host, so the cipher key can be added and protected. Fourth, someone who can list every LDAP source and repository with stored credentials, along with the accounts that own them.
Can a team handle this alone?
Yes, if the team has Redmine administration skills, can work through the Redmine documentation on the encryption task, and has a tested restore path. The risks lie in the details: losing the cipher key makes stored credentials unreadable, and a backup that lacks the key cannot restore them. A team working alone should test in a copy, record where the key is kept, and check that a restored environment decrypts its credentials before relying on it.
What happens to existing sessions and integrations after a key change?
Stored LDAP bind passwords and repository credentials are encrypted with the cipher key, so any change to that key requires re-encrypting the stored values. If the key changes without that step, LDAP authentication and repository fetching can fail until credentials are re-entered. User sessions are a separate matter and depend on session settings such as the secret used for session cookies. Confirm the effect in a copy first, and schedule a check of LDAP sign-in and repository sync immediately after the change.
Is there a risk of breaking sign-in for users?
Yes, if the LDAP bind credentials stop decrypting. Users who authenticate against LDAP may be unable to sign in until the bind account works again. Before the change, record which LDAP sources are active, test a sign-in with a non-administrator account, and keep a local administrator account available with a known good login. This gives you a route back if the directory connection needs repair.
What should we request in a quote?
Ask for a written scope that names the Redmine version, the database engine, the number of LDAP sources and repositories with stored credentials, and the environments to be changed. Request the planned steps, including a copy test, a backup and restore check, key custody and storage, the rotation procedure, and post-change verification. Ask which deliverables you receive, such as a runbook and a record of the tests run, and which items you are responsible for providing. DeployOpen does not publish a price list, so a quote follows from that written scope.
How does key rotation affect backups?
Every backup that contains encrypted credentials also depends on the cipher key that was active when it was taken. Before rotating, decide how long older backups must remain restorable, and keep the matching keys under the same access controls as the backups themselves. Rotation plans should state which backups can be restored after the change and how the old key is retired, so a restore from an older archive does not fail unexpectedly.
Where the official Redmine documentation covers this
Start with the Redmine installation guide before you change anything about how credentials are stored. It is the place to confirm how the encryption cipher key is set in config/configuration.yml for your release, and how the db:encrypt task is run against an existing database. Read the section for your exact version, because the wording of the key setting and the task steps can differ between branches. Check the Redmine installation guide and confirm which Ruby, Rails and database combination your release supports before you run the task in a test copy.
The Redmine upgrade guide matters for this topic in two places. It describes the backup and copy steps for configuration, uploads and plugins when you move to a new installation, which is where the cipher key must travel with the database. It also lists the migration tasks to run after the copy. If you are upgrading across branches while encrypting credentials, confirm with the upgrade guide for your source and target versions whether the encryption step belongs before or after the upgrade, and record that order in your runbook.
The Redmine home page gives the feature context: multiple LDAP authentication support and SCM integration are core features, so the stored bind and repository credentials are part of ordinary operation rather than an optional add-on. Use it to confirm which features your instance actually uses before you scope the work. Do not treat the documentation as a substitute for checking your own release notes and plugin documentation, since plugins that store their own credentials may follow different rules.
How DeployOpen works on this
DeployOpen treats encryption of the LDAP bind and repository credentials as one part of running Redmine in your own infrastructure, scoped in writing before any change is made. The work covers the cipher key, the encryption task, backup handling and a rotation runbook that your team can operate after handover.
How we scope
- Inventory which LDAP sources and repository connections store credentials in your Redmine database today.
- Confirm your Redmine version, database engine and where configuration.yml and backups are kept.
- Agree in writing who holds the cipher key, where it is stored and who approves rotation.
How we build
- Set the cipher key in configuration.yml outside the web root and restrict read access to the service account.
- Run the db:encrypt task in a maintenance window after a verified database backup.
- Test LDAP login and repository fetches after encryption to confirm stored credentials still work.
How we hand over
- Document the key location, backup handling rules and the steps to restore a backup alongside its matching key.
- Provide a rotation runbook covering re-encryption, repository checks and rollback.
- Walk your operations team through the procedure and record the verification results.
How we support
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as retainers.
- Ask your DeployOpen contact to confirm how the scope handles future Redmine upgrades and plugin changes.

