Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud Function Audit Log to find IP address of invoker

Hi,

We have cloudfunction running with cloud invoker role  for all user. We wanted to keep track of IP addresses and locations calling this function or posting to this function. I have enabled all audit log parameter for cloud function. How to filter the information of the caller 

0 4 1,187
4 REPLIES 4

Are you finding the logs in Cloud Logging for the invocation of your Cloud Function and asking how to filter the logs?

How do you even enable this?

Do you mind pointing me to a doc?

I suddenly got an alert from Google billing system and found out one of my personal functions started being called every 5 min by somebody.

But I'm not logging that information in the function and would like to figure who is calling it.

Do I need to log that information in the code or Google can log it for me for later review?

This might be a good start ...

https://cloud.google.com/functions/docs/monitoring/audit-logging

My belief is that Google Cloud Logging will contain logs for the execution of your Cloud Functions.  This will likely include who is calling, when they are calling and from where they are calling.   You should be able to enable Cloud Function logging from the Google Cloud console.  No coding or insertion of log statements should be required inside your Cloud Logging functions.

hi @kolban , I am not able to observer any audit logs when invoking a cloud function. FYI I am able to get appropriate audit logs when creating/deleting/updating a cloud function. In addition to this I have enabled all types of audit log for cloud function