Skip to main content
Cloud Capture is still in active development. Its capabilities and configuration format may change, and onboarding is done together with Kosli’s Customer Success team.
Cloud Capture snapshots the Cloud Run services and jobs, and the Google Kubernetes Engine (GKE) clusters, in the projects you register. Google Cloud support is in early access, so the Google Cloud page appears in your Cloud Capture settings only once Kosli has enabled it for your organization.

Set up

In order for Cloud Capture to reach into your Google Cloud project, to discover your Cloud Run services and jobs and your Google Kubernetes Engine (GKE) clusters, you need to grant permission to Kosli to do so. This requires a service account in your project that Cloud Capture can impersonate through workload identity federation; the service account, and the workload identity pool that guards it, exist within your own project. To simplify this process, Kosli has created a Terraform configuration that creates that service account, the read-only roles Cloud Capture needs, and a workload identity pool that accepts only the Kosli-side role created for your organization. If you would rather create these resources yourself, see Permissions and security for the service account, workload identity pool, and roles that Cloud Capture needs.
1

Download the Terraform configuration

Infrastructure Manager reads a configuration from a local directory, so download the published file into an empty directory:
You also need two values from Kosli: the Kosli AWS account ID, and the name of the Kosli-side IAM role for your organization. The configuration isn’t pre-filled with them. In your organization’s Settings, go to Cloud Capture, open Google Cloud, and select Register account; the first step of the form shows both.
2

Deploy with Infrastructure Manager

Deploy the configuration once in each project that holds Cloud Run services or jobs, or GKE clusters, you want Cloud Capture to snapshot. Run the following from the directory containing the configuration:
Infrastructure Manager runs Terraform as the service account you name, so that service account needs permission to enable APIs and to create workload identity pools, service accounts, custom roles, and project IAM bindings.
3

Read the two outputs

Kosli needs two values to connect to your project. The configuration emits both as Terraform outputs:
  • kosli_capture_provider: the full resource name of the workload identity provider
  • kosli_capture_service_account: the email of the service account Cloud Capture impersonates
You enter both when you register the project. You can read them at any time from the deployment’s latest revision:
4

Register the project

Accounts can only be registered while Cloud Capture is enabled. When you have deployed the configuration, continue the registration form: enter the project ID, the workload identity provider name, and the service account email, and choose the regions and services to scan. Cloud Run is selected for a new project. GKE is not selected, so select it if you want clusters snapshotted.Cloud Capture never connects to a GKE cluster. It lists the project’s clusters and reads their pods from Google’s Cloud Asset Inventory, so a private cluster is snapshotted like any other and nothing is installed in it. Cloud Asset Inventory can be a few minutes behind a cluster, so a pod that lives for less time than that may never be seen.Cloud Capture scans every five minutes unless you choose another frequency, and picks up a registered project the next time it runs - you should see environments and snapshots appearing within a few minutes.

Excluding resources

Exclude resources by label. In your organization’s Settings, go to Cloud Capture, open Google Cloud, and add the label to the Skip tags panel in the Google Cloud defaults. Key and value must both match the resource’s label exactly.
  • A Cloud Run service or job is skipped on its own, and the region’s Cloud Run environment in Kosli is made up of the services and jobs that remain.
  • A GKE cluster is skipped with everything in it. The label is read on the cluster; labels on workloads inside it are not read.
Through the API, the labels are the gcp list of skip_tags; see Using the API.

Permissions and security

For the model that is common to every cloud, see Cloud Capture security. Kosli publishes a Terraform configuration, for use with Infrastructure Manager, that creates everything Cloud Capture needs to snapshot Cloud Run and Google Kubernetes Engine (GKE). Infrastructure Manager runs Terraform as a managed service inside your project, so there is no state file or Terraform install for you to manage. Deploy the configuration once in each project you want Cloud Capture to snapshot. The current version, v0.2.0, is published at https://kosli-cloud-capture-templates.s3.eu-central-1.amazonaws.com/gcp/v0.2.0/main.tf, and what this page describes is taken from it. Everything it creates is yours, in your project. Cloud Capture runs in AWS and reaches your project through Workload Identity Federation. Cloud Capture exchanges its own short-lived AWS credentials for a short-lived Google token, then impersonates a service account that you create. No service account key is ever created or shared. Your workload identity pool makes two checks before it issues a token:
  1. It accepts only credentials issued by the Kosli AWS account in which Cloud Capture runs.
  2. Within that account, it accepts only the Kosli-side IAM role dedicated to your organization. Every Cloud Capture job runs under the role for the organization it is working for. A job for another Kosli tenant presents a different role name, so your pool refuses it, even if that tenant gave Kosli your provider and service account details instead of their own.
The role name is part of the credential that AWS signs and Google verifies, so the caller cannot forge it. For readers familiar with the AWS setup: the account check plays the part of the principal in the assume-role trust policy, and the role check plays the part of the external ID.

What the configuration creates

The configuration takes three inputs, none of which has a default: project_id, and the two values Kosli supplies, kosli_aws_account_id and kosli_role_name. It emits two outputs, kosli_capture_provider and kosli_capture_service_account, which you enter when you register the project; see Set up.

Permissions granted to the service account

All of the grants are read-only, and all are on the project. Worth knowing for a security review of GKE:
  • Cloud Capture never calls a cluster’s Kubernetes API. No Kubernetes RBAC objects are created inside your clusters, nothing is installed in them, and Cloud Capture needs no network access to any cluster control plane, so a private cluster is snapshotted like any other.
  • The GKE role is custom because Google’s predefined roles are wider: roles/cloudasset.viewer would list every asset type in the project, including Kubernetes Secrets.
  • The role cannot be made narrower than every pod in the project, because Cloud Asset Inventory filters by neither cluster nor namespace. A pod’s record holds its images, commands, arguments, labels, annotations, and any environment variables written into the spec in plain text. A value taken from a Kubernetes Secret appears as a reference and not as the secret.
  • A project inside a VPC Service Controls perimeter that restricts the Cloud Asset, Kubernetes Engine, or Cloud Run API needs an ingress rule that admits the service account, because Cloud Capture calls from outside the perimeter.
If you wish to grant access for Cloud Capture without using our published configuration, create the resources and grants in the two tables above. The pool must accept only the Kosli AWS account and, within it, only the Kosli-side role for your organization, and only that role may impersonate the service account.

The configuration in full

Tenant isolation

Each Cloud Capture job for your organization runs under the Kosli-side IAM role dedicated to your organization. The workload identity pool in your project accepts only that role, so a job running for a different tenant cannot obtain a token from your project or impersonate your service account. Separation is enforced by the identity provider, not by application code.
Last modified on November 27, 2026