bitnami / bitnami/sealed-secrets

Support disabling first key creation

Open
#702 1 comment 5 reactions 0 assignees View on GitHub
backlog enhancement
Dominant language
Go
Stars
9.3k
Forks
776
Avg merge
1d 13h
Merged PRs (30d)
30

Description

**Which component**:
The name (and version) of the affected component (controller or kubeseal)

controller 0.17.1, helm 2.0.1

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

sealed-secrets-controller can be configured to disable key rotation and provisioned with a bootstrap key.

With key rotation disabled this still doesn't prevent controller from generating keys.

Problem is, if bootstrap key for various reasons can fail to be provisioned or gets unprovisioned, controller will still start and continuer to work, it will generate first key
https://github.com/bitnami-labs/sealed-secrets/blob/main/cmd/controller/main.go#L146-L152

All SealedSecrets will fail to be unsealed.

Another case, if controller, with key rotation disabled, gets deployed first before bootstrap key, it will unwantedly use a first generated key instead.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

Please support configuring sealed-secrets-controller to crash/panic instead of generating first key if no key is present https://github.com/bitnami-labs/sealed-secrets/blob/main/cmd/controller/main.go#L146-L152

One can then monitor for controller (not) being up, and fix provisioning bootrstrap key.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

- Alerting on secrets failing to unseal, but on non-production environments this can be a common condition, and such alert disabled
- Alerting on log message emitted by sealed secrets controller on generating new key - problem is letting controller generate key results in lots of effort to clean up (to get controller in desired state, but also any secrets that got sealed with wrong key have to be resealed)

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Start at cmd/controller/main.go lines 146-152, where the controller generates its first key, and trace how key rotation is configured. Add a configuration path that makes startup fail when no key is present instead of generating one, then verify the controller's behavior with a missing bootstrap key and with key rotation disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.