output "detections" { description = "Each alarm, the audit log filters feeding its metric, and its condition." value = { for k, a in local.alarms : k => { conditions = [for c in local.connectors : c.condition if c.metric == a.metric] query = a.query } } } output "archive_bucket" { description = "The bucket containing the copy of every event, or empty when none is kept." value = local.archive ? oci_objectstorage_bucket.archive[0].name : "" } output "verify" { description = "How to prove the log is kept and the detections fire, and what the platform leaves out." value = <<-EOT Confirm each subscription email first. Notifications sends nothing to an address until then. kubectl exec -it -- true # the pod-exec alarm emails within a few minutes kubectl create clusterrolebinding probe --clusterrole=view --user=probe && kubectl delete clusterrolebinding probe In Logging Search, what the API server has recorded in the last hour, by call: search "${var.compartment_ocid}/_Audit" | where ${local.source} | summarize count() by data.eventName, data.identity.principalName If the exec is missing from that list, OKE did not record it: the pod-exec alarm cannot see what the platform does not send, and the Kubernetes for defenders page says what to do instead. kubectl get secret -n -o name # then the search above: a read that is absent from it is one OKE did not record Ten refused requests from one user in five minutes, such as kubectl get secrets -A --as=nobody run ten times: the forbidden-request alarm follows. If it stays quiet, read the forbidden_request metric in Monitoring; a connector may count a batch of events as one point. ${local.archive ? "Objects arrive in ${oci_objectstorage_bucket.archive[0].name} within a few minutes, and oci os object delete on one is refused for ${var.archive_retention_days} days while the rule stands.${var.lock_at == "" ? " Set lock_at so the rule itself cannot be removed." : ""}" : "Set archive_retention_days to keep a copy past the Audit service's 365 days."} EOT }