AWS Introduction
AWS Pricing
AWS Threats
AWS Misconfigurations
- Getting Started with AWS Audit
- Permissions required for Misconfigurations Detection
- API Gateway Audit
- Cloudformation Audit
- CloudFront Audit
- CloudTrail Audit
- Cloudwatch Audit
- DynamoDB Audit
- EC2 Audit
- Elastic Search Audit
- ELB Audit
- IAM Audit
- KMS Audit
- Kubernetes Audit
- Lambda Audit
- RDS Audit
- Redshift Audit
- Route53 Audit
- S3 Audit
- Security Groups Audit
- SES Audit
- SNS Audit
- IAM Deep Dive
- App Sync Audit
- Code Build Audit
- Open Search Audit
- Shield Audit
- SQS Audit
Kinesis Server Side Encryption
More Info:
Ensure that your AWS Kinesis streams are encrypted using Server-Side Encryption (SSE) in order to meet strict regulatory requirements and improve the security of your data at rest. Kinesis is a platform for streaming data on Amazon Web Services that provides you with the ability to build and manage your own custom streaming data applications for specialized needs. A Kinesis stream is an ordered sequence of data records collected within a dedicated storage layer. With SSE your sensitive data is encrypted before this is written to the Kinesis stream storage layer and decrypted after it’s retrieved from storage.
Risk Level
High
Address
Cost optimization, Operational Maturity, Security
Compliance Standards
HIPAA, ISO27001
Triage and Remediation
Remediation
To remediate the misconfiguration related to Kinesis Server Side Encryption for AWS DynamoDB using AWS console, follow these steps:
-
Navigate to AWS DynamoDB Console:
- Open the AWS Management Console and navigate to the DynamoDB service.
-
Select the Table:
- From the list of tables, select the table for which you want to enable encryption.
-
Click on the ‘Manage Stream’ button:
- Click on the ‘Manage Stream’ button to access the Stream details of the selected DynamoDB table.
-
Enable Server-Side Encryption:
- In the Stream details page, locate the setting for Server-Side Encryption.
- Click on the ‘Edit’ or ‘Modify’ button to change the encryption settings.
-
Choose Encryption Type:
- Select the option for Kinesis Server-Side Encryption.
- You may need to provide additional details such as KMS Key ARN for encryption.
-
Save Changes:
- After configuring the encryption settings, save the changes by clicking on the ‘Save’ or ‘Update’ button.
-
Verify Encryption Status:
- Once the changes are saved, verify that the Server-Side Encryption is enabled for the DynamoDB table stream.
By following these steps, you can remediate the misconfiguration related to Kinesis Server Side Encryption for AWS DynamoDB using the AWS Management Console.
To remediate the misconfiguration of Kinesis Server-Side Encryption for AWS DynamoDB using AWS CLI, you can follow these steps:
-
Check the current encryption status: Run the following AWS CLI command to check the current encryption status of your DynamoDB table:
aws dynamodb describe-table --table-name YOUR_TABLE_NAME
This command will return information about the specified DynamoDB table, including the encryption settings.
-
Enable Server-Side Encryption: If the encryption is not enabled, you can enable Server-Side Encryption for the DynamoDB table using the following AWS CLI command:
aws dynamodb update-table --table-name YOUR_TABLE_NAME --sse-specification Enabled=true
Replace
YOUR_TABLE_NAME
with the actual name of your DynamoDB table. This command will enable Server-Side Encryption for the specified DynamoDB table. -
Verify Encryption: After enabling Server-Side Encryption, you can verify the encryption status by running the
describe-table
command again:aws dynamodb describe-table --table-name YOUR_TABLE_NAME
Ensure that the
SSEDescription
section in the output confirms that Server-Side Encryption is enabled for the DynamoDB table.
By following these steps and using the AWS CLI commands provided, you can remediate the misconfiguration of Kinesis Server-Side Encryption for AWS DynamoDB.
To remediate the misconfiguration of not having Kinesis Server Side Encryption enabled for AWS DynamoDB using Python, follow these steps:
- Import the necessary Python libraries:
import boto3
def enable_kinesis_stream_encryption(stream_name, kms_key_id):
client = boto3.client('kinesis')
response = client.describe_stream(StreamName=stream_name)
stream_arn = response['StreamDescription']['StreamARN']
client.update_stream(
StreamName=stream_name,
EncryptionType='KMS',
KeyId=kms_key_id
)
print(f"Encryption enabled for Kinesis stream: {stream_arn}")
def main():
client = boto3.client('kinesis')
response = client.list_streams()
for stream_name in response['StreamNames']:
response = client.describe_stream(StreamName=stream_name)
encryption_type = response['StreamDescription']['EncryptionType']
if encryption_type == 'NONE':
kms_key_id = '<kms-key-id>'
enable_kinesis_stream_encryption(stream_name, kms_key_id)
if __name__ == "__main__":
main()
- Initialize the AWS DynamoDB client:
dynamodb = boto3.client('dynamodb')
- Enable server-side encryption for the DynamoDB table using the
update_table
method:
table_name = 'YOUR_TABLE_NAME'
response = dynamodb.update_table(
TableName=table_name,
SSESpecification={
'Enabled': True,
'SSEType': 'KMS'
}
)
Replace 'YOUR_TABLE_NAME'
with the actual name of your DynamoDB table.
- Verify that server-side encryption with KMS is enabled for the DynamoDB table:
response = dynamodb.describe_table(TableName=table_name)
if response['Table']['SSEDescription']['Status'] == 'ENABLED' and response['Table']['SSEDescription']['SSEType'] == 'KMS':
print(f"Server-side encryption with KMS is successfully enabled for the table {table_name}.")
else:
print(f"Failed to enable server-side encryption with KMS for the table {table_name}.")
- Run the Python script to apply the changes and verify that server-side encryption with KMS is enabled for the DynamoDB table.
By following these steps, you can remediate the misconfiguration of not having Kinesis Server Side Encryption enabled for AWS DynamoDB using Python.