This guide is for CTOs, tech leads and product owners who already encrypt everything and now must say who can decrypt what. For a review of an existing application, see application security assurance.
In this guide
- Why is "we encrypt at rest and in transit" not enough?
- What keys does a typical business application hold?
- Where should the keys live?
- How long should a key live before rotation?
- How do you run the key lifecycle as a team?
- Which TLS settings should application teams check?
- When should you not add more key machinery?
- Where AI fits
- What delivery record exists, and what does not
- Who should own key management, and how do you choose?
- What does this guide not cover?
- Frequently asked questions
- Next step
Why is "we encrypt at rest and in transit" not enough?
Encryption moves the secret from the data to the key. A database encrypted at rest is still readable by anyone who holds the key and the credentials that unwrap it, and a TLS connection is only as trustworthy as the private key and certificate behind it. The real security question is therefore who can use each key, where it lives and how fast it can be replaced.
Cryptographic failures are the fourth category of the OWASP Top 10 2025, which maps hard-coded keys as a named weakness and asks for TLS 1.2 or later with forward secrecy for all data in transit. Most are key-handling mistakes, not broken algorithms.
What keys does a typical business application hold?
Most business applications hold several kinds of key, and each needs its own row in a key register. Use the template below.
-
Key encryption key (KEK)
- What it protects
- The data keys below it
- Typical holder
- Key management service, never the application
- Rotation trigger
- Schedule, staff change, suspected incident
-
Data encryption keys (DEK)
- What it protects
- Database columns, files, backups
- Typical holder
- Stored wrapped next to the data
- Rotation trigger
- New KEK version, re-encryption project
-
TLS private keys and certificates
- What it protects
- Data in transit to users and partners
- Typical holder
- Load balancer or ingress, issued automatically
- Rotation trigger
- Certificate expiry, host change, compromise
-
Service and database credentials
- What it protects
- Access between application parts
- Typical holder
- Secrets manager, injected at runtime
- Rotation trigger
- Staff change, leak, schedule
-
Signing keys
- What it protects
- Tokens, webhooks, builds and releases
- Typical holder
- Key management service or signing service
- Rotation trigger
- Schedule, compromise, algorithm change
-
Backup encryption keys
- What it protects
- Backups stored off-site
- Typical holder
- Separate account from production
- Rotation trigger
- Schedule, restore test, provider change
For each row, also record the owner, who and which services may use it, the last rotation and how a replacement reaches every system. The OWASP Key Management Cheat Sheet supports the same structure: a single key for a single purpose, no keys in source code or build artifacts, access only for roles and workloads with a verified need, and an inventory of all keys as part of the compromise recovery plan.
Where should the keys live?
Custody is the choice that decides most of the rest. Three options cover nearly every application team.
| Criterion | Cloud key management service | Self-hosted secrets vault | Dedicated hardware security module |
|---|---|---|---|
| Who runs it | The cloud provider; you set policies and grants | Your team runs, patches and backs it up | Your team or a provider, with specialist skills |
| Fits | Applications on one cloud, envelope encryption | Several clouds or on-premises systems, dynamic credentials | Regulated keys that must stay in certified hardware |
| Main risk | Over-broad grants; keys tied to one provider | The vault becomes a critical system you must operate | Cost and scarce skills for a small team |
| Not worth it when | You never encrypt anything beyond default disk encryption | A single cloud already offers what you need | No regulator or customer requires dedicated hardware |
The common pattern underneath all three is envelope encryption. As Google Cloud's envelope encryption guide explains, a data encryption key encrypts the data and is stored, wrapped, near it, while a key encryption key held centrally in the key management service wraps the data keys and is rotated regularly and after a suspected incident. The application never stores the master key, and rotating it does not require re-encrypting every row.
How long should a key live before rotation?
A key should live until its scheduled cryptoperiod ends or an event makes it untrustworthy, whichever comes first. NIST SP 800-57 Part 1 is the reference for the protection each type of key needs and for choosing those periods.
Event triggers matter more than the calendar: a person with key access leaves, a secret appears in a repository or log, a provider reports an incident, or a certificate nears expiry. Write the triggers into the register so rotation is the owner's decision, not a debate during an incident.
How do you run the key lifecycle as a team?
-
Inventory
Search code, configuration, CI variables and infrastructure definitions for keys and secrets, and create one register row per key.
-
Assign owners and purposes
Give every key a named role as owner and one purpose; split any key used for two purposes.
-
Choose custody
Move key encryption keys into a key management service or vault, and remove keys from code, images and configuration files.
-
Adopt envelope encryption
Wrap data keys with a central key, store a key version with each encrypted record and keep old versions for decryption only.
-
Automate certificates
Issue and renew TLS certificates with the ACME protocol (RFC 8555) or the provider's managed certificates, and alert well before expiry.
-
Separate duties
Developers deploy code; a smaller group administers keys and grants. Combine this with the role design in our guide to internal app access and least privilege.
-
Log and review use
Send every key operation to an audit log and review grants on the same schedule as user access.
-
Rehearse replacement
Rotate one key of each kind in a test environment and restore a backup with a rotated key.
Which TLS settings should application teams check?
Application teams should check the protocol version, the certificate chain and the HTTPS redirect on every public, partner and internal endpoint. The OWASP Transport Layer Security Cheat Sheet covers protocols, cipher suites, certificates and HSTS. For US federal systems, NIST SP 800-52 Rev. 2 requires TLS 1.2 with approved cipher suites and support for TLS 1.3; TLS 1.3 (RFC 8446) is the current protocol version.
Internal traffic is where gaps hide: database and queue connections inside a private network often run unencrypted. Treat them as in transit too.
When should you not add more key machinery?
Do not buy a dedicated hardware module, build a custom key service or add application-level encryption to every column when no data class, customer contract or regulator calls for it; managed disk and database encryption plus a key register cover many internal tools. Do not encrypt fields you must search or sort on without a plan for how queries will work. Do not rotate keys on a short schedule your team cannot rehearse, because an untested rotation that breaks decryption is an outage you caused yourself.
Where AI fits
AI helps around key management, never with the keys themselves. A model can search a repository and its history for strings that look like secrets, compare infrastructure definitions against the key register and draft register rows for engineers to confirm, and summarise key service audit logs for the owner's review. Engineers decide every grant and rotation, and no AI tool receives key material or plaintext secrets. Netbase works with the major commercial and open-source AI tools and models, chosen per project, under human control.
- In delivered work
Recommendation engine
A recommendation engine delivered for 4over4's online store suggests products from browsing history and previous purchases.
- In delivered work
Knowledge assistants and document AI
Retrieval-augmented knowledge assistants and document AI delivered for clients that are not named.
- Available capability
Key register assistant
An assistant that drafts key register rows and flags plaintext secrets for engineers to confirm; not yet tied to a published case.
What delivery record exists, and what does not
Netbase's published security practices include TLS in transit and AES at rest, secure code review and version control, role-based access control and MFA for admin dashboards, vulnerability scanning and penetration testing, and disaster recovery. Security by design is part of how Netbase approaches delivery, and Netbase follows GDPR alignment for data privacy in Europe, HIPAA-aligned methodologies for healthcare data handling and CCPA compliance for clients with U.S. customer bases.
Netbase works as offshore development partner on a multi-tenant cloud ERP for a US client delivered as SaaS to small and mid-sized businesses, the kind of shared platform where data keys, tenant data and backups must be kept apart.
Netbase holds ISO 27001 certification and a SOC 2 Type II attestation for its own operations; neither certifies a client's application or its key management. Delivery follows a six-step lifecycle with weekly reviews, which is where an open key register item is tracked. Netbase does not publish key rotation results, incident figures or a timeline for a key management project; this guide explains a method, not a case study.
Who should own key management, and how do you choose?
- The application team with a managed key service. Fits most single-cloud applications; the team owns the register, grants and rotation runbook.
- A central platform or security team. Fits companies with many applications that share one vault and one set of policies; application teams still own their register rows.
- An outside review. Fits when you need an independent check of an existing application's encryption and key handling; the secure development lifecycle guide shows where those checks sit in the pipeline.
Selection criteria: how many applications and clouds share keys, whether a regulator or contract names key custody, and who is on call when a key fails. Most Netbase projects are delivered on fixed-price contracts, and a written key register makes that scope easier to agree.
What does this guide not cover?
- It does not compare named key management, vault or hardware security module products.
- It covers keys inside business applications, not end-to-end encrypted messaging, payment card key ceremonies or post-quantum migration.
Plan the next step with a Netbase consultant
Frequently asked questions
It protects against lost disks, but anyone with valid access to the running database still reads plaintext. Add a key register, restrict who can use the keys and consider field-level encryption for the most sensitive data classes.
Rotate on a schedule set per key type and immediately after events such as a leaked secret, a departure of someone with key access or a provider incident. With envelope encryption, rotating the central key is routine and does not require re-encrypting all data at once.
Only the application services that need it and a small, named group of key administrators, with every use logged. Developers should not need production keys to build or test the application.
Next step
If nobody can say who holds the keys to your production data, send us a short description of your application and hosting and we will reply with a proposal for a key register review and a rotation runbook.
Related services and solutions
Application security assurance for web, SaaS and AI features Netbase provides application security testing for product and engineering leaders to find and fix vulnerabilities before release, including in AI features. We review code with AI-assisted triage, scan dependencies and test running applications, then rank findings and retest fixes. Netbase's own alignment with ISO 27001 and SOC 2 Type II covers Netbase's operations, never your application.
Learn More
AI-ready SaaS development from a team that runs its own SaaS Netbase provides SaaS development for founders and product teams to launch and scale multi-tenant subscription software with AI features customers will pay for. We build and operate our own SaaS platforms, Printcart and the AI-powered Cloodo workplace, and bring that experience to client products. Discovery fixes the MVP scope and schedule.
Learn More
SaaS product accelerator: launch an AI-ready SaaS on proven Netbase modules A SaaS product accelerator is a set of reusable Netbase modules for accounts, billing, roles and integrations that helps founders and product teams launch subscription software faster, with room for in-product AI from the first release. Reusing these modules can shorten development time, and the approach is proven on Printcart, Netbase's own web-to-print SaaS.
Learn More
Work with Netbase remotely
Every Netbase engagement is delivered remotely, so clients in any country and any industry can work with us; Netbase has worked with clients in 80 countries. Contracts and invoices are issued by Netbase JSC, and payment is made by bank transfer to Netbase JSC's company account or PayPal Business. Talk to the CEO, Huy Nguyen (David), on WhatsApp or by email.
Discuss a project
Netbase JSC helps organizations design, build, modernize, and operate digital products and AI-enabled business systems.project@netbasejsc.com
+84 937 869 689
91 Nguyen Chi Thanh, Dong Da, Hanoi, Vietnam
Get in touch
Tell us what you want to build, modernize, or operate.