How to do it...

To set up our unauthorized activity alerting system, we'll create a Python program that will first verify the logs to find out if there are any unauthorized machines are created. If any unauthorized machine identified, the program will proceed to terminate them:

  1. In the Creating alerts on specific events recipe in Chapter 6Management Tools, you'll find how to filter logs and focus on the events which interest us. Similarly, for our security situation, we are interested in instances created and their instance type. The following is an example of a log filter:
  1. Next, we'll have to convert this log filter into an API request. ...

Get Google Cloud Platform Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.