# Saved Logs Explorer queries for working a case, shared with everyone who can # see the security project. The entries they search were copied in from other # projects and live in this project's insider buckets, which Logs Explorer # does not search by default: open a query, choose Refine scope, then Scope by # storage, and pick insider-data-theft or insider-object-reads. locals { saved = merge({ changes-by-person = { title = "Insider: changes by person" filter = local.any_match } # Who was given new access. Run it first when an alert names a person, to # see whether their access changed in the days before. permission-changes = { title = "Insider: permission changes" filter = local.permission_adds } one-principal = { title = "Insider: one principal" filter = "protoPayload.authenticationInfo.principalEmail=\"REPLACE-WITH-EMAIL\"" } }, local.reads_on ? { reads = { title = "Insider: object reads" filter = local.read_filter } } : {}) } resource "google_logging_saved_query" "insider" { for_each = local.saved parent = "projects/${var.security_project}" location = "global" name = "insider-${each.key}" display_name = each.value.title visibility = "SHARED" logging_query { filter = each.value.filter } }