You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/security/secrets.md
+24-49Lines changed: 24 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,37 +9,42 @@ toc: true
9
9
10
10
Codefresh provides out-of-the-box management for secrets, generally to store secrets for third-party integrations.
11
11
12
-
For secure secret storage, every Codefresh GitOps Runtime uses the[Bitnami Sealed Secrets controller](https://github.com/bitnami-labs/sealed-secrets){:target="_blank"} behind the scenes.
13
-
This controller is installed as part of the Runtime and automatically managed by Codefresh.
14
12
15
-
##How Sealed Secrets work
13
+
For secure secret storage, every Codefresh GitOps Runtime uses the[Bitnami Sealed Secrets Controller](https://github.com/bitnami-labs/sealed-secrets){:target="_blank"} behind the scenes.
14
+
This Controller is installed as part of the Runtime and automatically managed by Codefresh.
15
+
16
16
17
-
Sealed Secretsare based on[public/private key encryption](https://en.wikipedia.org/wiki/Public-key_cryptography){:target="_blank"}. When the controller is installed, it gets a public and private key. The private key stays within the cluster. The public key can be given anywhere to encrypt secrets.
17
+
##HowSealed Secretswork
18
18
19
-
Any kind of secret can be encrypted with the public key (also via the`kubeseal` executable), and then passed to the cluster for decryption when needed.
The Controller manages a public and a private key. The private key stays within the cluster. The public key can be distributed anywhere to encrypt secrets.
20
21
21
-
Codefresh handles Sealed Secrets at the level oftheaccount, meaning that you need to create a Sealed Secret for an integration once, and it is then availabletoall clusters managed intheaccount. To ensure maximum security, only the ConfigMap with the public key of the SealedSecret is commited to Git.
22
+
Any kind of secret encrypted withthepublic key (or via the`kubeseal` executable), can be passedto thecluster for decryption when needed.
22
23
24
+
Codefresh employs a mechanism to consistently apply Sealed Secrets across multiple clusters in the same account, in complete alignment with the GitOps paradigm.
25
+
It also facilitates sharing the public and private keys between the Codefresh platform and the[Shared Configuration Repository]({{site.baseurl}}/docs/installation/gitops/shared-configuration/)
26
+
in the user's GitOps Runtime environment.
23
27
24
-
Here's the event flow for Sealed Secrets in GitOps:
25
-
1. The operator or developer creates an encrypted secret with the`kubeseal` executable.
1. Codefresh also creates another Kubernetes resource, the`ConfigMap` containing the public key of the`SealedSecret`.
28
-
1. The`ConfigMap` resource is committed to Git.
29
-
1. When required for an application or a resource, the Sealed Secret controller identifies the Sealed Secret object and decrypts it using the private key of the cluster.
30
-
1. The Sealed Secret is converted to a[standard Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/){:target="_blank"} within the cluster.
31
-
1. It is then passed to the application like any other secret, as a mounted file or environment variable.
32
-
1. The application uses the secret in its decrypted form.
28
+
**Sealed Secrets mechanism in Codefresh**
29
+
1. The Sealed Secrets Controller generates both the public and private keys.
30
+
1. Codefresh creates a`ConfigMap` resource representing these keys, and enables their sharing across clusters.
31
+
The`ConfigMap` contains the public key of the`SealedSecret`.
32
+
1. The`ConfigMap` resource is committed to Git. When the`ConfigMap` is synced to the cluster from the Shared Configuration Repo by its Argo CD application,
33
+
the App-proxy reconciles the`ConfigMap`, transforming it into a sealing key secret.
34
+
1. When requested by an application:
35
+
* The Sealed Secret Controller identifies and decrypts the Sealed Secret object using the private key specific to the cluster.
36
+
* Transforms the decrypted Sealed Secret into a[standard Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/){:target="_blank"} within the cluster.
37
+
1. The application receives the decrypted secret just as any other secret, either as a mounted file or environment variable, and uses the secret in its decrypted form.
33
38
34
39
For more details, you can read our[blog post for sealed secrets](https://codefresh.io/blog/handle-secrets-like-pro-using-gitops/){:target="_blank"}.
35
40
36
-
##Configuring the Sealed Secretscontroller
41
+
##Configuring the Sealed SecretsController
37
42
38
-
The SealedSecret controller is fully managed by the Codefreshruntime, andsecretencryption and decryption are fully automated.
43
+
The SealedSecrets Controller is fully managed by the CodefreshGitOps Runtime, and encryption and decryption of secrets are fully automated.
39
44
40
-
>**Warning!** DO NOT tamper with thecontroller or its private/public keys in any way.
45
+
>**Warning!** DO NOT tamper with theController or its private/public keys in any way.
41
46
42
-
The applications you deploy with Codefresh should also have no knowledge of thecontroller. All secrets that you need in your own applications should be accessed using the standard Kubernetes methods.
47
+
The applications you deploy with Codefresh should also have no knowledge of theController. All secrets that you need in your own applications should be accessed using the standard Kubernetes methods.
43
48
44
49
##Related articles
45
50
[Verifying authenticity of Codefresh artifacts]({{site.baseurl}}/docs/security/codefresh-signed-artifacts/)
@@ -48,37 +53,7 @@ The applications you deploy with Codefresh should also have no knowledge of the
<!--- Codefresh provides out-of-the-box management for secrets, generally to store secrets for third-party integrations. For secure secret storage, every Codefresh GitOps Runtime uses the [Bitnami Sealed Secrets controller](https://github.com/bitnami-labs/sealed-secrets){:target="_blank"} behind the scenes. This controller is installed as part of the Runtime and automatically managed by Codefresh.
52
-
53
-
Codefresh employs a mechanism that applies a Sealed Secret consistently across multiple clusters, in complete alignment with the GitOps paradigm. It also facilitates sharing the public and private keys between the Codefresh platform and the Shared Configuration Repository in the user's GitOps Runtime environment.
54
-
55
-
56
-
57
-
58
-
## How Sealed Secrets work
59
-
60
-
Sealed Secrets are based on [public/private key encryption](https://en.wikipedia.org/wiki/Public-key_cryptography){:target="_blank"}. When the controller is installed, it gets a public and private key. The private key stays within the cluster. The public key can be given anywhere to encrypt secrets. Any kind of secret can be encrypted with the public key (also via the `kubeseal` executable), and then passed to the cluster for decryption when needed.
61
-
62
-
For Argo CD applications, it is critical to encrypt secrets, as it means that you can commit any kind of secret in Git as long as it is encrypted.
63
-
64
-
**Sealed Secrets mechanism in Codefresh**
65
-
The Sealed Secrets controller in a GitOps Runtime generates a sealing key, which is then divided into two parts:
66
-
67
-
1. Half the private key is saved in a `configmap` that represents this sealing key, stored in the Shared Configuration Repo
68
-
2. The other half of the private key is stored in the Codefresh platform
69
-
70
-
When the `configmap` is synced to the cluster from the Shared Configuration Repo by its Argo CD application, the App-proxy reconciles this `configmap` into a sealing key secret.
71
-
72
-
For more details, you can read our [blog post for sealed secrets](https://codefresh.io/blog/handle-secrets-like-pro-using-gitops/){:target="_blank"}.
73
-
74
-
The Sealed Secrets controller is completely managed by the Codefresh GitOps Runtime, and secret encryption and decryption are fully automated.
75
-
76
-
> **WARNING!**
77
-
_DO NOT_ tamper with the controller or its private/public keys in any way.
78
-
79
-
The Argo CD applications you deploy with Codefresh should also have no knowledge of the controller. Access the secrets that you need in your own applications using the standard Kubernetes methods.