Description
To encrypt incoming Kinesis records at rest, set encryption_state: enabled, encryption_type: KMS and a valid key_id. If an existing task omits these options, check the stream itself to see whether encryption is on.
Potential impact
Previously unencrypted records stay unencrypted until they expire. Review their retention period and handling.
Remediation
- Choose an approved key and check that producers and consumers have the access they need. Missing key permissions can interrupt writes or reads.
- Once the stream is
ACTIVE, allow up to five seconds for encryption to take effect. Write a test record and check forEncryptionType: KMSin thePutRecordresponse. Read it back with a consumer. Stream access and TLS need their own controls.
Examples
Before
yaml
- name: Encrypt Kinesis Stream test-stream
community.aws.kinesis_stream:
name: test-stream
state: present
shards: 1
encryption_state: disabled
encryption_type: KMS
key_id: alias/aws/kinesis
wait: yes
wait_timeout: 600
disabled requests that Kinesis stop encrypting new records, even though the task names a key.
After
yaml
- name: Encrypt Kinesis Stream test-stream
community.aws.kinesis_stream:
name: test-stream
state: present
shards: 1
encryption_state: enabled
encryption_type: KMS
key_id: alias/aws/kinesis
wait: yes
wait_timeout: 600
enabled requests encryption with the AWS managed Kinesis key, alias/aws/kinesis.