Logs, detection, and knowing something happened
An attack you cannot see is a longer attack. This lesson is about what to record and what a useful alert looks like.
Diagram
From a question to a detection
Step 1 of 4
Question
What would we need to know if an admin account were misused?
# Question # What would we need to know if an admin account were # misused?
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Questions first
- What fails
- Collecting everything without questions produces cost, not answers.
- Who is affected
- The SOC budget and analysts.
- What you would notice
- Logs no detection or investigation uses.
- What you change
- Map sources to the questions they answer.
Detections as hypotheses
- What fails
- Each rule is a guess about attacker behavior that must be tested.
- Who is affected
- Analysts and responders.
- What you would notice
- Rules never tested against real activity.
- What you change
- Test with replay or emulation, and track precision.
Gaps
- What fails
- Detection cannot see what is not logged.
- Who is affected
- Investigations.
- What you would notice
- Missing command lines or cloud data events.
- What you change
- Close the highest-value gaps first.
Logs answer questions
Collect logs because an incident will ask specific questions. Who signed in, from where, with what factor. Which token was used after the password changed. Which process started which child. Which admin API call created a user, a key, or a security-group rule. Which query touched the sensitive table. If the log cannot answer those, more volume will not help.
Record identity, time, source, action, and object. Leave out secrets, full payment numbers, and the bodies of private messages. A log that contains passwords is a second password database with worse access control. Sync clocks. Retention should cover the dwell time you worry about, which is often months, not days, and should meet the privacy limit you are willing to defend.
Where the useful records are
Identity provider sign-in and audit logs, cloud management trails, endpoint process and sign-in events, email and SaaS audit logs, application authorization failures, and pipeline runs. Network flow has a place and is rarely the first source for an identity-heavy intrusion. A product that only stores logs on the same host that was just compromised will not have them when you need them. Ship them off the box.
Alert on changes to the logging pipeline. Turning off the trail is a finding by itself.
Detections are hypotheses
A detection is a hypothesis: this pattern is rare and worth a person. New MFA device on an admin. A workload role calling an API it has never called. A burst of access-denied followed by success on one account. A repository token used from a new country. Write the hypothesis down, including why a legitimate admin might look the same, or the on-call will mute it.
Practice by generating the benign and the suspicious event in a lab tenant and finding both. If you cannot find the lab event, you will not find the real one. The older lessons on intrusion detection and network forensics introduce older sensors. Keep them, and add identity and cloud trails on top.
What detection will not do
Detection does not replace the control. A public bucket that pages you is still a public bucket. An alert for a stolen session is late relative to phishing-resistant MFA that would have made the session harder to mint. Fund the control that removes the class of event, then detect the residue.
Avoid detections you cannot legally or ethically seed. Do not run denial tests or live intrusion steps against systems outside your lab to see if the dashboard moves.
Check yourself
Recognition and the fix. Nothing here is a procedure.
Which source answers “who granted Global Administrator yesterday?”
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.
This page stands on its own. The lab and the glossary card are the next reading.