- Create a service account with no permissions for federation.
- If you do not attach a service account to compute resources or use the default service account, we recommend creating a new service account for the compute resources. Create a service account to attach to compute resources and impersonate the federation service account.
- Create an authorization policy to allow the federation service account to authenticate to Endor Labs.
- Provision the compute resources with the appropriate permissions.
- Test Keyless authentication.
Create GCP service accounts and authorization policies
To create your service accounts, first export your GCP project name as an environment variable:Create a federation service account
endorlabs-federation:Create a compute service account
endorlabs-compute-service:Assign impersonation permissions
serviceAccountOpenIdTokenCreator role to the endorlabs-compute-service service account:Create an authorization policy in Endor Labs
endorlabs-federation account to authenticate to your Endor Labs tenant.<your-tenant> with your Endor Labs tenant name and <insert-your-project> with your GCP project name.https://api.eu.endorlabs.com instead of https://api.endorlabs.com.Provision and test keyless authentication for GKE workloads
Prerequisites
The following prerequisites are required to setup keyless authentication on GKE workloads:- Workload identity is enabled on the target GKE cluster. See the GCP documentation on using workload identity for instructions on migrating existing cluster node pools or creating new clusters to use GCP workload identity.
- The gcloud auth plugin is installed and operational on your machine. See the GCP instructions on enabling the gcloud auth plugin for more details.
- The kubectl CLI is installed. See the Kubernetes documentation for instructions.
Procedure
The following instructions require you to export these environment variables:Create a GKE cluster with workload identity
Authenticate to the GKE cluster
Create a namespace for Endor Labs scans
Create a Kubernetes service account
Bind the Kubernetes service account to your GCP compute service account
<insert-your-project> with your GCP project name.Annotate the Kubernetes service account
endorlabs-compute-service with the appropriate name.Test a scanning workload using keyless authentication
Provision and Test Keyless Authentication for GCP Virtual Machine Instances
The following instructions require you to export the following environment variable:Create a virtual machine instance with the appropriate scopes
Download and install endorctl on the virtual machine instance
endorctl. See our documentation for instructions on downloading the latest version.Launch a test scan with keyless authentication
--gcp-service-account flag for federated access to Endor Labs: