Skip to content

Commit

Permalink
Minimize GCP permissions needed by the operator
Browse files Browse the repository at this point in the history
  • Loading branch information
isimluk committed Nov 18, 2021
1 parent 2d66e1a commit e572d06
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/deployment/gke/gcp-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: "Falcon Operator Container Push Agent"
description: "Role that enables pushing to GCR"
stage: "ALPHA"
includedPermissions:
- storage.buckets.get
- storage.objects.create
- storage.objects.delete
- storage.objects.get
- storage.objects.list
9 changes: 8 additions & 1 deletion docs/deployment/gke/run
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,20 @@ kubectl create ns $FALCON_SYSTEM_CONFIGURE --dry-run=client -o yaml | kubectl ap
GCP_PROJECT_ID=$(gcloud config get-value core/project)

if ! kubectl get secret builder -n $FALCON_SYSTEM_CONFIGURE > /dev/null 2>&1; then
GCP_ROLE_NAME=falconOperatorPush
if ! gcloud iam service-accounts describe falcon-operator@$GCP_PROJECT_ID.iam.gserviceaccount.com > /dev/null 2>&1 ; then

if ! gcloud iam roles describe "$GCP_ROLE_NAME" --project "$GCP_PROJECT_ID" > /dev/null 2>&1; then
gcloud iam roles create "$GCP_ROLE_NAME" --project="$GC_PROJECT_ID" \
--file=
fi

gcloud iam service-accounts create falcon-operator
fi

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

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

0 comments on commit e572d06

Please sign in to comment.