-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/#17820 Add intrusion pipeline
- Loading branch information
1 parent
c1d383e
commit b29061a
Showing
7 changed files
with
227 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
filter { | ||
darklist { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
filter { | ||
if [file_uri] { | ||
ruby { | ||
code => ' | ||
def rb_easy_unescape(str, encoding = Encoding::UTF_8) | ||
str.dup.force_encoding("ASCII-8BIT").gsub(/%((?:\p{XDigit}{2})+)/n) { [$1].pack("H*") }.force_encoding(encoding) | ||
end | ||
event.set("file_uri", rb_easy_unescape(event.get("file_uri"))) | ||
' | ||
} | ||
} | ||
} |
115 changes: 115 additions & 0 deletions
115
resources/templates/default/intrusion_geoenrich.conf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
filter { | ||
if [lan_ip] { | ||
cidr { | ||
address => [ "%{lan_ip}" ] | ||
network => [ "0.0.0.0/32", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7", "127.0.0.0/8", "::1/128","169.254.0.0/16", "fe80::/10","224.0.0.0/4", "ff00::/8","255.255.255.255/32" ] | ||
add_field => { "[src_locality]" => "private" } | ||
} | ||
} | ||
if [wan_ip]{ | ||
cidr { | ||
address => [ "%{wan_ip}" ] | ||
network => [ "0.0.0.0/32", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7", "127.0.0.0/8", "::1/128","169.254.0.0/16", "fe80::/10","224.0.0.0/4", "ff00::/8","255.255.255.255/32" ] | ||
add_field => { "[dst_locality]" => "private" } | ||
} | ||
} | ||
|
||
if [src_locality] != "private" { | ||
geoip { | ||
id => "geoip_city_lan" | ||
source => "lan_ip" | ||
default_database_type => "City" | ||
target => "city_lan" | ||
fields => [COUNTRY_CODE2] | ||
} | ||
geoip { | ||
id => "geoip_asn_lan" | ||
source => "lan_ip" | ||
default_database_type => "ASN" | ||
target => "asn_lan" | ||
fields => [AUTONOMOUS_SYSTEM_ORGANIZATION] | ||
} | ||
} | ||
|
||
if [dst_locality] != "private" { | ||
geoip { | ||
id => "geoip_city_wan" | ||
source => "wan_ip" | ||
default_database_type => "City" | ||
target => "city_wan" | ||
fields => [COUNTRY_CODE2] | ||
} | ||
geoip { | ||
id => "geoip_asn_wan" | ||
source => "wan_ip" | ||
default_database_type => "ASN" | ||
target => "asn_wan" | ||
fields => [AUTONOMOUS_SYSTEM_ORGANIZATION] | ||
} | ||
} | ||
|
||
if [lan_ip] { | ||
if [city_lan][country_code2] { | ||
mutate { | ||
add_field => { "src_country_code" => "%{[city_lan][country_code2]}" } | ||
} | ||
} | ||
if [asn_lan][as_org] { | ||
mutate { | ||
add_field => { "src_asn_name" => "%{[asn_lan][as_org]}" } | ||
} | ||
} | ||
if [src_country_code] { | ||
mutate { | ||
replace => { | ||
"public_ip" => "%{wan_ip}" | ||
"ip_country_code" => "%{src_country_code}" | ||
"lan_ip_country_code" => "%{src_country_code}" | ||
} | ||
} | ||
} | ||
if [src_asn_name] { | ||
mutate { | ||
add_field => { | ||
"lan_ip_as_name" => "%{src_asn_name}" | ||
"ip_as_name" => "%{src_asn_name}" | ||
} | ||
} | ||
} | ||
} | ||
|
||
if [wan_ip]{ | ||
if [city_wan][country_code2] { | ||
mutate { | ||
add_field => { "dst_country_code" => "%{[city_wan][country_code2]}" } | ||
} | ||
} | ||
if [asn_wan][as_org]{ | ||
mutate { | ||
add_field => {"dst_asn_name" => "%{[asn_wan][as_org]}"} | ||
} | ||
} | ||
if [dst_country_code]{ | ||
mutate { | ||
replace => { | ||
"public_ip" => "%{wan_ip}" | ||
"ip_country_code" => "%{dst_country_code}" | ||
"wan_ip_country_code" => "%{dst_country_code}" | ||
} | ||
} | ||
} | ||
if [dst_asn_name]{ | ||
mutate { | ||
replace => { | ||
"wan_ip_as_name" => "%{dst_asn_name}" | ||
"ip_as_name" => "%{dst_asn_name}" | ||
} | ||
} | ||
} | ||
} | ||
|
||
mutate { | ||
remove_field => ["@version","@timestamp", "asn_wan", "asn_lan", "city_wan", "city_lan", "src_country_code", "src_asn_name", "dst_country_code", "dst_asn_name", "src_locality", "dst_locality"] | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
filter { | ||
intrusion { | ||
} | ||
|
||
mutate { | ||
remove_field => ["@version","@timestamp"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
filter { | ||
macvendorsenrich { | ||
path => "<%= @mac_vendors %>" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters