How to setup an Intrusion & Detection System (IDS/IPS) for your homelab:
Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS) are among the first lines of defence.
As their name suggests, they detect and prevent hackers from breaching your network.
But what is an IDS/IPS actually?
In their simplest forms they are rule engines that watch traffic packets, hence the following image of Snort (one IDS tool) piggy backing on Wireshark - the packet police.
IDS/IPS are combinations of package inspection and rule engine software.
Essentially, the IDS watches all packets coming into your network, all the packets flying around inside your network and the ones that want to leave your network.
That means, all the packets are being watched! 📦 👀
But… What does that actually mean - packets are being watched?
Great question, as usual!
A packet has some content and some information about the package - we can call that meta information.
The IDS/IPS scans the packet information and checks them against its rules.
If the packet is categorized as possibly malicious the fun begins.
Depending on the configuration the IDS can isolate and drop the packet like there is no tomorrow.
It injects full power into the all destroying laser beams and burns any malicious content right down to their last bit.
Adios Mr packet bug. 📦🐛😵
In order to integrate with the SIEM the IDS/IPS needs to create and forward messages to our SIEM.
These are sometimes called alerts and in case of suricata, the IDS that we will install, they are saved in a file called eve.json located in
OK, great but how do we get that json file into our SIEM now?!
Here is the plan:
1. add one VM to our homelab - Debian/Ubuntu. 2. add the suricata repositories and install it 3. download and install rules from a public collection 4. setup wazuh agent 5. add suricata log collection to wazuh agent 6. profit 7. oh and test if the log forwarding actually works
Step-By-Step, lets GOOOOOO
1. add a debian/ubuntu VM to your homelab
I trust you are able to setup a new Virtual Machine with debian - if not yet:
⚠️ Keep in mind that in order for the connection to the SIEM to work you need to have a working SIEM in your homelab - here is a thread showing you how to do it:
2. add suricata repositories + install
Since suricata is not included in the standard repository collection of ubuntu/debian we need to add it - lucky for us we can do it with a single command:
sudo add-apt-repository ppa:oisf/suricata-stable
# afterwards we need to update the repository cache
sudo apt-get update
# and now we can finally install suricita
sudo apt-get install suricata -y
3. Download and install rules
Suricata needs rules to detect malicious activity - where do we get them though?
Open Source is our friend as usual!
you can have a look at the collection -
# first we download
cd /tmp/ && curl -LO
# now we untar the rules and move all the rules to the suricata rule folder
sudo tar -xzvf emerging.rules.tar.gz && sudo mv rules/*.rules /etc/suricata/rules/rules.emergingthreats.net/open/suricata-…
in order for suricata to be able to use the rules they need to be accessible
640 = owner read/write, group only read, everyone else has no permissions