-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate existing Sealed Secrets (#1266)
Signed-off-by: Alfredo Garcia <[email protected]>
- Loading branch information
1 parent
b590bb6
commit e959447
Showing
1 changed file
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -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 | ||
``` |