(no title)
dward | 6 years ago
https://cloud.google.com/iap/docs/using-tcp-forwarding#tunne...
For connecting VMs without public IPs to the outside world, Cloud NAT is the easiest answer. You could set one up yourself if you were so inclined (e.g. some forwarding rules and iptables rules on the bastion).
For ssh key distribution, there's a few options. You can store the key in Secret Manager and run your GCE VMs as a service account that has access to the key, then fetch it when pulling.
https://cloud.google.com/secret-manager/docs/
Something like:
$ ssh-add <(gcloud beta secrets versions access latest --secret=github-ssh-key)
On startup. I haven't actually tried out secret manager yet.
If you have too much time on your hands, you could rig something up with GCE vTPMs as well :)
https://cloud.google.com/blog/products/gcp/virtual-trusted-p...
jmarcher|6 years ago
As fart as managing SSH keys, I would say: don't do it. Use OS Login instead. For cases, like automation, create a service account and use it with OS Login. It gives you a centralized way to manage SSH access (and revoke access) and sudo privileges.
https://cloud.google.com/compute/docs/oslogin/
tomlockwood|6 years ago
tomlockwood|6 years ago