forked from TravisFSmith/SweetSecurity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogstash.conf
94 lines (90 loc) · 2.61 KB
/
logstash.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
input {
#stdin { }
file {
path => "/opt/nsm/bro/logs/current/*.log"
sincedb_path => "/opt/nsm/bro/logs/current/*.log"
start_position => "beginning"
}
}
filter {
if [message] =~ /^(\d+\.\d{6}\s+\S+\s+(?:[\d\.]+|[\w:]+|-)\s+(?:\d+|-)\s+(?:[\d\.]+|[\w:]+|-)\s+(?:\d+|-)\s+\S+\s+\S+\s+\S+\s+\S+\s+[^:]+::\S+\s+[^:]+::\S+\s+\S+(?:\s\S+)*$)/ {
grok{
patterns_dir => "/etc/logstash/custom_patterns"
match => {
message => "%{291009}"
}
add_field => [ "rule_id", "291009" ]
add_field => [ "Device Type", "IPSIDSDevice" ]
add_field => [ "Object", "Process" ]
add_field => [ "Action", "General" ]
add_field => [ "Status", "Informational" ]
}
}
translate {
field => "evt_dstip"
destination => "tor_IP"
dictionary_path => '/etc/logstash/translate/torIP.yaml'
}
translate {
field => "evt_srcip"
destination => "tor_IP"
dictionary_path => '/etc/logstash/translate/torIP.yaml'
}
translate {
field => "evt_dstip"
destination => "malicious_IP"
dictionary_path => '/etc/logstash/translate/maliciousIP.yaml'
}
translate {
field => "evt_srcip"
destination => "malicious_IP"
dictionary_path => '/etc/logstash/translate/maliciousIP.yaml'
}
date {
match => [ "start_time", "UNIX" ]
}
}
output {
stdout {
codec => rubydebug
}
if [tor_IP] == "YES" {
email {
address => "SMTP_HOST"
from => "EMAIL_USER"
htmlbody => "Traffic has been detected coming from or going to a TOR Exit Node IP address. <br/><br/>
<b>Source IP: </b>%{evt_srcip}<br/>
<b>Source Port: </b>%{evt_srcport}<br/>
<b>Destination IP: </b>%{evt_dstip}<br/>
<b>Destination Port: </b>%{evt_dstport}<br/><br/>
<b>Raw Log: </b>%{message}"
password => "EMAIL_PASS"
port => SMTP_PORT
subject => "Tor Exit IP Detected by SweetSecurity"
to => "EMAIL_USER"
use_tls => true
username => "EMAIL_USER"
}
}
if [malicious_IP] == "YES" {
email {
address => "SMTP_HOST"
from => "EMAIL_USER"
htmlbody => "Traffic has been detected coming from or going to a malicious IP address. <br/><br/>
<b>Source IP: </b>%{evt_srcip}<br/>
<b>Source Port: </b>%{evt_srcport}<br/>
<b>Destination IP: </b>%{evt_dstip}<br/>
<b>Destination Port: </b>%{evt_dstport}<br/><br/>
<b>Raw Log: </b>%{message}"
password => "EMAIL_PASS"
port => SMTP_PORT
subject => "Malicious IP Detected by SweetSecurity"
to => "EMAIL_USER"
use_tls => true
username => "EMAIL_USER"
}
}
elasticsearch {
hosts => localhost
}
}