Why the Hyperswitch card vault needs key custodians
Custodians are the people who must jointly unlock the Hyperswitch card vault, and this page explains how that dual control works. A team self-hosting Hyperswitch that will store real card data has to show a PCI DSS reviewer who can open the locker, under what conditions, and how that access is recorded. The card vault, also called the locker, is a separate Rust service in the juspay/hyperswitch-card-vault repository. The Hyperswitch architecture docs describe it as built for PCI DSS requirements and as holding card data apart from the app server, which handles routing, retries and observability. Because the vault is its own service with its own data store, it needs its own key material and its own access procedures.
Dual control matters because no single engineer should be able to decrypt stored card data alone. The vault's encryption keys are split so that several named custodians each hold a part, and the vault can only be unlocked when a required number of them participate. This protects against an insider acting alone, a compromised laptop, or an administrator who has broad cluster access but should not hold card data in the clear. It also gives the assessor a concrete control to test: who the custodians are, how the split was generated, where each share is stored, and who approved each unlock. Confirm the exact threshold and key generation steps against the current vault documentation and your own design, since these details change between releases.
The decisions start before the first deployment. You need to name custodians from roles that will persist, decide how their shares are stored and backed up, and define the unlock sequence that runs after every restart, planned upgrade or failover. You also need a runbook for when a custodian leaves the organization or changes role, because a departing custodian who still holds a share is a finding in its own right. The sections that follow cover key generation, the unlock sequence and the leaver runbook in order.
Which custodian holding model fits your environment
In this model, each custodian receives a share of the key material on paper or a hardware token, and the unlock ceremony needs a quorum of named people in the same room or on the same call. The trust sits with the individuals. Your organization pays for their time at each restart, for secure storage of the shares and for the replacement work when someone leaves. Nothing in the cryptography enforces who sits at the table, so the controls are procedural: sign-in sheets, witnessed handovers and written minutes.
- Who is trusted: the named custodians and the witnesses who confirm the ceremony. Their personal integrity and continued employment carry the control.
- Running cost: mostly labor. Each restart needs a quorum available, and each departure triggers a re-split and re-issue of shares.
- One-time cost: safe storage for paper or tokens, plus the ceremony design and a written runbook.
- Audit trail: the paper log, signed minutes and the tamper-evident storage records you maintain yourself. Auditors will ask how you prove that a share was not copied.
- Failure mode: an unavailable quorum delays the vault after a restart, so plan the custodian roster with spare people in different time zones.
Before choosing this model, confirm with your assessor how they will test custodian separation and whether they accept manual logs as evidence of dual control.
Here the key shares are held in a secrets backend, and an unlock request needs approval from a second authorized person before the backend releases the material. The approvals are recorded by the backend itself, so the custodians do not have to hold raw key shares on paper. The trust moves to the backend's access policy, its administrators and the approval workflow. The Hyperswitch vault and encryption service can be wired to a supported secrets backend, and the specific backend choices are covered in the sibling topics on HashiCorp Vault, AWS KMS and HSM integration.
- Who is trusted: the backend administrators, the people who write its policies and the approvers. Separation of these roles is the control to verify.
- Running cost: platform time to run and patch the backend, and license or hosting cost if you use a commercial edition. Ask vendors for the exact licensing model in writing.
- One-time cost: designing approval policies, integrating the unlock path and testing failover.
- Audit trail: backend audit logs that record who requested, who approved and when, which are usually easier to export than paper minutes.
- Failure mode: if the backend or its identity provider is down, the vault cannot unlock, so the backend's own availability becomes part of the vault's availability.
Ask your team whether the approvers can also administer the backend, because that overlap weakens the separation you are trying to show.
This model combines custodian shares with a hardware security module or a cloud key management service, so the root key never leaves protected hardware or the provider's controlled boundary. The custodians still take part in the ceremony, but they authorize use of a key rather than handling its plaintext. This is the most expensive model to run and the one that produces the strongest key-custody evidence. Whether an HSM is worth it depends on your regulator, your key volume and your in-house skills. The sibling topics on the HSM and KMS integrations describe the configuration.
- Who is trusted: the HSM or KMS operator and the provider's controls, plus the custodians for authorization. Responsibility is split between you and the provider.
- Running cost: hardware or service fees, support contracts and the skills to administer key policies. A cloud KMS charges per key and per request, so confirm its pricing and request volumes in writing.
- One-time cost: procurement or account setup, key policy design, and integration testing with the vault's configuration.
- Audit trail: the strongest of the three, usually including hardware logs or provider key-usage logs tied to each key operation, which you should export to your own log store.
- Failure mode: hardware failure or a misconfigured key policy can lock out the vault, so backup and recovery of the key material must be designed before go-live.
Ask the provider for its audit and compliance documentation and check that the custodian procedure matches the key policy you actually deploy.
The unlock sequence after every restart
This sequence takes the card vault from a locked state to serving requests after a pod restart, node drain or planned maintenance. Each step ends with a recorded check, so the team can show who unlocked the vault, when, and that the app server can reach it.
Confirm the vault pods are running
The platform engineer on call checks that every card vault pod has been rescheduled and is running, and that the database and secrets backend it depends on are reachable from the cluster. Start with pod status and recent events in the vault namespace, then confirm the vault health endpoint responds. Do not start an unlock while pods are crash-looping or waiting on storage, because a session opened against a half-started instance can leave you unsure which node holds the state. The step is done when every expected pod reports ready and the health endpoint returns a locked status rather than an error.
Open a controlled unlock session
The unlock lead opens a single, logged session for this restart and names the custodians who are expected to take part. Only the lead and the custodians should be present, and no custodian should share a terminal or pass a share to someone else. Record the change or incident reference, the reason for the restart and the list of custodians on duty. The step is done when the session record exists and each custodian has confirmed their identity to the lead.
Enter each custodian share
Each custodian enters their own key share into the vault unlock interface, one at a time, from their own workstation. Shares should never be typed into chat, tickets or shared documents. After each entry, the vault reports how many shares it has received against the threshold, without revealing the value. The step is done when the custodian sees an accepted confirmation and the lead records the time of each entry. The exact entry method and commands must be confirmed in the vault documentation for the version you run.
Verify the combined threshold
Once the required number of shares has been entered, the vault combines them and checks that the result is valid for its stored key material. The unlock lead confirms that the vault status changes from locked to unlocked and that no pod has reported a key error in its logs. If the combination fails, stop, do not re-enter shares repeatedly, and follow your incident process to determine whether the shares or the key material are wrong. The step is done when the vault reports unlocked on every pod that should serve requests.
Confirm vault health on every replica
The engineer checks the readiness and health endpoints on each vault replica, not only the one behind the service, because a replica that missed the unlock can still receive traffic if readiness is not tied to the unlock state. Confirm that the readiness probe reflects unlocked status. Review the vault logs for errors since the unlock began. The step is done when every replica reports healthy and ready, and the results are attached to the session record.
Test the app server path to the vault
The platform engineer confirms that the Hyperswitch app server can reach the vault over the network path and TLS configuration your deployment uses. Run a non-production test that exercises the vault from the app server, such as a read or tokenization call against a test record, and confirm the response. Check the app server logs for connection or certificate errors. The step is done when the test call succeeds and the app server logs show no vault connection failures during the test window.
Record the unlock and close the session
The unlock lead closes the session record with the time the vault became available, the custodians who took part, the number of shares entered, the checks performed and any anomalies. Store the record where your audit team can retrieve it, and confirm that it does not contain share values. Reconcile the custodian list against the roster for the period. The step is done when the record is complete and reviewed, and the lead confirms the vault is cleared for normal traffic.
How custodians, the vault and the app server interact at unlock
The diagram starts with custodians each submitting their key share to the card vault, which holds the locked state. A threshold check runs before the vault unlocks its key material, and only then can the Router app server and Scheduler reach the vault to read or write card data. Check that the vault's key storage sits inside the trust boundary, that no custodian share is cached outside it, and that the Scheduler is only reachable after unlock.
Custodian shares feed a threshold check before the vault and app services can reach card data.
Risks that break dual control in practice
Dual control on the Hyperswitch vault fails less often in design than in daily operation. The cards below cover the habits and gaps that quietly defeat a threshold scheme, and the control to put in place for each one.
Custodians sharing one share
When two custodians pass a share between them, the threshold still looks met on paper but no longer proves two people were involved. Each custodian should receive a share once, in a controlled handover, and enter it themselves during the unlock. Record which custodian holds which share and confirm that no share is copied to a shared drive, chat or ticket. Use one named person per share as the rule your runbook states in plain words.
Share stored on a laptop
A share kept on a personal laptop, in a notes app or in a synced cloud folder is exposed to device loss, malware and account takeover, and it leaves no custody trail. Require shares to be held in an approved secrets store or sealed, access-logged medium that the custodian retrieves only during an unlock. Confirm with your security team which storage meets your key management policy before the first custodian receives a share.
Unlock from an unrecorded session
An unlock run from an unmonitored terminal or a shared administrator session makes it impossible to show who entered which share and when. Run every unlock from a bastion or jump host with session recording enabled, under named accounts, and keep the terminal output in your log store. Ask the vendor and your platform team which unlock steps print to logs and which do not, and test that the record is complete before go-live.
Too few custodians after turnover
If the number of active custodians falls below the reconstruction threshold, the vault cannot be unlocked after a restart, and the outage lasts until the missing shares are recreated. Staff changes, leave and role moves all reduce the pool over time. Track custodian headcount against the threshold in your access reviews, and set a rule that a replacement custodian is enrolled before a departing one loses access. Confirm the threshold value in your configuration before you plan replacements.
Restarts without a runbook
A restart during business hours with no written unlock sequence pushes engineers to improvise, often by asking custodians over chat or skipping steps. Write the unlock sequence as a numbered runbook covering who to page, which host to use, the order of share entry and how to verify the vault is serving requests. Rehearse it in a non-production environment with the same custodians who will perform it in production.
Shares stored with encrypted data
If key shares sit in the same database, backup set, bucket or Kubernetes secret as the encrypted card data, a single access path exposes both halves of the protection. Separate the storage locations for shares, encrypted vault data and backups, with different access groups and logging. Review your backup restore procedure to confirm that restoring data does not also restore or expose shares.
Runbook when a custodian leaves
This sequence gives the team a repeatable response when a key custodian leaves or loses their role, so that no departed person can still reach the key material and the remaining custodians can still unlock the vault. It ends with a register entry and a tested unlock that prove the change is complete.
Log the departure and freeze custodian actions
The security lead records the departure in the incident or change ticket, with the custodian's name, the effective date and the people who now hold the custodian role. Until the revocation steps are complete, no unlock or key ceremony is scheduled. Done means the ticket is open, the owner is named and the team has agreed that the departing person is out of the ceremony pool.
Revoke access to shares and approvals
The platform team removes the departing custodian from the share store, including any password vault entries, cloud IAM roles, hardware token records and group memberships that could read or release a share. The same person is removed from any approval rights used for vault operations. Done means a named reviewer confirms, from the access lists themselves rather than from memory, that the person can no longer read or approve anything.
Determine whether the share may be exposed
The security lead reviews the custodian's access logs, device handling and any copies of the share they may have made, and records whether the share could have been exposed. The answer decides the next step: a share with no sign of exposure may be retired on a planned schedule, while a possibly exposed share should be treated as compromised. Done means the decision and its evidence are written in the ticket and signed off by the security lead.
Decide whether to re-issue shares
Using the threshold scheme the vault was set up with, the team decides whether the remaining shares still meet the unlock threshold and whether the key ceremony must generate new shares. If the departed custodian's share may be exposed, the team plans re-issuance so the old share is no longer valid for the threshold. Confirm the exact re-issue procedure, and whether it touches the master key, with the Hyperswitch documentation and the vault version in use before any ceremony. Done means a written decision exists, including the new threshold and the custodian count.
Run the ceremony with the remaining custodians
If re-issuance is approved, the ceremony runs with at least the threshold number of remaining custodians present, following the same witnessed procedure used for the original key generation. Each new share is delivered to its new holder and the old share is destroyed or retired under the documented process. Done means each custodian confirms receipt, the destruction is recorded and the ceremony log is filed with the ticket.
Update the custodian register
The custodian register is updated to show the departed person's end date, the revocation evidence, the exposure decision, the new custodian list and the share version now in use. The register's previous entries stay in place as history. Done means the register matches the access lists and the ceremony log, and a second reviewer has checked the entries against both.
Test the unlock with remaining custodians
The team performs a full unlock of the vault in a non-production environment, or in a controlled window that the vault owner approves, using only the custodians who remain. The test confirms the threshold works, the departed person's share no longer unlocks anything and the application can read stored cards after unlock. Done means the test result is recorded, any failure is resolved, and the ticket is closed with a link to the register entry.
Custodian and unlock options compared
This table compares the main choices for custodian count, threshold, share storage, unlock method and recovery for the Hyperswitch vault. Read each row as a decision: the right column shows when the option fits and what it costs in operator time and audit evidence. The main takeaway is that fewer custodians and more automation lower daily load but raise the stakes of each approval, so confirm the threshold with your own risk owners before generating keys.
| Decision | Option | Trade-off in operational load | When it fits |
|---|---|---|---|
| Custodian count and threshold | Small named group with a threshold you set | Low staffing load, but one absence can block every restart | Teams with stable staff and a clear on-call rota |
| Custodian count and threshold | Larger group with a higher threshold | More people to train and coordinate, stronger protection against a single insider | Organizations whose assessors expect split knowledge across roles |
| Share storage | Individual custodians hold their own share | Strongest separation, highest effort to keep shares available and rotated | Regulated teams that want named accountability for each share |
| Share storage | Secrets backend or KMS holds shares under access policy | Lower daily effort, but administrators of the backend become a control point | Stacks already running HashiCorp Vault, a cloud KMS or similar |
| Share storage | Hardware security module holds keys | Highest setup and change effort, with audit trails tied to device procedures | Programs where key custody is a formal requirement and budget allows |
| Unlock method | Manual unlock session after each restart | Predictable and easy to audit, but needs custodians online at every restart | Low restart frequency and mature change windows |
| Unlock method | Automated unlock with approval step | Faster recovery, but the approval workflow and its access rules must be reviewed carefully | Clusters that restart often or run on automated node recycling |
| Recovery procedure | Documented runbook with tested custodian replacement | Requires periodic drills and records of each exercise | Any team that expects staff changes during the key lifetime |
| Recovery procedure | Ad hoc recovery by whoever remembers the steps | Lowest upfront effort, highest risk of error and weak evidence | Not recommended for production vault keys |
Questions teams ask before running dual control on Hyperswitch
How much effort does the key ceremony take, and who runs it?
The key ceremony is a planned, witnessed event in which the master key and custodian keys are generated and split, and its effort depends on how many custodians you name, how many environments need keys, and how much of the procedure you write down before the day. Your security or platform team usually runs the ceremony, with each custodian present in person or on a call you record according to your own policy. The Hyperswitch docs do not supply a duration for this step, so ask any partner for a written ceremony plan with estimated hours per environment before you agree a quote. Effort rises sharply if you have to rehearse the procedure in a non-production stack first.
Can our team run dual control on Hyperswitch without outside help?
Yes, if your team has Kubernetes, secrets management and change control skills and someone who can own the runbook over time. Outside help is most useful for designing the custodian model, wiring the unlock sequence into your restart process and producing evidence that your assessor will accept. A DeployOpen engagement is fixed-scope, with deliverables and timelines agreed in writing before work starts, so you can decide which parts to keep in-house. Confirm with the Hyperswitch project which configuration keys and key formats your release expects, because these change between versions.
What does dual control require from our organization?
It requires named custodians who are independent of each other, a documented change control process for any key action, and evidence that each action happened as planned. In practice you need a custodian roster with backups, a rule for who can authorize a custodian change, and a log that records generation, split, unlock and rotation events with the people involved. Your policy should say where custodian keys are stored, how they are handed over and how a departing custodian's access is removed. Hyperswitch does not supply a fixed custodian count, so set it from your own risk assessment and confirm the approach with your assessor.
How often does the vault need to be unlocked, and is it planned?
The vault must be unlocked again after each restart of its service, so the frequency follows your restart pattern, including planned upgrades, node drains and unplanned failures. Planned unlocks are the normal case and should be scheduled with the custodians available, in a window your operations team has agreed. Unplanned restarts are the risk, because the vault stays unavailable until enough custodians can complete the sequence. Ask your team to measure restarts over a few months, and design availability around the custodian roster, not only the pods.
What will a PCI DSS assessor ask to see for key custody?
An assessor will typically ask how keys are generated, who can access them, how dual control is enforced, how key changes are approved and logged, and how custodians are removed when they leave. They will also check that your documented procedures match what happens during a real unlock or rotation. Gather the custodian roster, the ceremony record, change tickets, access reviews and restart logs before the assessment starts. The assessor and any certification body make the final determination, and DeployOpen prepares the evidence but does not issue audit reports or certifications. Confirm the specific requirements that apply to your scope with your assessor.
What drives the cost of this work up or down?
The main drivers are the number of environments with their own keys, the choice of key backend, the number of custodians and backups, how much of the runbook already exists, and how many restarts you expect to plan for. Cost is mostly one-time for design and the first ceremony, then recurring for custodian rotation, drills, evidence collection and runbook updates. Ask any partner for a quote that separates these items and states which Hyperswitch release and backend it covers. DeployOpen does not publish a price list, and a quote follows from the written scope.
Security and operational controls for the unlock process
Dual control only protects card data if the people and systems around it are controlled too. The cards below cover the controls that connect custodian duties, unlock events and vault health in a self-hosted, in-house PCI model, where the merchant carries PCI DSS responsibility as the Hyperswitch docs state.
Separate custodians from operators
Custodians hold key material and operators run the cluster, and the two roles should not overlap. If one engineer can both read a custodian share and restart the locker pods, dual control becomes a formality. Write down which people hold which shares, which people hold cluster admin rights, and confirm that no individual sits in both sets.
In-house PCI modelLog every unlock event
Each unlock attempt, successful or failed, should produce a record that names the custodians involved, the time, the target vault instance and the outcome. Ship these logs to storage the operators cannot edit. Ask your team to confirm which unlock events the Hyperswitch vault emits natively and which need wrapper tooling around the unlock step.
Monitor vault health continuously
Alert on locker pods that stay in a locked or unready state, on failed unlock attempts and on connectivity loss between the app server and the card vault. A locked vault looks like a payment outage to the business, so the alert should route to the on-call team who can act on it, not only to a dashboard. Confirm the health endpoints your chosen deployment exposes before writing alert rules.
Run restart drills
Schedule restart drills in a non-production environment that follow the full unlock sequence with the custodians who would perform it in an incident. Time the drill, record which step needed a person to look something up, and fix the runbook before the next drill. A drill that has never been run usually fails on the first real restart, often at a missing share or an expired credential.
Review custodian access regularly
Custodian access should be reviewed on a set schedule and whenever a role changes. Check that each custodian still has a current share, a working login to the systems they need, and no leftover access from a previous role. Pair this review with the leaver runbook so removals and re-issuance are recorded in the same place as the unlock logs.
Hyperswitch self-hosting docsSetting up dual control before the first saved card
This sequence turns the vault's unlock process into a documented, tested control before any customer card is stored. Each step produces evidence that the custodians, key material and restart procedure work as designed. The result is a vault that can be restarted and unlocked on demand without anyone holding a complete key alone.
Decide custodian roles and threshold
The security owner and the platform lead agree on how many custodians hold key shares, how many must be present to unlock the vault, and who is eligible to be a custodian. Record the names of the individuals, their backup alternates and the role each one plays in the ceremony. Confirm the chosen threshold with your compliance team and with the Hyperswitch documentation for the key storage backend you use. The step is done when a signed custodian register exists and no single person can reconstruct a key alone.
Generate keys in a controlled ceremony
Run key generation with the custodians present, on an air-gapped or tightly controlled workstation, following a written script. Generate the master key and the custodian key material using the procedure described in the Hyperswitch vault documentation for your deployment model. Watch the output, log who was present, and avoid writing shares to shared disks or chat tools. The step is done when the ceremony log is signed by each custodian and the generation output has been verified against the expected key format.
Store key shares separately
Give each custodian their share in a separate, access-controlled store, such as an encrypted offline medium or a secrets manager entry only that custodian can read. Keep shares in different physical locations or accounts so that one incident does not expose the threshold. Confirm that no copy of a share sits in source control, CI variables or ticketing systems. The step is done when you can list where every share is held and each custodian confirms receipt in writing.
Configure the vault to require unlock
Configure the locker and the encryption service so that the application cannot read stored card data until the threshold of custodians has supplied their shares. Set the unlock behavior and the backend settings according to the deployment guide for the vault in the sibling topic on deploying the card vault. Confirm that the configuration is stored in version control without any secret values. The step is done when a test start of the service stays locked until the configured number of shares is provided.
Run a restart and unlock drill
Restart the vault in a non-production environment and have the custodians perform the unlock sequence exactly as the runbook describes. Time nothing for compliance purposes, but record every step, every error and every person involved. Test one case where a custodian is missing to confirm the service does not unlock below the threshold. The step is done when the drill completes from a cold restart, the failure case is confirmed, and the runbook is corrected for any gaps found.
Record evidence of the setup
Assemble the evidence pack: the custodian register, the signed ceremony log, the share storage map, the configuration diff, the drill record and the runbook version. Store it in a system your compliance and audit teams can access, with restricted write permissions. Ask your independent assessor which artifacts they expect for key management controls before you finalize the pack. The step is done when the security owner signs off the pack and the approved version is referenced in the change record.
Allow real card data only after sign-off
Keep the vault in a non-production or test mode until every previous step is signed off. Confirm the scope boundary with your PCI DSS assessor, since the card data environment is defined by what the vault stores and who can reach it. Then enable live card storage and save a first test card through the normal flow. The step is done when the first live save succeeds, the unlock state is confirmed in monitoring, and the change record links to the evidence pack.
How DeployOpen scopes dual control for your vault
DeployOpen scopes dual control for your Hyperswitch vault as a fixed-scope engagement with the scope, deliverables and timeline agreed in writing before any work starts. The first step is a custodian design workshop with your security, compliance and platform leads. In that workshop we decide how many custodians hold key material, how their shares are split, who can stand in for an absent custodian, where the master and custodian keys are generated and stored, and which backend (cloud KMS, HashiCorp Vault or an HSM) holds the key material. Those decisions shape everything that follows, so they should be settled before any configuration is written.
From there, DeployOpen drafts the unlock runbook and the custodian departure runbook, then runs a restart drill in your non-production environment. The drill walks each custodian through the unlock sequence after a simulated restart of the vault, and records who did what, how long each step took and where the sequence stalled. We then assemble the evidence an assessor will ask for: the documented key ceremony, custodian appointment records, access and change logs and drill results. DeployOpen prepares these systems, controls and evidence. It does not issue audit reports, attestations or certifications. Your assessor or certification body makes that determination, so confirm early which artifacts they expect.
Ongoing support is available as a retainer. Typical retainer work includes re-running the restart drill after upgrades, rotating custodians when staff change, and retesting the runbooks against new Hyperswitch releases. Ask any provider for the written scope, the named deliverables and the acceptance criteria, and confirm how custodian onboarding and offboarding are handled in your own HR process. Those answers determine whether the runbook holds up on the day a custodian leaves.

