Skip to content

Commit 16ab01f

Browse files
committed
Issue 205 - Switch the sshd monitor to the new parser output
1 parent b196bab commit 16ab01f

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

moz_security/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
44

55
cmake_minimum_required(VERSION 3.0)
6-
project(moz-security VERSION 0.0.5 LANGUAGES C)
6+
project(moz-security VERSION 0.0.6 LANGUAGES C)
77
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mozilla Infrastructure Security Analysis")
88
include(sandbox_module)
99

moz_security/sandboxes/heka/analysis/moz_security_sshd_login_monitor.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ local msg = {
3333
}
3434

3535
function process_message()
36-
local user = read_message("Fields[remote_user]")
37-
local ip = read_message("Fields[remote_addr]")
38-
local city = read_message("Fields[remote_addr_city]")
39-
local country = read_message("Fields[remote_addr_country]")
36+
local user = read_message("Fields[user]")
37+
local ip = read_message("Fields[ssh_remote_ipaddr]")
38+
local city = read_message("Fields[ssh_remote_ipaddr_city]")
39+
local country = read_message("Fields[ssh_remote_ipaddr_country]")
4040

4141
msg.Fields[2].value = string.format("%s logged into bastion from %s", user, ip)
4242
-- If we also have city and country information, append that to the message
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
filename = "moz_security_sshd_login_monitor.lua"
2-
message_matcher = "Logger == 'input.syslog' && Fields[programname] == 'sshd' && Fields[sshd_authmsg] == 'Accepted'"
2+
message_matcher = "Logger == 'input.syslog' && Fields[programname] == 'sshd' && Fields[authmsg] == 'Accepted'"
33
ticker_interval = 0
44
process_message_inject_limit = 1

moz_security/tests/hindsight/run/input/generate_sshd.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ local msg = {
1818
Timestamp = nil,
1919
Logger = "input.syslog",
2020
Fields = {
21-
programname = "sshd",
22-
sshd_authmsg = "Accepted",
23-
remote_user = "",
24-
remote_addr = ""
21+
programname = "sshd",
22+
authmsg = "Accepted",
23+
user = "",
24+
ssh_remote_ipaddr = ""
2525
}
2626
}
2727

2828
function process_message()
2929
for i,v in ipairs(tests) do
3030
msg.Uuid = v[1]
31-
msg.Fields.remote_user = v[2]
32-
msg.Fields.remote_addr = v[3]
33-
geo.add_geoip(msg, "remote_addr")
31+
msg.Fields.user = v[2]
32+
msg.Fields.ssh_remote_ipaddr = v[3]
33+
geo.add_geoip(msg, "ssh_remote_ipaddr")
3434
inject_message(msg)
3535
end
3636
return 0

0 commit comments

Comments
 (0)