turbot/steampipe-mod-aws-compliance

Control: 11 DMS endpoints for MongoDB should have an authentication mechanism enabled

Description

This control checks whether an AWS DMS endpoint for MongoDB is configured with an authentication mechanism. The control fails if an authentication type isn't set for the endpoint.

AWS Database Migration Service supports two authentications methods for MongoDB—MONGODB-CR for MongoDB version 2.x, and SCRAM-SHA-1 for MongoDB version 3.x or later. These authentication methods are used to authenticate and encrypt MongoDB passwords if users want to use the passwords to access the databases. Authentication on AWS DMS endpoints ensures that only authorized users can access and modify the data being migrated between databases. Without proper authentication, unauthorized users may be able to gain access to sensitive data during the migration process. This can result in data breaches, data loss, or other security incidents.

Remediation

To enable an authentication mechanism on DMS endpoints for MongoDB, see Using MongoDB as a source for AWS DMS in the AWS Database Migration Service User Guide.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.foundational_security_dms_11

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
arn as resource,
case
when endpoint_type <> 'SOURCE' then 'skip'
when mongo_db_settings is null then 'skip'
when (mongo_db_settings ->> 'AuthMechanism') = 'default' then 'alarm'
else 'ok'
end as status,
case
when endpoint_type <> 'SOURCE' then title || ' endpoint is not of source type.'
when mongo_db_settings is null then title || ' endpoint is not of mongodb engine type.'
when (mongo_db_settings ->> 'AuthMechanism') = 'default' then title || ' authentication mechanism disabled.'
else title || ' ' || (mongo_db_settings ->> 'AuthMechanism') || ' authentication mechanism enabled.'
end as reason
, region, account_id
from
aws_dms_endpoint;

Tags