-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbeats-conf.conf
133 lines (120 loc) · 2.95 KB
/
beats-conf.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
input {
beats {
port => 5044
}
}
filter{
if [sensor_name] == "dionaea"{
json{
source => message
}
mutate {
rename => {
"dst_ip" => "dest_ip"
}
gsub => [
"src_ip", "::ffff:", "",
"dest_ip", "::ffff:", ""
]
}
if [credentials] {
mutate {
add_field => {
"username_dionaea" => "%{[credentials][username]}"
"password_dionaea" => "%{[credentials][password]}"
}
}
}
}
if [sensor_name] == "cowrie"{
json{
source => message
}
date {
match => [ "timestamp", "ISO8601" ]
}
if [src_ip] {
mutate {
add_field => {
"src_host" => "%{src_ip}"
}
rename => {
"protocol" => "connection.protocol"
}
}
dns {
reverse => [ "src_host" ]
nameserver => [ "8.8.8.8", "8.8.4.4" ]
action => "replace"
hit_cache_size => 4096
hit_cache_ttl => 900
failed_cache_size => 512
failed_cache_ttl => 900
}
}
}
if [sensor_name] == "malware" {
json {
source => message
}
date{
match => [ "timestamp", "ISO8601" ]
}
}
if [src_ip] {
geoip {
cache_size => 10000
source => "src_ip"
database => "/etc/logstash/vendor/geoip/GeoLite2-City.mmdb"
}
geoip {
cache_size => 10000
source => "src_ip"
database => "/etc/logstash/vendor/geoip/GeoLite2-ASN.mmdb"
}
translate {
refresh_interval => 86400
field => "src_ip"
destination => "ip_rep"
dictionary_path => "/etc/logstash/vendor/geoip/iprep.yaml"
}
}
mutate {
remove_tag => [ "beats_input_codec_plain_applied"]
# cut useless fields added by filebeat, if you use it of course
remove_field => [ "source", "offset", "beat", "message" ]
}
}
output {
elasticsearch {
hosts => ["10.33.109.81:9200"]
index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
}
if [sensor_name] == "malware" {
mongodb {
collection => "malware"
database => "honeypot"
uri => "mongodb://127.0.0.1:27017/honeypot"
codec => "json"
}
}
if [sensor_name] == "cowrie" {
mongodb{
collection => "cowrie"
database => "honeypot"
uri => "mongodb://127.0.0.1:27017/honeypot"
codec => "json"
}
}
if [sensor_name] == "dionaea" {
mongodb{
collection => "dionaea"
database => "honeypot"
uri => "mongodb://127.0.0.1:27017/honeypot"
codec => "json"
}
}
stdout {
codec => rubydebug
}
}