Join our Newsletter — 33% off our NHI Course
Home› Guides› How to detect attackers disabling cloud audit logging:…
Guide SOC & Detection Engineering

How to detect attackers disabling cloud audit logging: alert on every change to the record itself

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 18 November 2026 14 min read
On this page

When an attacker gets hold of a cloud identity with enough rights, one of the first things they often try is to switch off or redirect the audit trail, so the most useful single detection you can build is an alert on any change to the logging configuration itself. This guide explains which control plane actions matter in Amazon Web Services (AWS), Microsoft Azure and Google Cloud, how to alert on them from a location the attacker cannot reach, and how to respond in the first hour. Clouds are covered in alphabetical order, each in its own section, and the guide does not compare or rank them.

The guide is written for detection engineers, cloud security teams and identity teams who own the machine identities, roles and service accounts that hold logging permissions. It complements our AWS CloudTrail Guide, which covers trail configuration and hardening, and our How to Investigate CloudTrail for a Compromised Access Key, which covers the investigation that usually follows one of these alerts.

Key takeaways

  • MITRE ATT&CK v20 tracks this behaviour as T1685.002 Disable or Modify Cloud Log, under T1685 Disable or Modify Tools. The older ID T1562.008 is revoked, so update detection tags and reports that still use it.
  • Logging changes are rare and almost always made by a small number of known pipelines. That makes them one of the few cloud detections where alerting on every event is practical.
  • In AWS, a trail can only stop recording through the StopLogging action, and GuardDuty raises Stealth:IAMUser/CloudTrailLoggingDisabled when a trail is disabled, deleted or updated, or when its log bucket is deleted.
  • In Azure, the activity log is kept for 90 days by default. The signals to watch are writes and deletes of diagnostic settings and of legacy log profiles.
  • In Google Cloud, Admin Activity and System Event audit logs cannot be disabled, so the attacker's options are sinks, exclusions and Data Access log settings.
  • Most real gaps come from identity, not tooling: too many roles and service accounts can change logging, and the alert runs in the same account the attacker controls.

Why attackers go after the audit trail

Cloud audit logs are the record of who called which API, from where and with which credentials. For a non-human identity (NHI) such as an access key, a role session, a managed identity or a service account, that record is often the only evidence of what the identity did. An attacker who has stolen such a credential has every reason to reduce what is recorded before they move on to data access, persistence or privilege escalation.

The technique rarely looks dramatic. Common forms include:

  • Stopping or deleting a trail, diagnostic setting or sink outright.
  • Narrowing what is recorded, for example removing read events, data events or a region, so the trail still looks healthy on a dashboard.
  • Redirecting logs to a destination the attacker controls, or to one nobody reads.
  • Deleting or changing the storage where logs land, such as a bucket, storage account or log workspace.
  • Adding exclusion filters so that only the attacker's own calls are dropped.
  • Reducing retention so evidence ages out before anyone looks.

Each of these is a control plane call made by an identity. That is good news for defenders: the call to disable logging is itself logged in every major cloud, and the identity that made it is named in the event.

Mapping the technique and building the rule set

In ATT&CK v20 the behaviour sits under T1685 Disable or Modify Tools as sub-technique T1685.002 Disable or Modify Cloud Log, in the defence impairment tactic. Valid cloud accounts (T1078.004) are usually how the attacker arrived, so pair logging alerts with your identity detections rather than treating them as a separate stream.

A practical rule set has four layers, and each cloud section below fills them in:

  1. Configuration change alerts: any create, update, stop or delete of the logging configuration.
  2. Destination alerts: any delete or policy change on the storage where logs land.
  3. Heartbeat or absence alerts: no events received from an account, subscription or project for longer than a set window.
  4. Posture checks: scheduled checks that the expected configuration still exists, catching changes the first three layers missed.

Severity should depend on who made the change. A change made by the named logging pipeline role during a change window is informational. The same change made by a human user, a workload identity, an access key or a role assumed from outside the organisation should page someone.

AWS: CloudTrail and its destinations

The AWS CloudTrail API reference states that StopLogging "suspends the recording of AWS API calls and log file delivery for the specified trail" and that this action "is the only way to stop recording". It also notes that a trail can be updated without stopping it first, so there is very little legitimate reason to see StopLogging in production. For a trail enabled in all Regions the call must be made from the trail's home Region, which is a useful field to check in the event.

Events to alert on in CloudTrail management events:

  • StopLogging and DeleteTrail: treat both as high severity unless made by the named pipeline role.
  • UpdateTrail and PutEventSelectors: these can narrow what is recorded or change the destination while the trail stays on. Review the request parameters, not just the event name.
  • Bucket deletion and bucket policy changes on the log bucket, and key policy changes or scheduled deletion on any KMS key used for log encryption.
  • Changes to the CloudWatch Logs log group that receives the trail, including retention and deletion.

Amazon GuardDuty provides a managed detection for the core case. Its finding Stealth:IAMUser/CloudTrailLoggingDisabled reports that "AWS CloudTrail logging was disabled". The GuardDuty documentation says it can be triggered by a successful deletion or update of a trail, or by a successful deletion of an S3 bucket that stores the logs from a trail associated with GuardDuty. Its default severity is Low, so raise its priority in your own routing; NHI Mgmt Group recommends handling it as a potential credential compromise, which is also how the GuardDuty remediation guidance frames it.

AWS Security Hub controls give you the posture layer:

ControlWhat it checks
CloudTrail.1At least one multi-Region trail recording read and write management events
CloudTrail.2Encryption at rest with a KMS key
CloudTrail.3At least one trail is enabled
CloudTrail.4Log file validation is enabled
CloudTrail.5Trail is integrated with CloudWatch Logs
CloudTrail.6The log bucket is not publicly accessible
CloudTrail.7S3 access logging is enabled on the log bucket

Log file validation (CloudTrail.4) matters for this threat in particular. Security Hub explains that validation creates a digitally signed digest file containing a hash of each log, so you can tell whether a log was changed, deleted or left unchanged. That helps you prove what happened after an attacker touched the bucket.

Two design points close the most common gaps. First, use an organisation trail managed from a central account, so a member account identity cannot simply delete it. Second, run the alerting outside the monitored account, so a compromised administrator in that account cannot silence the alert as well as the trail.

Azure: activity log and diagnostic settings

Azure Monitor documentation states that Azure retains activity log events for 90 days and then deletes them. To keep them longer or analyse them centrally, you create a diagnostic setting that sends activity log entries to a Log Analytics workspace, Azure Event Hubs or Azure Storage. Microsoft also notes that activity log retention in Log Analytics can be extended up to 12 years, and that a common reason to extend it is to preserve resource creator information, which only the activity log holds.

Because the export depends on diagnostic settings, those settings are what an attacker targets. The Azure built in role permissions reference lists the actions to watch:

ActionDescription from Microsoft
Microsoft.Insights/DiagnosticSettings/WriteCreate or update a resource diagnostic setting
Microsoft.Insights/DiagnosticSettings/DeleteDelete a resource diagnostic setting
Microsoft.Insights/LogProfiles/WriteCreate or update an Activity Log log profile
Microsoft.Insights/LogProfiles/DeleteDelete an Activity Log log profile

Log profiles are the legacy export method; Microsoft advises disabling legacy configuration when you move to diagnostic settings. Once you have done so, any new log profile write is unexpected and worth an alert.

Build the Azure rule set as follows:

  • Alert on every diagnostic setting write or delete at subscription level, and on resources that matter for identity, such as Key Vault and Microsoft Entra ID export settings.
  • For writes, compare the new setting with the old one. A change of destination workspace, storage account or Event Hub is as serious as a delete.
  • Alert on deletion of, or access policy changes to, the receiving workspace, storage account or Event Hub namespace.
  • Add an absence alert per subscription in the receiving workspace: if a subscription that normally sends activity events goes quiet, investigate.
  • Because the activity log itself keeps 90 days regardless of export, compare it with your central copy during an investigation to find the gap.

Use Azure Policy to deploy and enforce the expected diagnostic settings, so that removal is both detected and corrected. Run the alert rules from a management subscription that workload identities in the monitored subscriptions cannot change. Our Azure Monitor, Activity Log and Diagnostic Settings Guide covers the configuration itself.

Google Cloud: audit logs, sinks and exclusions

Google Cloud documentation describes four audit log types. Admin Activity audit logs record calls that change resource configuration or metadata; they are always written and cannot be configured, excluded or disabled. System Event audit logs are also always written. Policy Denied audit logs are on by default and cannot be disabled, although exclusion filters can keep them out of Cloud Logging storage. Data Access audit logs are off by default for all services except BigQuery.

The _Required bucket stores Admin Activity and System Event logs, and its sink cannot be configured. The _Default bucket stores enabled Data Access logs and Policy Denied logs. This shapes the attacker's options. They cannot stop Admin Activity logging, but they can:

  • Delete or change user defined sinks that route logs to your SIEM, a central project or external storage.
  • Add exclusion filters to the _Default sink or to routing sinks.
  • Turn off Data Access audit logs that you had enabled, through the IAM audit configuration of a project, folder or organisation.
  • Delete or change the destination bucket, dataset or topic.

Changes to sinks, exclusions and audit configuration are configuration changes, so they land in Admin Activity logs, which the attacker cannot switch off. That makes Admin Activity the right source for these alerts. Build rules for sink create, update and delete, exclusion changes, and IAM policy changes whose audit configuration section removes or narrows Data Access logging.

Google Cloud also notes that Admin Activity and System Event logs routed to another project do not pass through that project's _Default or _Required sink, so a sink must be created in the destination project to store them there. Use an aggregated sink at organisation or folder level, owned by a central logging project, so that a project level identity cannot remove the export of its own logs.

Running alerts where the attacker cannot reach them

An alert that lives in the same account, subscription or project as the attacker can be disabled in the same session as the logging. Design the pipeline so that:

  • Logs are copied to a central security account, subscription or project before any alerting runs.
  • The central location has separate administrators and separate machine identities, with no standing access from workload accounts.
  • Storage for the central copy uses retention locks or immutability where the platform offers them.
  • The detection rules, notification channels and SIEM connectors are themselves under change control, with their own change alerts.
  • A heartbeat check confirms that each source is still sending, so silence becomes a signal.

Our Cloud Logging and Audit Trail Guide covers the wider design of a central logging pipeline, retention and evidence handling.

Who can change logging: the identity side

Every one of these detections is easier when very few identities hold logging permissions. In most estates, the list is far longer than it should be, because broad administrator roles include them. Work through the following:

  • List every role, managed identity and service account that can stop, delete or update trails, diagnostic settings, sinks or exclusions, including through wildcard permissions.
  • Remove these permissions from workload identities and CI/CD roles that do not deploy logging. Most application pipelines never need them.
  • Give logging configuration to one named pipeline identity per cloud, and alert when any other identity uses the permission.
  • Use organisation level guardrails, such as AWS service control policies, Azure Policy deny assignments or Google Cloud organisation policies and IAM deny, to block logging changes outside the central account, where your platform supports it.
  • Remove long lived keys from any identity that keeps logging permissions; see our Secrets Access Logging and Detection guide for related signals.

When the identity that disabled logging is a machine identity, it is very likely that its credential was stolen or its pipeline was abused. That changes the response: revoke and rotate first, then investigate.

Responding in the first hour

When a logging change alert fires and the change was not expected, NHI Mgmt Group recommends this order:

  1. Restore logging. Re-enable the trail, setting or sink from the central account using a pre-approved runbook. The gap is evidence, so record its start and end times.
  2. Identify the identity. Take the caller from the event: user, role session, managed identity or service account, plus source IP address, user agent and, for AWS, the access key ID.
  3. Contain the identity. Disable or revoke the credential, end active sessions, and block the identity at the organisation level if possible. For a role, check who could assume it.
  4. Find what happened in the gap. Use sources the attacker did not touch: the Azure activity log's own 90 day store, Google Cloud Admin Activity logs, AWS event history and other services' logs.
  5. Look for other impairment. Check for disabled threat detection, changed alert rules and new identities or keys created in the same session.
  6. Review the permission path. Decide why that identity could change logging at all, and remove the permission.

Common failure patterns

  • Alerts only on delete: narrowing a trail's event selectors or redirecting a diagnostic setting to another workspace goes unnoticed.
  • Detection in the compromised account: the attacker removes the alarm along with the trail.
  • Low default severity left as is: the GuardDuty finding defaults to Low and gets lost in a queue.
  • Too many identities with logging rights: broad administrator roles and deployment pipelines can all change logging, so alerts are noisy and get tuned out.
  • No absence alert: a source goes silent because of a deleted destination and nobody notices for weeks.
  • Outdated technique IDs: detection content still tagged T1562.008 does not line up with reports built on ATT&CK v20.
  • Legacy exports left in place: old Azure log profiles or forgotten Google Cloud sinks give attackers an easy target and confuse baselines.

Practitioner checklist

  • Tag detection content with T1685.002 and retire T1562.008 references.
  • Alert on StopLogging, DeleteTrail, UpdateTrail and PutEventSelectors, and route the GuardDuty finding Stealth:IAMUser/CloudTrailLoggingDisabled above its default severity.
  • Enable Security Hub controls CloudTrail.1 to CloudTrail.7 and fix failures.
  • Alert on every Microsoft.Insights/DiagnosticSettings/Write and Delete, and on any log profile write after legacy export is retired.
  • Alert on Google Cloud sink, exclusion and Data Access audit configuration changes using Admin Activity logs.
  • Add a heartbeat alert for every account, subscription and project.
  • Run alerting from a central security location with separate administrators.
  • Reduce logging permissions to one named pipeline identity per cloud.
  • Keep a tested runbook to restore logging and contain the identity within the hour.

Standards and references

Related NHI Mgmt Group resources: AWS CloudTrail Guide · How to Investigate CloudTrail for a Compromised Access Key · Cloud Logging and Audit Trail Guide · Secrets Access Logging and Detection

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.