Project has database auditing enabled
MongoDB Atlas projects with database auditing capture database operations and administrative events. The evaluation looks for an active audit configuration and, when present, notes any configured audit_filter that scopes which events are recorded.
Risk
Without auditing, critical actions lack traceability, reducing detectability and impeding forensics. Attackers can mask unauthorized reads/writes and privilege changes, threatening data confidentiality and integrity, and weakening non-repudiation and incident response.
Run this check with Prowler
Run in Prowler Cloudprowler mongodbatlas --checks projects_auditing_enabledRecommendation
Enable auditing and apply least-privilege filters to capture high-risk events:
- authentication and session activity
- DDL/config changes
- user/role modifications and privilege grants
Centralize logs in a SIEM, enforce retention/immutability with separation of duties, restrict access, and tune auditAuthorizationSuccess to balance coverage vs performance.
Remediation
CLI
atlas auditing update --projectId <example_resource_id> --enabledTerraform
resource "mongodbatlas_auditing" "example" {
project_id = "<example_resource_id>"
enabled = true # Critical: turns on project-level database auditing to pass the check
}Other
Check Code
from typing import List
from prowler.lib.check.models import Check, CheckReportMongoDBAtlas
from prowler.providers.mongodbatlas.services.projects.projects_client import (
projects_client,
)
class projects_auditing_enabled(Check):
"""Check if database auditing is enabled for MongoDB Atlas projects
This class verifies that MongoDB Atlas projects have database auditing
enabled to track database operations and security events.
"""
def execute(self) -> List[CheckReportMongoDBAtlas]:
"""Execute the MongoDB Atlas project auditing enabled check
Iterates over all projects and checks if they have database auditing
enabled by examining the audit configuration.
Returns:
List[CheckReportMongoDBAtlas]: A list of reports for each project
"""
findings = []
for project in projects_client.projects.values():
report = CheckReportMongoDBAtlas(metadata=self.metadata(), resource=project)
if not project.audit_config:
report.status = "FAIL"
report.status_extended = f"Project {project.name} does not have audit configuration available."
else:
# Check if audit configuration is enabled
if project.audit_config.enabled:
report.status = "PASS"
report.status_extended = (
f"Project {project.name} has database auditing enabled."
)
if project.audit_config.audit_filter:
report.status_extended += f" Audit filter configured: {project.audit_config.audit_filter}"
else:
report.status = "FAIL"
report.status_extended = f"Project {project.name} does not have database auditing enabled."
findings.append(report)
return findingsReferences
- https://www.mongodb.com/docs/manual/tutorial/configure-auditing/
- https://www.mongodb.com/docs/atlas/architecture/current/auditing/
- https://www.mongodb.com/docs/atlas/architecture/current/auditing-logging/?msockid=0878cc3dfa4e66a707beda0efb5a67b5
- https://www.mongodb.com/docs/atlas/operator/current/ak8so-configure-audit-logs/
- https://www.mongodb.com/docs/manual/core/auditing/
- https://www.mongodb.com/docs/atlas/database-auditing/