Amazon MQ encryption key settings need review

Amazon MQ encrypts stored data by default. Verify and explicitly configure the key ownership and management required by your organization.

Description

Amazon MQ always encrypts stored data. Both omitting EncryptionOptions and explicitly setting UseAwsOwnedKey: true select an AWS owned key.

Potential impact

Choose a customer managed key if you must control its policy or lifecycle. Disabling a key in use or revoking required grants can disrupt broker operation.

Remediation

For a customer managed key, set UseAwsOwnedKey: false, supply a symmetric KMS key from the same Region in KmsKeyId, and grant Amazon MQ the required access. Changing these settings requires broker replacement. Give a parallel broker a distinct name, stop publishing to the old broker, drain or migrate its queued messages, then check the new broker’s EncryptionOptions for the intended KmsKeyId. Test sending and receiving at its endpoint before switching clients.

Examples

The examples use the default ActiveMQ engine version. Supply an instance type supported in the Region and securely managed credentials. Review whether the broker needs PubliclyAccessible: true.

Default key selection

yaml
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
  BrokerInstanceType:
    Type: String
  BrokerUsername:
    Type: String
  BrokerPassword:
    Type: String
    NoEcho: true
Resources:
  BasicBroker:
    Type: AWS::AmazonMQ::Broker
    Properties:
      AutoMinorVersionUpgrade: true
      BrokerName: MyBasicBroker
      DeploymentMode: SINGLE_INSTANCE
      EngineType: ACTIVEMQ
      HostInstanceType: !Ref BrokerInstanceType
      PubliclyAccessible: true
      Users:
        - ConsoleAccess: true
          Groups:
            - MyGroup
          Password: !Ref BrokerPassword
          Username: !Ref BrokerUsername

Explicit key selection

yaml
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
  BrokerInstanceType:
    Type: String
  BrokerUsername:
    Type: String
  BrokerPassword:
    Type: String
    NoEcho: true
Resources:
  BasicBroker:
    Type: AWS::AmazonMQ::Broker
    Properties:
      AutoMinorVersionUpgrade: true
      BrokerName: MyBasicBroker
      DeploymentMode: SINGLE_INSTANCE
      EncryptionOptions:
        UseAwsOwnedKey: true
      EngineType: ACTIVEMQ
      HostInstanceType: !Ref BrokerInstanceType
      PubliclyAccessible: true
      Users:
        - ConsoleAccess: true
          Groups:
            - MyGroup
          Password: !Ref BrokerPassword
          Username: !Ref BrokerUsername

References