Agreed, an integration with Skynet would be awesome. I have a question in regards to maintaining Suricata and keeping up with their latest release. Did you do any testing with version 5.03?It's a great idea. Many desire ease. The problem is to maintain. My suggestion is to integrate Skynet, as an addon or even a Skynet+Suricata merger, fully maintained by Adamm. I don't want to interfere with the script. I help where possible, testing and suggesting. I am an admirer of the works of @Adamm. My influence.
Check the stats.log file, it's updated every 8sec. \var\log\suricata\stats.logWondering how don’t check the status ,see if it’s running ?
also just do aCheck the stats.log file, it's updated every 8sec. \var\log\suricata\stats.log
If the values increase it is working. Here is a link to the users guide:
I was wondering the same thing. The manual says to create a rotation file with these parameters:@rgnldo is there proper rotation of the stats.log file?
/var/log/suricata/stats.log /var/log/suricata/statslog.json
{
rotate 3
missingok
nocompress
create
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/suricata.pid 2>/dev/null` 2>/dev/null || true
endscript
}
I was wondering the same thing. The manual says to create a rotation file with these parameters:
Code:/var/log/suricata/stats.log /var/log/suricata/statslog.json { rotate 3 missingok nocompress create sharedscripts postrotate /bin/kill -HUP `cat /var/run/suricata.pid 2>/dev/null` 2>/dev/null || true endscript }
Yes. Excellent. New rules. Liked it.Did you do any testing with version 5.03?
Yes. Excellent. New rules. Liked it.
- stats:
enabled: no
filename: stats.log
interval: 10
append: no
- syslog:
enabled: yes
identity: suricata
facility: local1
level: notice
# Logging configuration. This is not about logging IDS alerts, but
# IDS output about what its doing, errors, etc.
logging:
# This value is overriden by the SC_LOG_LEVEL env var.
default-log-level: info
# Define your logging outputs.
outputs:
- console:
enabled: no
- file:
enabled: no
filename: /opt/var/log/suricata/suricata.log
- syslog:
enabled: yes
facility: off
Jun 19 08:38:12 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata
Jun 20 14:05:56 myrouter suricata[2780]: [1:2017919:2] ET DOS Possible NTP DDoS Inbound Frequent Un-Authed MON_LIST Requests IMPL 0x03 [Classification: Attempted Denial of Service] [Priority: 2] {UDP} 193.29.15.169:47346 -> aaa.zzz.yyy.xxx:123
Jun 22 12:35:07 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata
Jun 22 17:57:59 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata
Jun 22 17:58:12 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata
Jun 22 18:03:52 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata
Jun 22 18:12:22 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata
Jun 22 18:12:34 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata
Jun 22 18:12:36 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata
Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Notice> - This is Suricata version 4.1.8 RELEASE
Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - CPUs/cores online: 2
Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - Found an MTU of 1500 for 'eth0'
Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - Found an MTU of 1500 for 'eth0'
Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Warning> - [ERRCODE: SC_WARN_DEFAULT_WILL_CHANGE(317)] - in 5.0 the default for decoder event stats will go from 'decoder.<proto>.<event>' to 'decoder.event.<proto>.<event>'. See ticket #2225. To suppress this message, set stats.decoder-events-prefix in the yaml.
Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - fast output device (regular) initialized: fast.log
Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - stats output device (regular) initialized: stats.log
Jun 22 18:12:38 myrouter suricata[8631]: 22/6/2020 -- 18:12:38 - <Info> - Syslog output initialized
Jun 22 18:12:38 myrouter suricata[8631]: 22/6/2020 -- 18:12:38 - <Info> - 17 rule files processed. 2323 rules successfully loaded, 0 rules failed
Jun 22 18:12:38 myrouter suricata[8631]: 22/6/2020 -- 18:12:38 - <Info> - Threshold config parsed: 0 rule(s) found
Jun 22 18:12:38 myrouter suricata[8631]: 22/6/2020 -- 18:12:38 - <Info> - 2323 signatures processed. 208 are IP-only rules, 440 are inspecting packet payload, 1751 inspect application layer, 0 are decoder event only
Jun 22 18:12:41 myrouter suricata[8631]: 22/6/2020 -- 18:12:41 - <Info> - Going to use 2 thread(s)
Jun 22 18:12:41 myrouter suricata[8631]: 22/6/2020 -- 18:12:41 - <Notice> - all 2 packet processing threads, 4 management threads initialized, engine started.
Jun 22 18:12:42 myrouter suricata[8631]: 22/6/2020 -- 18:12:42 - <Info> - All AFP capture threads are running.
Jun 22 18:15:02 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata
Jun 22 18:15:02 myrouter suricata[8631]: 22/6/2020 -- 18:15:02 - <Notice> - Signal Received. Stopping engine.
Jun 22 18:15:02 myrouter suricata[8631]: 22/6/2020 -- 18:15:02 - <Info> - time elapsed 140.501s
Jun 22 18:15:04 myrouter suricata[8631]: 22/6/2020 -- 18:15:04 - <Info> - Alerts: 0
Jun 22 18:15:04 myrouter suricata[8631]: 22/6/2020 -- 18:15:04 - <Info> - cleaning up signature grouping structure... complete
Jun 22 18:15:04 myrouter suricata[8631]: 22/6/2020 -- 18:15:04 - <Notice> - Stats for 'eth0': pkts: 41926, drop: 0 (0.00%), invalid chksum: 0
Jun 20 14:05:56 myrouter suricata[2780]: [1:2017919:2] ET DOS Possible NTP DDoS Inbound Frequent Un-Authed MON_LIST Requests IMPL 0x03 [Classification: Attempted Denial of Service] [Priority: 2] {UDP} 193.29.15.169:47346 -> aaa.zzz.yyy.xxx:123
Very goodwell core system suricata info to syslog. Hope others find it helpful. This also will address the log rotation questions.
Yeah, I need to push out 2.4.3 There's enough little stuff now. Nothing big though.
For the logging/loggers out there, here's what I have in my yaml file.
Code:- stats: enabled: no filename: stats.log interval: 10 append: no - syslog: enabled: yes identity: suricata facility: local1 level: notice
I want to know about errors and what it's doing and care less about stats every x mins, so I changed this to send to syslog instead.
Code:# Logging configuration. This is not about logging IDS alerts, but # IDS output about what its doing, errors, etc. logging: # This value is overriden by the SC_LOG_LEVEL env var. default-log-level: info # Define your logging outputs. outputs: - console: enabled: no - file: enabled: no filename: /opt/var/log/suricata/suricata.log - syslog: enabled: yes facility: off
For those using scribe/logrotate, I've added the two files to @cmkelley gamma branch:
It gives me a nice pipe and shows....
- https://raw.githubusercontent.com/cynicastic/scribe/gamma/syslog-ng.share/suricata
- https://raw.githubusercontent.com/cynicastic/scribe/gamma/logrotate.share/suricata
Code:Jun 19 08:38:12 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata Jun 20 14:05:56 myrouter suricata[2780]: [1:2017919:2] ET DOS Possible NTP DDoS Inbound Frequent Un-Authed MON_LIST Requests IMPL 0x03 [Classification: Attempted Denial of Service] [Priority: 2] {UDP} 193.29.15.169:47346 -> aaa.zzz.yyy.xxx:123 Jun 22 12:35:07 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata Jun 22 17:57:59 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata Jun 22 17:58:12 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata Jun 22 18:03:52 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata Jun 22 18:12:22 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata Jun 22 18:12:34 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata Jun 22 18:12:36 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Notice> - This is Suricata version 4.1.8 RELEASE Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - CPUs/cores online: 2 Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - Found an MTU of 1500 for 'eth0' Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - Found an MTU of 1500 for 'eth0' Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Warning> - [ERRCODE: SC_WARN_DEFAULT_WILL_CHANGE(317)] - in 5.0 the default for decoder event stats will go from 'decoder.<proto>.<event>' to 'decoder.event.<proto>.<event>'. See ticket #2225. To suppress this message, set stats.decoder-events-prefix in the yaml. Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - fast output device (regular) initialized: fast.log Jun 22 18:12:38 myrouter suricata: 22/6/2020 -- 18:12:38 - <Info> - stats output device (regular) initialized: stats.log Jun 22 18:12:38 myrouter suricata[8631]: 22/6/2020 -- 18:12:38 - <Info> - Syslog output initialized Jun 22 18:12:38 myrouter suricata[8631]: 22/6/2020 -- 18:12:38 - <Info> - 17 rule files processed. 2323 rules successfully loaded, 0 rules failed Jun 22 18:12:38 myrouter suricata[8631]: 22/6/2020 -- 18:12:38 - <Info> - Threshold config parsed: 0 rule(s) found Jun 22 18:12:38 myrouter suricata[8631]: 22/6/2020 -- 18:12:38 - <Info> - 2323 signatures processed. 208 are IP-only rules, 440 are inspecting packet payload, 1751 inspect application layer, 0 are decoder event only Jun 22 18:12:41 myrouter suricata[8631]: 22/6/2020 -- 18:12:41 - <Info> - Going to use 2 thread(s) Jun 22 18:12:41 myrouter suricata[8631]: 22/6/2020 -- 18:12:41 - <Notice> - all 2 packet processing threads, 4 management threads initialized, engine started. Jun 22 18:12:42 myrouter suricata[8631]: 22/6/2020 -- 18:12:42 - <Info> - All AFP capture threads are running. Jun 22 18:15:02 myrouter S82suricata: Starting Suricata IDS/IPS /opt/etc/init.d/S82suricata Jun 22 18:15:02 myrouter suricata[8631]: 22/6/2020 -- 18:15:02 - <Notice> - Signal Received. Stopping engine. Jun 22 18:15:02 myrouter suricata[8631]: 22/6/2020 -- 18:15:02 - <Info> - time elapsed 140.501s Jun 22 18:15:04 myrouter suricata[8631]: 22/6/2020 -- 18:15:04 - <Info> - Alerts: 0 Jun 22 18:15:04 myrouter suricata[8631]: 22/6/2020 -- 18:15:04 - <Info> - cleaning up signature grouping structure... complete Jun 22 18:15:04 myrouter suricata[8631]: 22/6/2020 -- 18:15:04 - <Notice> - Stats for 'eth0': pkts: 41926, drop: 0 (0.00%), invalid chksum: 0
@rgnldo - so with that I get alerts (from fast.log) as well core system suricata info to syslog. Hope others find it helpful. This also will address the log rotation questions....
Also @Adamm here is a sample Suricata detection that I was thinking can be "read/parsed" and block the offending IP if only temporarily until next router reboot (for example).
Code:Jun 20 14:05:56 myrouter suricata[2780]: [1:2017919:2] ET DOS Possible NTP DDoS Inbound Frequent Un-Authed MON_LIST Requests IMPL 0x03 [Classification: Attempted Denial of Service] [Priority: 2] {UDP} 193.29.15.169:47346 -> aaa.zzz.yyy.xxx:123
We depend on entware packages. Is safer. The rest is easy. Any of you can help.
also just do a
ps w
should see this somewhere
16315 admin 784m S {Suricata-Main} suricata -c /opt/etc/suricata/suricata.yaml --af-packet
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!