How OpenBao issues short-lived PostgreSQL credentials
Many applications still connect to PostgreSQL with one long-lived password stored in a configuration file, a Kubernetes secret or a CI variable, and nobody is sure who has seen it or when it last changed. OpenBao's PostgreSQL database secrets engine replaces that pattern: it generates database credentials dynamically from configured roles, and each credential is issued as a lease that OpenBao can revoke automatically or in bulk. For accounts that must keep a fixed username, the engine offers static roles, and root credential rotation lets OpenBao change the password it uses to manage the database itself, so that password is no longer known only to the person who set it up.
The engine is enabled on a mount, configured with a connection string for a PostgreSQL account that has the privileges to create and drop roles, and then given roles that define the SQL statements run for each new login. In the connection configuration, password_authentication can be set to scram-sha-256, which matters if your server has moved off MD5 password authentication (PostgreSQL 18 deprecated it). Confirm the exact configuration keys, the default statements and the minimum PostgreSQL versions against the OpenBao documentation for the release you deploy, because the plugin's behavior is set per release. HashiCorp Vault has a PostgreSQL database secrets engine with the same role-based model. Treat it as a comparable pattern, and verify each setting in the Vault documentation before assuming the two are interchangeable.
OpenBao is an open source secrets manager and fork of Vault. Its repository is licensed under MPL-2.0 and the project is a Sandbox project of the Open Source Security Foundation (OpenSSF) under Linux Foundation stewardship. A Sandbox status means an early-stage project, so your review should cover the release cadence, the maintainers' response to security issues and your own support arrangements before you build critical access paths on it. Check which OpenBao minor line your organization will standardize on and confirm its upgrade path, because the secrets engine and its database plugins change between releases.
What you need before connecting OpenBao to PostgreSQL
Connecting OpenBao to PostgreSQL touches the database version, the OpenBao release you run, a management role, encrypted connections, network paths and the storage behind OpenBao itself. Each item below is a decision or check to settle before the first dynamic role is created, because changing any of them later means reworking the connection.
Supported PostgreSQL version
Confirm the PostgreSQL major version is still in support before you build around it. Versions 14 through 18 are supported, with 14 ending November 12, 2026 and 18 running to November 14, 2030. Plan a major upgrade first if your database is on version 13 or earlier, since those are unsupported and the credential work would sit on a database that no longer receives security fixes. Also confirm your password authentication is SCRAM, because the connection configuration accepts password_authentication=scram-sha-256.
Pinned OpenBao release
Pin one OpenBao release in your deployment manifests and record the version in your change log. v2.7.1 was the latest release supplied for this page, released October 1, 2026, and v2.6.4 covers the previous minor line. Check the release notes before you upgrade, and confirm that the database secrets engine behavior you rely on, such as static roles and root rotation, matches the version you choose.
OpenBao releasesManagement role for OpenBao
OpenBao needs a PostgreSQL login with rights to create and alter the roles it issues, grant them the privileges your applications need, and change its own password during root rotation. Create this role as a dedicated account, not the superuser or the owner of application databases. Decide which schemas and databases it can touch, and confirm with your DBA which privileges your PostgreSQL version and role model require so that rotation works without granting more than necessary.
TLS between OpenBao and PostgreSQL
Dynamic credentials are only as protected as the connection that carries them, so require TLS on every connection from OpenBao to PostgreSQL. Decide whether OpenBao verifies the server certificate against a private CA and whether it presents a client certificate. Confirm the certificate chain, subject names and expiry monitoring with your own PKI team, since the exact requirements depend on your environment and your PostgreSQL TLS configuration.
PostgreSQL secrets engine docsNetwork path from OpenBao
OpenBao must reach the PostgreSQL primary, and it should not reach it through a path that applications use for ordinary traffic. Map the firewall rules, routing and any connection pooler between the OpenBao nodes and the database endpoint, and confirm that the database accepts connections only from those nodes. If you put PgBouncer in front of PostgreSQL, decide whether OpenBao connects through the pooler or directly, because root rotation and role creation need a path that behaves predictably. Confirm exact port and firewall requirements in your own environment.
HA storage backend decision
OpenBao's officially supported HA backends are integrated storage (Raft) and PostgreSQL. Raft keeps the storage inside the OpenBao cluster, while PostgreSQL places OpenBao state in a database you already operate, and the docs describe PostgreSQL as easier to operate safely than Raft. Decide which one you will run before building, because it determines your backup, restore and node-replacement procedures. Note that the PostgreSQL backend stores OpenBao's own data, so it should not be the same instance that holds the application data you are issuing credentials for.
Storage backend docsChoosing dynamic roles, static roles or root rotation
Dynamic roles create a new PostgreSQL login for each lease and revoke it when the lease ends or is revoked. This suits applications that can request a fresh credential and reconnect on a schedule, such as services built with a framework that re-reads configuration on startup or a connection layer that can rebuild its pool. Each lease carries a time to live, so the application must renew or fetch a new credential before expiry. The pool has to be drained of connections that use the old login, which means the application cannot assume a username stays valid for its whole process lifetime.
- Connection pools: Pooled connections authenticate once, so a revoked login can keep working until the pool closes those connections. Plan a maximum connection lifetime shorter than the lease time to live.
- Revocation: Expiry and explicit revocation both drop the role in PostgreSQL. Test that a revoked session is refused on its next query.
- Application changes: Code must read credentials from OpenBao at runtime and handle reconnect errors, not cache a password at deploy time.
- Object ownership: Objects created by a dynamic role can outlive the role. Decide ownership and grants up front so that revocation does not break schema objects.
- Load on OpenBao: Every new connection can mean a lease request, so size the pool and the request rate together.
Confirm your framework's support for credential providers and how it closes connections when a password changes.
Static roles keep one existing PostgreSQL login and rotate its password on a schedule that OpenBao manages. Clients fetch the current password instead of receiving a new username. This fits legacy services, batch jobs, and third-party tools that require a fixed username in their configuration and cannot reconnect cleanly. The rotation schedule is the control: the shorter the period, the fewer long-lived passwords exist, but the more often consumers must refresh. The role itself must already exist in PostgreSQL, so ownership of that login stays with the database team.
- Fixed identity: The username stays the same, which keeps audit trails, grants and existing configuration intact.
- Rotation timing: Choose a period that works for the slowest consumer. Confirm which consumers fetch the password at startup and which read it on each use.
- Overlap risk: A consumer that holds an old password between rotations fails at the next connection attempt. Stagger rotation with scheduled jobs.
- Authentication method: Use SCRAM-SHA-256 for the stored password so the login matches your PostgreSQL authentication policy.
- Migration path: Static roles are often a stepping stone to dynamic roles once the consuming code can be changed.
Confirm with each legacy owner whether their software can re-read a password without a restart.
Root rotation changes the password of the account that OpenBao itself uses to create and revoke PostgreSQL logins. That account holds powerful privileges, so its password should be known only to OpenBao after initial setup. Rotating it removes the bootstrap password from configuration files and tickets. The root account is not an application identity and should never be handed to a workload. Plan this step before enabling dynamic roles, because the engine depends on that account working throughout.
- Scope: The root account needs enough privilege to create and drop roles. Limit it to that purpose and document why it exists.
- Rotation effect: A failed rotation can leave the engine unable to issue credentials. Test rotation in a non-production cluster first.
- Break-glass access: Decide who can recover the root password if OpenBao is unavailable, and store that procedure outside the cluster.
- Audit: Record each root rotation and the operator who initiated it.
- Cluster design: If PostgreSQL is replicated, confirm where the root account is valid after failover.
Confirm the rotation procedure and privilege list with your database team before the first production change.
Most estates use all three models, each for a different class of consumer. The decision follows from three questions: can the application obtain and reload a credential without a restart, does an external system require a fixed username, and does the component need the privileged account at all. Mapping each database consumer to one of these answers gives a clear inventory and a sequence of work. Applications that cannot change should keep a static role with a documented rotation schedule until they are updated.
- Inventory first: List every service, job and person that connects to each database, along with its connection method.
- Reconnect ability: Ask whether the client library can refresh credentials without a restart.
- Fixed username requirements: Identify tools that hard-code a username in audit or licensing logic.
- Privilege need: Only OpenBao should use the root account. Any workload that asks for it is a design error.
- Phased change: Move the most flexible services to dynamic roles first and keep legacy services on static roles until their owners agree to a change.
Confirm the inventory with application owners, since most surprises come from connection strings that were never documented.
Configuring the PostgreSQL secrets engine step by step
This sequence turns OpenBao into the single broker for PostgreSQL logins, so applications receive short-lived credentials, and no person or service holds the root password that OpenBao uses to create them. Each step ends with a check you can run before moving on.
Enable the database secrets engine
A platform or security engineer with administrative rights on OpenBao enables the database secrets engine at a chosen path, such as
database/, using the bao CLI or API. Decide the path and any namespace before this step, because roles and policies refer to it later. The step is done when the engine appears in the list of mounted secrets engines and responds to a read of its configuration path with no errors.Create a dedicated PostgreSQL management role
A PostgreSQL administrator creates a login role that OpenBao will use to manage other roles, and grants it only the privileges needed to create and drop login roles and to change their passwords. Avoid the superuser role and do not use the owner of application databases. Confirm the grant set against the PostgreSQL and OpenBao documentation for your version, since the required privileges depend on the statements your dynamic roles will run. The check is a login test from a psql session using that role, plus a failed attempt to read data from an application schema, which confirms the role is narrow.
Configure the connection with SCRAM authentication
The platform engineer writes the connection configuration for the PostgreSQL plugin, including the connection string, the management role, and
password_authenticationset toscram-sha-256. Confirm thatpg_hba.confon the server requires SCRAM for the management role and that the client connection uses TLS if the network path is not fully private. The check is a connection verification call from OpenBao that returns success, and a server-side look atpg_stat_sslor the connection log showing the expected authentication method.Define dynamic roles with creation statements and TTLs
The platform engineer creates one dynamic role per application or access pattern, specifying the SQL statements that create the login, grant privileges and set expiry, along with default and maximum TTLs for the leases. Keep grants at the level of the schema or table the application needs, and review each statement with the application owner. The check is generating a credential from the role with the read command, logging in with the returned username and password, and confirming that the lease shows the expected TTL and that the account is valid only within that window.
Add a static role for fixed accounts
For any account that cannot be recreated on demand, such as a vendor login or a legacy service account, the platform engineer defines a static role that points to an existing PostgreSQL user, along with a rotation period. OpenBao then changes that password on schedule and serves the current value to authorized clients. Record which applications depend on the static account, since they must read the password from OpenBao rather than hold a copy. The check is reading the static credential, logging in with it, and confirming the rotation timestamp changes after the scheduled interval.
Rotate the root credential
The security engineer runs root credential rotation on the connection, which sets a new password for the management role that only OpenBao knows and stores. Operators then stop using the original password, which should be removed from configuration files, wikis and pipelines. Confirm the rotation procedure and any documented limits with the OpenBao database plugin documentation before you run it in production, and store a recovery path under separate control. The check is that a fresh dynamic credential can still be generated, and that a login attempt with the original password fails.
Confirm leases are revoked and audited
The security engineer tests revocation by revoking one dynamic lease early, then confirms that the PostgreSQL login no longer authenticates and that the role has been dropped or disabled as designed. Enable audit logging on OpenBao and on PostgreSQL so that credential issuance, renewal and revocation are recorded and can be reviewed later. The step is complete when a revoked credential is refused, and the audit records show the issuance and revocation events for the test lease.
Why SCRAM and pg_hba.conf must change with the engine
PostgreSQL 18 deprecates MD5 password authentication in favor of SCRAM, so any role or client path still relying on MD5 needs a planned move before the dynamic engine goes live. The OpenBao PostgreSQL database plugin accepts password_authentication=scram-sha-256 in its connection configuration, and that setting should be treated as a requirement, not a preference. Before cutover, confirm the server side with SHOW password_encryption; on each primary and standby, and confirm that the value new passwords are stored under is scram-sha-256. Passwords set while the setting was md5 remain MD5 hashes until they are reset, so the static roles and the management role that OpenBao uses for root rotation need their passwords re-set after the change. Ask your DBA to list every role whose stored hash is still MD5 before scheduling the work.
Changing the hash type is not enough on its own, because pg_hba.conf decides which method a connection must use. Each entry that matches the management role used by OpenBao and each entry that matches the generated roles must name a method that accepts SCRAM, typically scram-sha-256, and must not fall through to an older md5 line. Review the file in order, since the first matching line wins, and keep the entries narrow by database, role and source address. Reload the configuration after edits and check the active rules in pg_hba_file_rules, a view that lists what the server is currently enforcing. Ask the team that owns the database which rule set is authoritative in your environment, and whether any pooler sits between OpenBao-issued clients and the server, because the pooler's own authentication settings must match.
Test with an existing account before cutover rather than switching the management role first. Pick a non-critical role, set its password under SCRAM, and connect from a host that represents the application path, confirming the method reported in the server log and in pg_stat_activity. Then repeat the test with a credential issued by a dynamic role in a staging database, so the full path from OpenBao to login is proven. Record the outcome for each client type. If a client library cannot negotiate SCRAM, the fix belongs in the client or its driver version, and that should be found now, not during rotation. Plan a rollback path that restores the previous hash setting and the previous pg_hba.conf file, and confirm who may approve each step.
Mapping OpenBao identities, roles and PostgreSQL grants
This table traces one application identity from its OpenBao auth method through its policy and database role to the PostgreSQL grants it receives. Read each row as a link in the chain, and check that the attributes on the right match what your own auth method and group structure provide. The main takeaway is that the database role should carry the least privilege the application needs, and the policy should limit which role each identity can request.
| Attribute | Server workload (AppRole) | Kubernetes workload | Human or SSO user (JWT/OIDC) |
|---|---|---|---|
| Auth method | AppRole, with role ID and secret ID delivered to the server | Kubernetes auth, bound to a service account and namespace | JWT/OIDC, mapped from identity provider groups |
| OpenBao policy | Read on the database credentials path for one role only | Read on the database credentials path for one role only | Read on a read-only or reporting role, if granted at all |
| Database role (OpenBao) | Dynamic role for the application schema, with a set TTL | Dynamic role or static role for a service account | Dynamic role issued per session, with a short TTL |
| Creation statement | Creates a login role with a generated password and an expiry, then applies grants | Same pattern as server workloads, scoped to the workload's schema | Same pattern, usually with fewer write grants |
| Revocation statement | Drops or disables the login role when the lease ends or is revoked | Same pattern, executed on lease expiry or pod removal | Revoked when the session or lease ends |
| PostgreSQL grants received | Connect, usage on schema, and only the table privileges the service needs | Connect, usage, and table privileges scoped to its namespace's schema | Select only, unless a documented need requires more |
| Who maps identities to groups | Confirm which team issues secret IDs and how often they rotate | Confirm service account naming and namespace ownership | Confirm the identity provider group names and who approves changes |
How an application gets and loses a database credential
The diagram starts with the application authenticating to OpenBao, which checks the request and asks the PostgreSQL database secrets engine to create a role for a fixed lease. The application then connects to PostgreSQL with that short-lived login. It renews the lease while it runs, and when the lease expires or is revoked, OpenBao drops the role. A separate root rotation path, shown on the right, lets OpenBao change the privileged password it uses to manage roles, so that password is never kept by people. Check that the OpenBao zone can reach PostgreSQL only on the required port and that the application can reach OpenBao but not the database admin credential.
Dynamic credential lifecycle from authentication through revocation, with the root rotation path.
Hardening the OpenBao to PostgreSQL trust path
OpenBao holds the most powerful database credential in the design, so the trust path between it, PostgreSQL and the applications deserves the same review as the database itself. The cards below cover the root credential, the roles that manage it, the connection, the policies that gate issuance, the audit trail and the storage layer. Together they give your security team concrete controls to review, though they do not make a deployment compliant on their own.
Rotate the root credential
The connection configuration for the PostgreSQL plugin holds a database account that can create and alter roles. After setup, rotate that root credential so that only OpenBao knows its current value, and confirm that the initial password is not kept in a configuration file, shell history or a ticket. Test a rotation on a non-production cluster first, then schedule it and record who owns the procedure. Ask DeployOpen or your team to document what happens if a rotation fails midway.
PostgreSQL plugin docsScope the management role
Grant OpenBao's management account only the privileges it needs to create and drop the roles it issues, rather than superuser rights. Review which schemas and objects that account can touch, and keep it separate from any administrator login used by people. Verify the grant set after each PostgreSQL major upgrade, since role and privilege behavior can change between versions. Write the grant list into your configuration repository so reviewers can compare it with the live database.
Encrypt the database connection
Credentials and query results travel between OpenBao and PostgreSQL, so require TLS on the connection and verify the server certificate rather than trusting any certificate. Set PostgreSQL to accept only SCRAM-based password authentication for these accounts, and confirm the client and server settings agree on the minimum TLS version. Ask your team to test a failed certificate check to prove the connection refuses to proceed. Certificate lifetimes and renewal need an owner before go-live.
Restrict which policies request roles
Any OpenBao token allowed to read a database role path can receive a working database login. Write policies that name each role path explicitly, bind them to specific auth methods such as AppRole or Kubernetes, and avoid wildcard paths that grant access to every role. Review the policies whenever an application is added or retired. Test with a token from one application to confirm it cannot read another application's role.
OpenBao auth methodsAudit lease issuance
Enable an OpenBao audit device so each credential request and lease is logged with the identity that made it. Pair these records with PostgreSQL connection logging so you can match a database session to a lease. Decide where logs are stored, who can read them, and how long they are kept, and confirm that the audit device blocks requests if logging fails. Keep the audit trail under the same access controls as the secrets it describes.
Choose storage and HA deliberately
OpenBao encrypts stored secrets before writing them to the storage backend, but the unseal material and the storage cluster still need protection. Compare integrated storage (Raft) with PostgreSQL as the backend, since the documentation describes PostgreSQL as easier to operate safely, and note that PostgreSQL can serve as both the secrets store and the managed database. Plan how many nodes run, how the unseal keys are held and how a standby takes over. Confirm the chosen storage version's HA behavior with the vendor before you commit.
Storage backend docsWhat changes in the applications
Moving to dynamic credentials changes how applications find their database password, so the application work is the part most likely to cause an outage if it is skipped. Start by inventorying every consumer of the database: web services, batch jobs, reporting tools, ETL pipelines, and any scripts that embed a connection string. For each one, record whether it reads credentials from a file or environment variable at startup, whether it can re-read them without a restart, and whether it holds connections open for hours. Applications with fixed connection strings, where the password is baked into a configuration file or container image, need a refresh mechanism before the shared password is retired. Confirm with each application owner how their framework and driver handle a changed password on a new connection.
The usual pattern is that the application or a sidecar asks OpenBao or Vault for a database credential, receives a username and password with a lease, and uses them to open its pool. Decide whether credentials are fetched once at startup or per lease, and make the application renew or re-fetch before the lease expires. When a lease ends, existing sessions may be terminated, so the pool must detect dead connections, discard them and open new ones with fresh credentials. If PgBouncer sits in front of PostgreSQL, check how your chosen version, which the researched facts list as 1.26.1 released October 14, 2026, handles authentication to the backend when the upstream password changes. Plan a reload or restart procedure for PgBouncer's user list if it is used, and test that procedure rather than assuming it works.
Hard-coded passwords must come out of configuration files, environment files, Helm values, CI variables and container images. Search your repositories and build pipelines for the existing password and for the connection strings that contain it, then rotate the shared password once the new path is live. Long-running jobs are the highest risk: a nightly batch that runs for six hours may outlive a short lease unless it renews. Test each job with a lease shorter than its runtime, confirm it recovers cleanly, and record what the job does on credential failure. Ask each vendor or internal team whether their tool supports dynamic credentials natively or needs a wrapper. Treat any tool that cannot re-authenticate as a documented exception with a named owner and a retirement date.
Common failures when credentials are dynamic
This table lists the failures teams most often hit when PostgreSQL logins come from OpenBao or Vault leases. Each row gives the likely cause, the check to run first and the fix, so you can work through a failed login or a broken job in order.
| Failure | Likely cause | Check to run | Fix |
|---|---|---|---|
| Secrets engine cannot create roles | The management role used in the connection configuration lacks CREATEROLE rights or the privileges to grant the roles it issues. | Connect as the management role and run a test CREATE ROLE statement, then check the role's attributes in pg_roles. | Grant the management role the minimum privileges needed to create, alter and drop the roles OpenBao issues, then rerun the connection test in OpenBao. |
| Logins fail with authentication errors | pg_hba.conf still requests md5 for the affected host, or the stored password was hashed with a different method than the client expects. | Check the password_encryption setting, the stored hash prefix in pg_authid, and the matching pg_hba.conf line for the client address. | Set password_encryption to scram-sha-256, set password_authentication to scram-sha-256 in the connection configuration, and change the pg_hba.conf entry to scram-sha-256. |
| Root rotation locks OpenBao out | The root credential was rotated in PostgreSQL, but OpenBao still holds the old value, or the new root password was not stored before rotation finished. | Attempt a connection with the stored root configuration, and review the OpenBao audit log for the rotation event and its result. | Keep a recovery path for the root account outside OpenBao, restore the root password through the PostgreSQL administrator, then write the new value back and test before retiring the old one. |
| Pooled connections fail after lease expiry | PgBouncer or the application pool keeps open sessions authenticated with credentials whose leases have been revoked. | Compare lease expiry times with pool connection lifetimes, and look for authentication failures in PostgreSQL and PgBouncer logs at the moment of revocation. | Set the pool's server lifetime below the lease TTL, make the application renew or reconnect before expiry, and confirm PgBouncer reloads credentials on its own schedule. |
| Batch jobs stop partway through | The lease TTL is shorter than the job's runtime, so the credential is revoked while the job still needs it. | Measure the longest runtime for each job over several recent runs, and compare it with the TTL on the role. | Lengthen the TTL for that role only, or have the job renew its lease at intervals, and keep the maximum TTL set so leases cannot stay open indefinitely. |
| Applications cannot reach the database port | Firewall or security group rules block the path from the application network to the PostgreSQL port, often after a network change. | Test TCP reachability from the application host to the database port, then check host firewall and cloud security group rules on both ends. | Open only the required source ranges to the PostgreSQL port, document the rule, and add the check to the deployment runbook. |
| Dynamic roles remain after applications stop | Leases were not revoked or the role was not cleaned up after the consuming service was retired, leaving unused database roles. | List roles in PostgreSQL that match the OpenBao naming pattern, and compare them with active leases in OpenBao. | Revoke leases for retired services, confirm the role is dropped, and review the naming and cleanup process as part of routine access reviews. |
| Static role password drifts from the application | A static role was rotated on a schedule, but the application still reads the old password from its own configuration. | Check the rotation period for the static role, and compare the failure timestamps with the rotation times in the OpenBao audit log. | Have the application fetch the secret at startup or on a short interval, rather than storing a copy in its configuration file, and test a rotation in staging first. |
Questions teams ask before connecting OpenBao to PostgreSQL
What drives the cost of connecting OpenBao to PostgreSQL?
The main cost drivers are the number of applications that will request credentials, the authentication methods those applications and people use, how each application's connection pool behaves, and the high availability design of both OpenBao and PostgreSQL. Each application needs its own role design, lease and renewal behavior, and a change to how it reads credentials, so a single service costs far less to connect than a fleet of services. Auth method choices matter because OpenBao documents methods such as AppRole, JWT/OIDC, Kubernetes, LDAP and TLS certificates, and each one adds identity configuration to test. An HA design for OpenBao, which can use integrated storage (Raft) or PostgreSQL as an officially supported HA backend, adds infrastructure and failover testing. Ask any provider to price these items separately in the written quote: applications in scope, auth methods, pooling changes, HA topology and the verification each one needs. Setup is typically a one-time cost, while patching, upgrades and rotation reviews recur.
What does my team need to provide before the work starts?
You need database administrator access to create the OpenBao service account and grant it the privileges required for role management, plus a named owner for each application that will change how it reads credentials. Network rules must allow OpenBao to reach the PostgreSQL primary, and allow applications to reach OpenBao and, where pooling is used, the pooler in front of PostgreSQL. Your security team should supply the TLS certificate authority, the identity provider or directory the auth methods will trust, and the audit logging destination. Application owners must confirm how their code reads a secret today, how long their connections live, and whether they can restart or reconnect when a credential changes. Missing any of these items is the most common reason a timeline slips, so ask the provider to list them in the scope document with a named owner for each.
Can my team connect OpenBao to PostgreSQL without outside help?
A team with working PostgreSQL and OpenBao experience can connect a single application on its own, because the database secrets engine is documented, supports dynamic roles, static roles and root credential rotation, and accepts password_authentication=scram-sha-256 in its connection configuration. The work becomes harder across many applications, because each one needs its own role, grant set, lease expectations and reconnect logic, and mistakes in one role can break another team's service. Operating OpenBao safely also requires knowledge of its HA model, storage backend, unsealing procedure and audit configuration. A useful test is whether someone on your team can explain how a revoked lease reaches a running application and what happens to that application's pool at the moment of revocation. If that question is hard to answer, an outside partner can help define the pattern once and hand over the runbooks.
How long does a PostgreSQL and OpenBao credential project take?
Duration depends on scope rather than on a fixed template, so no single figure applies to every organization. The main variables are the number of applications, whether each one can reconnect cleanly after a credential changes, how many auth methods must be integrated, and whether the OpenBao HA design and PostgreSQL failover path need new infrastructure. A pilot covering one application with dynamic roles is a very different project from a migration of shared passwords across a whole estate. Ask any provider to tie the timeline to named deliverables, such as the role model, the first application cutover, the rotation runbook and the restore test, rather than to a generic number of weeks. Your own calendar also matters, because application change windows and approval cycles often take longer than the technical work.
Does DeployOpen fix the scope in writing before work starts?
Yes. Most DeployOpen engagements are fixed-scope, which means the scope, deliverables and timelines are agreed in writing before work starts. For this topic, that agreement would normally name the applications in scope, the auth methods, the role and grant design, the pooling behavior to be verified, the OpenBao and PostgreSQL topology, the handover documents and the acceptance tests. Anything added later, such as a new application or an extra auth method, should go through a written change to the scope so cost and timing stay visible to both sides. Ask for the written scope to list what your team must provide and who on each side is accountable for it. DeployOpen does not publish a price list, so the quote follows from that written scope.
Will existing applications need code changes to use dynamic credentials?
Most applications need some change, because a shared password read once at startup does not match credentials that expire and are revoked. The required change depends on how the application connects. Applications that read a password from configuration at startup usually need a way to fetch a new lease, reconnect, and handle authentication errors when a lease is revoked. Applications behind a connection pool need the pool to recycle connections before or when a lease expires, which is where pool behavior becomes an engineering decision rather than a setting. Batch jobs and long-running workers need a plan for lease renewal. Ask the application owner to identify every place the password is used, including scripts, CI jobs and monitoring agents, because these are the places that break when a shared password is retired.
What must we verify before retiring the shared database passwords?
Verify that each application obtains a dynamic credential, connects successfully, renews or re-leases it on schedule, and recovers when a lease is revoked, all without a manual restart. Confirm that the connection configuration uses password_authentication=scram-sha-256 and that PostgreSQL's authentication rules in pg_hba.conf match that design. Test root credential rotation so you know the OpenBao root credential can change without breaking existing roles, and test static role rotation for any account that cannot be dynamic. Check the audit log shows who requested credentials and when they were revoked. Finally, run a failover or restore exercise against the HA design you chose, because a credential path that works only against the primary can fail when a standby is promoted. Record each result so the handover includes evidence, not just configuration.
What are the main risks of connecting OpenBao to PostgreSQL?
The most common risks are applications that cannot reconnect cleanly after revocation, pools that keep old connections open past their lease, and a root credential that is lost or rotated without a runbook. Another risk is a single OpenBao deployment becoming a dependency for every application without a tested HA plan, since applications may fail to start when OpenBao is unreachable. Overly broad roles, where one database role can read data it does not need, undo much of the benefit of dynamic credentials. Plan for these by testing each application's failure behavior, keeping a documented break-glass path for database administrators, and reviewing grants during design rather than after cutover. A pilot on a non-critical application will expose many of these issues before they reach production.
How we scope the credential migration
Scoping starts with an inventory of every place a shared PostgreSQL password is used today. The inventory is the first deliverable, because the cutover order depends on it. For each application, batch job, reporting tool and administrator account, record which database user it logs in as, where the password is stored (environment file, Kubernetes secret, CI variable, configuration file in a repository), which schemas and privileges the account holds, and how the application reconnects after a failure. Shared accounts that several services use are the usual source of surprises, so each one should be mapped to every consumer before any change is planned. Ask the client to confirm which systems can read the database password from Vault or OpenBao today and which need a configuration change.
The target role model is agreed in writing before any configuration is changed. It defines which OpenBao or Vault roles exist for the PostgreSQL database secrets engine, which of them are dynamic roles that create a new user per lease and which are static roles that rotate an existing account, and which privileges each role receives through its creation statements. It also decides who holds the root connection credential used for root rotation, where that credential is stored, and who may read or rotate it. Decisions on password_authentication set to scram-sha-256 and on the matching pg_hba.conf rules belong in the same document, since clients must support SCRAM before the switch. Confirm the exact creation and revocation statements against the current OpenBao PostgreSQL database secrets engine documentation for the version you run.
Cutover is sequenced per application, not for the whole estate at once. A reasonable order starts with a low-risk, well-understood service that can tolerate a restart, then moves on to services whose connection pools, long-running jobs or migration tools need extra work. Each step has an agreed rollback path, a named owner who checks login and query behavior, and a period in which the old shared password stays valid so it can be revoked only after the new path is proven. Schedule revocation of the legacy password as its own step with a sign-off. The inventory, role model and cutover order together form the statement of work, and the quote follows from that written scope.
How DeployOpen delivers dynamic PostgreSQL credentials
DeployOpen plans and builds the OpenBao or Vault setup that issues and revokes PostgreSQL credentials, inside infrastructure you control. Each engagement is scoped in writing first, then built, tested and handed over with the runbooks your database and security teams need to operate it.
How we scope
- Inventory which applications, batch jobs and administrators currently share PostgreSQL passwords and which roles each one needs.
- Agree in writing whether dynamic roles, static roles or both fit each consumer, and which database clusters are in scope.
- Confirm the OpenBao or Vault edition, storage backend, auth methods and the PostgreSQL version and SCRAM settings before any build begins.
How we build
- Configure the PostgreSQL database secrets engine with a rotated root credential and scram-sha-256 password authentication.
- Define dynamic role statements with least-privilege grants, lease durations and revocation behavior tested against real connections.
- Wire application identity through the agreed auth method and test lease renewal, expiry and bulk revocation during failure drills.
How we hand over
- Deliver the configuration as code, with a written record of roles, policies, lease settings and the root rotation procedure.
- Document application changes, including connection retry logic and how pools handle credential expiry, for your development teams.
- Run a handover session with your platform, database and security staff covering rotation, incident revocation and restore steps.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer, covering OpenBao or Vault releases and PostgreSQL minor updates.
- Retest the credential flows after each planned upgrade so lease behavior and access controls are checked again.
- Ask any provider, including DeployOpen, to confirm in the quote which upgrade, retest and incident response work is included.

