turbot/steampipe-mod-aws-compliance

Control: SageMaker notebook instances should be encrypted using CMK

Description

This control checks if SageMaker notebook instance storage volumes are encrypted with AWS KMS Customer Master Keys (CMKs) instead of AWS managed-keys.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.sagemaker_notebook_instance_encrypted_with_kms_cmk

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

with sagemaker_notebook_instances as (
select
arn,
region,
account_id,
kms_key_id,
title,
tags,
_ctx
from
aws_sagemaker_notebook_instance
), kms_keys as (
select
arn,
key_manager,
enabled
from
aws_kms_key
)
select
i.arn as resource,
case
when kms_key_id is null then 'alarm'
when k.key_manager = 'CUSTOMER' then 'ok'
else 'alarm'
end as status,
case
when kms_key_id is null then i.title || ' encryption disabled.'
when k.key_manager = 'CUSTOMER' then i.title || ' encryption at rest with CMK enabled.'
else i.title || ' encryption at rest with CMK disabled.'
end as reason
, i.region, i.account_id
from
sagemaker_notebook_instances as i
left join kms_keys as k on i.kms_key_id = k.arn;

Tags