Control: GuardDuty EKS audit log monitoring should be enabled
Description
This control checks whether GuardDuty EKS audit log monitoring is enabled. For a standalone account, the control fails if GuardDuty EKS audit log monitoring is disabled in the account. In a multi-account environment, the control fails if the delegated GuardDuty administrator account and all member accounts don't have EKS audit log monitoring enabled.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.guardduty_detector_eks_audit_log_monitoring_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.guardduty_detector_eks_audit_log_monitoring_enabled --share
SQL
This control uses a named query:
with eks_audit_log_monitoring as ( select arn from aws_guardduty_detector, jsonb_array_elements(features) as f where f ->> 'Name' = 'EKS_AUDIT_LOGS' and f ->> 'Status' = 'ENABLED')select d.arn as resource, case when m.arn is not null then 'ok' else 'alarm' end as status, case when m.arn is not null then title || ' has EKS audit log monitoring enabled.' else title || ' has EKS audit log monitoring disabled.' end as reason , region, account_idfrom aws_guardduty_detector as d left join eks_audit_log_monitoring as m on m.arn = d.arn