Security Operations (SOC & SIEM)
Logs are only useful if someone looks at them. A Security Operations Centre (SOC) is the team (in-house or outsourced) that monitors an organisation's systems around the clock, investigates alerts and coordinates the response. Its main tool is a SIEM.
The SOC team
| Role | Typical work |
|---|---|
| Tier 1 analyst | Watches the alert queue, triages: false positive, or escalate? |
| Tier 2 analyst / incident responder | Investigates escalated alerts in depth, contains incidents |
| Tier 3 / threat hunter | Searches proactively for attackers no rule has caught yet; builds new detections |
| Detection engineer | Writes, tests and tunes detection rules |
| SOC manager | Processes, metrics, staffing, reporting |
Many organisations also run threat intelligence (tracking attacker groups and their techniques) and vulnerability management close to the SOC.
The tool stack
- SIEM (Security Information and Event Management): collects logs from everywhere (servers, firewalls, cloud, identity provider, endpoints), normalises them into a common schema, stores them and runs correlation rules that turn events into alerts. Examples: Splunk, Microsoft Sentinel, Elastic Security, Wazuh.
- EDR/XDR (Endpoint/Extended Detection and Response): agents on laptops and servers that record process activity and can isolate a machine.
- SOAR (Security Orchestration, Automation and Response): playbooks that automate repetitive steps, such as enriching an IP with reputation data or disabling an account.
- Threat intelligence feeds: lists of known-bad IPs, domains and file hashes (indicators of compromise, IOCs).
Normalisation
Every product logs in its own format. A SIEM maps them to common fields (user, src_ip, action, outcome) so that a single rule can look across sources:
raw_events = [
{"source": "vpn", "data": {"username": "alice", "client_ip": "198.51.100.7", "status": "LOGIN_OK"}},
{"source": "o365", "data": {"UserId": "alice@corp.example", "ClientIP": "203.0.113.50",
"Operation": "UserLoggedIn"}},
{"source": "linux", "data": "Failed password for bob from 192.0.2.44"},
]
def normalise(event):
d = event["data"]
if event["source"] == "vpn":
return {"user": d["username"], "src_ip": d["client_ip"], "action": "login",
"outcome": "success" if d["status"] == "LOGIN_OK" else "failure"}
if event["source"] == "o365":
return {"user": d["UserId"].split("@")[0], "src_ip": d["ClientIP"], "action": "login",
"outcome": "success" if d["Operation"] == "UserLoggedIn" else "failure"}
if event["source"] == "linux":
words = d.split()
return {"user": words[3], "src_ip": words[5], "action": "login",
"outcome": "failure" if words[0] == "Failed" else "success"}
for e in raw_events:
print(f"{e['source']:<6}", normalise(e))vpn {'user': 'alice', 'src_ip': '198.51.100.7', 'action': 'login', 'outcome': 'success'}
o365 {'user': 'alice', 'src_ip': '203.0.113.50', 'action': 'login', 'outcome': 'success'}
linux {'user': 'bob', 'src_ip': '192.0.2.44', 'action': 'login', 'outcome': 'failure'}
Now "alice logged in from two different IPs within minutes" can be detected even though the VPN and the email service use completely different field names.
Correlation rules
A correlation rule combines several events, often from different sources, into one alert. Single events are rarely conclusive; sequences are. The model below implements two rules over normalised events:
events = [
{"t": 100, "user": "erin", "src_ip": "203.0.113.50", "action": "login", "outcome": "failure"},
{"t": 110, "user": "erin", "src_ip": "203.0.113.50", "action": "login", "outcome": "failure"},
{"t": 125, "user": "erin", "src_ip": "203.0.113.50", "action": "login", "outcome": "failure"},
{"t": 140, "user": "erin", "src_ip": "203.0.113.50", "action": "login", "outcome": "success"},
{"t": 200, "user": "erin", "src_ip": "203.0.113.50", "action": "mfa_device_added", "outcome": "success"},
{"t": 400, "user": "frank", "src_ip": "10.1.1.9", "action": "role_change", "outcome": "success",
"detail": "frank -> admin"},
{"t": 900, "user": "frank", "src_ip": "10.1.1.9", "action": "bulk_export", "outcome": "success"},
]
def rule_takeover(events):
""">= 3 failures then success, then an MFA change within 10 minutes."""
alerts = []
for i, e in enumerate(events):
if e["action"] == "login" and e["outcome"] == "success":
fails = [x for x in events[:i] if x["user"] == e["user"]
and x["action"] == "login" and x["outcome"] == "failure"]
mfa = [x for x in events[i:] if x["user"] == e["user"]
and x["action"] == "mfa_device_added" and x["t"] - e["t"] <= 600]
if len(fails) >= 3 and mfa:
alerts.append(("HIGH", f"possible account takeover of {e['user']}"))
return alerts
def rule_privilege_then_export(events):
"""Privilege gained, then bulk export by the same user within an hour."""
alerts = []
for e in events:
if e["action"] == "role_change":
for x in events:
if x["user"] == e["user"] and x["action"] == "bulk_export" and 0 < x["t"] - e["t"] <= 3600:
alerts.append(("MEDIUM", f"{e['user']} exported data soon after a role change"))
return alerts
for severity, message in rule_takeover(events) + rule_privilege_then_export(events):
print(f"[{severity}] {message}")[HIGH] possible account takeover of erin
[MEDIUM] frank exported data soon after a role change
The takeover rule captures a classic sequence: password guessed, then the attacker registers their own MFA device to keep access.
Triage
Analysts can't investigate everything equally. Alerts are prioritised by combining the rule's severity with context: how critical is the asset, is the user privileged, does the source IP appear in threat intelligence?
SEVERITY = {"low": 1, "medium": 2, "high": 3}
CRITICAL_ASSETS = {"payroll-db", "domain-controller"}
PRIVILEGED = {"admin", "frank"}
BAD_IPS = {"203.0.113.50"}
alerts = [
{"id": "A-101", "rule": "port probe from internet", "severity": "low",
"asset": "web-01", "user": None, "ip": "198.51.100.200"},
{"id": "A-102", "rule": "malware detected and quarantined", "severity": "medium",
"asset": "hr-laptop-3", "user": "gina", "ip": None},
{"id": "A-103", "rule": "possible account takeover", "severity": "high",
"asset": "mail", "user": "erin", "ip": "203.0.113.50"},
{"id": "A-104", "rule": "new admin added", "severity": "medium",
"asset": "domain-controller", "user": "frank", "ip": "10.1.1.9"},
]
def score(a):
s = SEVERITY[a["severity"]] * 10
s += 15 if a["asset"] in CRITICAL_ASSETS else 0
s += 10 if a["user"] in PRIVILEGED else 0
s += 10 if a["ip"] in BAD_IPS else 0
return s
for a in sorted(alerts, key=score, reverse=True):
print(f"{score(a):>3} {a['id']} {a['rule']}") 45 A-104 new admin added
40 A-103 possible account takeover
20 A-102 malware detected and quarantined
10 A-101 port probe from internet
The medium-severity "new admin added" alert ends up above the high-severity takeover alert, because it involves the domain controller (the keys to the whole network) and a privileged user. Context can matter more than the rule's own label.
SOC metrics
SOCs track metrics such as MTTD (mean time to detect), MTTR (mean time to respond/recover), the number of alerts per analyst per shift, and the false-positive rate per rule. Rules that only produce noise are tuned or retired; gaps found in incidents become new rules. Mapping rules to MITRE ATT&CK techniques shows which attacker behaviours you can see and which you can't.
Go further: Defensive Security covers the SOC in depth, from SOC Roles, Tiers and Shifts to a correlation engine and Sigma rules.
Test yourself
What does a SIEM primarily do?
- Encrypts traffic
- Collects and normalises logs from many sources and correlates them into alerts
- Scans code for bugs
- Issues certificates
Why do SIEMs normalise events into common fields?
- To save disk space only
- So one rule can work across products that log in different formats
- To anonymise users
- It is required by law
Which SOC role searches proactively for attackers that no existing rule has detected?
- Tier 1 analyst
- Threat hunter
- Help desk
- Auditor