turbot/steampipe-mod-aws-compliance

Control: 2 Amazon Connect instances should have CloudWatch logging enabled

Description

This control checks whether an Amazon Connect instance is configured to generate and store flow logs in an Amazon CloudWatch log group. The control fails if the Amazon Connect instance isn't configured to generate and store flow logs in a CloudWatch log group.

Amazon Connect flow logs provide real-time details about events in Amazon Connect flows. A flow defines the customer experience with an Amazon Connect contact center from start to finish. By default, when you create a new Amazon Connect instance, an Amazon CloudWatch log group is created automatically to store flow logs for the instance. Flow logs can help you analyze flows, find errors, and monitor operational metrics. You can also set up alerts for specific events that can occur in a flow.

Remediation

For information about enabling flow logs for an Amazon Connect instance, see Enable Amazon Connect flow logs in an Amazon CloudWatch log group in the Amazon Connect Administrator Guide.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.foundational_security_connect_2

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.foundational_security_connect_2 --share

SQL

This control uses a named query:

with contactflow_logs_attribute as (
select
concat('arn:', a.partition, ':connect:', a.region, ':', a.account_id, ':instance/', a.instance_id) as instance_id
from
aws_connect_instance as i
left join aws_connect_instance_attribute as a on i.arn = concat('arn:', a.partition, ':connect:', a.region, ':', a.account_id, ':instance/', a.instance_id)
where
attribute_type = 'CONTACTFLOW_LOGS'
and value = 'true'
)
select
arn as resource,
case
when a.instance_id is not null then 'ok'
else 'alarm'
end as status,
case
when a.instance_id is not null then title || ' logging enabled.'
else title || ' logging disabled.'
end as reason
, region, account_id
from
aws_connect_instance as i
left join contactflow_logs_attribute as a on a.instance_id = i.arn;

Tags