1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-25 00:08:49 +00:00
dockerfiles/snort/README.md

47 lines
1.4 KiB
Markdown
Raw Normal View History

2015-09-03 02:08:27 +00:00
snort
=====
2015-09-02 17:58:29 +00:00
![](https://badge.imagelayers.io/vimagick/snort:latest.svg)
2020-06-08 05:20:41 +00:00
[Snort][1] is an open source intrusion prevention system capable of real-time
2015-09-02 17:58:29 +00:00
traffic analysis and packet logging.
2018-08-26 06:55:20 +00:00
```yaml
snort:
image: vimagick/snort
2020-06-08 06:16:46 +00:00
command: -q -c /etc/snort/snort.conf -y -i eth0
2018-08-26 06:55:20 +00:00
volumes:
- ./data/snort.conf:/etc/snort/snort.conf
2020-06-08 06:16:46 +00:00
- ./data/u2json.conf:/etc/snort/u2json.conf
2018-08-26 06:55:20 +00:00
- ./data/rules:/etc/snort/rules
- ./data/log:/var/log/snort
cap_add:
- NET_ADMIN
net: host
restart: unless-stopped
```
2015-09-03 02:08:27 +00:00
2018-08-26 06:55:20 +00:00
```bash
# /etc/snort/rules/local.rules
alert icmp any any -> any any (msg:"ICMP Echo Request"; itype:8; sid:10000;)
alert icmp any any -> any any (msg:"ICMP Echo Reply"; itype:0; sid:10001;)
2015-09-03 02:08:27 +00:00
```
2018-08-26 06:55:20 +00:00
```bash
$ docker-compose up -d
2018-08-26 07:15:42 +00:00
2020-06-08 06:16:46 +00:00
$ docker-compose exec snort idstools-u2json @/etc/snort/u2json.conf --stdout
2018-08-26 07:36:51 +00:00
$ tail -f data/log/alert
snort_1 | 08/26/18-06:47:35.460754 [**] [1:10000:0] ICMP Echo Request [**] [Priority: 0] {ICMP} x.x.x.x -> y.y.y.y
snort_1 | 08/26/18-06:47:35.460835 [**] [1:10001:0] ICMP Echo Reply [**] [Priority: 0] {ICMP} y.y.y.y -> x.x.x.x
2018-08-26 07:15:42 +00:00
$ tcpdump -n -r data/log/snort.log.xxx
06:47:35.460754 IP x.x.x.x > y.y.y.y: ICMP echo request, id 17767, seq 933, length 12
06:47:35.460835 IP y.y.y.y > x.x.x.x: ICMP echo reply, id 17767, seq 933, length 12
2018-08-26 10:48:38 +00:00
2020-06-08 06:16:46 +00:00
$ while :; do inotifywait -q -e modify data/log/alert.json && play -q alert.wav; done
2015-09-03 02:08:27 +00:00
```
2015-09-02 17:58:29 +00:00
[1]: https://snort.org/