All checks
Low SageMaker · regional

SageMaker feature group offline stores should be encrypted with AWS KMS keys

Checks that the feature group's offline store names a KMS key of yours for the Amazon S3 data it writes. Without one the data is still encrypted, under an AWS managed key; a key of your own puts its policy, rotation and deletion under your control and logs every use in CloudTrail.

service
SageMaker
severity
Low
scope
evaluated in every region

How to fix it

  • Replaces the resource: The key is fixed at creation: create a new feature group with it, copy the historical data and repoint readers and writers, then delete this one (its S3 data stays until you delete it).
  • Affects another check: A group that also has an online store carries a second key, read by SageMaker.18; set both in the same replacement.

Settings

OfflineStoreConfig.S3StorageConfig.KmsKeyId
A symmetric customer managed key; not the online store's key if its policy has a kms:ViaService condition
RoleArn
A role with kms:GenerateDataKey on that key

With the AWS CLI

aws sagemaker create-feature-group --feature-group-name <feature-group-name> --record-identifier-feature-name <record-identifier> --event-time-feature-name <event-time-feature> --feature-definitions '[{"FeatureName":"<record-identifier>","FeatureType":"String"}]' --role-arn <execution-role-arn> --offline-store-config '{"S3StorageConfig":{"S3Uri":"s3://<bucket>/<prefix>","KmsKeyId":"<kms-key-arn>"}}' --region <region>

With Terraform

resource "aws_sagemaker_feature_group" "this" {
  feature_group_name             = var.feature_group_name
  record_identifier_feature_name = var.record_identifier
  event_time_feature_name        = var.event_time_feature
  role_arn                       = var.execution_role_arn

  feature_definition {
    feature_name = var.record_identifier
    feature_type = "String"
  }

  offline_store_config {
    s3_storage_config {
      s3_uri     = var.offline_store_s3_uri
      kms_key_id = var.kms_key_arn
    }
  }
}

See which of your accounts this check is failing on.

Book a live scan