Review Glue Security Configuration encryption settings

Check encryption modes for Glue logs, bookmarks and results, and that the security configuration is applied.

Description

A Glue security configuration sets encryption for CloudWatch logs, job bookmarks and S3 outputs. Attach it to the jobs and crawlers that use it. Ray jobs do not support security configurations.

Potential impact

CloudWatch Logs and new S3 objects already have storage encryption. They can still use a different key than your policy requires. Missing KMS access can interrupt logging, processing or recovery.

Remediation

  • For CloudWatch logs that require KMS, set cloudwatch_encryption_mode = "SSE-KMS" and kms_key_arn. For client-side encryption of bookmarks, use CSE-KMS and its key. For S3, choose SSE-S3 or SSE-KMS as required.
  • To change the CloudWatch key on a deployed configuration, create a replacement under a different name and attach it to the affected jobs and crawlers. Grant the execution roles and relevant AWS services the required key permissions. Check the encryption and read access for the outputs of a run before retiring the original configuration.

Examples

The excerpts use the same symmetric KMS key for bookmarks and S3 outputs. Supply the referenced key.

Log key not specified

hcl
resource "aws_glue_security_configuration" "glue_security" {
  name = "example"

  encryption_configuration {
    cloudwatch_encryption {
      cloudwatch_encryption_mode = "SSE-KMS"
    }

    job_bookmarks_encryption {
      job_bookmarks_encryption_mode = "CSE-KMS"
      kms_key_arn                   = data.aws_kms_key.example.arn
    }

    s3_encryption {
      kms_key_arn        = data.aws_kms_key.example.arn
      s3_encryption_mode = "SSE-KMS"
    }
  }
}

CloudWatch encryption is set to SSE-KMS, but its key ARN is missing.

Log key specified

hcl
resource "aws_glue_security_configuration" "glue_security" {
  name = "example"

  encryption_configuration {
    cloudwatch_encryption {
      cloudwatch_encryption_mode = "SSE-KMS"
      kms_key_arn                = data.aws_kms_key.example.arn
    }

    job_bookmarks_encryption {
      job_bookmarks_encryption_mode = "CSE-KMS"
      kms_key_arn                   = data.aws_kms_key.example.arn
    }

    s3_encryption {
      kms_key_arn        = data.aws_kms_key.example.arn
      s3_encryption_mode = "SSE-KMS"
    }
  }
}

The second configuration adds kms_key_arn for CloudWatch logs.

References