4.7 Ensure Monitor and Audit Activity is enabled
Description
Regular monitoring and auditing of activity in Amazon DynamoDB help ensure your database's security, performance, and compliance.
Rationale
This keeps track and ensures who has recently modified a document and monitors all activity within the database. This information allows the individual to use the details provided for auditing purposes and to address any compliance requirements.
Impact
N/A
Audit Procedure
Using AWS Console
Enable CloudTrail Logging for DynamoDB
- Sign in to the AWS Management Console and open the CloudTrail console at https://console.aws.amazon.com/cloudtrail/.
- Choose
Trails from the left-side menu.
- Click
Create trail or select an existing trail.
- Specify a trail name, choose an S3 bucket for storing logs, and configure other trail settings.
- Under
Data events, select the checkbox for DynamoDB to enable logging of DynamoDB data events.
- Click
Create trail or Save changes to save the CloudTrail configuration.
Enable DynamoDB Streams
- Sign in to the AWS Management Console and open the DynamoDB console at https://console.aws.amazon.com/dynamodb/.
- Select the DynamoDB table you want to monitor.
- Click on the
Overview tab.
- Under the
DynamoDB Streams section, click Manage stream.
- Enable DynamoDB Streams with the desired view type (e.g.,
New and old images).
- Click
Enable.
Configure Amazon CloudWatch Alarms
- Sign in to the AWS Management Console and open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.
- In the left-side menu, click on
Alarms.
- Click
Create alarm.
- Select a DynamoDB metric to monitor (e.g., Read or Write capacity units).
- Configure the threshold, conditions, and actions for the alarm.
- Choose the actions to take when the alarm state is triggered (e.g., send notifications, auto-scaling actions, etc.).
- Click
Create alarm to save the configuration.
Analyze and Review Logs and Metrics
- Sign in to the AWS Management Console and open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.
- In the left-side menu, click
Logs to access CloudWatch Logs.
- Select the appropriate log group for DynamoDB (e.g.,
/aws/dynamodb/TableName).
- Review the logs to monitor activities, errors, and any unusual behavior.
- Navigate to the CloudWatch console and click
Metrics in the left-side menu.
- Select the DynamoDB namespace and the desired metrics (e.g., ConsumedReadCapacityUnits, ConsumedWriteCapacityUnits).
- Analyze the metrics to identify trends, capacity needs, and potential issues.
Enable AWS Config for DynamoDB
- Sign in to the AWS Management Console and open the AWS Config console at https://console.aws.amazon.com/config/.
- Click on
Rules in the left-side menu.
- Click
Add rule.
- Configure a rule for DynamoDB compliance checks, such as checking for unencrypted tables or insecure IAM policies.
- Customize the rule settings and scope based on your requirements.
- Click
Save to create the AWS Config rule.
Expected Result
CloudTrail logging is enabled for DynamoDB data events, DynamoDB Streams are enabled, CloudWatch alarms are configured, and AWS Config rules are in place for compliance monitoring.
Remediation
Using AWS Console
Follow the same steps as the audit procedure to enable monitoring and auditing for DynamoDB.
Default Value
By default, CloudTrail logs management events but not DynamoDB data events. DynamoDB Streams are disabled by default.
References
- https://aws.amazon.com/products/databases/
CIS Controls
| Controls Version |
Control |
IG 1 |
IG 2 |
IG 3 |
| v8 |
8.1 Establish and Maintain an Audit Log Management Process |
x |
x |
x |
| v7 |
6.2 Activate audit logging |
x |
x |
x |
Profile
Level 1 | Manual
1---2name: cis-aws-database-4-73description: Ensure Monitor and Audit Activity is enabled4---56# 4.7 Ensure Monitor and Audit Activity is enabled78## Description910Regular monitoring and auditing of activity in Amazon DynamoDB help ensure your database's security, performance, and compliance.1112## Rationale1314This keeps track and ensures who has recently modified a document and monitors all activity within the database. This information allows the individual to use the details provided for auditing purposes and to address any compliance requirements.1516## Impact1718N/A1920## Audit Procedure2122### Using AWS Console23241. Enable CloudTrail Logging for DynamoDB25 - Sign in to the AWS Management Console and open the CloudTrail console at https://console.aws.amazon.com/cloudtrail/.26 - Choose `Trails` from the left-side menu.27 - Click `Create trail` or select an existing trail.28 - Specify a trail name, choose an S3 bucket for storing logs, and configure other trail settings.29 - Under `Data events`, select the checkbox for `DynamoDB` to enable logging of DynamoDB data events.30 - Click `Create trail` or `Save changes` to save the CloudTrail configuration.31322. Enable DynamoDB Streams33 - Sign in to the AWS Management Console and open the DynamoDB console at https://console.aws.amazon.com/dynamodb/.34 - Select the DynamoDB table you want to monitor.35 - Click on the `Overview` tab.36 - Under the `DynamoDB Streams` section, click `Manage stream`.37 - Enable DynamoDB Streams with the desired view type (e.g., `New and old images`).38 - Click `Enable`.39403. Configure Amazon CloudWatch Alarms41 - Sign in to the AWS Management Console and open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.42 - In the left-side menu, click on `Alarms`.43 - Click `Create alarm`.44 - Select a DynamoDB metric to monitor (e.g., Read or Write capacity units).45 - Configure the threshold, conditions, and actions for the alarm.46 - Choose the actions to take when the alarm state is triggered (e.g., send notifications, auto-scaling actions, etc.).47 - Click `Create alarm` to save the configuration.48494. Analyze and Review Logs and Metrics50 - Sign in to the AWS Management Console and open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.51 - In the left-side menu, click `Logs` to access CloudWatch Logs.52 - Select the appropriate log group for DynamoDB (e.g., `/aws/dynamodb/TableName`).53 - Review the logs to monitor activities, errors, and any unusual behavior.54 - Navigate to the CloudWatch console and click `Metrics` in the left-side menu.55 - Select the DynamoDB namespace and the desired metrics (e.g., ConsumedReadCapacityUnits, ConsumedWriteCapacityUnits).56 - Analyze the metrics to identify trends, capacity needs, and potential issues.57585. Enable AWS Config for DynamoDB59 - Sign in to the AWS Management Console and open the AWS Config console at https://console.aws.amazon.com/config/.60 - Click on `Rules` in the left-side menu.61 - Click `Add rule`.62 - Configure a rule for DynamoDB compliance checks, such as checking for unencrypted tables or insecure IAM policies.63 - Customize the rule settings and scope based on your requirements.64 - Click `Save` to create the AWS Config rule.6566## Expected Result6768CloudTrail logging is enabled for DynamoDB data events, DynamoDB Streams are enabled, CloudWatch alarms are configured, and AWS Config rules are in place for compliance monitoring.6970## Remediation7172### Using AWS Console7374Follow the same steps as the audit procedure to enable monitoring and auditing for DynamoDB.7576## Default Value7778By default, CloudTrail logs management events but not DynamoDB data events. DynamoDB Streams are disabled by default.7980## References81821. https://aws.amazon.com/products/databases/8384## CIS Controls8586| Controls Version | Control | IG 1 | IG 2 | IG 3 |87| ---------------- | ---------------------------------------------------------- | ---- | ---- | ---- |88| v8 | 8.1 Establish and Maintain an Audit Log Management Process | x | x | x |89| v7 | 6.2 Activate audit logging | x | x | x |9091## Profile9293Level 1 | Manual