GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Google Cloud
  • iap
  • proxy
  • identity
  • More posts
  • architecture
  • Latest Posts
  • Facebook
  • Twitter
  • Github

This view

  • Original page
  • New address

GeezerVison is showing chefbc.com — Private instances access without an bastion host on GCP

Identity-Aware Proxy is a managed service that can control the access to your VM without an bastion host.

alt text

Enabling IAP tunneling by adding ingress firewall rule from IAP’s forwarding netblock.

For SSH access:

gcloud compute firewall-rules create allow-ssh-ingress-from-iap \
  --direction=INGRESS \
  --action=allow \
  --rules=tcp:22 \
  --source-ranges=35.235.240.0/20

For other protocols (PORT based on protocol):

gcloud compute firewall-rules create allow-ingress-from-iap \
  --direction=INGRESS \
  --action=allow \
  --rules=tcp:PORT \
  --source-ranges=35.235.240.0/20

IAP tunneling can be enforced via IAM permissions. (Grant the iap.tunnelResourceAccessor role to the user):

gcloud projects add-iam-policy-binding PROJECT_ID \
    --member=user:EMAIL \
    --role=roles/iap.tunnelResourceAccessor

Access via “gcloud compute ssh” command with the “tunnel-though-iap” flag to connect to an instance.

gcloud compute ssh my-instance \
--tunnel-through-iap 

Access via local port forwarding.

gcloud compute ssh  my-instance \
--tunnel-through-iap \
--ssh-flag="-N -L 3306:localhost:3306"

References

  • https://cloud.google.com/iap/docs/using-tcp-forwarding
  • https://cloud.google.com/iap/docs/tcp-forwarding-overview
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.