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
**Note**: The service account key *must* be named `cloud-sa.json` at driver deploy time
34
34
35
35
However, if there is no pre-existing service account for use the provided script
36
-
can be used to create a new service account with all the required permissions:
36
+
can be used to create a new service account with all the required permissions.
37
+
38
+
#### Security Note: Service Account Impersonation
39
+
40
+
The CSI driver requires the `roles/iam.serviceAccountUser` role to impersonate node service accounts when attaching and detaching disks. This role can be configured in two ways:
41
+
42
+
***Recommended (Scoped)**: Grant the role only for specific node service accounts
43
+
***Default (Project-wide)**: Allow project-wide service account impersonation (less secure)
44
+
45
+
For improved security, specify the node service accounts that the CSI driver needs to impersonate using the `NODE_SERVICE_ACCOUNTS` environment variable. This limits the role to only the specified accounts. Without `NODE_SERVICE_ACCOUNTS`, the CSI driver can impersonate any service account in the project.
46
+
47
+
```console
48
+
$ NODE_SERVICE_ACCOUNTS="master-sa@project.iam.gserviceaccount.com,worker-sa@project.iam.gserviceaccount.com"# Comma-separated list of node service accounts
49
+
```
50
+
51
+
For more details, see [How to remediate over privileged service account users](https://cloud.google.com/security-command-center/docs/how-to-remediate-security-health-analytics-findings#over_privileged_service_account_user).
52
+
53
+
#### Create service account for the CSI driver
37
54
38
55
```console
39
56
$ PROJECT=your-project-here # GCP project
@@ -46,9 +63,10 @@ $ ./deploy/setup-project.sh
46
63
deployment, all actions performed by the driver will be performed as the
47
64
specified service account
48
65
49
-
3. Deploy driver to Kubernetes Cluster
66
+
### 3. Deploy driver to Kubernetes Cluster
50
67
51
68
```console
69
+
$ NODE_SERVICE_ACCOUNTS="master-sa@project.iam.gserviceaccount.com,worker-sa@project.iam.gserviceaccount.com"# Same as the setup-project.sh step
52
70
$ GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to get the service account key
53
71
$ GCE_PD_DRIVER_VERSION=stable-master # Driver version to deploy
54
72
$ ./deploy/kubernetes/deploy-driver.sh
@@ -74,6 +92,8 @@ additional permissions are required in order to create the new service account:
0 commit comments