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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.