SOC Analyst with Wazuh: Detecting and Responding to Attacks
Exit

Lesson 1 of 11 · The SOC and Wazuh

The SOC analyst job: tiers, SIEM, incidents and MITRE ATT&CK

35 min Debian 12

Objective

Understand what an analyst really does in a SOC (Security Operations Center), how an alert becomes an incident, and speak the common language of the profession: SIEM, XDR, tiers L1-L2-L3 and MITRE ATT&CK. This lesson sets the scene for the whole course.

Key points

  • A SOC is the team (and the room) that continuously monitors an organization's systems to detect attacks and respond to them quickly.
  • Analysts are organized in tiers: L1 triages alerts, L2 investigates and contains, L3 hunts threats and handles complex cases.
  • A SIEM collects and correlates logs; an EDR protects each endpoint; an XDR connects the two. Wazuh is a free and open source platform that does both SIEM and XDR.
  • An incident follows a life cycle: preparation, detection and analysis, containment, eradication, recovery, lessons learned.
  • MITRE ATT&CK is a public catalog of attacker behaviors: tactics (the "why") and numbered techniques (the "how"), for example T1110 for brute force.

A day in a SOC

Picture the SOC of a bank in Casablanca. It is 8:05 a.m. The dashboard shows 1,240 alerts since midnight. Nobody can read them all one by one: the job is to triage.

Sarah, an L1 analyst, opens the queue. Most alerts are noise: antivirus updates, log rotations, normal logins. Yet she spots one line: 48 failed SSH passwords on a web server, from a foreign address, followed by one successful login. This is no longer noise. She qualifies the alert, writes her first observations in the ticket and escalates it to L2.

Youssef, an L2 analyst, takes over the ticket. He looks at what the account did after logging in, isolates the server, blocks the address and warns the system team. By noon, the threat is contained; he writes the report.

You will replay this scenario from start to finish in this course, on your own machine.

Analyst tiers

Tier Main role Example tasks
L1 — triage monitor the queue, qualify alerts discard false positives, open a ticket, escalate
L2 — response investigate and contain rebuild the timeline, block an IP, isolate a machine
L3 — expertise hunt and improve threat hunting, malware analysis, new detection rules
SOC manager lead metrics, on-call duty, relationship with management and the CISO

In Morocco, these jobs exist in banks and insurance companies, at telecom operators, in ministries and large public institutions, and at managed security service providers (MSSP) that monitor several clients from Casablanca or Rabat, often for European clients too. The L1 position is the classic entry point.

Two metrics to know

  • MTTD (Mean Time To Detect): the average time between the start of an attack and its detection.
  • MTTR (Mean Time To Respond): the average time between detection and containment.

A good SOC lowers both. A well-written detection rule (lesson 2.2) reduces the MTTD; a well-tuned active response (lesson 3.1) reduces the MTTR.

SIEM, EDR, XDR, SOAR: who does what?

Acronym Name What it brings
SIEM Security Information and Event Management collect logs from everywhere, normalize them, correlate them, alert
EDR Endpoint Detection and Response an agent on each machine that watches processes and files, and can act
XDR Extended Detection and Response bring SIEM and EDR (and more) together into a single detection
SOAR Security Orchestration, Automation and Response automate responses (block, notify, open a ticket)

Wazuh combines an agent installed on the machines (log monitoring, file integrity, vulnerabilities, active response) and a central server that analyzes and correlates: it therefore covers both the SIEM role and the XDR role. It is free and open source (GPLv2 license) and costs nothing, which makes it an excellent tool for learning, and a real choice for many SMEs and public administrations.

Triage vocabulary

  • Event: a log line ("successful SSH login"). Millions per day.
  • Alert: an event (or a group of events) that a rule found interesting. In Wazuh, each alert has a level from 0 to 15.
  • Incident: a confirmed alert that harms (or threatens to harm) confidentiality, integrity or availability.
  • True positive: the alert matches a real attack.
  • False positive: the alert fired by mistake (an administrator who mistypes their password three times).
  • False negative: a real attack without an alert. This is the most dangerous case, because it is invisible.

An L1 analyst spends a large part of their time discarding false positives. A good L2 or L3 analyst reduces their number by refining the rules.

The incident life cycle

The most cited reference is the NIST SP 800-61 guide. Remember these steps:

  1. Preparation ──► 2. Detection and analysis ──► 3. Containment ──► 4. Eradication ──► 5. Recovery
        ▲                                                                                     │
        └──────────────────────── 6. Lessons learned (post-incident activity) ◄──────────────┘
Step Question Example for our bank
Preparation Are we ready? Wazuh installed, agents on all servers, written procedures
Detection and analysis What is really happening? 48 failures then one success: true positive
Containment How do we stop it from spreading? block the IP, disable the deploy account
Eradication How do we remove the attacker? delete the added account, remove the planted SSH key
Recovery How do we get back to normal? restore the files, monitor closely for 15 days
Lessons learned What should we change? forbid password logins on SSH, add a rule

In Morocco, the DGSSI (Direction générale de la sécurité des systèmes d'information, the national information systems security agency) hosts maCERT, the national center for monitoring and incident response. Public administrations and operators of vital importance have security and incident reporting obligations (law 05-20 on cybersecurity). If personal data is affected, law 09-08 and the CNDP (the data protection authority) also come into play. You will see these aspects in the lesson on the incident report.

MITRE ATT&CK: the common language

MITRE ATT&CK is a public and free knowledge base, built from attacks actually observed in the wild. It classifies what attackers do into:

  • Tactics: the attacker's goal at a given stage (get access, stay, steal credentials…). IDs look like TA00xx.
  • Techniques: the way to reach that goal. IDs look like Txxxx, and Txxxx.yyy for sub-techniques.

Some tactics of the Enterprise matrix, in the order of a typical attack:

Tactic ID Attacker's question
Initial Access TA0001 How do I get in?
Execution TA0002 How do I run my code?
Persistence TA0003 How do I stay after a reboot?
Privilege Escalation TA0004 How do I become root?
Defense Evasion TA0005 How do I hide?
Credential Access TA0006 How do I steal passwords?
Discovery TA0007 What is around me?
Lateral Movement TA0008 How do I move to another machine?
Exfiltration TA0010 How do I get the data out?
Impact TA0040 How do I break or encrypt things?

And the techniques you will meet most often in this course:

Technique Name Concrete example
T1110 Brute Force thousands of passwords tried on SSH
T1110.001 Password Guessing one account, many passwords
T1110.003 Password Spraying one common password, many accounts
T1078 Valid Accounts the attacker logs in with a real stolen account
T1136.001 Create Account: Local Account useradd support2 to keep access
T1098 Account Manipulation a key added to authorized_keys
T1059.004 Unix Shell commands run by a malicious bash script
T1486 Data Encrypted for Impact ransomware

Wazuh already maps many of its rules to ATT&CK techniques: when an alert appears in the dashboard, you see T1110 right next to it. This lets you speak the same language as a colleague from another SOC, as maCERT or as an international threat report.

# In a Wazuh alert (JSON format), the MITRE part looks like this:
#   "rule": { "id": "5763", "level": 10,
#             "mitre": { "id": ["T1110"], "tactic": ["Credential Access"] } }

Triage: a simple method

Faced with a queue of alerts, an L1 analyst always asks the same questions, in this order:

  1. Severity: what level? Levels 10 to 15 come before the rest.
  2. Affected asset: a payment server matters more than a test workstation.
  3. Context: is the address internal (10.x) or external? Is the account a service account?
  4. Sequence: do several alerts tell the same story (failures, then success, then an account created)?
  5. Decision: false positive (document it and close it), true positive (escalate), doubt (escalate too).
# A preview of what you will do on the command line in the lab:
awk -F';' 'NR>1 && $2>=10' alertes.csv          # alerts of level 10 and above
sort -t';' -k2,2nr alertes.csv | head           # sort by decreasing level
grep '203.0.113.45' alertes.csv                 # pivot on an IP address

Common pitfalls

  • Judging an alert on its own: 48 failed passwords are commonplace on the Internet; 48 failures followed by a success are an incident. Always look at what comes before and after.
  • Closing an alert without a trace: even a false positive is documented in one sentence. Otherwise, the night-shift colleague will redo the same work.
  • Mixing up tactic and technique: "Credential Access" is a tactic (TA0006), "Brute Force" is a technique (T1110).
  • Believing the tool does everything: Wazuh produces alerts; the analyst is the one who turns them into a diagnosis.

Lab

You start your first L1 shift. A file /root/soc/alertes.csv contains ten alerts from the night. You will:

  1. map the burst of password attempts to its MITRE technique;
  2. do the same for the account created without authorization;
  3. count the alerts of level 10 or higher;
  4. prepare the work queue, from the most severe to the least severe.

Start the lab on your work machine with sudo ml demarrer wazuh-1-1, then check with sudo ml verifier.

Quiz

  1. What is the difference between the role of an L1 analyst and that of an L2?
  2. What is a false negative, and why is it more dangerous than a false positive?
  3. List the steps of the incident life cycle according to NIST.
  4. Is T1110 a tactic or a technique? And TA0006?
  5. Why is Wazuh described as both a SIEM and an XDR?
Answers
  1. L1 monitors the queue, triages alerts, discards false positives and escalates; L2 investigates in depth, rebuilds what happened and contains the incident (blocking, isolation).
  2. A real attack that triggers no alert. It is more dangerous because nobody sees it: the attacker acts undisturbed.
  3. Preparation; detection and analysis; containment, eradication and recovery; post-incident activity (lessons learned).
  4. T1110 (Brute Force) is a technique; TA0006 (Credential Access) is a tactic, that is, a goal.
  5. Because it collects and correlates the logs of the whole fleet (SIEM role) and it has an agent on each machine able to observe and act, for example to block an address (EDR role, combined into XDR).

Reference sources: Wazuh documentation (CC BY-SA 4.0), MITRE ATT&CK, NIST SP 800-61, DGSSI/maCERT. Original MasterLinux text.

Practical exercises

To do on Debian 12

Do this lab on your own machine

The terminal is yours: a Linux VM (VirtualBox, VMware, Hyper-V, WSL…) or Docker/Podman. The ml tool prepares the exercise and checks your work; the lesson is validated here automatically.

Create a free account to get your personal command and have your labs checked automatically.

Create my account

Tasks

  1. Alert A02 describes dozens of failed SSH passwords from the same address. Write only the ID of the matching MITRE ATT&CK technique (for example T1234) in /root/soc/A02.txt
    Show a hintIt is the "Brute Force" technique, in the Credential Access tactic.
    Show the solution
    echo T1110 > /root/soc/A02.txt

    Check : grep -Eqix " *T1110(\.00[1-4])? *" /root/soc/A02.txt

  2. Alert A03 reports the creation of an unexpected local account. Write the ID of the matching MITRE technique in /root/soc/A03.txt
    Show a hintTechnique "Create Account" (sub-technique Local Account), tactic Persistence.
    Show the solution
    echo T1136.001 > /root/soc/A03.txt

    Check : grep -Eqix " *T1136(\.001)? *" /root/soc/A03.txt

  3. In /root/soc/alertes.csv (separator ;), count the alerts of level 10 or higher and write only this number in /root/soc/critiques.txt
    Show a hintawk -F';' 'NR>1 && $2>=10' selects the right lines (NR>1 skips the header).
    Show the solution
    awk -F";" "NR>1 && \$2>=10 {n++} END {print n+0}" /root/soc/alertes.csv > /root/soc/critiques.txt

    Check : test "$(tr -d " \n" < /root/soc/critiques.txt)" = "$(awk -F";" "NR>1 && \$2>=10 {n++} END {print n+0}" /root/soc/alertes.csv)"

  4. Prepare the work queue: write in /root/soc/file.txt the IDs of the alerts of level 10 or higher, one per line, from the most severe to the least severe
    Show a hintawk to filter, sort -t';' -k2,2nr to sort by decreasing level, cut -d';' -f1 to keep the ID.
    Show the solution
    awk -F";" "NR>1 && \$2>=10" /root/soc/alertes.csv | sort -t";" -k2,2nr -k1,1 | cut -d";" -f1 > /root/soc/file.txt

    Check : f=/root/soc/file.txt; c=/root/soc/alertes.csv; test "$(tr -d " \r" < $f | sort)" = "$(awk -F";" "NR>1 && \$2>=10 {print \$1}" $c | sort)" && tr -d " \r" < $f | awk -F";" "NR==FNR {n[\$1]=\$2; next} FNR>1 && n[\$1]>p {e=1} {p=n[\$1]} END {exit e}" $c -

Official references consulted: Wazuh documentation — Getting started, Components — https://documentation.wazuh.com/current/getting-started/components/index.html ; Wazuh documentation — Use cases — https://documentation.wazuh.com/current/getting-started/use-cases/index.html ; MITRE ATT&CK — Enterprise Tactics — https://attack.mitre.org/tactics/enterprise/ ; MITRE ATT&CK — T1110 Brute Force — https://attack.mitre.org/techniques/T1110/ ; MITRE ATT&CK — T1136 Create Account — https://attack.mitre.org/techniques/T1136/ ; NIST SP 800-61 — Computer Security Incident Handling Guide — https://csrc.nist.gov/pubs/sp/800/61/r3/final ; DGSSI / maCERT — Centre marocain de veille, détection et réponse aux attaques informatiques — https://www.dgssi.gov.ma. Original MasterLinux text.