Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Minimise GCP permissions needed by the operator #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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=https://raw.githubusercontent.com/CrowdStrike/falcon-operator/e572d06efaf8dbb0cecdfeaa3cbede9b0f2d5c6d/docs/deployment/gke/gcp-role.yaml
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