Skip to content

Commit e572d06

Browse files
committed
Minimize GCP permissions needed by the operator
1 parent 2d66e1a commit e572d06

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

docs/deployment/gke/gcp-role.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
title: "Falcon Operator Container Push Agent"
2+
description: "Role that enables pushing to GCR"
3+
stage: "ALPHA"
4+
includedPermissions:
5+
- storage.buckets.get
6+
- storage.objects.create
7+
- storage.objects.delete
8+
- storage.objects.get
9+
- storage.objects.list

docs/deployment/gke/run

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,20 @@ kubectl create ns $FALCON_SYSTEM_CONFIGURE --dry-run=client -o yaml | kubectl ap
8282
GCP_PROJECT_ID=$(gcloud config get-value core/project)
8383

8484
if ! kubectl get secret builder -n $FALCON_SYSTEM_CONFIGURE > /dev/null 2>&1; then
85+
GCP_ROLE_NAME=falconOperatorPush
8586
if ! gcloud iam service-accounts describe falcon-operator@$GCP_PROJECT_ID.iam.gserviceaccount.com > /dev/null 2>&1 ; then
87+
88+
if ! gcloud iam roles describe "$GCP_ROLE_NAME" --project "$GCP_PROJECT_ID" > /dev/null 2>&1; then
89+
gcloud iam roles create "$GCP_ROLE_NAME" --project="$GC_PROJECT_ID" \
90+
--file=
91+
fi
92+
8693
gcloud iam service-accounts create falcon-operator
8794
fi
8895

8996
gcloud projects add-iam-policy-binding $GCP_PROJECT_ID \
9097
--member serviceAccount:falcon-operator@$GCP_PROJECT_ID.iam.gserviceaccount.com \
91-
--role roles/storage.admin
98+
--role roles/"$GCP_ROLE_NAME"
9299

93100
gcloud iam service-accounts keys create \
94101
--iam-account "falcon-operator@$GCP_PROJECT_ID.iam.gserviceaccount.com" \

0 commit comments

Comments
 (0)