Control: DataSync tasks should have logging enabled
Description
This control checks whether an AWS DataSync task has logging enabled. The control fails if the task doesn't have logging enabled.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.datasync_task_logging_enabledSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.datasync_task_logging_enabled --shareSQL
This control uses a named query:
select  arn as resource,  case    when cloud_watch_log_group_arn is not null and options ->> 'LogLevel' in ('BASIC', 'TRANSFER') then 'ok'    else 'alarm'  end as status,  case    when cloud_watch_log_group_arn is not null and options ->> 'LogLevel' in ('BASIC', 'TRANSFER') then title || ' ' || (options ->> 'LogLevel') || ' level logging enabled.'    else title || ' logging disabled.'  end as reason    , region, account_idfrom  aws_datasync_task;