Skip to content

Tripati3000/SIEM-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 

Repository files navigation

Building a SIEM system using Elasticsearch πŸ›‘οΈπŸ’»

SIEM System steps

What is a SIEM ?πŸ€”

SIEM stands for Security Information and Event Management. It's like a digital security guard for computer systems. It collects and analyzes data from various sources like logs and sensors to detect and respond to security threats and incidents in real-time. Think of it as a tool that helps organizations monitor, detect, and investigate potential security breaches or unusual activities within their networks.

Description

You'll create a home lab using Elastic's web portal and a Kali Linux VM to learn Elastic SIEM. Generate security events on Kali, forward data to SIEM, and analyze logs for insights.

Tools

  • Elastic Search
  • Elastic Defender
  • Kali linux VM
  • Virtual machine or VMware

Overview of tasks

  • Setup: You'll create a home lab environment using Elastic's web portal and a virtual machine (VM) running Kali Linux.
  • Generating Security Events: On your Kali Linux VM, you'll simulate security events. This means creating situations that mimic real-world security threats, like attempted breaches or suspicious activities.
  • Forwarding Data: You'll set up an agent on the Kali Linux VM to send the generated security event data to the Elastic SIEM. This is like installing a messenger to send the information securely to the SIEM platform.
  • Query and Analysis: Once the data is in the SIEM, you'll use the Elastic web portal to query and analyze the logs. This involves asking specific questions about the data, like "show me all failed login attempts," and getting insights to understand potential security issues or patterns.

walkthrough:

Step 1: Create an elastic account for free - https://cloud.elastic.co/registration
SIEM System steps

Step 2: Create Deployment
SIEM System steps

Step 3: After creating deployment download Kali VM - https://www.kali.org/get-kali/#kali-platforms Add kali files on Virtual machine and the user name and password is kali. if you face any difficulty then search on youtube "how to setup kali vm on Virtual box"
SIEM System steps

Step 4: Putting agent on Kali VM to collect logs - Go to elastic , Click on 3 lines , Click down "Add Integrations"
SIEM System steps

Step 5: Click on Elastic Defend
SIEM System steps

Step 6: Click on Add
SIEM System steps

Configure whatever name you want to add then "save and continue":
SIEM System steps

Step 7: Click on Add "Elastic agent to your host"
SIEM System steps

Step 8: Copy the LinkπŸ”— (make sure your kali VM Running on background)
SIEM System steps

Step 9: Paste it on Kali VM and Press "Enter":
SIEM System steps

Step 10: After Installed Successfully run this command - "sudo systemctl status elastic-agent.service"
SIEM System steps

Step 11: Use Nmap on Kali VM to generate security events for testing. For install Run command - "sudo apt-get install nmap" After that run these 2 commands below πŸ‘‡
SIEM System steps

Step 12: Now that we've sent data from Kali VM to the SIEM, we can analyze and search through the logs in the SIEM to understand what's happening in our system. Go to Elastic >>> 3 lines >>> Observability >>> logs
SIEM System steps SIEM System steps

Step 13: >> Enter search query in the bar. >> Click "Search". >> Results show below. >> Click dots for more details. Analyzing events helps understand security incidents.
SIEM System steps

Step 14: Use visualizations and dashboards to analyze logs for patterns or anomalies. For instance, create a dashboard showing security event counts over time. Go to elastic >> 3 lines >> Analytic >> dashboard >> create visualization πŸ‘
SIEM System steps SIEM System steps

Step 15: Select Area
SIEM System steps

Step 16: Click Horizantal axis and select "Timestamp" and for Vertical axis select "Count". So here,"Count" for the number of events and "Timestamp" for the time axis to show event counts over time.
SIEM System steps

Step 17: After that Save it πŸ˜„
SIEM System steps

Step 18: Create Alert (importamt)βœ… >>> Go to Alerts >>> Click 'Manage rules' at top right corner. >>> Click 'Create new rules' >>> On 'define rule' section click 'Custum query'
SIEM System steps

Step 19: Search >>> event.action:"nmap-scan" on Custum query. on about rule section give your rule name or description like (nmap detection) and Choose how serious the alert is, so you know which ones need immediate attention. Leave all other settings as they are and then click "Continue."
SIEM System steps SIEM System steps

Step 20:

  1. After setting up Custum query Go to the "Actions" section.

  2. Choose what action you want to happen when the rule activates: send an email notification, create a Slack message, or trigger a custom webhook.

  3. Click on the "Create and enable rule" button to set up the alert.

  4. Once the alert is created, it will monitor your logs for Nmap scan events.

  5. If an Nmap scan event is detected, the alert will be triggered, and the action you selected will be executed.

  6. To manage your alerts, go to the "Alerts" section under "Security."

Conclusion πŸ‘

We built a home lab using Elastic SIEM and a Kali VM. We connected the Kali VM to the SIEM using Elastic Beats agent to send data. Then, we created security events on the Kali VM using Nmap. We checked and studied these logs in the SIEM using the Elastic web interface. Additionally, we made a dashboard to display security events visually. Finally, we set up an alert to catch security events as they happen.