WebServer Access Logs Deleted

Identifies the deletion of WebServer access logs. This may indicate an attempt to evade detection or destroy forensic evidence on a system.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/11/03"
  3integration = ["endpoint", "windows"]
  4maturity = "production"
  5updated_date = "2025/01/15"
  6min_stack_version = "8.14.0"
  7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies the deletion of WebServer access logs. This may indicate an attempt to evade detection or destroy forensic
 13evidence on a system.
 14"""
 15from = "now-9m"
 16index = ["auditbeat-*", "winlogbeat-*", "logs-endpoint.events.*", "logs-windows.sysmon_operational-*"]
 17language = "eql"
 18license = "Elastic License v2"
 19name = "WebServer Access Logs Deleted"
 20risk_score = 47
 21rule_id = "665e7a4f-c58e-4fc6-bc83-87a7572670ac"
 22setup = """## Setup
 23
 24If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 25events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 26Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 27`event.ingested` to @timestamp.
 28For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
 29"""
 30severity = "medium"
 31tags = [
 32    "Domain: Endpoint",
 33    "OS: Linux",
 34    "OS: Windows",
 35    "OS: macOS",
 36    "Use Case: Threat Detection",
 37    "Tactic: Defense Evasion",
 38    "Data Source: Elastic Defend",
 39    "Data Source: Sysmon",
 40    "Resources: Investigation Guide",
 41]
 42timestamp_override = "event.ingested"
 43type = "eql"
 44
 45query = '''
 46file where event.type == "deletion" and
 47  file.path : ("C:\\inetpub\\logs\\LogFiles\\*.log",
 48               "/var/log/apache*/access.log",
 49               "/etc/httpd/logs/access_log",
 50               "/var/log/httpd/access_log",
 51               "/var/www/*/logs/access.log")
 52'''
 53note = """## Triage and analysis
 54
 55> **Disclaimer**:
 56> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
 57
 58### Investigating WebServer Access Logs Deleted
 59
 60Web server access logs are crucial for monitoring and analyzing web traffic, providing insights into user activity and potential security incidents. Adversaries may delete these logs to cover their tracks, hindering forensic investigations. The detection rule identifies log deletions across various operating systems by monitoring specific file paths, signaling potential attempts at evasion or evidence destruction.
 61
 62### Possible investigation steps
 63
 64- Review the specific file path where the deletion event was detected to determine which web server's logs were affected, using the file.path field from the alert.
 65- Check for any recent access or modification events on the affected web server to identify potential unauthorized access or suspicious activity prior to the log deletion.
 66- Investigate user accounts and processes that had access to the deleted log files around the time of the deletion event to identify potential malicious actors or compromised accounts.
 67- Correlate the log deletion event with other security alerts or anomalies in the same timeframe to identify patterns or related incidents.
 68- Examine backup logs or alternative logging mechanisms, if available, to recover deleted information and assess the impact of the log deletion on forensic capabilities.
 69
 70### False positive analysis
 71
 72- Routine log rotation or maintenance scripts may delete old web server logs. To handle this, identify and exclude these scheduled tasks from triggering alerts by specifying their execution times or associated process names.
 73- Automated backup processes that move or delete logs after archiving can trigger false positives. Exclude these processes by adding exceptions for the backup software or scripts used.
 74- Development or testing environments where logs are frequently cleared to reset the environment can cause alerts. Consider excluding these environments by specifying their IP addresses or hostnames.
 75- System administrators manually deleting logs as part of regular maintenance can be mistaken for malicious activity. Implement a policy to log and approve such actions, and exclude these approved activities from detection.
 76- Temporary log deletions during server migrations or upgrades might trigger alerts. Document these events and create temporary exceptions during the migration period.
 77
 78### Response and remediation
 79
 80- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
 81- Conduct a thorough review of recent user activity and system changes to identify any unauthorized access or modifications that may have led to the log deletion.
 82- Restore the deleted web server access logs from backups, if available, to aid in further forensic analysis and investigation.
 83- Implement enhanced monitoring on the affected system to detect any further attempts at log deletion or other suspicious activities.
 84- Review and tighten access controls and permissions on log files to ensure only authorized personnel can modify or delete them.
 85- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are compromised.
 86- Document the incident, including all actions taken, and update incident response plans to improve future detection and response capabilities."""
 87
 88
 89[[rule.threat]]
 90framework = "MITRE ATT&CK"
 91[[rule.threat.technique]]
 92id = "T1070"
 93name = "Indicator Removal"
 94reference = "https://attack.mitre.org/techniques/T1070/"
 95
 96
 97[rule.threat.tactic]
 98id = "TA0005"
 99name = "Defense Evasion"
100reference = "https://attack.mitre.org/tactics/TA0005/"
...
toml

Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

Web server access logs are crucial for monitoring and analyzing web traffic, providing insights into user activity and potential security incidents. Adversaries may delete these logs to cover their tracks, hindering forensic investigations. The detection rule identifies log deletions across various operating systems by monitoring specific file paths, signaling potential attempts at evasion or evidence destruction.

  • Review the specific file path where the deletion event was detected to determine which web server's logs were affected, using the file.path field from the alert.
  • Check for any recent access or modification events on the affected web server to identify potential unauthorized access or suspicious activity prior to the log deletion.
  • Investigate user accounts and processes that had access to the deleted log files around the time of the deletion event to identify potential malicious actors or compromised accounts.
  • Correlate the log deletion event with other security alerts or anomalies in the same timeframe to identify patterns or related incidents.
  • Examine backup logs or alternative logging mechanisms, if available, to recover deleted information and assess the impact of the log deletion on forensic capabilities.
  • Routine log rotation or maintenance scripts may delete old web server logs. To handle this, identify and exclude these scheduled tasks from triggering alerts by specifying their execution times or associated process names.
  • Automated backup processes that move or delete logs after archiving can trigger false positives. Exclude these processes by adding exceptions for the backup software or scripts used.
  • Development or testing environments where logs are frequently cleared to reset the environment can cause alerts. Consider excluding these environments by specifying their IP addresses or hostnames.
  • System administrators manually deleting logs as part of regular maintenance can be mistaken for malicious activity. Implement a policy to log and approve such actions, and exclude these approved activities from detection.
  • Temporary log deletions during server migrations or upgrades might trigger alerts. Document these events and create temporary exceptions during the migration period.
  • Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
  • Conduct a thorough review of recent user activity and system changes to identify any unauthorized access or modifications that may have led to the log deletion.
  • Restore the deleted web server access logs from backups, if available, to aid in further forensic analysis and investigation.
  • Implement enhanced monitoring on the affected system to detect any further attempts at log deletion or other suspicious activities.
  • Review and tighten access controls and permissions on log files to ensure only authorized personnel can modify or delete them.
  • Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are compromised.
  • Document the incident, including all actions taken, and update incident response plans to improve future detection and response capabilities.

Related rules

to-top