LinuxQuestions.org
Review your favorite Linux distribution.
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 01-27-2003, 03:27 PM   #1
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Firewall vs. TCP-Wrappers


Hello. This is a bit of a security design question and there is no right answer but I would just like to get different opinions on the matter.

I am using ssh to allow myself to access my server from specific remote locations. I decided to use TCP Wrappers to deny everyone the ssh service. Of course I allowed myself to access ssh from specific IP's.

Now I have a router with a built in Firewall that sits between my server and the Internet. I could easily configure the router's firewall to deny everyone access to ssh except for certain IP's.

Now what is the preferred way to do this from a security standpoint? Basically I have three options:

1) Stop ssh access at the firewall
2) Stop ssh access with the TCP Wrappers
3) Stop ssh access using both the firewall and TCP Wrappers

The only reason that I am currently using TCP Wrappers, rather then the firewall or both, is that if someone does attempt to login who I am not familiar with I will be able to see this in my log files. Unfortunatly, the router's firewall does not have any logging capabilities.

I'm not too familiar with TCP Wrappers and I dont' know if stopping access at the Firewall would be more secure then using the TCP Wrappers. I am sure however that using both would probably be the most secure way but the downside of this is that I won't be able to see failed attempts in log files.

Heres your chance to pretend to be a big shot Security Consultant. What would you recommend?
 
Old 01-28-2003, 09:29 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Your choice of words. In my book "consultant" and "account manager" are the two titles that spell major trouble...

AFAIK what you're trying to do is find a balance between an essential requirement, a "gotta have": security and a commodity, a "nice to have": logging. Logging can be a result/spin off of a tightened security posture, but logging can't lead to heightened security (even realtime logging is in essence too late, and who watches logs from 10 boxen the whole damn day). So I'd say stop it as soon as you can, at the router. Skiddies will probe 'n try, fail, and move on.
This doesn't mean you shouldn't set up apps to use libwrap or not have a firewall script in place on the server itself: don't make a single point of failure out of your router.

I'd also suggest running Snort on the server. That'll be outright boring. But say one of your remote trusted hosts get's compromised you'll still have a good chance of dropping traffic that looks like it's trying to run an exploit tru your sshd.

Just my 2 cents w/o pretending.
 
Old 01-28-2003, 11:35 AM   #3
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Original Poster
Rep: Reputation: 57
Yeah I've heard of this SNORT thing and I've tried to install it but had no luck. I think I somehow went for the advanced installation because I wall installing things like ACID and WebAdmin and all this crap. How can I set up SNORT easily? How do you have it set up?
 
Old 01-28-2003, 12:39 PM   #4
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
From a paranoid point of view (= my point of view) I would limit access to SSH on the firewall, then tcp_wrappers and then on the service itself ... so 3 security layers :-)
 
Old 01-28-2003, 01:15 PM   #5
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Original Poster
Rep: Reputation: 57
Limit access on the service itself? How is this done?
 
Old 01-28-2003, 06:13 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
How can I set up SNORT easily?
just install the tarball, install Barnyard for parsing unified log format and say, Guardian if you want blocking based on alerts.

Last edited by unSpawn; 01-28-2003 at 06:15 PM.
 
Old 01-30-2003, 11:12 AM   #7
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
Well for details check the thread Securing SSH
 
Old 01-30-2003, 12:46 PM   #8
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Original Poster
Rep: Reputation: 57
My sshd_config file looks very similar to the one shown in the Thread you mentioned markus1982 however there is one difference. I have PasswordAuthentication set to Yes. I'm not to clear on this in SSH but if I set PasswordAuthentication to No then the client must have my public key to access SSH right? How does SSH know what user to log in as if you are not prompted for a username and password?

Last edited by Crashed_Again; 01-30-2003 at 01:13 PM.
 
Old 01-31-2003, 06:35 AM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Because you use the "-l" option with ssh when connecting?
 
  


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
NFS with TCP Wrappers! stakhous Linux - Software 1 02-17-2005 09:25 PM
tcp wrappers or iptables? dominant Linux - Security 3 02-23-2004 12:56 PM
TCP Wrappers ? juanb Linux - Newbie 1 01-31-2004 01:35 PM
tcp wrappers --with-tcp-wrappers ForumKid Linux - Security 2 01-04-2002 04:01 PM
TCP Wrappers ltrain Linux - Security 6 05-31-2001 10:40 PM

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

All times are GMT -5. The time now is 05:55 AM.

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