### [Fail2Ban](http://www.fail2ban.org/wiki/index.php/Main_Page) monitors log files to determine if someone who is trying to gain access is a legitimate user. If they aren't, they get banned temporarily by their IP address. Policies can be setup in conjunction with a firewall to log failed access attempts and drop traffic for a period of time, preventing a would-be attacker from even attempting to access your services. <center><img src="http://www.steemimg.com/images/2016/12/03/fail2ban-logo4341e.jpg" alt="fail2ban-logo4341e.jpg" border="0"></center> <center><em>[source](http://codelog.climens.net/2011/02/13/using-fail2ban-with-nginx-in-debian/)</em></center> This is a continuation from 3 previous parts: - [Secure Your Linux Server with a Firewall](https://steemit.com/cybersecurity/@krnel/secure-your-linux-server-with-a-firewall) - [Setting Up A Linux VPS Securely (Pt.2)](https://steemit.com/cybersecurity/@krnel/setting-up-a-linux-vps-securely-pt-2) - [Setting Up A Linux VPS Securely (Pt.1)](https://steemit.com/witness-category/@krnel/setting-up-a-linux-vps-securely-pt-1-join-me-on-my-journey-to-become-a-witness) --- # Installation ```sudo apt-get update``` ```sudo apt-get install fail2ban``` ```sudo apt-get install sendmail``` (optional) Together: ```sudo apt-get install fail2ban sendmail``` Given the previous guide for UFW being done, turn it on and allow ssh as an example. ``` ufw enable ufw allow ssh ``` --- # Configuration Here is where the config is located: ```/etc/fail2ban/jail.conf``` We don't edit that file though. We make a copy and comment out the contents like so: ```awk '{ printf "# "; print; }' /etc/fail2ban/jail.conf | sudo tee /etc/fail2ban/jail.local``` This file ```jail.local``` will override the defaults in ```jail.conf```, so we just add any changes there instead. Let's see how the original file looks: ```sudo nano /etc/fail2ban/jail.conf``` # Editing configuration If you want to exempt your own IP from multiple login security, open: ```sudo nano /etc/fail2ban/jail.local``` and add somewhere in the the following (or you can uncomment each section by removing the #): ``` [DEFAULT] ignoreip = 127.0.0.1/8 123.45.67.89 ``` 127... is for the local server itself, and then 123... is an example of your own IP. This applies to all jails for all programs. If you want to whitelist an IP per jail section, like ```ssh```, use the command: ```fail2ban-client set ssh addignoreip 123.45.67.89 ``` ## Bans If you want to change how long an IP is banned for, the time interval to check for login attempt failures, or the maximum login attempt limit, then add and change the ```bantime```, ```findtime``` and ```maxretry``` parameters. ## Emails If you want to setup email delivery of alerts from Fail2ban: ``` # ACTIONS destemail = yourEmail@domain.com sendername = Fail2Ban sender = admin@server.com mta = sendmail ``` Then add: ```action = $(action_)s``` where you replace ```action_``` with either: - ```action_mw``` for email alerts or - ```action_mwl``` for w/ relevant log lines # Jail Configuration Apart from those main settings, are the individual service settings, like for SSH. You can look through to see what services are filtered by default. Failregexs - these are custom filters you can make with regular expression matches that scan log files for attempted intruders. I suggest you google more into this feature and regex to learn more if you want to. Regex is powerful. This command will tell you if fail2ban is running: ```sudo fail2ban-client status``` Apart from ```status```, there is also the ```stop and``` ```start``` command on the service, or ```restart``` to reload the configuration alone. And then reload the changes made in the config file with: ```sudo fail2ban-client reload``` # Done That's it. Now if anyone tries to login to your ssh configured port, and fail to enter the password three times, their IP will be banned. If you didn't add your own IP to the configuration earlier, then you will also get banned if you fail to login after 3 attempts. --- ## Recap summary: ```sudo apt-get update``` ```sudo apt-get -y install fail2ban sendmail``` ```awk '{ printf "# "; print; }' /etc/fail2ban/jail.conf | sudo tee /etc/fail2ban/jail.local``` ```sudo nano /etc/fail2ban/jail.local``` Add exemption for your IP (either add the lines or uncomment, and edit), and the email if you want to receive: ``` [DEFAULT] ignoreip = 127.0.0.1/8 123.45.67.89 destemail = yourEmail@domain.com sendername = Fail2Ban sender = admin@server.com mta = sendmail ``` #### Reload and Done ```sudo fail2ban-client reload``` ```sudo fail2ban-client status``` You should see: ``` krnel@steembuntu:~$ sudo fail2ban-client status Status |- Number of jail: 1 `- Jail list: sshd ``` If not, go back into the original ```/etc/fail2ban/jail.conf``` and add a line under the [ssh] section: ```enabled = true``` Then do this again: ```sudo fail2ban-client reload``` ```sudo fail2ban-client status``` That should do it. If not, try to troubleshoot with the below section: --- --- ### If that doesn't work... or for whatever reason you want only what you need in the file, put in all these values in a new config ```/etc/fail2ban/jail.local```: ``` [INCLUDES] before = paths-debian.conf [DEFAULT] ignoreip = 127.0.0.1/8 123.45.67.89 ignorecommand = bantime = 600 findtime = 600 maxretry = 5 backend = auto usedns = warn logencoding = auto enabled = false filter = %(__name__)s ``` Add your email if you want: ``` destemail = yourEmail@domain.com sendername = Fail2Ban sender = admin@server.com mta = sendmail ``` ``` protocol = tcp chain = INPUT port = 0:65535 banaction = iptables-multiport action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"] action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"] %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"] action_mwl = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"] %(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"] action_xarf = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"] xarf-login-attack[service=%(__name__)s, sender="%(sender)s", logpath=%(logpath)s, port="%(port)s"] action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"] %(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"] action_blocklist_de = blocklist_de[email="%(sender)s", service=%(filter)s, apikey="%(blocklist_de_apikey)s"] action_badips = badips.py[category="%(name)s", banaction="%(banaction)s"] action = %(action_mw)s ``` ``` [sshd] enabled = true port = ssh logpath = %(sshd_log)s [sshd-ddos] # This jail corresponds to the standard configuration in Fail2ban. # The mail-whois action send a notification e-mail with a whois request # in the body. port = ssh logpath = %(sshd_log)s ``` If you want to enable jailing on individual services, for example in the ```[ssh]``` section, add that section to the ```jail.local``` file and add or uncomment the section as well. Uncomment any section you want to have fail2ban enabled on, or copy and paste it at the end with the other additions, if that's what you already did. #### Reload and Done ```sudo fail2ban-client reload``` ```sudo fail2ban-client status``` --- Ok. That's it. The last section was only required if you want a cleaner file, with less filters running. You will have to add the filters you need as you need them though, since they won't be enabled by default any longer, such as HTTP for a web server fail2ban protection. I hope the tutorial was of use to you. ---- #### Thank you for your time and attention! I appreciate the knowledge reaching more people. Take care. Peace. <center><img src="http://i.imgur.com/LwhouOq.gif" /><img src="http://i.imgur.com/X7bllkJ.png" /> <strong>Payout Selected</strong></center> --- [References: [1](http://www.fail2ban.org/wiki/index.php/MANUAL_0_8), [2](https://www.digitalocean.com/community/tutorials/how-to-protect-ssh-with-fail2ban-on-ubuntu-14-04), [3](https://www.linode.com/docs/security/using-fail2ban-for-security)] --- If you appreciate and value the content, please consider: Upvoting <img src="https://www.steemimg.com/images/2016/08/30/upvote91a69.png" alt="upvote91a69.png" /> , Sharing <img src="https://www.steemimg.com/images/2016/08/30/share2195b.png" alt="share2195b.png" /> **and** Reblogging <img src="https://www.steemimg.com/images/2016/09/19/reblog33b5f.png" alt="reblog33b5f.png" /> **below**. [](https://steemit.com/@krnel) me for more content to come! --- @krnel 2016-12-04, 10am
author | krnel |
---|---|
permlink | secure-your-linux-server-with-fail2ban |
category | cybersecurity |
json_metadata | {"tags":["cybersecurity","firewall","linux","howto","tutorial"],"users":["krnel"],"image":["http://www.steemimg.com/images/2016/12/03/fail2ban-logo4341e.jpg","http://i.imgur.com/LwhouOq.gif","http://i.imgur.com/X7bllkJ.png","https://www.steemimg.com/images/2016/08/30/upvote91a69.png","https://www.steemimg.com/images/2016/08/30/share2195b.png","https://www.steemimg.com/images/2016/09/19/reblog33b5f.png","https://www.steemimg.com/images/2016/08/30/follow2be5e.png"],"links":["http://www.fail2ban.org/wiki/index.php/Main_Page","http://codelog.climens.net/2011/02/13/using-fail2ban-with-nginx-in-debian/","https://steemit.com/cybersecurity/@krnel/secure-your-linux-server-with-a-firewall","https://steemit.com/cybersecurity/@krnel/setting-up-a-linux-vps-securely-pt-2","https://steemit.com/witness-category/@krnel/setting-up-a-linux-vps-securely-pt-1-join-me-on-my-journey-to-become-a-witness","http://www.fail2ban.org/wiki/index.php/MANUAL_0_8","https://www.digitalocean.com/community/tutorials/how-to-protect-ssh-with-fail2ban-on-ubuntu-14-04","https://www.linode.com/docs/security/using-fail2ban-for-security","https://steemit.com/@krnel"],"app":"steemit/0.1","format":"markdown"} |
created | 2016-12-04 15:00:06 |
last_update | 2016-12-04 15:06:42 |
depth | 0 |
children | 8 |
last_payout | 2017-01-04 15:36:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 25.776 HBD |
curator_payout_value | 1.675 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 9,102 |
author_reputation | 1,343,547,270,297,082 |
root_title | "Secure Your Linux Server with Fail2Ban" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 1,914,468 |
net_rshares | 61,502,361,898,532 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
barrie | 0 | 360,266,188,828 | 100% | ||
neogen1 | 0 | 569,176,689,183 | 100% | ||
hermes | 0 | 601,635,168,092 | 100% | ||
hermes-miner | 0 | 724,731,521,588 | 100% | ||
thorium1 | 0 | 413,210,693,129 | 100% | ||
thorium2 | 0 | 361,853,282,130 | 100% | ||
datasecuritynode | 0 | 6,017,357,749,272 | 100% | ||
bunkermining | 0 | 430,661,329,592 | 100% | ||
xeldal | 0 | 8,865,974,489,108 | 100% | ||
bitshares.org | 0 | 185,285,671,215 | 100% | ||
blockchainbunker | 0 | 122,557,976,230 | 100% | ||
enki | 0 | 5,507,062,189,693 | 100% | ||
blocktech | 0 | 44,085,272,801 | 100% | ||
neominer2016 | 0 | 11,521,743,237 | 100% | ||
abderus | 0 | 183,219,941,432 | 100% | ||
olympus-steemy | 0 | 7,952,815,528 | 100% | ||
hephaestus | 0 | 202,645,967,584 | 100% | ||
aquarius.com | 0 | 101,863,935,489 | 100% | ||
minosman | 0 | 44,413,033,371 | 100% | ||
aphrodite | 0 | 126,953,492,090 | 100% | ||
hotels.com | 0 | 15,467,335,256 | 100% | ||
aries.com | 0 | 12,763,992,134 | 100% | ||
rabbitminer | 0 | 73,884,175,874 | 100% | ||
insurance.com | 0 | 20,831,866,404 | 100% | ||
fund.com | 0 | 91,523,497,932 | 100% | ||
heracles | 0 | 12,243,942,032 | 100% | ||
bunkerchainlabs | 0 | 18,171,213,653 | 100% | ||
liondani | 0 | 2,219,779,170,245 | 100% | ||
complexring | 0 | 7,952,728,879,026 | 100% | ||
steemychicken1 | 0 | 1,316,624,586,894 | 100% | ||
tigerminer | 0 | 1,470,906,111 | 100% | ||
boombastic | 0 | 462,844,760,198 | 100% | ||
bingo-0 | 0 | 4,880,820,665 | 100% | ||
bingo-1 | 0 | 1,297,698,187 | 100% | ||
benjojo | 0 | 445,294,818,249 | 100% | ||
proctologic | 0 | 108,359,063,134 | 70% | ||
peerplays | 0 | 208,071,224,361 | 100% | ||
apollo | 0 | 15,296,455,863 | 100% | ||
athena | 0 | 9,867,231,342 | 100% | ||
muses | 0 | 1,582,135,245 | 100% | ||
perseus | 0 | 256,721,184 | 100% | ||
proctologic2 | 0 | 1,355,708,004 | 70% | ||
alexgr | 0 | 65,534,045,359 | 100% | ||
piedpiper | 0 | 700,577,297,760 | 100% | ||
valtr | 0 | 16,081,829,688 | 100% | ||
makishart | 0 | 8,727,635,079 | 100% | ||
andzzz | 0 | 1,489,760,035 | 15% | ||
craig-grant | 0 | 596,514,147,065 | 100% | ||
proctologic3 | 0 | 619,111,828 | 70% | ||
leesunmoo | 0 | 943,505,978,175 | 100% | ||
teamsteem | 0 | 174,264,959,413 | 50% | ||
nanzo-scoop | 0 | 1,321,267,852,659 | 100% | ||
hannixx42 | 0 | 46,771,995,969 | 100% | ||
mummyimperfect | 0 | 204,193,715,578 | 100% | ||
tmendieta | 0 | 26,630,258,479 | 100% | ||
klye | 0 | 127,729,937,355 | 100% | ||
murh | 0 | 2,052,653,732 | 15.09% | ||
cryptofunk | 0 | 1,059,585,265 | 6% | ||
dragonslayer109 | 0 | 228,306,809,907 | 100% | ||
ak2020 | 0 | 85,734,231,813 | 100% | ||
mrsteemgarden | 0 | 290,458,199 | 100% | ||
steemgarden | 0 | 290,270,902 | 100% | ||
damien-beverly | 0 | 8,620,798,715 | 50% | ||
justtryme90 | 0 | 135,584,345,306 | 100% | ||
pets | 0 | 275,168,845 | 100% | ||
coinbitgold | 0 | 114,635,216,870 | 100% | ||
applecrisp | 0 | 1,367,282,622 | 20% | ||
juanmiguelsalas | 0 | 36,302,512,614 | 60% | ||
kenny-crane | 0 | 118,770,702,216 | 100% | ||
pangur-ban | 0 | 297,167,288 | 20% | ||
rednetkjh | 0 | 39,814,595,639 | 100% | ||
tee-em | 0 | 8,540,753,338 | 20% | ||
grandpere | 0 | 22,932,482,964 | 70% | ||
unonimity | 0 | 309,343,406 | 100% | ||
mark-waser | 0 | 40,100,075,522 | 100% | ||
horoscope | 0 | 289,405,861 | 100% | ||
geoffrey | 0 | 340,144,953,859 | 100% | ||
crok | 0 | 4,164,525,275 | 100% | ||
emily-cook | 0 | 77,933,443,368 | 100% | ||
mctiller | 0 | 38,211,367,257 | 100% | ||
trevonjb | 0 | 83,153,208,514 | 100% | ||
paul-gillbanks | 0 | 291,854,867 | 100% | ||
jakevanderark | 0 | 32,996,418,208 | 100% | ||
fyrstikken | 0 | 168,423,489,098 | 10% | ||
skapaneas | 0 | 59,235,644,734 | 100% | ||
michaellamden68 | 0 | 1,780,705,703 | 100% | ||
asmolokalo | 0 | 41,721,566,989 | 100% | ||
rubybian | 0 | 55,457,698,788 | 100% | ||
robrigo | 0 | 287,292,486,538 | 100% | ||
yuliana | 0 | 31,456,174,119 | 100% | ||
r4fken | 0 | 31,484,319,805 | 100% | ||
strangerarray | 0 | 27,979,729,593 | 100% | ||
paco | 0 | 94,281,849,096 | 100% | ||
thelindvall | 0 | 10,970,246,614 | 100% | ||
juvyjabian | 0 | 27,674,746,292 | 100% | ||
inertia | 0 | 121,066,361,703 | 100% | ||
creemej | 0 | 45,503,189,432 | 100% | ||
the-future | 0 | 26,882,175,314 | 100% | ||
ellamaeamor | 0 | 346,099,761 | 100% | ||
deanliu | 0 | 98,337,153,733 | 100% | ||
seb | 0 | 764,024,166 | 100% | ||
raymonjohnstone | 0 | 6,131,804,907 | 100% | ||
sokoloffa | 0 | 6,058,437,101 | 100% | ||
whalepool | 0 | 51,281,623 | 100% | ||
carlidos | 0 | 18,563,238,157 | 100% | ||
sergey44 | 0 | 277,483,895 | 100% | ||
marius19 | 0 | 154,157,683,918 | 100% | ||
summonerrk | 0 | 13,459,349,515 | 100% | ||
trisnawati | 0 | 7,851,930,471 | 100% | ||
tommyhansen | 0 | 76,600,778,978 | 100% | ||
spinner | 0 | 2,594,882,964 | 100% | ||
ap2002 | 0 | 96,335,665 | 100% | ||
transhuman | 0 | 1,906,604,948 | 100% | ||
laoyao | 0 | 35,227,044,082 | 100% | ||
allpunk | 0 | 1,443,676,857 | 100% | ||
augur | 0 | 9,742,652,102 | 100% | ||
thisvsthis | 0 | 1,509,981,947,479 | 85% | ||
elena000 | 0 | 277,379,445 | 100% | ||
kurtbeil | 0 | 116,251,201,451 | 100% | ||
velourex | 0 | 17,036,581,945 | 100% | ||
oflyhigh | 0 | 12,098,083,683 | 100% | ||
captainsteem | 0 | 113,832,574 | 100% | ||
numberone | 0 | 4,797,080,189 | 100% | ||
hanshotfirst | 0 | 153,062,690,381 | 100% | ||
bledarus | 0 | 3,716,314,628 | 100% | ||
zeartul | 0 | 57,154,683 | 100% | ||
ioc | 0 | 1,358,677,062,891 | 100% | ||
razberrijam | 0 | 83,936,162 | 15% | ||
philipnbrown | 0 | 1,560,124,142 | 100% | ||
blocho | 0 | 7,475,220,176 | 100% | ||
chinadaily | 0 | 21,140,845,492 | 100% | ||
pjheinz | 0 | 15,208,440,444 | 100% | ||
lemouth | 0 | 44,729,430,365 | 100% | ||
jesus2 | 0 | 112,237,057 | 70% | ||
gokugirl | 0 | 72,228,484 | 100% | ||
lamech-m | 0 | 2,270,873,955 | 50% | ||
almerri | 0 | 19,745,244,706 | 100% | ||
jsantana | 0 | 7,773,875,211 | 50% | ||
samstonehill | 0 | 16,348,310,658 | 100% | ||
jyp | 0 | 137,638,876,564 | 100% | ||
andrewawerdna | 0 | 32,190,955,924 | 100% | ||
mrsteemitbwhale | 0 | 809,424,436 | 100% | ||
leahmchenry | 0 | 25,212,611,355 | 100% | ||
sethlinson | 0 | 2,994,200,623 | 20% | ||
hilarski | 0 | 19,629,624,042 | 20% | ||
oldtimer | 0 | 427,285,459,086 | 100% | ||
inchonbitcoin | 0 | 380,491,975,504 | 100% | ||
dajohns1420 | 0 | 3,987,241,976 | 100% | ||
runridefly | 0 | 4,135,529,597 | 21% | ||
stephenkendal | 0 | 15,868,625,303 | 100% | ||
krnel | 0 | 332,617,684,405 | 100% | ||
pollux.one | 0 | 69,855,881,308 | 100% | ||
carrinm | 0 | 75,678,292,293 | 100% | ||
funkywanderer | 0 | 3,754,983,529 | 100% | ||
richardcrill | 0 | 43,152,936,173 | 100% | ||
blockcodes | 0 | 1,623,040,487 | 100% | ||
steemwatch | 0 | 50,612,605 | 100% | ||
davidjkelley | 0 | 2,146,905,031 | 100% | ||
sponge-bob | 0 | 229,470,177,784 | 100% | ||
kosmatimuc | 0 | 51,207,552 | 100% | ||
digital-wisdom | 0 | 18,261,743,004 | 100% | ||
ethical-ai | 0 | 5,211,106,331 | 100% | ||
dailybitcoinnews | 0 | 18,023,510,744 | 100% | ||
immortalfame | 0 | 13,212,368,992 | 100% | ||
titusfrost | 0 | 15,061,649,300 | 100% | ||
jwaser | 0 | 7,561,641,580 | 100% | ||
tfeldman | 0 | 11,809,742,339 | 100% | ||
bwaser | 0 | 2,629,589,940 | 100% | ||
renzoarg | 0 | 39,316,228,818 | 100% | ||
allyouneedtoknow | 0 | 9,407,133,916 | 100% | ||
jsg | 0 | 105,708,989,463 | 100% | ||
brains | 0 | 233,510,534,709 | 100% | ||
bitcoinparadise | 0 | 7,538,147,655 | 100% | ||
portuguesinha | 0 | 1,318,901,245 | 100% | ||
natsbats | 0 | 71,107,221 | 100% | ||
inphiknit | 0 | 7,670,138,169 | 100% | ||
ksc | 0 | 103,911,503,225 | 100% | ||
t-bot | 0 | 54,096,924 | 100% | ||
ellepdub | 0 | 6,753,471,795 | 100% | ||
arama | 0 | 474,934,984,727 | 100% | ||
herpetologyguy | 0 | 46,161,923,800 | 100% | ||
lllchoselll | 0 | 1,998,109,248 | 100% | ||
morgan.waser | 0 | 4,744,850,278 | 100% | ||
koskl | 0 | 15,996,285,553 | 100% | ||
justusagenstum | 0 | 12,930,344,430 | 100% | ||
lloyddavis | 0 | 13,421,262,982 | 100% | ||
donchate | 0 | 4,004,388,239 | 100% | ||
psych101 | 0 | 1,262,396,810 | 100% | ||
saiku | 0 | 4,046,711,962 | 100% | ||
strong-ai | 0 | 5,189,862,249 | 100% | ||
lifeisamazing | 0 | 972,918,894 | 100% | ||
abdullar | 0 | 1,526,597,071,359 | 80% | ||
bosjaya | 0 | 3,813,924,391 | 100% | ||
before | 0 | 1,376,028,601 | 100% | ||
dianargenti | 0 | 4,824,008,358 | 100% | ||
pinc | 0 | 78,151,738 | 100% | ||
hendrikdegrote | 0 | 7,535,705,442,793 | 100% | ||
soyjoseluis | 0 | 12,126,601,491 | 100% | ||
dgiors | 0 | 49,729,347,104 | 100% | ||
toddemaher1 | 0 | 213,437,626 | 20% | ||
barcisz | 0 | 9,472,881,409 | 100% | ||
aurorax | 0 | 1,099,681,441 | 100% | ||
steem-meme | 0 | 1,303,514,524 | 20% | ||
papergirl | 0 | 4,245,427,766 | 100% | ||
sanghkaang | 0 | 17,235,663,928 | 100% | ||
sunscape | 0 | 7,030,459,444 | 20% | ||
promx | 0 | 141,689,168 | 100% | ||
sochul | 0 | 477,343,055,407 | 100% | ||
goodgirl | 0 | 210,764,861 | 100% | ||
mental | 0 | 172,351,023 | 70% | ||
amat | 0 | 1,718,905,898 | 100% | ||
mokluc | 0 | 41,014,672,008 | 100% | ||
voterinterstpool | 0 | 133,506,858 | 100% | ||
lovethepeople | 0 | 95,035,275 | 70% | ||
porco-bastardo | 0 | 92,347,562 | 70% | ||
adelja | 0 | 169,550,003 | 100% | ||
joanaltres | 0 | 33,557,675,955 | 100% | ||
selwi | 0 | 117,032,290 | 100% | ||
angel76 | 0 | 81,998,365,346 | 100% | ||
stevebj | 0 | 64,407,169 | 100% | ||
trans-juanmi | 0 | 2,603,527,909 | 60% | ||
jfesrom | 0 | 1,967,377,526 | 33% | ||
baerdric | 0 | 18,567,858,422 | 100% | ||
universalsoldier | 0 | 123,679,431 | 100% | ||
doodleman | 0 | 8,733,809,905 | 100% | ||
steempredict | 0 | 100,738,432 | 20% | ||
pavelmenme | 0 | 391,977,154 | 100% | ||
fosho | 0 | 290,263,339 | 50% | ||
grildrig | 0 | 1,141,030,654 | 100% | ||
glyuk | 0 | 639,694,999 | 100% | ||
godzilla | 0 | 108,556,096 | 20% | ||
hopehuggs | 0 | 3,344,046,488 | 100% | ||
vratnik | 0 | 130,356,069 | 100% | ||
ozymandias | 0 | 444,936,784 | 100% | ||
cestlavie | 0 | 1,127,634,587 | 100% | ||
themartian | 0 | 1,236,567,284 | 100% | ||
goldsteem | 0 | 30,931,375,107 | 100% | ||
butan | 0 | 3,055,049,426 | 100% | ||
blackchen | 0 | 96,712,531,358 | 100% | ||
zeitgeist | 0 | 588,406,878 | 100% | ||
technoprogressiv | 0 | 5,000,621,168 | 100% | ||
mafeeva | 0 | 24,920,649,861 | 100% | ||
damiendecoster | 0 | 531,437,699 | 100% | ||
bottymcbotface | 0 | 285,979,691 | 100% | ||
cyonghao | 0 | 578,184,789 | 100% | ||
detshiva | 0 | 212,607,262 | 100% | ||
lindo | 0 | 103,124,143 | 100% | ||
seablue | 0 | 3,271,551,616 | 100% | ||
chappers | 0 | 24,253,452,373 | 100% | ||
asitnm | 0 | 263,700,285 | 100% | ||
cryptofreedom | 0 | 927,197,058 | 100% | ||
shlikanov | 0 | 443,118,520 | 100% | ||
qubes | 0 | 141,591,320,647 | 100% | ||
steemlife10 | 0 | 555,703,941 | 100% | ||
juliosalas | 0 | 684,704,277 | 60% | ||
mmc1800 | 0 | 1,772,268,516 | 100% | ||
w00tomg | 0 | 361,874,747 | 100% | ||
bilbo | 0 | 527,641,915 | 100% | ||
photowebgear | 0 | 0 | 100% | ||
globalvanguard | 0 | 0 | 46% | ||
hugorosen | 0 | 0 | 100% | ||
hoek | 0 | 0 | 100% |
I see a lot of agressive e.g. 2-3 failed attempt configurations that forgot to whitelist their own IP, so good job there and I just wanted to reiterate that point because it is very easy to hit 3 failed attempts. What I did not see is what I consider the best part of fail 2 ban: with minimal knowledge of regex you can create custom filters, which means you can monitor any file for specific lines and leave it up to a simple fail2ban setting (in /etc/fail2ban/filter.d which is uneditable by the apache/nginx user) for deciding whether the offending IP has done enough to warrant a ban. Protect drupal or wordpress installations without use of yet another plugin requiring several updates per year? Yes please. Even more powerful, any time a web developer is sanitizing input they can simply log it when the code detects a condition they would never expect. For instance, a log line might look like "SUSPICIOUS BEHAVIOR by [IP]: submitting data to a dropdown box that is not one of the dropdown items" And the rest -- monitoring a user for how frequently they conduct a suspicious act and banning when appropriate -- is all handled by fail2ban. Instead what I frequently see is a developer writing the entire logging, checking, banning, and cleanup sequence into every page load. Just look at popular security plugins for wordpress/drupal. If you have control of the server, fail2ban and a custom filter makes for a far better option with a fraction of the effort.
author | bilbo |
---|---|
permlink | re-krnel-secure-your-linux-server-with-fail2ban-20161204t170919702z |
category | cybersecurity |
json_metadata | {"tags":["cybersecurity"]} |
created | 2016-12-04 17:09:18 |
last_update | 2016-12-04 17:09:18 |
depth | 1 |
children | 1 |
last_payout | 2017-01-04 15:36:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,474 |
author_reputation | 24,103,890,446 |
root_title | "Secure Your Linux Server with Fail2Ban" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,915,324 |
net_rshares | 81,499,213,821 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
krnel | 0 | 81,499,213,821 | 25% | ||
hoek | 0 | 0 | 100% |
Thanks for the feedback and extra suggestions. Much appreciated :)
author | krnel |
---|---|
permlink | re-bilbo-re-krnel-secure-your-linux-server-with-fail2ban-20161204t172303001z |
category | cybersecurity |
json_metadata | {"tags":["cybersecurity"]} |
created | 2016-12-04 17:23:03 |
last_update | 2016-12-04 17:23:03 |
depth | 2 |
children | 0 |
last_payout | 2017-01-04 15:36:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 66 |
author_reputation | 1,343,547,270,297,082 |
root_title | "Secure Your Linux Server with Fail2Ban" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,915,425 |
net_rshares | 0 |
Hi, Thanks for this post, fail2ban is up one my witness server now! Just a little mistake, it is not `action = $(action_)s` but `action = %(action_)s`
author | elmetro |
---|---|
permlink | re-krnel-secure-your-linux-server-with-fail2ban-20180411t093309324z |
category | cybersecurity |
json_metadata | {"tags":["cybersecurity"],"app":"steemit/0.1"} |
created | 2018-04-11 09:33:09 |
last_update | 2018-04-11 09:33:09 |
depth | 1 |
children | 0 |
last_payout | 2018-04-18 09:33:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 151 |
author_reputation | 2,378,652,793,261 |
root_title | "Secure Your Linux Server with Fail2Ban" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 49,461,388 |
net_rshares | 0 |
upvoted.
author | freecrypto |
---|---|
permlink | re-krnel-secure-your-linux-server-with-fail2ban-20161204t150158747z |
category | cybersecurity |
json_metadata | {"tags":["cybersecurity"]} |
created | 2016-12-04 15:02:06 |
last_update | 2016-12-04 15:02:06 |
depth | 1 |
children | 0 |
last_payout | 2017-01-04 15:36:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 8 |
author_reputation | 239,976,093,022,435 |
root_title | "Secure Your Linux Server with Fail2Ban" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,914,481 |
net_rshares | 0 |
Very good. I knew there was a reason to follow you. As I move away from windows OS and into Linux, security has been at the top of my list.
author | gutzofter |
---|---|
permlink | re-krnel-secure-your-linux-server-with-fail2ban-20161204t175644869z |
category | cybersecurity |
json_metadata | {"tags":["cybersecurity"]} |
created | 2016-12-04 17:56:45 |
last_update | 2016-12-04 17:56:45 |
depth | 1 |
children | 0 |
last_payout | 2017-01-04 15:36:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 139 |
author_reputation | 7,621,537,677,018 |
root_title | "Secure Your Linux Server with Fail2Ban" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,915,658 |
net_rshares | 81,754,927,894 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
krnel | 0 | 81,754,927,894 | 25% |
Good post friend
author | okrcasebob |
---|---|
permlink | re-krnel-secure-your-linux-server-with-fail2ban-20161205t034409519z |
category | cybersecurity |
json_metadata | {"tags":["cybersecurity"]} |
created | 2016-12-05 03:44:09 |
last_update | 2016-12-05 03:44:09 |
depth | 1 |
children | 0 |
last_payout | 2017-01-04 15:36:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 16 |
author_reputation | 379,521,186 |
root_title | "Secure Your Linux Server with Fail2Ban" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,919,672 |
net_rshares | 507,043,664 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
okrcasebob | 0 | 507,043,664 | 100% |
Beautiful man! I wrote about creating a lambda server the other day but avoided the server hardening stuff. This guide could be used in conjunction to do so.
author | raymonjohnstone |
---|---|
permlink | re-krnel-secure-your-linux-server-with-fail2ban-20161204t153821233z |
category | cybersecurity |
json_metadata | {"tags":["cybersecurity"]} |
created | 2016-12-04 15:38:21 |
last_update | 2016-12-04 15:38:21 |
depth | 1 |
children | 1 |
last_payout | 2017-01-04 15:36:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 157 |
author_reputation | 14,614,836,628,125 |
root_title | "Secure Your Linux Server with Fail2Ban" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,914,717 |
net_rshares | 88,245,508,107 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
krnel | 0 | 88,245,508,107 | 25% |
Sweet!
author | krnel |
---|---|
permlink | re-raymonjohnstone-re-krnel-secure-your-linux-server-with-fail2ban-20161204t154104281z |
category | cybersecurity |
json_metadata | {"tags":["cybersecurity"]} |
created | 2016-12-04 15:41:03 |
last_update | 2016-12-04 15:41:03 |
depth | 2 |
children | 0 |
last_payout | 2017-01-04 15:36:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 6 |
author_reputation | 1,343,547,270,297,082 |
root_title | "Secure Your Linux Server with Fail2Ban" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,914,735 |
net_rshares | 6,131,804,907 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
raymonjohnstone | 0 | 6,131,804,907 | 100% |