Suricata Installation: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 13: Zeile 13:
  
 
* '''vim /etc/suricata/suricata.yaml'''
 
* '''vim /etc/suricata/suricata.yaml'''
−
<pre>
 
−
%YAML 1.1
 
−
---
 
−
# Variablen für die Adressgruppen festlegen
 
−
vars:
 
−
  address-groups:
 
−
    LAN: "[172.16.1''xx''.0/24]"
 
−
    DMZ: "[10.0.1''xx''.0/24]"
 
−
    INTERNAL_NET: "[$LAN,$DMZ]"
 
−
    EXTERNAL_NET: "!$INTERNAL_NET"
 
  
−
# Standard-Log-Verzeichnis
+
%YAML 1.1
−
default-log-dir: /var/log/suricata/
+
---
−
 
+
# Variablen für die Adressgruppen festlegen
−
# Statistiken aktivieren
+
vars:
−
stats:
+
  address-groups:
−
  enabled: yes
+
    LAN: "[172.16.1''xx''.0/24]"
−
  interval: 8
+
    DMZ: "[10.0.1''xx''.0/24]"
−
 
+
    INTERNAL_NET: "[$LAN,$DMZ]"
−
# Ausgaben konfigurieren
+
    EXTERNAL_NET: "!$INTERNAL_NET"
−
outputs:
+
−
  - fast:
+
# Standard-Log-Verzeichnis
−
      enabled: yes
+
default-log-dir: /var/log/suricata/
−
      filename: fast.log
+
−
      append: yes
+
# Statistiken aktivieren
−
  - alert-debug:
+
stats:
−
      enabled: yes
+
  enabled: yes
−
      filename: alert-debug.log
+
  interval: 8
−
      append: yes
+
−
  - stats:
+
# Ausgaben konfigurieren
−
      enabled: yes
+
outputs:
−
      filename: stats.log
+
  - fast:
−
      append: yes
+
      enabled: yes
−
      totals: yes
+
      filename: fast.log
−
      threads: no
+
      append: yes
−
 
+
  - alert-debug:
−
# Logging-Einstellungen
+
      enabled: yes
−
logging:
+
      filename: alert-debug.log
−
  default-log-level: notice
+
      append: yes
−
  outputs:
+
  - stats:
−
  - console:
+
      enabled: yes
−
      enabled: yes
+
      filename: stats.log
−
  - file:
+
      append: yes
−
      enabled: yes
+
      totals: yes
−
      level: info
+
      threads: no
−
      filename: suricata.log
+
−
 
+
# Logging-Einstellungen
−
# Netzwerkschnittstellen konfigurieren
+
logging:
−
af-packet:
+
  default-log-level: notice
−
  - interface: enp0s3
+
  outputs:
−
    threads: auto
+
  - console:
−
    cluster-id: 97
+
      enabled: yes
−
    cluster-type: cluster_flow
+
  - file:
−
    defrag: yes
+
      enabled: yes
−
  - interface: enp0s8
+
      level: info
−
    threads: auto
+
      filename: suricata.log
−
    cluster-id: 98
+
−
    cluster-type: cluster_flow
+
# Netzwerkschnittstellen konfigurieren
−
    defrag: yes
+
af-packet:
−
  - interface: enp0s9
+
  - interface: enp0s3
−
    threads: auto
+
    threads: auto
−
    cluster-id: 99
+
    cluster-id: 97
−
    cluster-type: cluster_flow
+
    cluster-type: cluster_flow
−
    defrag: yes
+
    defrag: yes
−
 
+
  - interface: enp0s8
−
# PID-Datei
+
    threads: auto
−
pid-file: /var/run/suricata.pid
+
    cluster-id: 98
−
 
+
    cluster-type: cluster_flow
−
# Coredump-Einstellungen
+
    defrag: yes
−
coredump:
+
  - interface: enp0s9
−
  max-dump: unlimited
+
    threads: auto
−
 
+
    cluster-id: 99
−
# Host-Modus
+
    cluster-type: cluster_flow
−
host-mode: auto
+
    defrag: yes
−
 
+
−
# Unix-Befehlseingabe konfigurieren
+
# PID-Datei
−
unix-command:
+
pid-file: /var/run/suricata.pid
−
  enabled: yes
+
−
  filename: /var/run/suricata-command.socket
+
# Coredump-Einstellungen
−
 
+
coredump:
−
# Engine-Analyse-Einstellungen
+
  max-dump: unlimited
−
engine-analysis:
+
−
  rules-fast-pattern: yes
+
# Host-Modus
−
  rules: yes
+
host-mode: auto
−
 
+
−
# Defragmentierungseinstellungen
+
# Unix-Befehlseingabe konfigurieren
−
defrag:
+
unix-command:
−
  memcap: 32mb
+
  enabled: yes
−
  hash-size: 65536
+
  filename: /var/run/suricata-command.socket
−
  trackers: 65535
+
−
  max-frags: 65535
+
# Engine-Analyse-Einstellungen
−
  prealloc: yes
+
engine-analysis:
−
  timeout: 60
+
  rules-fast-pattern: yes
−
 
+
  rules: yes
−
# Standardregelverzeichnis
+
−
default-rule-path: /etc/suricata/rules
+
# Defragmentierungseinstellungen
−
 
+
defrag:
−
# Regel-Dateien
+
  memcap: 32mb
−
rule-files:
+
  hash-size: 65536
−
  - local.rules
+
  trackers: 65535
−
 
+
  max-frags: 65535
−
# Klassifikationsdatei
+
  prealloc: yes
−
classification-file: /etc/suricata/classification.config
+
  timeout: 60
−
 
+
−
# Referenzkonfigurationsdatei
+
# Standardregelverzeichnis
−
reference-config-file: /etc/suricata/reference.config
+
default-rule-path: /etc/suricata/rules
−
 
+
−
nfq:
+
# Regel-Dateien
−
  mode: repeat
+
rule-files:
−
  repeat-mark: 1
+
  - local.rules
−
  repeat-mask: 1
+
−
                         
+
# Klassifikationsdatei
−
 
+
classification-file: /etc/suricata/classification.config
−
 
+
−
</pre>
+
# Referenzkonfigurationsdatei
 +
reference-config-file: /etc/suricata/reference.config

Version vom 17. September 2023, 20:52 Uhr

Installation

  • sudo apt update
  • sudo apt -y install suricata
  • systemctl stop suricata
  • suricata -V
This is Suricata version 6.0.1 RELEASE

Update Rules

  • suricata-update

Suricata minimale Konfiguration

  • vim /etc/suricata/suricata.yaml
%YAML 1.1
---
# Variablen für die Adressgruppen festlegen
vars:
  address-groups:
    LAN: "[172.16.1xx.0/24]"
    DMZ: "[10.0.1xx.0/24]"
    INTERNAL_NET: "[$LAN,$DMZ]"
    EXTERNAL_NET: "!$INTERNAL_NET"

# Standard-Log-Verzeichnis
default-log-dir: /var/log/suricata/

# Statistiken aktivieren
stats:
  enabled: yes
  interval: 8

# Ausgaben konfigurieren
outputs:
  - fast:
      enabled: yes
      filename: fast.log
      append: yes
  - alert-debug:
      enabled: yes
      filename: alert-debug.log
      append: yes
  - stats:
      enabled: yes
      filename: stats.log
      append: yes
      totals: yes
      threads: no

# Logging-Einstellungen
logging:
  default-log-level: notice
  outputs:
  - console:
      enabled: yes
  - file:
      enabled: yes
      level: info
      filename: suricata.log

# Netzwerkschnittstellen konfigurieren
af-packet:
  - interface: enp0s3
    threads: auto
    cluster-id: 97
    cluster-type: cluster_flow
    defrag: yes
  - interface: enp0s8
    threads: auto
    cluster-id: 98
    cluster-type: cluster_flow
    defrag: yes
  - interface: enp0s9
    threads: auto
    cluster-id: 99
    cluster-type: cluster_flow
    defrag: yes

# PID-Datei
pid-file: /var/run/suricata.pid

# Coredump-Einstellungen
coredump:
  max-dump: unlimited

# Host-Modus
host-mode: auto

# Unix-Befehlseingabe konfigurieren
unix-command:
  enabled: yes
  filename: /var/run/suricata-command.socket

# Engine-Analyse-Einstellungen
engine-analysis:
  rules-fast-pattern: yes
  rules: yes

# Defragmentierungseinstellungen
defrag:
  memcap: 32mb
  hash-size: 65536
  trackers: 65535
  max-frags: 65535
  prealloc: yes
  timeout: 60

# Standardregelverzeichnis
default-rule-path: /etc/suricata/rules

# Regel-Dateien
rule-files:
  - local.rules

# Klassifikationsdatei
classification-file: /etc/suricata/classification.config

# Referenzkonfigurationsdatei
reference-config-file: /etc/suricata/reference.config