MODULE 5
π‘οΈ Security Operations Centre (SOC)
Log Analysis and Threat Detection
Module Introduction
Welcome to Module Five of your Security Operations Centre (SOC) course! In this module, we will explore log analysis and threat detection. You will learn how to analyze logs from various sources to detect threats and investigate incidents.
Think of this module as learning how to read the clues left behind by attackers. Logs are the digital footprints of activity on your network and systems. By mastering log analysis, you can uncover attacks that might otherwise go unnoticed.
π‘ What you will learn: Log types (OS, application, audit, security), Windows logging (Sysmon, Event Logs, PowerShell logs), Linux logging (syslog, rsyslog, auditd), log analysis techniques and tools, YARA rules for malware identification, and the MITRE ATT&CK framework application.
Learning Objectives
By the end of this module, you will be able to:
- Identify different log types: OS, application, audit, and security.
- Analyze Windows logs (Sysmon, Event Logs, PowerShell logs).
- Analyze Linux logs (syslog, rsyslog, auditd).
- Apply log analysis techniques and tools.
- Create and use YARA rules for malware identification.
- Apply the MITRE ATT&CK framework for threat detection.
Warmβup Story
Chinwe's Log Analysis Discovery
Chinwe was a SOC analyst at a hospital in Abuja. One morning, she noticed unusual activity in the Windows Event Logs. She analyzed the logs and found evidence of a ransomware attack in progress.
She used Sysmon to track the attacker's movements and identified the malicious process. She created a YARA rule to detect the malware and prevented it from spreading. Her quick analysis saved the hospital from a major breach.
Main Lessons
Lesson 1: Introduction to Log Analysis
Definition: Log analysis is the process of examining logs to identify security events, detect threats, and investigate incidents.
Why it is important: Logs provide a detailed record of activity on systems and networks, making them essential for detecting and investigating threats.
- Realβlife example: A company analyzes logs to detect unauthorized access.
- School example: A school analyzes logs to monitor student activity.
- Home example: A parent analyzes logs to monitor internet usage.
- Nigerian example: A bank analyzes logs to detect fraud.
π Mini summary: Log analysis is the process of examining logs to detect threats and investigate incidents.
Lesson 2: Log Types
Definition: Logs are records of events that occur on systems and networks. They can be categorized into different types.
π₯οΈ OS Logs
Logs from operating systems (Windows, Linux).
π± Application Logs
Logs from applications (web servers, databases).
π Audit Logs
Logs that track changes and access.
π‘οΈ Security Logs
Logs related to security events (IDS/IPS, firewalls).
π Mini summary: Log types include OS logs, application logs, audit logs, and security logs.
Lesson 3: Windows Logging
Definition: Windows provides several logging mechanisms, including Event Logs, Sysmon, and PowerShell logs.
- Windows Event Logs: Record system, application, and security events.
- Sysmon: Provides detailed system monitoring.
- PowerShell Logs: Record PowerShell activity.
π Mini summary: Windows logging includes Event Logs, Sysmon, and PowerShell logs.
Lesson 4: Linux Logging
Definition: Linux provides several logging mechanisms, including syslog, rsyslog, and auditd.
- syslog: A standard for log collection.
- rsyslog: An enhanced version of syslog.
- auditd: The Linux audit system.
π Mini summary: Linux logging includes syslog, rsyslog, and auditd.
Lesson 5: Log Analysis Techniques
Definition: Log analysis techniques are methods used to examine logs and detect threats.
- Filtering: Narrow down logs to specific events.
- Correlation: Identify relationships between events.
- Pattern Matching: Look for specific patterns.
- Anomaly Detection: Identify unusual activity.
π Mini summary: Log analysis techniques include filtering, correlation, pattern matching, and anomaly detection.
Lesson 6: Log Analysis Tools
Definition: Log analysis tools help analysts examine logs efficiently.
- ELK Stack: Elasticsearch, Logstash, Kibana.
- Splunk: Commercial SIEM tool.
- Wazuh: Open-source SIEM solution.
- Graylog: Open-source log management tool.
π Mini summary: Log analysis tools include ELK Stack, Splunk, Wazuh, and Graylog.
Lesson 7: YARA Rules
Definition: YARA is a tool for identifying malware based on patterns in files or processes.
Why it is important: YARA rules help detect malware that might otherwise evade detection.
rule SilentBanker {
meta:
description = "Detects SilentBanker malware"
strings:
$a = {6A 40 68 00 30 00 00 6A 14 8D 91}
$b = "SilentBanker"
condition:
$a or $b
}
π Mini summary: YARA rules identify malware based on patterns in files or processes.
Lesson 8: MITRE ATT&CK Framework
Definition: The MITRE ATT&CK framework is a knowledge base of adversary tactics and techniques.
Why it is important: ATT&CK provides a common language for describing and detecting threats.
- Tactics: The adversary's goals (e.g., Initial Access, Execution).
- Techniques: How the adversary achieves their goals (e.g., Phishing, Exploit Public-Facing Application).
- Procedures: Specific implementations of techniques.
π Mini summary: The MITRE ATT&CK framework provides a common language for describing and detecting threats.
Lesson 9: Applying MITRE ATT&CK
Definition: Applying MITRE ATT&CK involves mapping threats to tactics and techniques to improve detection.
- Mapping: Identify which tactics and techniques apply to a threat.
- Detection: Use the mapping to create detection rules.
- Response: Use the mapping to guide incident response.
π Mini summary: Applying MITRE ATT&CK involves mapping threats to tactics and techniques to improve detection and response.
Lesson 10: Best Practices for Log Analysis
Definition: Best practices for log analysis ensure effective threat detection and investigation.
- Collect logs from all sources: Ensure comprehensive coverage.
- Normalize logs: Standardize log formats.
- Use SIEM: Aggregate and correlate logs.
- Create YARA rules: Detect malware.
- Apply MITRE ATT&CK: Improve detection and response.
- Monitor continuously: Detect threats in real-time.
π Mini summary: Best practices for log analysis include collecting logs from all sources, normalizing logs, using SIEM, creating YARA rules, applying MITRE ATT&CK, and continuous monitoring.
Key Vocabulary
Log Analysis: The process of examining logs to detect threats.
YARA: A tool for identifying malware.
MITRE ATT&CK: A knowledge base of adversary tactics and techniques.
Sysmon: A Windows system monitoring tool.
auditd: The Linux audit system.
SIEM: Security Information and Event Management.
Correlation: Identifying relationships between events.
Pattern Matching: Looking for specific patterns in logs.
Anomaly Detection: Identifying unusual activity.
Tactics: The adversary's goals.
Important Concepts
- Log analysis is essential for detecting and investigating threats.
- Log types include OS logs, application logs, audit logs, and security logs.
- Windows logging includes Event Logs, Sysmon, and PowerShell logs.
- Linux logging includes syslog, rsyslog, and auditd.
- YARA rules identify malware based on patterns.
- MITRE ATT&CK provides a common language for threat detection.
Step-by-Step Explanations
How to Create a YARA Rule
- Identify the malware you want to detect.
- Find unique strings or byte sequences in the malware.
- Create a YARA rule with the identified patterns.
- Test the rule on known malware samples.
- Deploy the rule in your environment.
How to Apply MITRE ATT&CK
- Identify the threat you are investigating.
- Map the threat to the appropriate tactics and techniques.
- Use the mapping to create detection rules.
- Use the mapping to guide incident response.
- Continuously update the mapping based on new threats.
Real-Life Examples
- In a business: A company uses YARA rules to detect ransomware.
- In a school: A school uses MITRE ATT&CK to improve threat detection.
- In a hospital: A hospital uses log analysis to detect insider threats.
- In Nigeria: A bank uses log analysis to detect fraud.
Nigerian Examples
- A bank in Lagos uses YARA rules to detect malware.
- A telecom company in Abuja uses MITRE ATT&CK.
- A hospital in Kano uses log analysis to protect patient data.
- A government agency in Enugu uses log analysis for threat detection.
Fun Examples Children Can Relate To
- A detective examining clues (log analysis).
- A security guard watching cameras (threat detection).
- A librarian organizing books (log management).
- A spy decoding messages (YARA rules).
Everyday Examples
- Checking your phone's call log (log analysis).
- Monitoring your home security camera (threat detection).
- Organizing your files (log management).
- Decoding a secret message (YARA rules).
Teacher Notes
- Emphasize the importance of log analysis in SOC operations.
- Use real-world examples to illustrate concepts.
- Discuss the role of YARA rules and MITRE ATT&CK.
- Encourage students to practice with log analysis tools.
Parent Tips
- Help your child understand the importance of log analysis.
- Discuss how logs can detect threats.
- Encourage them to think about security monitoring in their digital life.
- Support their interest in cybersecurity careers.
Interesting Facts
- Logs are often the first evidence of a security incident.
- YARA was created by Victor M. Alvarez in 2011.
- MITRE ATT&CK was first released in 2013.
- Sysmon was released by Microsoft in 2014.
Did You Know?
Did you know? YARA is used by many antivirus companies.
Did you know? MITRE ATT&CK is updated regularly with new techniques.
Did you know? Sysmon can monitor network connections and process creation.
Remember This
- Log analysis is essential for detecting and investigating threats.
- Log types include OS logs, application logs, audit logs, and security logs.
- Windows logging includes Event Logs, Sysmon, and PowerShell logs.
- Linux logging includes syslog, rsyslog, and auditd.
- YARA rules identify malware based on patterns.
- MITRE ATT&CK provides a common language for threat detection.
Common Mistakes
- Not collecting enough logs: Incomplete data leads to missed threats.
- Not normalizing logs: Inconsistent formats hinder analysis.
- Not using YARA rules: Malware may go undetected.
- Not applying MITRE ATT&CK: Detection may be ineffective.
- Not monitoring continuously: Threats may go undetected.
Best Practices
- Collect logs from all sources.
- Normalize log formats.
- Use SIEM for log aggregation and correlation.
- Create and deploy YARA rules.
- Apply MITRE ATT&CK for threat detection.
- Monitor continuously.
Comparison: Log Types
| Type | Description | Examples |
| OS Logs | Operating system events | Windows Event Logs, syslog |
| Application Logs | Application events | Web server logs, database logs |
| Audit Logs | Changes and access | auditd, Windows Security logs |
| Security Logs | Security events | IDS/IPS logs, firewall logs |
Comparison: Log Analysis Tools
| Tool | Type | Best for |
| ELK Stack | Open-source | Small to medium |
| Splunk | Commercial | Large enterprises |
| Wazuh | Open-source | Small to medium |
| Graylog | Open-source | Small to medium |
End-of-Module Summary
Congratulations! You have completed Module Five. You now know:
- What log analysis is and why it is important.
- Different log types: OS, application, audit, and security.
- Windows logging (Event Logs, Sysmon, PowerShell logs).
- Linux logging (syslog, rsyslog, auditd).
- Log analysis techniques and tools.
- YARA rules for malware identification.
- MITRE ATT&CK framework application.
You are now ready to move on to Module Six, where you will learn about Incident Response.
Frequently Asked Questions
- What is log analysis? The process of examining logs to detect threats.
- What are log types? OS logs, application logs, audit logs, and security logs.
- What is Windows logging? Event Logs, Sysmon, PowerShell logs.
- What is Linux logging? syslog, rsyslog, auditd.
- What are log analysis techniques? Filtering, correlation, pattern matching, anomaly detection.
- What are log analysis tools? ELK Stack, Splunk, Wazuh, Graylog.
- What are YARA rules? Rules for identifying malware.
- What is MITRE ATT&CK? A knowledge base of adversary tactics and techniques.
- Why is log analysis important? It helps detect and investigate threats.
- What are the best practices for log analysis? Collect logs from all sources, normalize logs, use SIEM, create YARA rules, apply MITRE ATT&CK, monitor continuously.
Review Questions
- What is log analysis?
- What are the log types?
- What is Windows logging?
- What is Linux logging?
- What are log analysis techniques?
- What are log analysis tools?
- What are YARA rules?
- What is MITRE ATT&CK?
- Why is log analysis important?
- What are the best practices for log analysis?
- How do you create a YARA rule?
- How do you apply MITRE ATT&CK?
- What is the difference between syslog and rsyslog?
- What is the difference between ELK Stack and Splunk?
- What is the difference between tactics and techniques in MITRE ATT&CK?
Fill-in-the-Blank Exercises
- __________ is the process of examining logs to detect threats.
- __________ logs record operating system events.
- __________ logs record application events.
- __________ logs record changes and access.
- __________ logs record security events.
- __________ is a Windows system monitoring tool.
- __________ is the Linux audit system.
- __________ rules identify malware based on patterns.
- __________ is a knowledge base of adversary tactics and techniques.
- __________ is a commercial SIEM tool.
True or False
- Log analysis is not important for SOCs. (False)
- OS logs record operating system events. (True)
- Application logs record application events. (True)
- Audit logs record security events. (False)
- Sysmon is a Windows monitoring tool. (True)
- auditd is a Linux audit system. (True)
- YARA rules identify malware. (True)
- MITRE ATT&CK is a commercial tool. (False)
- Splunk is an open-source SIEM tool. (False)
- Continuous monitoring is not necessary. (False)
Multiple Choice Questions
- What is log analysis?
a) The process of examining logs b) A type of software c) A hardware device d) A threat
Answer: a
- What are log types?
a) OS, application, audit, security b) Only OS c) Only security d) None
Answer: a
- What is Windows logging?
a) Event Logs, Sysmon, PowerShell logs b) Only Event Logs c) Only Sysmon d) None
Answer: a
- What is Linux logging?
a) syslog, rsyslog, auditd b) Only syslog c) Only auditd d) None
Answer: a
- What are log analysis techniques?
a) Filtering, correlation, pattern matching, anomaly detection b) Only filtering c) Only correlation d) None
Answer: a
- What are log analysis tools?
a) ELK Stack, Splunk, Wazuh, Graylog b) Only ELK Stack c) Only Splunk d) None
Answer: a
- What are YARA rules?
a) Rules for identifying malware b) A type of software c) A hardware device d) A threat
Answer: a
- What is MITRE ATT&CK?
a) A knowledge base of adversary tactics and techniques b) A type of software c) A hardware device d) A threat
Answer: a
- Why is log analysis important?
a) It helps detect and investigate threats b) It is not important c) It only collects logs d) None
Answer: a
- What are the best practices for log analysis?
a) Collect logs from all sources, normalize logs, use SIEM, create YARA rules, apply MITRE ATT&CK, monitor continuously b) Only collect logs c) Only normalize logs d) None
Answer: a
- How do you create a YARA rule?
a) Identify patterns, create a rule, test it b) Only identify patterns c) Only create a rule d) None
Answer: a
- How do you apply MITRE ATT&CK?
a) Map threats to tactics and techniques b) Only map threats c) Only create rules d) None
Answer: a
- What is the difference between syslog and rsyslog?
a) rsyslog is enhanced version of syslog b) They are the same c) syslog is enhanced version of rsyslog d) None
Answer: a
- What is the difference between ELK Stack and Splunk?
a) ELK is open-source; Splunk is commercial b) They are the same c) Splunk is open-source; ELK is commercial d) None
Answer: a
- What is the difference between tactics and techniques in MITRE ATT&CK?
a) Tactics are goals; techniques are methods b) They are the same c) Techniques are goals; tactics are methods d) None
Answer: a
Matching Exercises
Match the term on the left with its description on the right.
| Term | Description |
| 1. Log Analysis | A. Rules for identifying malware |
| 2. YARA | B. Knowledge base of adversary tactics and techniques |
| 3. MITRE ATT&CK | C. The process of examining logs |
| 4. Sysmon | D. Windows system monitoring tool |
| 5. auditd | E. Linux audit system |
Answers: 1-C, 2-A, 3-B, 4-D, 5-E
Short Answer Questions
- What is log analysis and why is it important?
- What are the different log types?
- What is the difference between syslog and rsyslog?
- What are YARA rules and how are they used?
- What is the MITRE ATT&CK framework and how is it applied?
Scenario-Based Exercises
- Scenario: You are a SOC analyst. You receive an alert about unusual activity on a Windows system. What logs would you analyze and why?
- Scenario: You need to detect ransomware in your environment. How would you use YARA rules?
- Scenario: You want to improve threat detection in your SOC. How would you use MITRE ATT&CK?
Group Activity
In groups of 3-4, analyze a set of logs and identify potential threats. Use YARA rules and MITRE ATT&CK to detect and describe the threats. Present your findings to the class.
Individual Activity
Write a one-page report on a log analysis tool of your choice (ELK Stack, Splunk, Wazuh, or Graylog). Include its features and use cases.
Classroom Discussion Questions
- Why is log analysis important for SOCs?
- What are the challenges of log analysis?
- How can YARA rules improve threat detection?
- What is the role of MITRE ATT&CK in threat detection?
- How can organizations improve their log analysis capabilities?
Mini Project
Project: "Log Analysis and Threat Detection." Analyze a set of logs and identify potential threats. Create YARA rules to detect malware. Apply MITRE ATT&CK to describe the threats. Present your findings to the class.
Practical Assignment
Analyze a set of Windows Event Logs and identify suspicious activity. Write a report on your findings.
Challenge Exercise
Create a YARA rule to detect a specific malware family. Test the rule on known samples. Write a one-page report on your findings.
Quiz Answers
Fill-in-the-Blank Answers:
- Log analysis
- OS
- Application
- Audit
- Security
- Sysmon
- auditd
- YARA
- MITRE ATT&CK
- Splunk
True or False Answers: 1-F, 2-T, 3-T, 4-F, 5-T, 6-T, 7-T, 8-F, 9-F, 10-F
Key Takeaways
- Log analysis is essential for detecting and investigating threats.
- Log types include OS logs, application logs, audit logs, and security logs.
- Windows logging includes Event Logs, Sysmon, and PowerShell logs.
- Linux logging includes syslog, rsyslog, and auditd.
- YARA rules identify malware based on patterns.
- MITRE ATT&CK provides a common language for threat detection.
Preparation for the Next Module
In Module Six, you will learn about Incident Response. You will explore incident response frameworks, the IR process, playbooks, and incident communication.