A09—Security Logging and Alerting Failures
>Control Description
>Prevention & Mitigation Strategies
- 1.Ensure all login, access control, and server-side input validation failures can be logged with sufficient user context to identify suspicious or malicious accounts and held for enough time to allow delayed forensic analysis.
- 2.Ensure that every part of your app that contains a security control is logged, whether it succeeds or fails.
- 3.Ensure that logs are generated in a format that log management solutions can easily consume.
- 4.Ensure log data is encoded correctly to prevent injections or attacks on the logging or monitoring systems.
- 5.Ensure all transactions have an audit trail with integrity controls to prevent tampering or deletion, such as append-only database tables or similar.
- 6.Ensure all transactions that throw an error are rolled back and started over. Always fail closed.
- 7.If your application or its users behave suspiciously, issue an alert. Create guidance for your developers on this topic so they can code against this or buy a system for this.
- 8.DevSecOps and security teams should establish effective monitoring and alerting use cases including playbooks such that suspicious activities are detected and responded to quickly by the Security Operations Center (SOC) team.
- 9.Add ‘honeytokens’ as traps for attackers into your application e.g. into the database, data, as real and/or technical user identity. As they are not used in normal business, any access generates logging data that can be alerted with nearly no false positives.
- 10.Behavior analysis and AI support could be optionally an additional technique to support low rates of false positives for alerts.
- 11.Establish or adopt an incident response and recovery plan, such as National Institute of Standards and Technology (NIST) 800-61r2 or later. Teach your software developers what application attacks and incidents look like, so they can report them.
>Attack Scenarios
A children's health plan provider's website operator couldn't detect a breach due to a lack of monitoring and logging. An external party informed the health plan provider that an attacker had accessed and modified thousands of sensitive health records of more than 3.5 million children. A post-incident review found that the website developers had not addressed significant vulnerabilities. As there was no logging or monitoring of the system, the data breach could have been in progress since 2013, a period of more than seven years.
A major Indian airline had a data breach involving more than ten years' worth of personal data of millions of passengers, including passport and credit card data. The data breach occurred at a third-party cloud hosting provider, who notified the airline of the breach after some time.
A major European airline suffered a GDPR reportable breach. The breach was reportedly caused by payment application security vulnerabilities exploited by attackers, who harvested more than 400,000 customer payment records. The airline was fined 20 million pounds as a result by the privacy regulator.
>Related CWEs
>References
- •OWASP Proactive Controls: C9: Implement Logging and Monitoring
- •OWASP Application Security Verification Standard: V16 Security Logging and Error Handling
- •OWASP Cheat Sheet: Application Logging Vocabulary
- •OWASP Cheat Sheet: Logging
- •Data Integrity: Recovering from Ransomware and Other Destructive Events
- •Data Integrity: Identifying and Protecting Assets Against Ransomware and Other Destructive Events
- •Data Integrity: Detecting and Responding to Ransomware and Other Destructive Events
- •Real world example of such failures in Snowflake Breach
Ask AI
Configure your API key to use AI features.