output "switch_on" { description = "Switches on audit and authenticator logging for the cluster. EKS writes nothing until this runs." value = "aws eks update-cluster-config --name ${var.cluster_name} --logging '{\"clusterLogging\":[{\"types\":[\"audit\",\"authenticator\"],\"enabled\":true}]}'" } output "verify" { description = "How to prove the audit log arrives and the detections fire." value = <<-EOT aws eks describe-cluster --name ${var.cluster_name} --query 'cluster.logging.clusterLogging[?enabled].types' # includes audit kubectl exec -it -- true # the pod-exec alarm fires within about ten minutes aws logs filter-log-events --log-group-name ${local.group} --filter-pattern '{ $.objectRef.subresource = "exec" }' --max-items 5 EOT }