Skip to content

Commit 0eb91af

Browse files
authored
Merge pull request #505 from tam7t/tam7t/docs-namespace
docs: kube-system, upgrades, best-practices
2 parents 0f0990b + 5a7ac42 commit 0eb91af

File tree

4 files changed

+107
-19
lines changed

4 files changed

+107
-19
lines changed

docs/book/src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
- [Getting Started](./getting-started/getting-started.md)
66
- [Installation](./getting-started/installation.md)
77
- [Usage](./getting-started/usage.md)
8+
- [Upgrades](./getting-started/upgrades.md)
89
- [Topics](./topics/topics.md)
910
- [Metrics](./topics/metrics.md)
1011
- [Secret Auto Rotation](./topics/secret-auto-rotation.md)
1112
- [Sync as Kubernetes Secret](./topics/sync-as-kubernetes-secret.md)
1213
- [Set as ENV var](./topics/set-as-env-var.md)
14+
- [Best Practices](./topics/best-practices.md)
1315
- [Providers](./providers.md)
1416
- [Troubleshooting](./troubleshooting.md)
1517
- [Load tests](./load-tests.md)

docs/book/src/getting-started/installation.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ Secrets Store CSI Driver allows users to customize their installation via Helm.
1919
2020
```bash
2121
helm repo add secrets-store-csi-driver https://raw.githubusercontent.com/kubernetes-sigs/secrets-store-csi-driver/master/charts
22-
helm install csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver
22+
helm install csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --namespace kube-system
2323
```
2424

25-
Running the above `helm install` command will install the Secrets Store CSI Driver on Linux nodes.
25+
Running the above `helm install` command will install the Secrets Store CSI Driver on Linux nodes in the `kube-system`
26+
namespace.
2627

2728
#### Values
2829

@@ -67,23 +68,6 @@ secretproviderclasses.secrets-store.csi.x-k8s.io
6768
secretproviderclasspodstatuses.secrets-store.csi.x-k8s.io
6869
```
6970

70-
<aside class="note warning">
71-
<h1>Warning</h1>
72-
73-
**v0.0.17** and earlier installed the driver to the `default` namespace.
74-
Newer versions of the driver will install the driver to the `kube-system`
75-
namespace. After applying the new YAML files to your cluster run the following
76-
to clean up old resources:
77-
78-
```bash
79-
kubectl delete daemonset csi-secrets-store --namespace=default
80-
kubectl delete daemonset csi-secrets-store-windows --namespace=default
81-
kubectl delete serviceaccount secrets-store-csi-driver --namespace=default
82-
```
83-
84-
</aside>
85-
</details>
86-
8771
## Use the Secrets Store CSI Driver with a Provider
8872

8973
Now that the Secrets Store CSI Driver has been deployed, select a provider from the supported provider list, then follow the installation steps for the provider:
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Upgrades
2+
3+
This page includes instructions for upgrading the driver to the latest version.
4+
5+
```bash
6+
helm upgrade csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --namespace=NAMESPACE
7+
```
8+
9+
Set `NAMESPACE` to the same namespace where the driver was originally installed,
10+
(i.e. `kube-system`)
11+
12+
If you are upgrading from one of the following versions there may be additional
13+
steps that you should take.
14+
15+
## pre `v0.0.20`
16+
17+
`v0.0.20` removed support for non-gRPC based providers. Follow your provider
18+
documentation to upgrade providers to use gRPC before upgrading the driver to
19+
`v0.0.20` or greater.
20+
21+
## pre `v0.0.18`
22+
23+
`v0.0.17` and earlier installed the driver to the `default` namespace when using
24+
the YAML based install. Newer versions of the driver YAML files install the
25+
driver to the `kube-system` namespace. After applying the new YAML files to your
26+
cluster run the following to clean up old resources:
27+
28+
```bash
29+
kubectl delete daemonset csi-secrets-store --namespace=default
30+
kubectl delete daemonset csi-secrets-store-windows --namespace=default
31+
kubectl delete serviceaccount secrets-store-csi-driver --namespace=default
32+
```
33+
34+
## pre `v0.0.12`
35+
36+
The `SecretProviderClass` needs to be in the same namespace as the pod
37+
referencing it as of `v0.0.12`.
38+
39+
Defining driver configuration and provider-specific parameters to the CSI driver
40+
in `pod.Spec[].Volumes` has been deprecated in `v0.0.12`. It is now mandatory to
41+
use `SecretProviderClass` custom resource.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Best Practices
2+
3+
1. Deploy the driver and providers into the `kube-system` or a separate
4+
dedicated namespace.
5+
6+
The driver is installed as a `DaemonSet` with the ability mount kubelet
7+
`hostPath` volumes and view pod service account tokens. It should be treated
8+
as privileged and regular cluster users should not have permissions to
9+
deploy or modify the driver.
10+
11+
1. Do not grant regular cluster users permissions to modify
12+
`SecretProviderClassPodStatus` resources.
13+
14+
The `SecretProviderClassPodStatus` CRD is used by the driver to keep track
15+
of mounted resources. Manually editing this resource could have unexpected
16+
consequences to the system health and in particular modifying
17+
`SecretProviderClassPodStatus/status` may have security implications.
18+
19+
1. Disable `Secret` sync if not needed.
20+
21+
If you do not intend to use the `Secret` syncing feature, do not install the
22+
RBAC permissions that allow the driver to access cluster `Secret` objects.
23+
24+
This can be done by setting `syncSecret.enabled = false` when installing
25+
with helm.
26+
27+
1. Enable KMS application wrapping if using `Secret` sync.
28+
29+
If you need to synchronise your external secrets to Kubernetes `Secret`s
30+
consider configuring
31+
[encryption of data at rest](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/)
32+
33+
This will ensure that data is encrypted before it is stored in `etcd`.
34+
35+
1. Keep the driver up to date.
36+
37+
Subscribe to the
38+
[`kubernetes-secrets-store-csi-driver`](https://groups.google.com/forum/#!forum/kubernetes-secrets-store-csi-driver)
39+
mailing list to be notified of new releases and security announcements.
40+
41+
Consider using the
42+
[Github Watch](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/viewing-your-subscriptions)
43+
feature to subscribe to releases as well.
44+
45+
Always be sure to review the [release notes](https://github.com/kubernetes-sigs/secrets-store-csi-driver/releases)
46+
before upgrading.
47+
48+
1. When evaluating this driver consider the following threats:
49+
50+
* When a secret is accessible on the **filesystem**, application
51+
vulnerabilities like directory traversal attacks can become higher
52+
severity as the attacker may gain the ability read the secret material.
53+
* When a secret is consumed through **environment variables**,
54+
misconfigurations such as enabling a debug endpoints
55+
or including dependencies that log process environment details may leak
56+
secrets.
57+
* When syncing secret material to Kubernetes Secrets, consider whether the
58+
access controls on that data store are sufficiently narrow in scope.
59+
60+
If possible, directly integrating with a purpose built secrets API may offer
61+
the best security tradeoffs.

0 commit comments

Comments
 (0)