Documentation

esc
    Move to Pantech / Connect Google Cloud

    Connect Google Cloud

    Give Pantech read-only access to your Google Cloud projects with Workload Identity Federation, without creating a service account key, then check, fix or remove the connection.

    Pantech reads your Google Cloud projects through a service account that only your Pantech connection can use. You never create or share a service account key: Pantech signs a token for this connection, and Google's Security Token Service swaps it for read-only access that lasts 15 minutes. Nothing secret is stored on either side.

    You need to be an Owner of the project that will hold the identity pool, and able to grant roles on each project you want scanned. On Pantech you need to be an Owner or Admin of your organization.

    How it works

    1. You create a connection with provider gcp. It gets an id like ccn_06gk3x9tq7m2v8r4y1c5d0zp8w, the status awaiting role, and a setup with a script for your projects.
    2. You run the setup script (or its Terraform version) in your Google Cloud organization. It creates:
      • a workload identity pool, pantech-migrate, and in it one OIDC provider for this connection, which trusts Pantech's issuer (setup.issuer_url), accepts only the audience pantech-migrate, and has the condition assertion.sub == '<connection id>';
      • a service account, pantech-migrate-…, whose only Workload Identity User is this connection's subject;
      • a custom role, pantechMigrateReader, on each project you scan, granted to that service account.
    3. The script prints a line of JSON. You send it to Pantech, and the connection moves to verifying while Pantech uses the service account once.
    4. The connection is connected, ready to scan. If the check fails it is failed, with a reason and what to do.

    Create the connection

    Terminal
    $ curl -X POST https://api.pantechdynamics.com/public/v1/cloud-connections \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)" \    -H "Content-Type: application/json" \    -d '{"provider": "gcp", "name": "Production GCP"}'

    Or ask your AI app to do it (see with your AI). The response's setup holds:

    setup fieldWhat it is
    accessfederated
    issuer_url, audience, subjectPantech's issuer, pantech-migrate, and this connection's id: the three values the provider trusts
    templateThe gcloud setup script, written for this connection (template_format is shell)
    filesThe same setup as Terraform: pantech-migrate-gcp.tf
    permissionsEvery permission the custom role holds

    Save setup.template as pantech-migrate-gcp.sh, for example with jq -r .setup.template.

    Run the setup

    Run the script in Cloud Shell, or anywhere gcloud is signed in as an Owner of the project that will hold the pool. PROJECT_ID is that project; SCAN_PROJECTS lists every project Pantech may read (1 to 20, and it defaults to PROJECT_ID):

    Terminal
    $ PROJECT_ID=my-project SCAN_PROJECTS="my-project other-project" \    bash pantech-migrate-gcp.sh

    It turns on the APIs it needs in PROJECT_ID (IAM, IAM Credentials, Security Token Service, Compute Engine, Cloud SQL Admin and Cloud Resource Manager), creates the pool, the provider, the service account and the role, and ends by printing what to send to Pantech:

    What the script prints
    {"gcp":{"project_number":"123456789012","pool_id":"pantech-migrate","provider_id":"pantech-…","service_account_email":"pantech-migrate-…@my-project.iam.gserviceaccount.com","project_ids":["my-project","other-project"]}}

    With Terraform instead, write files[0].content to pantech-migrate-gcp.tf and apply it; its pantech output is the same JSON:

    Terminal
    $ terraform init$ terraform apply -var project_id=my-project -var 'scan_projects=["my-project","other-project"]'$ terraform output -raw pantech

    Send it to Pantech

    Send what the setup printed, then poll the connection until status is connected or failed:

    Terminal
    $ curl -X PATCH https://api.pantechdynamics.com/public/v1/cloud-connections/ccn_06gk3x9tq7m2v8r4y1c5d0zp8w \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)" \    -H "Content-Type: application/json" \    -d '{"gcp": {"project_number": "123456789012", "pool_id": "pantech-migrate", "provider_id": "pantech-…", "service_account_email": "pantech-migrate-…@my-project.iam.gserviceaccount.com", "project_ids": ["my-project", "other-project"]}}'

    These are identifiers, not secrets. To scan more projects later, run the script again with the new list in SCAN_PROJECTS and send the new JSON.

    Every permission the role holds

    A custom role, so Pantech reads only what it needs. The built-in roles/compute.viewer would also allow reading serial port output and screenshots, so it is not used.

    PermissionWhat for
    compute.instances.list, compute.machineTypes.listServers, and their vCPUs and memory
    compute.disks.listDisks
    compute.networks.list, compute.subnetworks.listNetworks and subnets
    compute.firewalls.listFirewall rules
    compute.addresses.list, compute.globalAddresses.listPublic addresses
    compute.forwardingRules.list, compute.globalForwardingRules.listLoad balancers
    compute.regions.list, compute.zones.listWhere things run
    cloudsql.instances.listCloud SQL databases
    storage.buckets.listBucket names
    resourcemanager.projects.getThe project itself
    resourcemanager.projects.getIamPolicyThe people with access to the project

    Every request Pantech makes also names exactly the fields it wants, so a server's metadata, where startup scripts live, is never sent to Pantech.

    What a scan reads

    Servers, disks, networks and subnets, firewall rules, public addresses, load balancers, Cloud SQL databases and bucket names, in every project you listed. People are the user: members of each project's IAM policy: groups and service accounts are not people. An owner or project IAM admin is suggested as an Admin on Pantech, anyone else as a Member (see invite your team).

    Google Cloud has no read-only spend API without a BigQuery billing export, so a scan does not read your bill. It carries the warning cost_not_available, and the plan's price comparison shows no Google Cloud figure.

    If the check fails

    CodeWhat it meansWhat to do
    assume_role_deniedPantech couldn't use the service accountCheck the setup script finished, and that the project number, pool, provider and service account you sent are the ones it printed. Then retry
    permission_missingThe service account is missing a permission on a projectRun the latest setup script again for every project you chose, then retry
    provider_unavailableGoogle Cloud did not answer in timeRetry in a few minutes
    internalSomething went wrong on Pantech's sideRetry; if it keeps happening, contact support

    Retry with PATCH /cloud-connections/{connection_id} and {"retry": true}. Details that do not fit Google Cloud's shape are refused straight away with 422 VALIDATION_FAILED and INVALID_FEDERATION. Troubleshooting has every code.

    The agent, for copies

    Pantech scans this cloud itself, so a scan needs nothing installed. The copy steps that read from inside your network use the Pantech Migrate agent, which this connection can have too: copying a server from the server itself, importing a database and moving a Kubernetes cluster. Enroll it with POST /cloud-connections/{connection_id}/agent-enrollments or pantech migrate agent enroll <connection id>. Here it never scans and needs no Google Cloud credential: only what each copy step needs, in its configuration.

    Disconnect

    1. In Pantech, disconnect the connection: DELETE /cloud-connections/{connection_id}, or ask your AI app. Its scans are deleted with it; plans stay until you delete them.
    2. In Google Cloud, delete the pool's provider for this connection, the service account and the pantechMigrateReader role on each project, or run terraform destroy if you used the Terraform version. Deleting the provider or the service account alone already cuts access.

    Was this page helpful?

    Updated