[![Crates.io Version](https://img.shields.io/crates/v/kubevault)](https://github.com/chezmoi-sh/kubevault/releases)
[![Crates.io Downloads (recent)](https://img.shields.io/crates/dr/kubevault)](https://crates.io/crates/kubevault)
[![Coverage Status](https://coveralls.io/repos/github/chezmoi-sh/kubevault/badge.svg)](https://coveralls.io/github/chezmoi-sh/kubevault)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue?logo=git&logoColor=white&logoWidth=20)](LICENSE)
[![Open in GitHub Codespaces](https://img.shields.io/badge/Open_in_Github_Codespace-black?logo=github)](https://github.com/codespaces/new?hide_repo_select=true&repo=832751595)
[![๐ Release kubevault](https://github.com/chezmoi-sh/kubevault/actions/workflows/release.publish-kubevault.yaml/badge.svg)](https://github.com/chezmoi-sh/kubevault/actions/workflows/release.publish-kubevault.yaml)
About ยท
Getting Started ยท
How it works ? ยท
Vulnerability Reporting ยท
License
---
> [!WARNING]
>
> This project is still in development and is not yet released; take in consideration I will push
> force inside the `main` branch until the first release. Also, keep in mind that is my first Rust
> project and I'm still learning the language, so the code may not be the best.
## โน๏ธ About
`kubevault` is a homemade alternative to [HashiCorp Vault](https://www.vaultproject.io/) or managed secret management
services like [ASM](https://aws.amazon.com/secrets-manager/) for managing secrets, aiming to have a less complex,
less resource-consuming, but also less secure system.
It relies on Kubernetes' native features for managing secrets (`v1/Secret`), access control (`rbac.authorization.k8s.io/v1/*`),
as well as internal features like audits.
`kubevault` is in reality a simple binary that generates Kubernetes manifests from a configuration directory and lets you
apply them to your Kubernetes cluster in the manner you want _(`kubectl apply`, `GitOps`, ...)_. It also provides some
utilities to manage the secrets and the access control lists.
### ๐ **DISCLAIMER**
> [!WARNING]
>
> **Attention**, the goal of this project is not to provide yet another _shoddy_ alternative to HashiCorp Vault, to be
> THE solution to all secret management problems, or to be THE most secure solution... In fact, this solution
> **IS NOT SECURE** like these services and will not be in the future.
>
> Its purpose is to offer a simple way to manage my secrets in Kubernetes, without having secrets lying around on a
> Post-It or in a text file on the operator computer. It remains "secure" as long as all secrets are encrypted and the
> encryption password or the Kubernetes cluster is not compromised.
>
> Therefore, I do not recommend using this project for production use, but rather if you don't want to bother with
> secret management in Kubernetes _(development clusters or homelab)_.
### ๐ฎ Why create my own _solution_?
This is a rather legitimate question considering the plethora of solutions for managing secrets in Kubernetes. But before
explaining my choice, here is the context in which I found myself when choosing a secret management solution:
1. **I want** my secrets to be securely stored
2. **I want** to have all my secrets in one place
3. **I want** to access my secrets from any Kubernetes cluster
4. **I want** my secrets to be accessible to whoever I want them to be
5. **I do not want** to use more than 1/5GB of RAM
6. **I do not want** to spend time managing the solution
1. Less than 30 seconds to create/modify/delete a secret and apply it
2. Less than 10 minutes per month for updates
3. Less than an hour to rebuild all my data in case of total cluster loss
7. **I do not want** to depend on a third-party service
8. **I would like** to version my secrets
9. **I would like** to audit my secrets
Given these prerequisites, the list was quite short:
- ~~AWS Secrets Manager, Azure Key Vault, Google Secret Manager, HashiCorp Vault Cloud, ...~~ _Third-Party Service_
- ~~1Password, LastPass, Dashlane, ...~~ _Third-Party Service_
- ~~HashiCorp Vault, Open Bao~~ _Quite heavy and complex to manage/maintain_
- ~~Bitwarden, Vaultwarden, ...~~ _No easy-to-use ACL system and no Kubernetes integration_
- There are probably others, but I didn't ~~find~~ look for them
In the end, I didn't find a solution that met all my needs... So I decided to create my own solution.
## ๐ Getting started
### TLDR;
```shell
# Install kubevault
cargo binstall kubevault
# Create a new vault and your first secrets
kubevault new vault
cat <