I have cloud run instances that runs users code and I was made aware that their code could access the instance's metadata just by querying the VM's metadata server from their code:
$ curl "http://metadata.google.internal/computeMetadata/v1/?recursive=true&alt=text" \
-H "Metadata-Flavor: Google"
While I believe the information this provides is not necessarily sensitive (am I wrong?), I still want to block that IP from my VMs.
I looked around in cloud run VM configuration dashboard but couldn't find network security rules. What is the recommended approach for blocking an IP on cloud run?
About Google metadata server: https://cloud.google.com/compute/docs/metadata/overview
The security issue documented: https://about.gitlab.com/blog/2020/02/12/plundering-gcp-escalating-privileges-in-google-cloud-platform/#metadata-endpoint