Description
Neptune audit logs record database requests. To read them in CloudWatch Logs, enable both audit generation and export.
Potential impact
Without audit records, it is harder to identify who sent a database request.
Remediation
Set neptune_enable_audit_log to 1 in the cluster’s attached parameter group and add audit to enable_cloudwatch_logs_exports. After changing the audit parameter, reboot the DB instances. Make a database request and check for its record in CloudWatch Logs.
Examples
Keep the existing cluster_identifier when enabling exports. Changing it to neptune-cluster1 as shown replaces the cluster, and skip_final_snapshot = true skips the final snapshot on deletion.
Before
hcl
resource "aws_neptune_cluster" "example" {
cluster_identifier = "neptune-cluster"
engine = "neptune"
backup_retention_period = 5
preferred_backup_window = "10:10-11:11"
skip_final_snapshot = true
iam_database_authentication_enabled = true
apply_immediately = true
}
After
hcl
resource "aws_neptune_cluster" "example" {
cluster_identifier = "neptune-cluster1"
engine = "neptune"
backup_retention_period = 5
preferred_backup_window = "10:10-11:11"
skip_final_snapshot = true
iam_database_authentication_enabled = true
apply_immediately = true
enable_cloudwatch_logs_exports = ["audit"]
}