-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add sealed secrets as platform secrets documentation #143
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
Open
ferruhcihan
wants to merge
2
commits into
main
Choose a base branch
from
APL-1811
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| slug: secrets | ||
| title: Platform Secrets | ||
| sidebar_label: Secrets | ||
| --- | ||
|
|
||
| The **Secrets** page lists all platform secrets managed by Sealed Secrets. Platform administrators can create new secrets and update existing ones. Secret values are write-only — they are encrypted immediately on save and are never displayed in plaintext. | ||
|
|
||
| Platform secrets are encrypted using [Bitnami Sealed Secrets](https://github.com/bitnami-labs/sealed-secrets) and distributed to applications via the [External Secrets Operator](https://external-secrets.io) (ESO). No secrets are stored in plaintext on disk or in Git. | ||
|
|
||
| ## How Platform Secrets Work | ||
|
|
||
| 1. All sensitive configuration values (passwords, API tokens, TLS keys) are encrypted into `SealedSecret` manifests and stored in the values Git repository. | ||
| 2. The sealed-secrets controller running in the cluster decrypts them into standard Kubernetes Secrets in the `apl-secrets` namespace. | ||
| 3. ESO reads from `apl-secrets` via a `ClusterSecretStore` and distributes the secrets to each application's namespace using `ExternalSecret` resources. | ||
|
|
||
| This means the values Git repository contains only encrypted manifests, never plaintext secrets. | ||
|
|
||
| ## Secret Lifecycle | ||
|
|
||
| ### On Installation | ||
|
|
||
| During the bootstrap phase the platform: | ||
|
|
||
| 1. Generates an RSA-4096 key pair for the sealed-secrets controller. | ||
| 2. Encrypts all sensitive configuration values into `SealedSecret` manifests. | ||
| 3. Writes the encrypted manifests to the values repository. | ||
| 4. Deploys the sealed-secrets controller, which decrypts the manifests into Kubernetes Secrets in the `apl-secrets` namespace. | ||
| 5. Deploys ESO and the `ClusterSecretStore`, which distributes secrets to application namespaces via `ExternalSecret` resources. | ||
|
|
||
| ### On Runtime | ||
|
|
||
| The operator polls the values Git repository for changes. When a change is detected: | ||
|
|
||
| 1. Helmfile applies updated `ExternalSecret` resources. | ||
| 2. ESO syncs the corresponding Kubernetes Secrets to each application's namespace. | ||
| 3. ESO refreshes all secrets on a hardcoded one-hour interval. Secret updates take up to one hour to propagate to application namespaces. | ||
|
|
||
| ## The Sealed Secrets Key Pair | ||
|
|
||
| The RSA key pair used to encrypt and decrypt all platform secrets is stored as a Kubernetes TLS secret named `sealed-secrets-key` in the `sealed-secrets` namespace. The sealed-secrets controller uses this key to decrypt `SealedSecret` manifests on the cluster. | ||
|
|
||
| :::note | ||
| If this key pair is lost and cannot be recovered, all `SealedSecret` manifests become undecryptable. Back up the key pair immediately after installation and store it securely outside the cluster. | ||
| ::: | ||
|
|
||
| ### Back Up the Key Pair | ||
|
|
||
| See [Sealed Secrets Key Recovery](../disaster-recovery/sealed-secrets-key.md) for the export command and instructions on how to use this backup to restore a cluster. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| --- | ||
| slug: sealed-secrets-key | ||
| title: Sealed Secrets Key Recovery | ||
| sidebar_label: Sealed Secrets Key | ||
| --- | ||
|
|
||
| The sealed-secrets RSA key pair is the root of trust for all platform secrets. It is stored as a Kubernetes TLS secret named `sealed-secrets-key` in the `sealed-secrets` namespace. The sealed-secrets controller uses this key to decrypt all `SealedSecret` manifests in the cluster. | ||
|
|
||
| If the key pair is lost and cannot be recovered, all `SealedSecret` manifests become undecryptable and the platform must be reinstalled with fresh secrets. | ||
|
|
||
| ## Back Up the Key Pair | ||
|
|
||
| Back up the key pair immediately after installation and store it securely outside the cluster. | ||
|
|
||
| Run the following command to export the key manifest: | ||
|
|
||
| ```bash | ||
| kubectl get secrets -n sealed-secrets \ | ||
| -l sealedsecrets.bitnami.com/sealed-secrets-key=active \ | ||
| -o yaml > sealed-secrets-key.yaml | ||
| ``` | ||
|
|
||
| Store `sealed-secrets-key.yaml` securely — for example, in a password manager or encrypted storage in a different location from the cluster. | ||
|
|
||
| ## Restore the Key Pair on a New Cluster | ||
|
|
||
| Use this procedure when the cluster has been destroyed but you have: | ||
|
|
||
| - A BYO Git repository containing the existing values and `SealedSecret` manifests. | ||
| - A backup of the sealed-secrets key pair. | ||
|
|
||
| ### Steps | ||
|
|
||
| 1. Start from the values file used for the original BYO Git installation. | ||
|
|
||
| 2. Add `installation.mode: recovery` and embed the contents of `sealed-secrets-key.yaml` under `installation.recovery.manifests`: | ||
|
|
||
| ```yaml | ||
| installation: | ||
| mode: recovery | ||
| recovery: | ||
| manifests: | ||
| apiVersion: v1 | ||
| items: | ||
| - apiVersion: v1 | ||
| data: | ||
| tls.crt: <base64-encoded certificate> | ||
| tls.key: <base64-encoded private key> | ||
| kind: Secret | ||
| metadata: | ||
| labels: | ||
| sealedsecrets.bitnami.com/sealed-secrets-key: active | ||
| name: sealed-secrets-key | ||
| namespace: sealed-secrets | ||
| type: kubernetes.io/tls | ||
| kind: List | ||
| metadata: | ||
| resourceVersion: "" | ||
| ``` | ||
|
|
||
| The values for `tls.crt` and `tls.key` come directly from the `sealed-secrets-key.yaml` export — they are already base64-encoded. | ||
|
|
||
| 3. Install the platform: | ||
|
|
||
| ```bash | ||
| helm install apl apl/apl -f values.yaml | ||
| ``` | ||
|
|
||
| During installation the operator provisions the sealed-secrets key before bootstrap. The sealed-secrets controller then decrypts the existing `SealedSecret` manifests from the values repository using the restored key, and ESO distributes the secrets to application namespaces. | ||
|
|
||
| ## Recovery Scenarios | ||
|
|
||
| | Scenario | Recovery Path | | ||
| | --- | --- | | ||
| | Cluster destroyed, key pair backed up, values repo (BYO Git) intact | Use `installation.mode: recovery` with the backed-up key pair (this guide) | | ||
| | Key pair lost, values repo intact | Reinstall with fresh secrets; all platform passwords will reset | | ||
| | Values repo lost, key pair intact | Restore the values repo from a backup, then reinstall using `installation.mode: recovery` | | ||
| | Both key pair and values repo lost | Reinstall with fresh secrets; all platform passwords will reset | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| --- | ||
| slug: update-admin-password | ||
| title: Update the otomi-admin password | ||
| sidebar_label: Update admin password | ||
| --- | ||
|
|
||
| This guide provides step-by-step instructions to update the `otomi-admin` password. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| 1. Access to the Keycloak admin console. | ||
| 2. Access to the platform console (platform view). | ||
|
|
||
| ## Steps | ||
|
|
||
| ### Step 1: Generate a New Password | ||
|
|
||
| ```bash | ||
| # Generate a random 16-character alphanumeric password | ||
| head /dev/urandom | LC_ALL=C tr -dc A-Za-z0-9 | head -c 16 | ||
| # Example output: FPpLvZyAdAmuzc3N | ||
| ``` | ||
|
|
||
| ### Step 2: Update the Password in Keycloak | ||
|
|
||
| 1. Log in to the Keycloak admin console using the platform admin credentials. | ||
|
|
||
| 2. Go to **Users** in the left-hand sidebar and find the `otomi-admin` user. | ||
|
|
||
| 3. Navigate to the **Credentials** tab. | ||
|
|
||
| 4. Change the password to the one you generated. | ||
|
|
||
| 5. Save changes (set Temporary to Disabled). | ||
|
|
||
| :::info | ||
| Don't make any other changes during this operation. | ||
| ::: | ||
|
|
||
| ### Step 3: Update the Password in the Platform Console | ||
|
|
||
| 1. Open the platform console and go to the **Platform** view. | ||
|
|
||
| 2. Navigate to **Secrets** in the left-hand sidebar. | ||
|
|
||
| 3. Click on `otomi-secrets` (namespace: `apl-secrets`). | ||
|
|
||
| 4. Find the `adminPassword` field in the **Secret Data** section | ||
|
|
||
| 5. Click on the lock `🔒` icon and enter the new password in **plain text**. | ||
|
|
||
| 6. Click **Save Changes**. | ||
|
|
||
| The platform encrypts the value using Sealed Secrets and commits the updated manifest to the values repository. No manual encryption is required. | ||
|
|
||
| :::info | ||
| Changes become active after the pipeline finishes applying the updated secrets. | ||
| ::: | ||
|
|
||
| ### Step 4: Verify the Changes | ||
|
|
||
| 1. Allow the pipeline to run and verify it completes successfully. | ||
|
|
||
| 2. Restart the `apl-keycloak-operator` deployment to ensure the new credentials are applied: | ||
|
|
||
| ```bash | ||
| kubectl rollout restart deployment -n apl-keycloak-operator apl-keycloak-operator | ||
| ``` | ||
|
|
||
| 3. Verify that the platform is working as expected with the new credentials. | ||
|
|
||
| This completes the password update process for `otomi-admin`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Page is under the Console section but opens with architecture rather than what the operator sees in the UI. Added a UI-first intro: operators can create and modify secrets but values are write-only and never displayed in plaintext.