Making Your Home Lab: Elastic Stack SIEM

Here is my Guide to Setting up your Own Lab as a SIEM with Elastic Stack

Setting Up a Home Lab SIEM with Elastic Stack

Prerequisites:

Step 1: Install the Elastic Stack

  1. Add the Elastic Repository:
    sudo apt-get install apt-transport-https
    curl -fsSL https://artifacts.elastic.co/GPG-KEY-public | sudo apt-key add -
    echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list
    
  2. Update the Package Lists:
    sudo apt update
    
  3. Install Elasticsearch, Logstash, and Kibana:
    sudo apt install elasticsearch logstash kibana
    

Step 2: Configure Elasticsearch

  1. Edit the Configuration File:
    sudo nano /etc/elasticsearch/elasticsearch.yml
    
  2. Set the Network Interface: Uncomment the network.host line and set it to 0.0.0.0 to allow connections from other machines.
  3. Start Elasticsearch:
    sudo systemctl start elasticsearch
    

Step 3: Configure Logstash

  1. Create a Logstash Pipeline: Create a new configuration file (e.g., /etc/logstash/conf.d/siem.conf) and add the following configuration:
    input {
        stdin {
            codec => json
        }
    }
    
    filter {
        # Add filters here, e.g., grok, dissect, mutate
    }
    
    output {
        elasticsearch {
            hosts => ["localhost:9200"]
        }
    }
    
  2. Start Logstash:
    sudo systemctl start logstash
    

Step 4: Configure Kibana

  1. Start Kibana:
    sudo systemctl start kibana
    
  2. Access Kibana: Open a web browser and go to http://localhost:5601.

Step 5: Ingest Sample Data

  1. Generate Sample Data: You can use tools like tcpdump, wireshark, or syslog-ng to generate sample network traffic or system logs.
  2. Send Data to Logstash: Use tools like nc or logger to send the data to Logstash’s input port.
  3. Visualize Data in Kibana: Explore the Discover tab to view the ingested data. Create visualizations and dashboards to analyze the data.

Additional Tips:

By following these steps, you’ll have a basic SIEM environment up and running. Experiment with different data sources, filters, and visualizations to gain hands-on experience with security analytics.