Sainaimu

Sainaimu logo

Automated SSH request blocker for ufw (Uncomplicated Firewall).

Dependencies

Configuration

The default configuration file is ~/Configuration.json. If this file doesn't exist, it'll be created for you using the template below.

{
"FailCount": 5,
"AllowedIPAddresses": [ "" ],
"BlockType": "Deny",
}

If any syntax error occurs in the configuration file, the program will fail to run, and the line/character in question will be highlighted.

FailCount

"FailCount": 5

Any numeric value (in the bounds of an unsigned, standard Python integer) can be placed here.

AllowedIPAddresses

"AllowedIPAddresses": [
"241.225.138.8",
"159.124.142.51",
]

IP addresses placed as values here are whitelisted from being blocked. Therefore, no addresses here will be blocked from server access no matter the amount of times they fail to logon.

Multiple addresses can be placed here (as seen in the example).

BlockType

"BlockType": "Deny"

There are two possible values: Deny and Reject. You can read about the difference between the two types here.


You can download Sainaimu with the source code here.