NIST SP 800-53 Rev. 5 · Audit and Accountability
AU-9 on AWS
Audit logging disabled or deleted — a published SQL (Athena) + Lambda query you can run against Amazon Athena over CloudTrail, with the evidence it needs, the settings you decide, and what a result does and does not establish.
Why this matters
Someone switched off the recording of what happens on the system
Systems keep a record of significant events, and that record is how anyone reconstructs what happened after an incident. It is also the first thing an intruder turns off, because everything they do afterwards goes unrecorded. Switching it off is a legitimate administrative action, so it does not look like an attack — which is why it works.
Why this check earns its place. The check does not decide whether the person was allowed to do it. It surfaces that it happened, so a human can ask, which is the only correct handling for an action that is sometimes routine and sometimes the first move of a break-in.
- What it reads
- The organization's own record of administrative actions taken on its systems.
- What it reports
- Occasions when the recording of system events was stopped, deleted, or altered.
See related public disclosures on the Signals page →
What this finds
Audit logging configuration stopped, deleted, or modified; the reviewer determines whether the actor was authorized.
The requirement
The organization must protect audit information and audit logging tools from unauthorized access, modification, and deletion.
NIST SP 800-53 Rev. 5 — AU-9 (Protection of Audit Information).
NIST requires protection of audit information. Which logging surfaces are in scope, which identities may legitimately modify logging configuration, and the expected response time are organization-defined.
How this maps to the CISA performance goals
The Cross-Sector Cybersecurity Performance Goals are a voluntary baseline published by CISA — the U.S. federal agency for critical-infrastructure cybersecurity — written for organizations too small to employ security staff. This control speaks to:
- 3.Q — Maintain log collection & storage
The goal requires logs to be collected and retained; the pack finds logging switched off or records removed.
See the full coverage map, including the goals no query can answer →
Evidence this query needs
None. This query runs on platform telemetry alone — there is no file to prepare and nothing to export.
The query
Published as au-9-audit-tampering.aws.sql. Reads cloudtrail_logs. Requires: athena:StartQueryExecution; s3:GetObject on the CloudTrail bucket.
Before this returns anything,
cloudtrail_logs has to be reaching Amazon Athena over CloudTrail. If not, the query reports nothing found — which looks
exactly like nothing wrong. What has to be switched on first →
-- AU-9 -- CloudTrail logging stopped, deleted, or reconfigured
SELECT
eventtime, eventname,
useridentity.arn AS actor_arn,
useridentity.type AS actor_type,
sourceipaddress,
requestparameters,
awsregion,
'AWS CloudTrail' AS source_system
FROM cloudtrail_logs
WHERE eventname IN (
'StopLogging', 'DeleteTrail', 'UpdateTrail',
'PutEventSelectors', 'DeleteConfigurationRecorder',
'StopConfigurationRecorder'
)
AND errorcode IS NULL
AND from_iso8601_timestamp(eventtime) > current_timestamp - interval '7' day
ORDER BY eventtime DESC;
Open this pack on AWS to adjust the settings and download it →
The interactive version opens on AWS — the platform on this page — even if your environment profile does not list it.
Settings you decide
NIST states the objective and leaves these to your organization. The interactive version of this pack applies them to the query for you.
- Review window (days) (default 7)
- How far back to examine CloudTrail configuration events.
Running it continuously
EventBridge rule → Lambda → Security Hub + SNS
Trigger: EventBridge rule matching CloudTrail
management events (near real time)
Event pattern: source = aws.cloudtrail
detail.eventName = StopLogging | DeleteTrail |
UpdateTrail | PutEventSelectors
Compute: Lambda (Python 3.12), 30s timeout
Step 1: Check actor against the authorized-modifier allowlist
Step 2: If not allowlisted, BatchImportFindings -> Security Hub
Step 3: Publish to SNS for immediate on-call notification
Severity label: CRITICAL
RelatedRequirements: NIST.800-53.r5 AU-9
Idempotency: Id = sha256(eventID)
Event-driven, not scheduled. The Athena query above is for retrospective review; the EventBridge pattern is what gives near-real-time detection. Both are useful and they answer different questions.
What a result does not prove
A logging configuration change is not automatically malicious. It is, however, one of the few conditions where the cost of a slow review is high enough to justify treating it as urgent by default.
Validation status for this platform: Not tenant-validated. Structure, query generation, and preflight are covered by the project's automated test suites. This pack has not been executed against a live tenant, account, or index. Validate it in a non-production scope before relying on any result.
Before you act on a result
- Was this part of an approved change or platform migration?
- Is the actor an automation identity that should be allowlisted?
- Was logging restored, and was there a gap in coverage?
- Does other activity by the same actor in the surrounding window warrant investigation?
Common questions
- How do I check for audit logging disabled or deleted in AWS?
- Run the published SQL (Athena) + Lambda query on this page against Amazon Athena over CloudTrail. It reads cloudtrail_logs and reports: Audit logging configuration stopped, deleted, or modified; the reviewer determines whether the actor was authorized.
- What permissions are needed to run this AWS query?
- athena:StartQueryExecution; s3:GetObject on the CloudTrail bucket.
- Does a result from this query mean the control has failed?
- A logging configuration change is not automatically malicious. It is, however, one of the few conditions where the cost of a slow review is high enough to justify treating it as urgent by default.
Terms used on this page
- NIST SP 800-53the U.S. federal catalogue of security requirements
- The catalogue of security and privacy requirements published by the National Institute of Standards and Technology, a U.S. federal agency. U.S. government systems are measured against it, and many private organizations adopt it voluntarily. Each requirement has an identifier such as AC-2. Official source →
- CISACybersecurity and Infrastructure Security Agency
- The U.S. federal agency responsible for national critical-infrastructure cybersecurity. Its publications are works of the U.S. government and are free to use. Official source →
- CPGCross-Sector Cybersecurity Performance Goals
- A voluntary baseline of security practices published by the U.S. Cybersecurity and Infrastructure Security Agency, written specifically for organizations too small to employ security staff. It is a short, plainly written starting list rather than a full standard. Official source →
- not tenant-validatednever executed against real data
- The check has passed the project's automated tests for structure and syntax, but has never been run against real data anywhere. Test it in a safe scope before relying on any result.