Bring Your Own Key (BYOK) Encryption for a PII Vault

Why BYOK Is a Procurement Gate

“Who holds the encryption keys?” is the question that decides whether your security review gets a green stamp or sits in a queue for six months. Regulated buyers — banks, insurers, healthcare, government, universities — increasingly refuse to ship sensitive data to any vendor whose answer is “we hold them.”

Bring Your Own Key (BYOK) lets the customer retain custody of the cryptographic key that protects their data, even when the application processing that data runs in a vendor-managed environment. It is the difference between “trust the vendor with your data” and “trust the vendor with cipher-text that they cannot decrypt without your key.”

For any vault holding PII, PHI, PCI, or KYC, BYOK is rapidly moving from “nice to have” to “table stakes.” Modern compliance frameworks — SOC 2, ISO 27001, HIPAA, PCI DSS, FedRAMP, IRAP — all expect documented key custody, and the cleanest answer is “the customer’s own KMS, not the vendor’s.”

Databunker Pro’s Key Hierarchy

Databunker Pro is built around a three-layer key hierarchy specifically designed to make BYOK natural:

Customer-managed · BYOK
Wrapping Key
Lives in your KMS, HSM, or HashiCorp Vault. You retain full custody and control rotation.
Master Key
Never exposed to users or operators. Unwrapped once at startup, held only in Databunker Pro's memory.
Per-record AES-256 envelopes
One envelope per encrypted PII record, FIPS 140-2 compliant. The actual cryptography against customer data.

Three independent keys, three different jobs:

  1. Per-record data keys — AES-256, one envelope per encrypted record. Where the actual cryptography against PII happens. FIPS 140-2 compliant.
  2. Master Key — encrypts the per-record envelopes. Never exposed to users, administrators, or operators. Generated once during initial setup and stored only in encrypted form.
  3. Wrapping Key — encrypts the Master Key. This is the key you bring. It lives wherever you decide: AWS KMS, Azure Key Vault, GCP KMS, HashiCorp Vault, on-prem HSM, or even a Kubernetes secret for development.

The Master Key never leaves Databunker Pro’s memory in plaintext. The data envelopes never leave the database in plaintext. The Wrapping Key never leaves your KMS in plaintext. Three layers, three custody boundaries.

Where Your Wrapping Key Can Live

Backend When to use
AWS KMS AWS-resident deployments. Inherit your AWS account’s IAM and CloudTrail audit.
Azure Key Vault Azure-resident deployments. Use existing Key Vault HSM SKU for FIPS 140-2 Level 3.
GCP KMS GCP-resident deployments. Inherit Cloud Audit Logs.
HashiCorp Vault Multi-cloud or on-prem. Useful when you already operate a Vault cluster for secrets.
On-prem HSM Highest-assurance regulated industries (banking, defence, government). Requires custom integration; let us know your model.
Kubernetes secret Development and staging only. Production deployments should use one of the above.

You can also operate different wrapping-key backends per environment — production in AWS KMS with strict IAM, staging in a Kubernetes secret — without changing the application code that talks to Databunker Pro.

Why This BYOK Model Is Stronger Than Most

A common shortcut other vendors take is to use a customer-supplied KMS key to encrypt individual records directly. That technically counts as BYOK, but it has two real problems:

  1. You cannot rotate the key without re-encrypting every record. A rotation that should take a minute turns into a multi-hour batch job on millions of rows, with a non-zero risk of dropping records in flight.
  2. Every read of every record makes a KMS API call. This is expensive at scale and hammers your KMS rate limit.

Databunker Pro’s wrapping-key model avoids both:

  • Rotation without re-encryption. When you rotate the Wrapping Key, Databunker Pro re-encrypts the Master Key (one small operation) and you are done. The millions of per-record envelopes stay untouched because they were never encrypted with your wrapping key directly.
  • KMS calls only on startup. The Master Key is unwrapped once at process start and held in memory. Steady-state reads and writes do not call your KMS.

This is what makes BYOK operationally viable, not just contractually viable.

Wrapping-Key Rotation in Practice

Rotation is a single API call. Behind the scenes:

  1. You generate (or rotate to) a new Wrapping Key in your KMS.
  2. Databunker Pro unwraps the Master Key with the old Wrapping Key.
  3. Databunker Pro re-wraps the Master Key with the new Wrapping Key.
  4. The new Wrapping Key reference is stored. The old one can be retired in your KMS.

There is no re-encryption of stored PII. There is no downtime. There is no per-record migration. You can rotate quarterly — or daily, if you want to — without operational impact.

This makes Databunker Pro fit naturally into compliance frameworks that mandate periodic key rotation (PCI DSS 3.6.4, NIST 800-57, ISO 27001 Annex A.10).

Recovery: Shamir’s Secret Sharing

What happens if you lose the Wrapping Key — say your KMS account is compromised and rotated, or your HashiCorp Vault is restored from an old backup that no longer has the key?

Databunker Pro generates five Shamir Key Shares during initial setup, encoded under a 3-of-5 threshold scheme (Shamir’s Secret Sharing). Any three of the five shares can reconstruct the Wrapping Key.

The standard practice:

  • Distribute the five shares to five different trustees — typically the CISO, the CTO, the DPO, the head of platform, and an offline escrow.
  • No single trustee can recover the key. Any three together can.
  • If three are unavailable simultaneously, the key is irrecoverable — by design.

This gives you the resilience of a backup without the risk of a single point of compromise. It is the recommended disaster-recovery posture for any production Databunker Pro deployment.

BYOK and Multi-Tenancy

For SaaS providers running a single Databunker Pro instance with many tenants (PostgreSQL Row-Level Security), the wrapping key is instance-wide — not per-tenant. Each tenant’s data is cryptographically isolated at the database layer via RLS, but they share the same Master Key envelope.

For SaaS providers whose customers genuinely demand per-customer key custody (“I want to revoke access by destroying my key, not by asking you to delete rows”), the right pattern is one Databunker Pro instance per customer — usually as the highest tier of your offering, where the customer pays for the operational overhead in exchange for sovereign key control. Combined with multi-jurisdiction deployment, this gives you a clean enterprise SKU.

What About HYOK?

Hold Your Own Key (HYOK) is the stricter sibling of BYOK: the key never leaves the customer’s environment, even for use — every cryptographic operation runs against the customer-side key service. This is a much harder operational model: every encrypt/decrypt becomes a network round-trip.

Databunker Pro’s wrapping-key architecture is BYOK by design. True HYOK against the per-record envelopes is on the roadmap for the highest-tier enterprise SKU; if you need it today, contact us and we will scope an integration.

BYOK Across Your Compliance Programmes

Framework What BYOK gives your auditor
SOC 2 (CC6.1, CC6.7) Documented key management, customer-controlled rotation.
ISO 27001 (Annex A.10) Cryptographic key lifecycle managed inside customer’s policy boundary.
HIPAA (164.312(a)(2)(iv)) “Encryption and decryption” with documented key custody.
PCI DSS (3.5, 3.6) Key-management evidence, including rotation cadence.
GDPR (Article 32) “Appropriate technical measures” — encryption with verifiable custody.
FedRAMP / IRAP Customer-controlled cryptography aligned with sovereignty requirements.

In every framework, “the customer holds the key” is a stronger answer than “the vendor holds the key.” BYOK turns one of the hardest control narratives into one of the easiest.

Getting Started with BYOK

  1. Decide your wrapping-key backend. Most customers start with their existing KMS (AWS, Azure, GCP).
  2. Provision a key. Use a CMK / KEK with rotation enabled at the cadence your compliance demands.
  3. Grant Databunker Pro’s service identity permission to Wrap and Unwrap against that key — and only that key. Nothing else.
  4. Configure Databunker Pro to use that key reference for the Master Key envelope.
  5. Generate Shamir Key Shares during initial setup. Distribute to your trustees. Document the recovery procedure.
  6. Schedule rotation in your KMS at your compliance-mandated cadence. Databunker Pro will rotate the Master Key envelope automatically.

The full reference for the key hierarchy, rotation, and Shamir recovery is in the Databunker Pro documentation — see Master key, Key rotation, and Shamir keys.

Conclusion

Bring Your Own Key encryption stops being a buzzword and starts being a compliance accelerator when the underlying vault is designed for it. Databunker Pro’s three-layer key hierarchy — per-record envelopes, Master Key, customer-managed Wrapping Key — gives you BYOK that actually scales, with rotation that does not require re-encryption and recovery that does not require trusting any single individual.

If your security review keeps blocking on “where do the keys live,” BYOK on Databunker Pro is the answer that ends the conversation.

Your next step · Free compliance assessment

Get Free SOC2 / GDPR / DPDP Compliance Report

A free 30-minute working session with our compliance team — across SOC 2, ISO 27001, GDPR, HIPAA, DPDP and PCI DSS. We map every gap in your cloud and databases to the exact clause it violates, then send you a written remediation roadmap. Read-only access. No infrastructure changes.

Book My Free Compliance Assessment 🚀 Learn more →

✓ 30-min call · ✓ Written assessment · ✓ No credit card required

Databunker compliance platform

  • Databunker Radar — 1,000+ compliance checks across cloud and databases
  • Databunker Pro — encrypted storage and tokenization for sensitive data
  • Databunker DPO — data subject requests, reporting, and privacy workflows

See it on your stack or talk through your compliance roadmap?