Review Glue Data Catalog and connection password encryption

Review Glue catalog encryption at rest and encrypted connection-password responses together.

Description

Glue has two separate controls. encryption_at_rest protects catalog metadata. return_connection_password_encrypted controls whether connection passwords stay encrypted in GetConnection and GetConnections responses.

Potential impact

A caller able to retrieve connection details may receive a readable password. Removing required KMS access can also interrupt catalog reads and jobs.

Remediation

  • Choose the catalog encryption mode and key. Glue can use its AWS managed key. Set sse_aws_kms_key_id if you need a customer-managed key.
  • In connection_password_encryption, specify aws_kms_key_id and set return_connection_password_encrypted = true. Limit password decryption to callers that need it, separately from permissions to create or update connections.
  • Update any existing connections whose passwords are still unencrypted. Verify the retrieval response and run a job. Configure data-source encryption and TLS separately.

Examples

Both excerpts use the same symmetric KMS key for SSE-KMS catalog encryption. Supply the referenced key and permissions.

Encrypted password responses disabled

hcl
resource "aws_glue_data_catalog_encryption_settings" "catalog_settings" {
  data_catalog_encryption_settings {
    connection_password_encryption {
      aws_kms_key_id                       = aws_kms_key.test.arn
      return_connection_password_encrypted = false
    }

    encryption_at_rest {
      catalog_encryption_mode = "SSE-KMS"
      sse_aws_kms_key_id      = aws_kms_key.test.arn
    }
  }
}

false allows passwords to be returned without this encryption.

Encrypted password responses enabled

hcl
resource "aws_glue_data_catalog_encryption_settings" "catalog_settings" {
  data_catalog_encryption_settings {
    connection_password_encryption {
      aws_kms_key_id                       = aws_kms_key.test.arn
      return_connection_password_encrypted = true
    }

    encryption_at_rest {
      catalog_encryption_mode = "SSE-KMS"
      sse_aws_kms_key_id      = aws_kms_key.test.arn
    }
  }
}

With true, passwords for connections created or updated under this setting remain encrypted when retrieved.

References