Suricata: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 34: | Zeile 34: | ||
*cat *.rules > /etc/suricata/rules/suricata.rules | *cat *.rules > /etc/suricata/rules/suricata.rules | ||
| − | + | ||
| − | |||
| − | |||
| − | |||
=Suricata config= | =Suricata config= | ||
| Zeile 46: | Zeile 43: | ||
- local.rules | - local.rules | ||
=IDS= | =IDS= | ||
| − | * | + | =Local Rules= |
| − | *suricata -i | + | *cat /etc/suricata/rules/local.rules |
| + | alert icmp any any -> any any (msg:"ICMP Snort Test"; sid:1000000002;) | ||
| + | alert tcp any any -> any any (flags: S; msg: "SYN packet"; sid:100000003;) | ||
| + | *suricata -i eth1 | ||
=IPS= | =IPS= | ||
| + | =Local Rules= | ||
| + | *cat /etc/suricata/rules/local.rules | ||
| + | drop icmp any any -> 1.1.1.1 any (msg:"Snort Test"; sid:1000000001;) | ||
| + | alert icmp any any -> any any (msg:"ICMP Snort Test"; sid:1000000002;) | ||
*suricata -q0 | *suricata -q0 | ||
*iptables -I FORWARD -i $WAN -o eth1 -j NFQUEUE | *iptables -I FORWARD -i $WAN -o eth1 -j NFQUEUE | ||
Version vom 13. Oktober 2020, 20:17 Uhr
Prinzip
Suricata ist ein IDS(Intrusion Detection System) bzw. IPS(Intrusion Prevention System) System das nach folgendem Prinzip funktioniert
Empfang
- Pakete werden vom Netzwerk gelesen.
- Durch abhören einer Schnittstelle (IDS)
- Übergabe durch den Firewall Stack (IPS)
Decodierung
Die Pakete werden decodiert und der Original-Datenstrom wird restauriert.
Analyse
Der Datenstrom wird mit den hinterlegten Signaturen verglichen.
Output
- Auftretene Alarmierungen werden verarbeitet. (IDS)
- Bei Treffern können die Pakete verworfen (IPS).
Multitreadverarbeitung durch Suricata
Bild: Alexander Hosfeld Lizenz(en): Creative Commons Namensnennung
Installation
- sudo apt -y install software-properties-common
- sudo add-apt-repository ppa:oisf/suricata-stable
- sudo apt update
- sudo apt -y install suricata
Install Rules
- wget http://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz
- tar zxvf emerging.rules.tar.gz
- cd rules
- cat *.rules > /etc/suricata/rules/suricata.rules
Suricata config
- add to /etc/suricata/suricata.yaml
rule-files:
- suricata.rules - local.rules
IDS
Local Rules
- cat /etc/suricata/rules/local.rules
alert icmp any any -> any any (msg:"ICMP Snort Test"; sid:1000000002;) alert tcp any any -> any any (flags: S; msg: "SYN packet"; sid:100000003;)
- suricata -i eth1
IPS
Local Rules
- cat /etc/suricata/rules/local.rules
drop icmp any any -> 1.1.1.1 any (msg:"Snort Test"; sid:1000000001;) alert icmp any any -> any any (msg:"ICMP Snort Test"; sid:1000000002;)
- suricata -q0
- iptables -I FORWARD -i $WAN -o eth1 -j NFQUEUE
Add iptables rules
- iptables -I FORWARD -m mark ! --mark $MARK/$MASK -j NFQUEUE
Links
- https://www.pro-linux.de/artikel/2/1751/suricata-einbruchserkennung-mit-dem-erdm%C3%A4nnchen.html
- https://www.howtoforge.com/tutorial/suricata-with-elk-and-web-front-ends-on-ubuntu-bionic-beaver-1804-lts/
- https://suricata.readthedocs.io/en/suricata-4.1.0/index.html
- https://suricata.readthedocs.io/en/suricata-5.0.3/setting-up-ipsinline-for-linux.html?highlight=inline
