ISO 27001 Control A.8.15: Logging
When something goes wrong, the first questions are always the same. What happened, when, who did it, and what else was touched? Without logs, the honest answer is “we do not know”, which is the worst possible thing to tell a customer, a regulator or your own board. A.8.15 is the control that makes sure you have the records to answer. It is the fifteenth of 34 technological controls in our walk through Annex A.
Logging is also one of the easiest controls to do badly while feeling good about it. Collecting gigabytes nobody reads, or logs that an attacker can quietly edit, gives false comfort. The aim is the right events, kept for the right time, protected from tampering, and actually looked at.
What the control requires
Annex A control 8.15 of ISO 27001:2022 states that logs that record activities, exceptions, faults and other relevant events shall be produced, stored, protected and analysed.
The key elements:
- Logs that record activities, exceptions, faults and other relevant events - who did what, what went wrong, and anything else that helps reconstruct or detect events
- Produced - systems are configured to generate the logs in the first place
- Stored - kept for a defined period, in a place that survives the failure of the source system
- Protected - safe from alteration and deletion, including by administrators and attackers
- Analysed - someone or something actually reviews them, so logs lead to detection and learning
In ISO/IEC 27002:2022 this control is attributed as detective. Annex A states the control; ISO 27002 gives guidance on what log entries should contain, such as user identifiers, timestamps, event types, system identifiers and network addresses, and on protecting log integrity, handling privacy and using log analysis. The standard does not prescribe retention periods or tools. You set them according to risk, legal requirements and investigation needs.
How to implement logging
Decide what to log and why
Start from purposes, not from tools. Logs serve security monitoring, incident investigation, troubleshooting, accountability and evidence for compliance. Based on your risks, list the events that matter. For most organizations the core set includes:
- Successful and failed log-ins, and changes to authentication settings, building on Secure authentication
- Use of privileged accounts and administrative actions, which ties to Privileged access rights
- Access to sensitive data and changes to access rights, relevant to Information access restriction and Access rights
- Changes to configuration, security settings and software installation, linked to Configuration management
- Alerts from security tools, such as malware detections from Protection against malware
- Faults, errors and failed backups, including those described in Information backup
- Access to source code repositories, as covered in Access to source code
- Physical access records, where badge systems exist, tying in with Physical entry
Do not log everything at maximum verbosity. Choose levels sensibly and increase detail for critical systems. Include the cloud: audit trails for your cloud accounts, identity provider and SaaS applications are often the most valuable logs you have.
Make each entry useful
A good log entry answers who, what, when, where and with what result. Make sure entries carry accurate timestamps, user or service identifiers, the source system, the action and the outcome. Consistent time across systems is essential for piecing a timeline together, and we cover this under Clock synchronization (A.8.17) later in the series. Where possible, use a common format so that logs from different systems can be searched together.
Be careful what you put in logs. Passwords, full payment card numbers, tokens and unnecessary personal data should not appear in them. Developers need clear guidance on this, otherwise sensitive values leak into debug output and end up in a widely readable system. Under many privacy laws, logs containing personal data are subject to the same obligations as other records. We are not lawyers, so check the position in your jurisdiction.
Centralize and protect
Logs held only on the system that produced them are lost when that system fails or is compromised. Send them to a central platform, a log management or SIEM service, or at minimum to a separate, locked-down storage location. Restrict access: read access for those who need to investigate, and no ability for the administrators of the source systems to edit or delete the central copy. Use write-once or immutable storage for the most important logs, protect the transmission path, and monitor the logging service itself so that you notice if a source stops sending. The people who administer systems should not be the only ones who can see what administrators did.
Decide retention based on investigation needs and legal duties. Many incidents are discovered weeks or months after they begin, so keeping only a few days of logs is rarely enough for critical systems. Equally, keeping everything forever is costly and can conflict with privacy obligations. Align your choice with Legal, statutory, regulatory and contractual requirements and with Information deletion.
Analyse the logs
The word “analysed” is the part most organizations underinvest in. Decide who looks at logs, how often and for what. That may be automated alerting for high-risk events, such as repeated failed log-ins, new administrator accounts, logging being switched off or unusual data downloads, plus periodic manual review of summary reports. Assign alerts to a named person with a documented response. Link suspicious findings to your incident process, as in Assessment and decision on information security events, and use logs to support Collection of evidence where an investigation may result in disciplinary or legal action.
Test the whole chain occasionally. Perform a harmless but detectable action, such as a failed privileged log-in, and check that it was logged, centralized, alerted on and traceable. This kind of exercise finds broken pipelines before an incident does.
Respect privacy and staff transparency
Logs about people’s activities are personal data in many places. Tell staff what is logged and why, limit access to logs on a need-to-know basis, and avoid using them for purposes beyond those stated. Rules about employee monitoring vary by country, so involve your legal adviser where logs cover user behavior in detail.
Related controls and clauses
A.5.25 connection. Assessment and decision on information security events depends on logs to judge whether an event is an incident.
A.5.28 connection. Collection of evidence relies on logs that are accurate, protected and have a clear chain of custody.
A.5.34 connection. Privacy and protection of personal identifiable information (PII) affects what logs may contain and how long they are kept.
A.8.2 connection. Privileged access rights are among the most important activities to log and review.
A.8.9 connection. Configuration management should include enabling and protecting logging on every system.
Clause 9.1 connection. Monitoring, measurement, analysis and evaluation uses log-derived data as an input for evaluating ISMS performance.
Forward reference. Monitoring activities (A.8.16) and Clock synchronization (A.8.17) build directly on this control and are covered next in the series.
What auditors check
Logging scope and rationale. Auditors ask which systems and events are logged and how you decided.
Content of entries. They look at sample logs to see that they contain identifiable users, times, actions and outcomes.
Central storage and protection. Expect questions on where logs are kept, who can alter them and how integrity is ensured.
Retention. Auditors compare the retention period with your policy, risks and legal duties.
Analysis in practice. They ask for examples of alerts, reviews or investigations that used logs, and check that someone owns them.
Privileged activity. Auditors often focus on whether administrator actions are logged and reviewed independently.
Common mistakes to avoid
Logging into the void. Logs nobody reads protect nothing. Define alerts and review responsibilities.
Logs on the same machine. An attacker with access can wipe them. Ship them elsewhere.
Administrators who can edit their own trail. Separate duties so those who act cannot also erase evidence.
Secrets in logs. Passwords, tokens and card numbers in log files create a new vulnerability.
Too little retention. If you only keep a week, you cannot investigate something found next month.
Forgetting cloud and SaaS. Many of the most useful audit trails live in identity and cloud platforms. Turn them on and keep them.
How 27kay can help
We help organizations decide what to log, where to keep it and who looks at it, scaled to the size of the team and the risks involved. As part of ISO 27001 implementation, we review your log sources, close the biggest gaps, and prepare the evidence an auditor will ask for. For the full picture, see our ISO 27001 knowledge hub.
If you suspected a breach tonight, could you reconstruct what happened from the logs you have? Get in touch - we will help you make sure the answer is yes.