Introduction to Security Logs
Read a security log line by its timestamp, source, user, action, result and origin, choose which log answers a question, and explain how gaps in logging hide an attack.
"I was asleep at 2 am"
On Wednesday morning Sameer Joshi walks into Neha's office worried. His email shows that someone signed in to his account during the night, and he insists he was asleep. Neha does not have to guess who is right. She opens the mail service's record of sign-ins and finds the exact line: a successful login to Sameer's account at 02:13 from an address in Bhopal, right after seven failed attempts. That record is a log: a running list a computer keeps of what happened on it, one line per event, each stamped with the time. Logs are how defenders find out what actually happened, rather than what people remember or assume.
A housing society's gate register is a log kept by hand. The watchman writes down the time, the visitor's name, the flat they are going to and why. On a normal day nobody reads it. The day a flat is burgled, the register is the first thing everyone asks for, because it shows who came in, when, and where they went.
What one log line tells you
Most log lines answer the same handful of questions, even though different systems write them in slightly different layouts. Learning to read those parts is the first skill of anyone who watches over systems.
Every part of the line answers a question: when, which system, who, what, whether it worked, and from where.
The "from where" part needs a word of explanation. Every device that talks over the internet has an IP address, a number that works like a postal address so that data can find its way back. A phone at the Kothrud store and a laptop in Bhopal have different IP addresses, and services can roughly tell which city an address belongs to. The guess is not exact, and a criminal can route through a computer elsewhere, but a sudden change from "always Pune" to "Bhopal at 2 am" is still a strong hint.
Three kinds of log
Tulsi Health's systems write many logs, but three kinds matter most for security. A system log is written by the operating system, the basic software that runs a computer, such as Windows on a billing laptop. It records things that happen to the machine itself: starting up, shutting down, new software being installed, a USB drive being plugged in, errors. An authentication log records attempts to prove who you are, the step called authentication: every login that worked or failed, every password change, every two-step code that was accepted or refused. An application log is written by a particular program, such as MedLedger or the Tulsi Health app's server, and records what people did inside it: an invoice saved, a price edited, a customer record viewed, a list of orders exported.
The machine, the person and the work: each kind of log sees a different layer, and an investigation usually needs all three.
Each kind answers different questions. Only the authentication log can tell you whether Sameer's password was guessed. Only MedLedger's application log can tell you who changed a price. Only the laptop's system log shows that a USB stick was plugged in just before the trouble began. Practise matching questions to the log that can answer them below; ask whether the question is about the machine, about proving who someone is, or about work done inside a program.
Timestamps: putting events in order
A timestamp is the date and time written at the start of every log line. Timestamps let a defender line up events from different systems into one story: the failed logins, then the success, then the new mail rule, then files copied from the shared drive. Without them, Neha would have a pile of facts and no order.
Lined up by timestamp, three separate logs tell one story. The quiet Wi-Fi log matters too: nobody was using a store connection, so the login came from outside.
This only works if the clocks agree. If the Nashik Road router's clock runs seven minutes slow, its lines appear in the wrong place in the story. If the cloud mail service writes times in UTC, the world's reference time, while MedLedger writes Indian Standard Time, which is 5 hours 30 minutes ahead, the same moment appears as two very different times. Good practice is to set every device's clock automatically from a trusted time source and to make every log line say which time zone it uses.
Try it: the cloud mail log shows a login at 20:41 UTC on 11 November. What time was that in Pune?
Indian Standard Time is UTC plus 5 hours 30 minutes. 20:41 + 5:30 = 26:11, which runs past midnight: 26:11 − 24:00 = 02:11 on 12 November. So it is the same night-time login as the 02:11 entry in MedLedger's IST log, not a separate evening event.
Defender visibility: you cannot investigate what was never written down
Visibility means how much of what happens in its systems an organisation can actually see. Every gap is a place an attacker can work unnoticed. A society register kept only during the day shift tells you nothing about who came in at night. A register left on the watchman's desk can have its pages torn out by the very visitor it recorded.
Computer logs have the same weaknesses. Logging may be switched off on some machines, as it often is out of the box. Logs may be kept for only a week, so a break-in that started a month ago has left no trace by the time anyone looks. And logs stored only on the computer they describe can be deleted by an attacker who takes over that computer, which careful attackers do. The usual answer is to send a copy of every log line, within seconds, to a separate log store that ordinary accounts cannot change, and to keep it for months.
An attacker who takes over a laptop can wipe that laptop's own log, but not the copy that already left for the locked store.
Logs also need protecting for another reason: they hold personal information. A line saying that Mrs. Lata Gokhale's record was opened, or which staff member logged in from where, is itself private. Tulsi Health should let only Neha's team read the security logs, avoid recording things logs do not need, such as passwords or full prescriptions, and delete old logs once the agreed keeping period is over.
The log below is from one night and morning at Tulsi Health. Two facts help: Arjun is on leave this week, and Vikram is in Mumbai for a supplier meeting today. Read every line, use the filter if it helps (try typing a user name), and tick the lines you would look into.