Clear Linux or Mac System Logs is an action that deletes or truncates operating system logs on Linux or macOS hosts. Attackers do this to hide execution, authentication, and persistence activity after compromise. Defenders should forward logs off-host, protect log permissions, and alert on log deletion, truncation, or gaps in expected telemetry.
What Log Clearing Means on Linux and macOS
Clearing logs is more than deleting a file, it is a deliberate attempt to remove evidence that would otherwise show what happened on a host. On Linux and macOS, that can include authentication records, command execution traces, service changes, and signs of persistence.
Because logs are a primary source of host telemetry, clearing them is often treated as a post-compromise concealment step rather than a routine maintenance action. It becomes especially important when the event stream is the main way defenders would reconstruct user activity, admin actions, or malware execution.
Why Attackers Clear System Logs
Attackers clear logs to reduce visibility after they have obtained access, executed payloads, or established persistence. The goal is to make incident response harder by removing timestamps, account activity, and process or service evidence that would otherwise connect actions into a timeline.
This behavior often appears after the attacker has already achieved a foothold, because the value of log clearing increases once the compromise has something to hide. For defenders, that means log deletion can be an indicator of intrusion, not just a housekeeping anomaly.
MITRE ATT&CK tracks this behavior directly, and defenders can use that mapping to search for related activity such as privilege escalation, persistence creation, and defense evasion around the same time window. MITRE ATT&CK Guide for Defenders is useful here because it connects the technique to detection thinking, not just taxonomy.
How Defenders Spot Log Tampering
Exposure is usually found by comparing local host logs against off-host copies, SIEM ingestion, or expected telemetry volume. If the host logs suddenly stop, shrink unexpectedly, or show a gap that does not match system activity, the clearing action may already have happened.
On macOS and Linux alike, defenders should treat log gaps, abrupt truncation, and missing expected authentication events as suspicious when they occur alongside administrative changes or unusual process execution. A local-only logging model is fragile because the same host that is compromised can also be used to erase the evidence.
The Windows-centric details are different, but the defensive principle is the same: preserve independent log copies and watch for clearing behaviors. Windows Event Log Guide provides a useful comparison point for how clearing activity is recognized and investigated in a mature logging model.
Containment, Recovery, and Evidence Preservation
When log clearing is suspected, the most important step is to preserve what remains before normal operations overwrite volatile evidence. That usually means isolating the host, collecting available log sources quickly, and checking adjacent systems such as central log collectors, EDR telemetry, authentication providers, and endpoint backup records.
Recovery is not just about restoring logs, it is about restoring trust in the timeline. If an attacker cleared system logs, defenders should assume other artefacts may also have been altered, including persistence mechanisms, scheduled tasks, service configurations, or shell history.
Forensic completeness depends on having log forwarding and retention outside the affected host. If the only copy of the evidence lived on the machine being investigated, the attacker may have permanently reduced visibility into the compromise.
Risk and Threat Considerations
Clearing system logs is dangerous because it targets the defender’s ability to reconstruct events, confirm scope, and prove what the attacker did. The immediate risk is loss of visibility, but the larger threat is that a compromise can persist longer when the usual audit trail has been erased.
Failure mechanism: An attacker with sufficient host access uses built-in tools or direct file manipulation to delete, truncate, or disable local logs, then continues operating with reduced chance of detection.
Impact: Incident responders may lose the evidence needed to identify initial access, privilege escalation, lateral movement, or persistence, which can delay containment and increase the chance of reinfection.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack and risk surface, while NIST SP 800-53 Rev 5, CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1070.001 — Clear Linux or Mac System Logs | Directly covers log clearing as defense evasion on Linux and macOS. |
| Recommendation — Map host log-clearing events to T1070.001 and hunt for adjacent execution and persistence activity. | ||
| NIST SP 800-53 Rev 5 | AU-6 — Audit Record Review, Analysis, and Reporting | Requires reviewing audit records and detecting unusual gaps or tampering. |
| AU-9 — Protection of Audit Information | Protects logs from unauthorized access, modification, and destruction. | |
| AU-12 — Audit Record Generation | Ensures the system generates the records that attackers often try to remove. | |
| Recommendation — Review audit data for truncation, deletion, and missing-event anomalies as part of continuous monitoring. Protect audit records with access restrictions and integrity controls so attackers cannot erase evidence. Generate the required audit events and route them to protected, centralized log storage. | ||
| CIS Controls v8 | CIS-8 — Audit Log Management | Covers collection, retention, review, and protection of audit logs. |
| Recommendation — Centralize, retain, and monitor logs so deletion or truncation on one host is still visible. | ||
| NIST CSF 2.0 | DE.CM-01 — Monitoring for Anomalies and Events | Addresses continuous monitoring for suspicious changes in telemetry and host behavior. |
| Recommendation — Alert on missing, reduced, or inconsistent telemetry that suggests log tampering. | ||
Practitioner Guidance
What to watch for: Treat log deletion, truncation, and unexplained telemetry gaps as security signals, not just storage or maintenance events. A host that suddenly stops reporting expected audit data deserves immediate review even if other alerts are quiet.
Governance implication: Logging policy should assume the endpoint can be compromised, so the authoritative copy of security telemetry must live off-host and be protected from the same administrative trust boundary as the source system.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
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.
Reviewed and updated by the NHIMG editorial team on October 17, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org