Created
August 5, 2014 14:47
-
-
Save jsiwek/2a7692aa9f24e197ca9c to your computer and use it in GitHub Desktop.
ssh-login-watch.bro
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
@load base/frameworks/notice | |
@load base/protocols/ssh | |
module SSH; | |
export { | |
const watched_servers: set[addr] = { | |
192.168.1.100, | |
192.168.1.101, | |
192.168.1.102, | |
} &redef; | |
redef enum Notice::Type += { | |
Watched_Login | |
}; | |
} | |
redef Notice::emailed_types += { Watched_Login }; | |
event heuristic_successful_login(c: connection) | |
{ | |
if ( c$id$resp_h in watched_servers ) | |
NOTICE([$note=Watched_Login, | |
$msg=fmt("Possible SSH login to watched server: %s:%s", | |
c$id$resp_h, c$id$resp_p), | |
$conn=c]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment