Description
Use DocumentDB audit logs to investigate authentication and database operations, and profiler logs to find slow operations. CloudTrail separately records AWS management API calls.
Potential impact
Gaps in either log can make it harder to trace unusual access or a slowdown.
Remediation
- Select audit events with
audit_logsin a custom parameter group attached to the cluster. For profiling, enableprofilerand set the threshold and sampling rate. - Add the required types to
enableCloudwatchLogsExports. Check CloudWatch Logs for a selected audit event or sampled slow operation. - Restrict log access, set retention and review costs and profiling overhead.
Examples
The manifests select the exports. Configure the parameter group and remaining cluster settings separately.
Before
yaml
apiVersion: docdb.aws.crossplane.io/v1alpha1
kind: DBCluster
spec:
forProvider:
region: us-east-1
engine: docdb
After
yaml
apiVersion: docdb.aws.crossplane.io/v1alpha1
kind: DBCluster
spec:
forProvider:
region: us-east-1
engine: docdb
enableCloudwatchLogsExports:
- audit
- profiler