All Projects → msimerson → Sentry

msimerson / Sentry

Bruteforce attack blocker (ssh, FTP, SMTP, and more)

Programming Languages

perl
6916 projects

Projects that are alternatives of or similar to Sentry

Windowsspyblocker
WindowsSpyBlocker 🛡️ is an application written in Go and delivered as a single executable to block spying and tracking on Windows systems.
Stars: ✭ 2,913 (+4922.41%)
Mutual labels:  blocker, firewall
Cidram
CIDRAM: Classless Inter-Domain Routing Access Manager.
Stars: ✭ 86 (+48.28%)
Mutual labels:  blocker, firewall
React Raven
A simple React component for Sentry integration.
Stars: ✭ 12 (-79.31%)
Mutual labels:  sentry
Basic Firewall
Basic-Firewall is an educational project, using to help me better understood how to write Kernel Modules. This project is a hook to the NetFilters and manipulates the packets going via the network interfaces. Basic-Firewall supporting only IPV-4.
Stars: ✭ 51 (-12.07%)
Mutual labels:  firewall
Venona
Codefresh runtime-environment agent
Stars: ✭ 31 (-46.55%)
Mutual labels:  firewall
Ufw Docker
To fix the Docker and UFW security flaw without disabling iptables
Stars: ✭ 878 (+1413.79%)
Mutual labels:  firewall
Sentry React Native
Official Sentry SDK for react-native
Stars: ✭ 1,032 (+1679.31%)
Mutual labels:  sentry
Sentry Laravel
Laravel SDK for Sentry
Stars: ✭ 927 (+1498.28%)
Mutual labels:  sentry
Sentry
Middleware to integrate with sentry crash reporting.
Stars: ✭ 55 (-5.17%)
Mutual labels:  sentry
Arbitrium Rat
Arbitrium is a cross-platform, fully undetectable remote access trojan, to control Android, Windows and Linux and doesn't require any firewall exceptions or port forwarding rules
Stars: ✭ 938 (+1517.24%)
Mutual labels:  firewall
Pytos
A Python SDK for Tufin Orchestration Suite
Stars: ✭ 49 (-15.52%)
Mutual labels:  firewall
Pywall
Python firewall.
Stars: ✭ 27 (-53.45%)
Mutual labels:  firewall
Sipcheck
SIPCheck is a tool that watch the authentication of users of Asterisk and bans automatically if some user (or bot) try to register o make calls using wrong passwords.
Stars: ✭ 20 (-65.52%)
Mutual labels:  firewall
Xwaf
xWAF 3.0 - Free Web Application Firewall, Open-Source.
Stars: ✭ 48 (-17.24%)
Mutual labels:  firewall
Sentry Python
The new Python SDK for Sentry.io
Stars: ✭ 870 (+1400%)
Mutual labels:  sentry
Iptables Essentials
Iptables Essentials: Common Firewall Rules and Commands.
Stars: ✭ 1,057 (+1722.41%)
Mutual labels:  firewall
Yypbd Delphi Headerporting
Win32 Header Porting
Stars: ✭ 10 (-82.76%)
Mutual labels:  firewall
Pi Hole
A black hole for Internet advertisements
Stars: ✭ 34,076 (+58651.72%)
Mutual labels:  blocker
Botwall4j
A botwall for Java web applications
Stars: ✭ 41 (-29.31%)
Mutual labels:  firewall
Ublock
uBlock: a fast, lightweight, and lean blocker for Chrome, Firefox, and Safari.
Stars: ✭ 8,075 (+13822.41%)
Mutual labels:  blocker

NAME

sentry - safe and effective protection against bruteforce attacks

SYNOPSIS

sentry --ip=N.N.N.N [ --connect | --blacklist | --whitelist | --delist ]
sentry --report [--verbose --ip=N.N.N.N ]
sentry --help
sentry --update

ADDITIONAL DOCUMENTATION

DESCRIPTION

Sentry detects and prevents bruteforce attacks against sshd using minimal system resources.

SAFE

To prevent inadvertant lockouts, Sentry auto-whitelists IPs that have connected more than 3 times and succeeded at least once. Now that forgetful colleague behind the office NAT router won't get us locked out of our system. Again. Nor the admin whose script just failed to login 12 times in 2 seconds.

Sentry includes support for adding IPs to a firewall. Support for IPFW, PF, ipchains is included. Firewall support is disabled by default. Firewall rules may terminate existing session(s) to the host (attn. IPFW users). Get your IPs whitelisted (connect 3x or use --whitelist) before enabling the firewall option.

SIMPLE

Sentry is written in perl, which is installed nearly everywhere you find sshd. It has no dependencies. Installation and deployment is extremely simple.

FLEXIBLE

Sentry supports blocking connection attempts using tcpwrappers and several popular firewalls. It is easy to extend sentry to support additional blocking lists.

Sentry was written to protect the SSH daemon but also blocks on FTP and MUA logs. As this was written, the primary attack platform in use is bot nets comprised of exploited PCs on high-speed internet connections. These bots are used for carrying out SSH attacks as well as spam delivery. Blocking bots prevents multiple attack vectors.

The programming style of sentry makes it easy to insert code for additonal functionality.

EFFICIENT

The primary goal of Sentry is to minimize the resources an attacker can steal, while consuming minimal resources itself. Most bruteforce blocking apps (denyhosts, fail2ban, sshdfilter) expect to run as a daemon, tailing a log file. That requires a language interpreter to always be running, consuming at least 10MB of RAM. A single hardware node with dozens of virtual servers will lose hundreds of megs to daemon protection. Sentry uses resources only when connections are made.

Once an IP is blacklisted for abuse, whether by tcpd or a firewall, the resources it can consume are practically zero.

REQUIRED ARGUMENTS

  • ip

    An IP address. The IP should come from a reliable source that is difficult to spoof. Tcpwrappers is an excellent source. UDP connections are a poor source as they are easily spoofed. The log files of TCP daemons can be good source if they are parsed carefully to avoid log injection attacks.

All actions except report and help require an IP address. The IP address can be manually specified by an administrator, or preferably passed in by a TCP server such as tcpd (tcpwrappers), inetd, or tcpserver (daemontools).

ACTIONS

  • blacklist

    deny all future connections

  • whitelist

    whitelist all future connections, remove the IP from the blacklists, and make it immune to future connection tests.

  • delist

    remove an IP from the white and blacklists. This is useful for testing that sentry is working as expected.

  • connect

    register a connection by an IP. The connect method will log the attempt and the time. See CONNECT.

  • update

    Check the most recent version of sentry against the installed version and update if a newer version is available. This is most reliable when LWP::UserAgent is installed.

EXAMPLES

See https://github.com/msimerson/sentry/wiki/Examples

NAUGHTY

Sentry has flexible rules for what constitutes a naughty connection. For SSH, attempts to log in as an invalid user are considered naughty. See the configuration section in the script related settings.

CONNECT

When new connections arrive, the connect method will log the attempt and the time. If the IP is white or blacklisted, sentry exits immediately.

Next, sentry checks to see if the IP has been seen more than 3 times. If so, check the logs for successful, failed, and naughty attempts from that IP. If there are any successful logins, whitelist the IP and exit.

If there are no successful logins and there are naughty ones, blacklist the IP. If there are no successful and no naughty attempts but more than 10 connection attempts, blacklist the IP. See also NAUGHTY.

CONFIGURATION AND ENVIRONMENT

There is a very brief configuration section at the top of the script. Once your IP is whitelisted, update the booleans for your firewall preference and Sentry will update your firewall too.

Sentry does NOT make changes to your firewall configuration. It merely adds IPs to a table/list/chain. It does this dynamically and it is up to the firewall administrator to add a rule that does whatever you'd like with the IPs in the sentry table.

See also: PF

DIAGNOSTICS

Sentry can be run with --verbose which will print informational messages as it runs.

DEPENDENCIES

Sentry uses only modules built into perl. Additional modules may be used in the future but Sentry will not depend upon them. In other words, if you extend Sentry with modules are aren't built-ins, also include a fallback method.

BUGS AND LIMITATIONS

The IPFW and ipchains code is barely tested.

Report problems to author.

AUTHOR

Matt Simerson (@msimerson)

ACKNOWLEDGEMENTS

Those who came before me: denyhosts, fail2ban, sshblacklist, et al

LICENCE AND COPYRIGHT

Copyright (c) 2015 The Network People, Inc. http://www.tnpi.net/

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].