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

Create a validate sealed secrets howto for Sealed Secrets public documentation #1266

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Changes from all 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
30 changes: 29 additions & 1 deletion site/content/docs/latest/howto/validate-sealed-secrets.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# How-to Validate existing Sealed Secrets

TBC
The `validate` Sealed Secrets feature is useful for ensuring the correctness of Sealed Secrets, especially when they need to be shared or used in various Kubernetes environments. By validating Sealed Secrets, you can verify that the encryption and decryption processes are functioning as expected and that the secrets are protected properly.

If you want to validate an existing sealed secret, `kubeseal` has the flag `--validate` to help you.

Giving a file named `sealed-secrets.yaml` containing the following sealed secret:

```yaml
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
name: mysecret
namespace: mynamespace
spec:
encryptedData:
foo: AgBy3i4OJSWK+PiTySYZZA9rO43cGDEq.....
```

You can validate if the sealed secret was properly created or not:

```console
$ cat sealed-secrets.yaml | kubeseal --validate
```

In case of an invalid sealed secret, `kubeseal` will show:

```console
$ cat sealed-secrets.yaml | kubeseal --validate
error: unable to decrypt sealed secret
```