Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Security and Privacy
FedoraForum Search

Forgot Password? Join Us!

Security and Privacy Sadly, malware, spyware, hackers and privacy threats abound in today's world. Let's be paranoid and secure our penguins, and slam the doors on privacy exploits.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 29th June 2009, 01:52 AM
bigmacbb63's Avatar
bigmacbb63 Offline
Registered User
 
Join Date: Feb 2006
Location: southern california
Posts: 521
/etc/hosts.allow and hosts.deny

Hi all,

I need to know how to secure /etc/hosts.allow and /etc/hosts.deny
I've never configured them and that I'm sure is a problem for me.

Thanks for your help I appreciate all of you,

bigmac
Reply With Quote
  #2  
Old 29th June 2009, 03:30 AM
bigmacbb63's Avatar
bigmacbb63 Offline
Registered User
 
Join Date: Feb 2006
Location: southern california
Posts: 521
Hi guys,

I think I have the answer? I was looking at this and it looks right?
Maybe someone can tell me if I'm wrong.

http://www.brighthub.com/computing/l...les/20184.aspx

Thanks, bigmac
Reply With Quote
  #3  
Old 29th June 2009, 01:42 PM
stevea's Avatar
stevea Online
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,302
man hosts.allow

Bad thread title - /etc/hosts is NOT relate hosts.allow/deny.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #4  
Old 29th June 2009, 01:46 PM
scottro's Avatar
scottro Offline
Retired Community Manager -- Banned from Texas by popular demand.
 
Join Date: Sep 2007
Location: NYC
Posts: 8,142
As per stevea's suggestion, I've edited the title.
__________________
--
http://home.roadrunner.com/~computertaijutsu

Do NOT PM forum members with requests for technical support. Ask your questions on the forum.


"I don't know why there is the constant push to break any semblance of compatibility" --anon
Reply With Quote
  #5  
Old 30th June 2009, 01:52 AM
bodhi.zazen's Avatar
bodhi.zazen Offline
Registered User
 
Join Date: Jul 2006
Location: Montana
Posts: 731
No offense intended, but the man page on hosts.allow / hosts.deny is actually fairly helpful.

http://linux.die.net/man/5/hosts.allow
__________________
If it is not broken, tweak it... If you break Fedora you get to keep both pieces :p
Reply With Quote
  #6  
Old 30th June 2009, 01:47 PM
ibbo's Avatar
ibbo Offline
Registered User
 
Join Date: Jun 2005
Location: Leeds
Posts: 1,264
Remember 1st and foremost that this is only one trench in your in depth defense of your system. I actually think this one is pretty good, well built trench that is very configurable.

Basically
hosts.deny
--------------
ALL: ALL

Deny everything by default.

hosts.allow
--------------
httpd: ALL
smtp: 192.168.1
etc: ...

Open up services for (a anyone, b local network).
The man pages are very helpful on this and give many examples of the stuff you can do. I.E. notifications

I would also look at deny hosts and look at getting to grips with iptables.

Defense in depth is the key, SELinux is the icing.

Ibbo
__________________
A Hangover Lasts A Day, But Our Drunken Memories Last A Lifetime
--
Linux user #349545
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCfdjyzXscddzQvlhBedAcD7qfKmHo==zx0H
Reply With Quote
  #7  
Old 30th June 2009, 04:18 PM
bigmacbb63's Avatar
bigmacbb63 Offline
Registered User
 
Join Date: Feb 2006
Location: southern california
Posts: 521
security installed

Hi guys,

I have installed tripwire, rkhunter, aide, denyhosts, ettercap, nmap, chkrootkit.
That's about all. The one thing I can't get to work is my /bin/rpm file has been hijacked
it keeps saying that it cannot stat: when I scan with rkhunter and I don't know how to
fix that. Does anyone have any suggestions?

Thanks,

bigmac
Reply With Quote
  #8  
Old 1st July 2009, 06:32 AM
bodhi.zazen's Avatar
bodhi.zazen Offline
Registered User
 
Join Date: Jul 2006
Location: Montana
Posts: 731
Quote:
Originally Posted by ibbo View Post
Remember 1st and foremost that this is only one trench in your in depth defense of your system. I actually think this one is pretty good, well built trench that is very configurable.

Basically
hosts.deny
--------------
ALL: ALL

Deny everything by default.

hosts.allow
--------------
httpd: ALL
smtp: 192.168.1
etc: ...

Open up services for (a anyone, b local network).
The man pages are very helpful on this and give many examples of the stuff you can do. I.E. notifications

I would also look at deny hosts and look at getting to grips with iptables.

Defense in depth is the key, SELinux is the icing.

Ibbo
I like TCPwrapper (host.allow / hosts.deny) but by default with most distros (Fedora included) Apache does not use tcpwrappers.

If you wish to use tcp wrappers with apache you need to recompile apache.

You can see if an application uses tcp wrappers with "strings"

Code:
strings -f /usr/sbin/sshd | grep hosts_access
/usr/sbin/sshd: hosts_access
But not httpd

Code:
strings -f /usr/sbin/httpd | grep hosts_access
     < -- see no output
So, if you are relying on tcpwrappers take the time to make sure your service in fact uses tcpwrappers.

Last, many servers have ACL (access control lists) or ACL functionality built into the config files.

Using apache as an example , apache is usually public, so rather then deny all and allow some (whitelist) you usually allow all and deny some (blacklist)

Code:
< Location />
< Limit GET POST PUT>
order allow,deny
allow from all
deny from 111.222.33.444
deny from 111.222.33.555
< /Limit>
< /Location>
Which eventually leads back to iptables, or similar applications, as you can maintain one "central" blacklist rather then service - by - service configuration (assuming you are running multiple services of course).

<snip-it>

iptables -A INPUT -j blacklist # check a blacklist (see below)
iptables -A INPUT -s 192.168.0.0/16 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -j DROP

iptables -N blacklist
iptables -A blacklist -s 111.22.333.444/32 -j DROP
iptables -A blacklist -s 111.22.333.555/32 -j DROP

</snip-it>

Note: In practice you will need to define your blacklist first or you will get an error with the first command, but I hope the above layout is easier to follow.

A few "simple" iptables rules to check a blacklist, accept ssh from LAN only, accept all traffic on port 80, drop everything else.

While iptables is intimidating at first, taking the time to learn the rules (or use something like shorewall) can pay off in spades (rather then learning tcpwrappers, adding fail2ban, recompile apache there, etc).
__________________
If it is not broken, tweak it... If you break Fedora you get to keep both pieces :p

Last edited by bodhi.zazen; 1st July 2009 at 06:39 AM.
Reply With Quote
  #9  
Old 21st January 2010, 11:26 PM
jenaniston's Avatar
jenaniston Offline
Registered User
 
Join Date: Dec 2009
Location: Malibu, California
Posts: 318
linuxfedorafirefox
do I have a LAN boot tcp wrappers deny/problem ?

Quote:
Originally Posted by bodhi.zazen View Post
. . . if you are relying on tcpwrappers take the time to make sure your service in fact uses tcpwrappers.
( reviving an older thread that came up in search for tcp wrappers . . .similar topic of sorts)

tcp_wrappers 7.6-55.fc11 i586 comes installed with with my F11 Live . . .(as well as the tcp_wrappers-libs)
and tcp_wrappers 7.6-56.fc12.i686 comes with my F12 Live which I am using for a LAN boot point-to-point connection.

dhcp server works fine to the client diskless laptop, but the tftp gets hung . . .
etc/hosts_allow is only # comment lines/description so everything should be allowed ?

Bottom line:
How do I check status of the tcp_wrappers ? . . .
i.e if my xinetd service (tftp server) is in fact using or not using the installed tcp_wrappers in Fedora 11 or 12 ?

Thank you very much.

P.S. Since tcpdump and snort do NOT show any TCP flags or options -
that should mean there are no tcp wrappers issues involved in stopping the boot filename packet from reaching the client destination ?

Last edited by jenaniston; 21st January 2010 at 11:35 PM. Reason: Postscript added
Reply With Quote
  #10  
Old 19th March 2010, 10:22 PM
bigmacbb63's Avatar
bigmacbb63 Offline
Registered User
 
Join Date: Feb 2006
Location: southern california
Posts: 521
windows_vistafirefox
Re: /etc/hosts.allow and hosts.deny

Hi guys,

In /etc/hosts.deny where do you put ALL:ALL
What I mean is which line?

Thanks,

bigmac
Reply With Quote
Reply

Tags
hostsdeny, or etc or hostsallow

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to configure hosts.allow and hosts.deny nkjha Security and Privacy 4 19th January 2009 03:10 PM
hosts.deny vs iptables cbrenchley Using Fedora 3 15th April 2008 12:38 AM
sshd and /etc/hosts.deny brinda Using Fedora 11 2nd May 2006 05:52 PM


Current GMT-time: 22:36 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat