Networking Forums  

Go Back   Networking Forums > Networking Newsgroups > Linux Networking

filtering access via hosts.allow

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2006, 03:08 PM
Default filtering access via hosts.allow



I am trying to prevent access from half the world's idiots through
hosts.allow using:

sendmail: ALL
sshd: 192.168.1., 68.155. : allow
httpd: .us, .com, .net, .gov, .org, .nz, .nl, .mx, .lu, .gb, .de, .ca,
..bs, .at, .au : allow
vsftpd: 192.168.1., 68.155. : allow

I was led to believe I could filter requests by countries via this
format of TLDs from some FAQ I read. I am still getting pounded
through ssh and http by sources in Asia. My hosts.deny was
alternatively empty and ALL: ALL.

I know I have other issues from sources that I am allowing access, but
I feel I can deal with that on a piecemeal basis. What is the correct
format for this filter (and hosts.deny).

thanks
ed



ebabin@yahoo.com
Reply With Quote
  #2  
Old 01-04-2006, 03:38 PM
Bit Twister
Guest
 
Posts: n/a
Default Re: filtering access via hosts.allow

On 4 Jan 2006 07:08:56 -0800, (E-Mail Removed) wrote:
> I am trying to prevent access from half the world's idiots through
> hosts.allow using:
>
> sendmail: ALL
> sshd: 192.168.1., 68.155. : allow
> httpd: .us, .com, .net, .gov, .org, .nz, .nl, .mx, .lu, .gb, .de, .ca,


Hmmm, .net, looking at my ip I get
$ host 24.1.202.185
domain name pointer c-24-1-202-185.hsd1.tx.comcast.net

Looks like that would let anyone from comcast.net or covad.net


> .bs, .at, .au : allow
> vsftpd: 192.168.1., 68.155. : allow


Instead of the 192.168.1. I use LOCAL and anyone on my local lan .home.invalid
ALL: LOCAL,.home.invalid

As for your : allow; by defintion, anyone in hosts.allow is allowed.

> I was led to believe I could filter requests by countries via this
> format of TLDs from some FAQ I read. I am still getting pounded
> through ssh and http by sources in Asia.


You will get pounded regardless of what is in your allow/deny.
Your hosts.allow/deny will be used when someone tries to connedt to a
wrapped service.

Put up a firewall, and poke holes in it for what you want.
I am running Mandriva Linux and use webmin to manage the config rules.
You can use blacklist to manage ip ranges, ports, protocol...


> My hosts.deny was
> alternatively empty and ALL: ALL.


hosts.deny needs the
ALL: ALL <=== followed by a carriage return

Reply With Quote
  #3  
Old 01-04-2006, 04:17 PM
ebabin@yahoo.com
Guest
 
Posts: n/a
Default Re: filtering access via hosts.allow

>You will get pounded regardless of what is in your allow/deny.
>Your hosts.allow/deny will be used when someone tries to connedt to a
>wrapped service.


These rules should not allow an attempt to login correct?

Entry from /var/log/secure:
sshd[24121]: Failed password for invalid user mwe from 222.233.123.198
port 45256 ssh2
sshd[24121]: Invalid user mwe from 222.233.123.198

Reply With Quote
  #4  
Old 01-04-2006, 06:21 PM
Bit Twister
Guest
 
Posts: n/a
Default Re: filtering access via hosts.allow

On 4 Jan 2006 08:17:28 -0800, (E-Mail Removed) wrote:
>>You will get pounded regardless of what is in your allow/deny.
>>Your hosts.allow/deny will be used when someone tries to connedt to a
>>wrapped service.

>
> These rules should not allow an attempt to login correct?


No idea, my firewall stops attempts from connecting.
Is the tpcd service/daemon running?

> Entry from /var/log/secure:


My logs only has entries from my lan box.
Reply With Quote
  #5  
Old 01-04-2006, 07:01 PM
Clifford Kite
Guest
 
Posts: n/a
Default Re: filtering access via hosts.allow

(E-Mail Removed) wrote:
>>You will get pounded regardless of what is in your allow/deny.
>>Your hosts.allow/deny will be used when someone tries to connedt to a
>>wrapped service.


> These rules should not allow an attempt to login correct?


They cannot prevent the attempt but do prevent the login. You'll need
a firewall to prevent the attempt.

> Entry from /var/log/secure:
> sshd[24121]: Failed password for invalid user mwe from 222.233.123.198
> port 45256 ssh2
> sshd[24121]: Invalid user mwe from 222.233.123.198


--
Clifford Kite Email: "echo xvgr_yvahk-(E-Mail Removed)|rot13"
Reply With Quote
  #6  
Old 01-04-2006, 11:00 PM
Michael Heiming
Guest
 
Posts: n/a
Default Re: filtering access via hosts.allow

In comp.os.linux.networking (E-Mail Removed):
>>You will get pounded regardless of what is in your allow/deny.
>>Your hosts.allow/deny will be used when someone tries to connedt to a
>>wrapped service.

^^^^^^^

> These rules should not allow an attempt to login correct?


> Entry from /var/log/secure:
> sshd[24121]: Failed password for invalid user mwe from 222.233.123.198
> port 45256 ssh2


Is your sshd compiled to support tcp_wrapper at all?

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 62: need to wrap system in aluminum foil to
fix problem
Reply With Quote
  #7  
Old 01-05-2006, 01:31 PM
Giovanni
Guest
 
Posts: n/a
Default Re: filtering access via hosts.allow

On 01/04/06 16:08, (E-Mail Removed) wrote:
> I am trying to prevent access from half the world's idiots through
> hosts.allow using:
>
> sendmail: ALL
> sshd: 192.168.1., 68.155. : allow
> httpd: .us, .com, .net, .gov, .org, .nz, .nl, .mx, .lu, .gb, .de, .ca,
> .bs, .at, .au : allow
> vsftpd: 192.168.1., 68.155. : allow
>
> I was led to believe I could filter requests by countries via this
> format of TLDs from some FAQ I read. I am still getting pounded
> through ssh and http by sources in Asia. My hosts.deny was
> alternatively empty and ALL: ALL.
>
> I know I have other issues from sources that I am allowing access, but
> I feel I can deal with that on a piecemeal basis. What is the correct
> format for this filter (and hosts.deny).
>
> thanks
> ed
>


Maybe your httpd and sshd daemons do not use "Tcp Wrappers".

AFAIK they are standalone daemons and do not get wakened via inetd.

Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
Registered Linux user #337974 <http://counter.li.org/>
Reply With Quote
  #8  
Old 01-05-2006, 02:50 PM
Michael Heiming
Guest
 
Posts: n/a
Default Re: filtering access via hosts.allow

In comp.os.linux.networking Giovanni <(E-Mail Removed)>:
> On 01/04/06 16:08, (E-Mail Removed) wrote:
>> I am trying to prevent access from half the world's idiots through
>> hosts.allow using:
>>
>> sendmail: ALL
>> sshd: 192.168.1., 68.155. : allow
>> httpd: .us, .com, .net, .gov, .org, .nz, .nl, .mx, .lu, .gb, .de, .ca,
>> .bs, .at, .au : allow
>> vsftpd: 192.168.1., 68.155. : allow

[..]

> Maybe your httpd and sshd daemons do not use "Tcp Wrappers".


> AFAIK they are standalone daemons and do not get wakened via inetd.


Sshd can use tcp_wrapper if compiled to do so, no matter if
started from (x)inetd or not, though many distro default sshd
aren't compiled to do so.

Httpd certainly doesn't.

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 119: evil hackers from Serbia.
Reply With Quote
  #9  
Old 01-05-2006, 04:07 PM
Giovanni
Guest
 
Posts: n/a
Default Re: filtering access via hosts.allow

On 01/05/06 15:50, Michael Heiming wrote:
> In comp.os.linux.networking Giovanni <(E-Mail Removed)>:
>
>>On 01/04/06 16:08, (E-Mail Removed) wrote:
>>
>>>I am trying to prevent access from half the world's idiots through
>>>hosts.allow using:
>>>
>>>sendmail: ALL
>>>sshd: 192.168.1., 68.155. : allow
>>>httpd: .us, .com, .net, .gov, .org, .nz, .nl, .mx, .lu, .gb, .de, .ca,
>>>.bs, .at, .au : allow
>>>vsftpd: 192.168.1., 68.155. : allow

>
> [..]
>
>
>>Maybe your httpd and sshd daemons do not use "Tcp Wrappers".

>
>
>>AFAIK they are standalone daemons and do not get wakened via inetd.

>
>
> Sshd can use tcp_wrapper if compiled to do so, no matter if
> started from (x)inetd or not, though many distro default sshd
> aren't compiled to do so.
>
> Httpd certainly doesn't.
>


You can start apache from your inetd daemon, as long as you set
ServerType inetd

I can't say anything about performances ;-)

Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
Registered Linux user #337974 <http://counter.li.org/>
Reply With Quote
  #10  
Old 01-05-2006, 05:56 PM
Michael Heiming
Guest
 
Posts: n/a
Default Re: filtering access via hosts.allow

In comp.os.linux.networking Giovanni <(E-Mail Removed)>:
> On 01/05/06 15:50, Michael Heiming wrote:
>> In comp.os.linux.networking Giovanni <(E-Mail Removed)>:
>>
>>>On 01/04/06 16:08, (E-Mail Removed) wrote:
>>>
>>>>I am trying to prevent access from half the world's idiots through
>>>>hosts.allow using:

[..]

>>>Maybe your httpd and sshd daemons do not use "Tcp Wrappers".

>>
>>
>>>AFAIK they are standalone daemons and do not get wakened via inetd.

>>
>>
>> Sshd can use tcp_wrapper if compiled to do so, no matter if
>> started from (x)inetd or not, though many distro default sshd
>> aren't compiled to do so.
>>
>> Httpd certainly doesn't.
>>


> You can start apache from your inetd daemon, as long as you set
> ServerType inetd


> I can't say anything about performances ;-)


For the record, it is possible though you need to reconfigure it
and I'm not aware of anyone serious doing so, since apache has
built in access control that easily allows this. Running https
defeats this unless someone is brainless not to use a passphrase
on the servers cert.

Dunno about anyone serious doing this, so it escaped from my
mind. ;-)

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 28: CPU radiator broken
Reply With Quote
Reply

Tags
access, filtering, hostsallow

Thread Tools
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


All times are GMT. The time now is 06:46 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.