Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(key-manager): add a page explaining the difference between secret manager and key manager #3648

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
meta:
title: What is the difference between Key Manager and Secret Manager?
description: Learn the differences between Key Manager and Secret Manager and which one to use according to your needs
content:
h1: What is the difference between Key Manager and Secret Manager?
paragraph: Learn the differences between Key Manager and Secret Manager and which one to use according to your needs
tags: key-manager secret-manager security
dates:
validation: 2024-08-28
---



Secret Manager and Key Manager are both security-focused products aiming
to help you protect your data and improve the security of your
infrastructure.
The difference between them is not always clear, and it is natural
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
to ask which one you need according to your use-case.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved

This document helps you answer that question.


## Secret Manager

The Secret Manager stores various secrets that your applications wants to
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
access at some point. For example, when your application needs to call
an external API service or connect to a database, it fetches the API token
or the credentials from the Secret Manager before proceeding.

Secrets can be pretty much everything you want: API tokens,
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
credentials to connect to a database, sensible data.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
There is no limitation, if not the size of the secrets.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved


## Key Manager

In contrast, Key Manager only stores cryptographic keys.

At first, the Key Manager seems to be just a restricted version of
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
the Secret Manager, only for keys.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
It is indeed true that the Secret Manager could also store cryptographic keys
and hand over the keys to applications that need to perform cryptographic operations.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved

However, this approach is full of pitfalls and can lead to serious security problems:

- Inadvertently storing the keys in plaintext, or exposing them (<i>e.g.</i>, in logs)
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
- Incorrect (re-)use of key: your application would be responsible to use the key correctly,
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
which is harder than it looks.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
- Not disposing the key properly after use (<i>e.g.</i>, letting it reside in swap disk)
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved

They are typical key management problems, and the Secret Manager does not solve them
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
effectively, hence the need of the Key Manager.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved

The Key Manager simply does **not** gives you any key.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
All keys residing in the Key Manager never (and never will) leave the Key Manager, since
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
there is no way to extract them by design.

Since you cannot have the key, the Key Manager performs the cryptographic operations
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
for you: your application supplies the plaintext to be encrypted, or
the ciphertext to be decrypted. That means your application is no longer
responsible of managing the keys and using them properly, the Key Manager takes care of it.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved

Last, but not least, the Key Manager provides another way of authorizing some actions.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
You might want to authorize some principals to only encrypt data, and other
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
principals to only decrypt data.
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved

For example, imagine an application that receives
some sensible health data that needs to be encrypted before being inserted into
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
a database. Such an application would have the privilege to ask the Key Manager
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
encryption operations, but not decryption opeartions, so it cannot read sensible
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
data already stored.

This is not possible to achieve with Secret Manager, since both writing and reading
applications would need at least the privilege of reading the key from the Secret Manager,
which is sufficient to both encrypt and decrypt the data.


## Conclusion

Cryptographic keys are secrets that need special care, and the Key Manager
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
is an effective tool to helps you manage them securely,
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
allowing your application to offload all the sensible cryptographic
nerda-codes marked this conversation as resolved.
Show resolved Hide resolved
operations and keep keys out-of-band for extra security.
Loading