LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-17-2008, 10:14 PM   #1
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
sshd (or other services): Filtering entire countries


Note -> hopefully this will complement two already existing, related resources:
  1. the LQWiki sshd configuration entry; and
  2. the Failed ssh login attempt thread.

I don't intend to exhaustively rehash or debate what's already been advised there. Just a quick summary and I'll get to the point.

--------------------------------

As basic sshd hardening steps, in the past I've generally:
  • set obvious sshd_config options (PermitRootLogin no, Protocol 2);
  • required PubkeyAuthentication (and allowed no other authentication);
  • utilized the AllowUsers directive;
  • permitted certain IPs via netfilter or tcp wrappers, and denied all else by default; and
  • stayed on top of openssh security updates.

When circumstances have allowed all this, it has been highly effective. But, I recently ran into a situation where I had to allow ChallengeResponseAuthentication + UsePAM for a customer, and sshd needed to be available to all United States subnets.

So... a little bit of poking around and I found a useful resource (originally spotted on the wikipedia entry for CIDR):

================================

http://www.ipdeny.com/ipblocks/

From their 'about' section:
Quote:
IPdeny was found to offer up to date and ready-to-go country ip block zone files allocated by regional registries (RIR's). Our main goal is to publish all allocated IPs into single country files in CIDR format...
================================

Very nice. Thought I'd share this as I have seen the topic come up in a few different threads where folks are trying to allow or block entire countries.
 
Old 03-17-2008, 10:18 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935

Original Poster
Blog Entries: 5

Rep: Reputation: Disabled
Just submitted this and already two caveats:

First, some guy already mentioned the site here.

Second, it should go without saying that this won't help you much if attacks are being staged from compromised machines on any US subnet (which they certainly could be).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network services (sshd, webmin, httpd) stopped answering rustyz82 Fedora 1 02-20-2006 07:21 AM
FC4-Starting sshd: Privilege separation user sshd does not exist FAILED kiranherekar Fedora 5 12-29-2005 02:22 PM
get Squidguard to block entire countries web sites? Possible? Pcghost Linux - Software 3 09-19-2004 02:25 PM
knoppix hd install set services sshd kwn statmobile Debian 4 06-01-2004 08:01 AM
Configuring services, sshd and Samba scarr3d Debian 2 02-26-2004 06:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration