Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restrict access to Google Cloud Functions to a given network?

I'm looking through Google Cloud Functions docs and I wonder if it is possible to restrict access to HTTP cloud function to the given network? I would like to avoid anyone to exhaust the free quota.

Is there any firewall rules or similar mechanism for Cloud Functions?

like image 326
Evgeny Timoshenko Avatar asked Apr 23 '17 11:04

Evgeny Timoshenko


1 Answers

You can add authentication to a cloud function by using firebase authentication. Here's a github example of how to do to it: https://github.com/firebase/functions-samples/tree/master/authorized-https-endpoint

Note however that the authentication code is executed by your function, so rejecting unauthorized access would still consume a small portion of your free resource allowance.

like image 73
Aaron Avatar answered Sep 21 '22 20:09

Aaron