Bluehost.com Web Hosting $6.95

forbid internet access to an application?

This is a discussion on forbid internet access to an application? within the Linux Networking forums, part of the Linux Forums category; Michael Heiming a écrit : > >>>The netfilter owner module can accomplish this objective > >>Support ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 05-28-2007
Pascal Hambourg
 
Posts: n/a
Default Re: forbid internet access to an application?

Michael Heiming a écrit :
>
>>>The netfilter owner module can accomplish this objective

>
>>Support for the --pid-owner, --sid-owner and --cmd-owner options has
>>been removed from kernel 2.6.14 and later versions.

>
> Interesting, seems my man page is broken


It seems the paragraph about the "owner" match in the iptables man page
has been last updated one year before the 2.6.14 kernel was released.

> and the OP back to the script I had already recommended. ;-)


Unless he uses a non-SMP kernel version < 2.6.14, including the latest
2.4 versions.

P.S. : Special thanks to Dave Uhring for calling me a cretin.
Reply With Quote
  #12 (permalink)  
Old 05-28-2007
lucatrv
 
Posts: n/a
Default Re: forbid internet access to an application?

> That would of course be entirely trivial to evade. Just make a hard link
to
> the program with a different name.
>
> It is like denying access to a building to anyone who says their name is

John.
> How long would that be effective?


I understand, but that would be the behaviour of a malign code. I'm not
talking of that, but only of preventing some normal application to access
the network. Since I use gentoo with kernel 2.6.20 SMP, from your answers I
have a confirmation that there's no way to do that with netfilter...
As for now, the only idea I have is if it is possible to define a selinux
policy with no access to the network, and then apply it to the applicatoin's
files. But it's only a supposition, since I actually haven't good knowledge
of selinux, and I guess it's not really easy to set it up with gentoo.

> If you told us which program you wanted to restrict, then we could perhaps
> give better advice.


Ok, so let's for instance consider ping.

Luca


Reply With Quote
  #13 (permalink)  
Old 05-28-2007
lucatrv
 
Posts: n/a
Default Re: forbid internet access to an application?

> If there is no such thing you want, consider writing your own
> and put the source online, so others might use and perhaps
> improve it.


That's a good point, but I'm not actually in the position of doing that. And
I guess it wouldn't be an easy code to write.

Luca


Reply With Quote
  #14 (permalink)  
Old 05-29-2007
Unruh
 
Posts: n/a
Default Re: forbid internet access to an application?

"lucatrv" <lucatrv@com.com> writes:

>> That would of course be entirely trivial to evade. Just make a hard link

>to
>> the program with a different name.
>>
>> It is like denying access to a building to anyone who says their name is

>John.
>> How long would that be effective?


>I understand, but that would be the behaviour of a malign code. I'm not
>talking of that, but only of preventing some normal application to access
>the network. Since I use gentoo with kernel 2.6.20 SMP, from your answers I
>have a confirmation that there's no way to do that with netfilter...
>As for now, the only idea I have is if it is possible to define a selinux
>policy with no access to the network, and then apply it to the applicatoin's
>files. But it's only a supposition, since I actually haven't good knowledge
>of selinux, and I guess it's not really easy to set it up with gentoo.


>> If you told us which program you wanted to restrict, then we could perhaps
>> give better advice.


>Ok, so let's for instance consider ping.


That one is simple. Don't run it. Then it will not access the net.

I meant "What is the real problem you are tring to solve". Yours is a
hypothetical one. If you do not want ping to access the network and you are
not talking about rogue programs, the do not use ping. It is that simple.
But I suspect that is not the answer you want.
NOw, you have a concern about some program you are running, presumably on
purpose, which can sometimes access the net, but you do not want it to.
How does it access the net? Is it a dns lookup, is it http, or what? Your
specification is not good enough and your idiotic example is just that.



>Luca



Reply With Quote
  #15 (permalink)  
Old 05-29-2007
MoMule
 
Posts: n/a
Default Re: forbid internet access to an application?

On May 28, 9:44 pm, Unruh <unruh-s...@physics.ubc.ca> wrote:
> "lucatrv" <luca...@com.com> writes:
> >> That would of course be entirely trivial to evade. Just make a hard link

> >to
> >> the program with a different name.

>
> >> It is like denying access to a building to anyone who says their name is

> >John.
> >> How long would that be effective?

> >I understand, but that would be the behaviour of a malign code. I'm not
> >talking of that, but only of preventing some normal application to access
> >the network. Since I use gentoo with kernel 2.6.20 SMP, from your answers I
> >have a confirmation that there's no way to do that with netfilter...
> >As for now, the only idea I have is if it is possible to define a selinux
> >policy with no access to the network, and then apply it to the applicatoin's
> >files. But it's only a supposition, since I actually haven't good knowledge
> >of selinux, and I guess it's not really easy to set it up with gentoo.
> >> If you told us which program you wanted to restrict, then we could perhaps
> >> give better advice.

> >Ok, so let's for instance consider ping.

>
> That one is simple. Don't run it. Then it will not access the net.
>
> I meant "What is the real problem you are tring to solve". Yours is a
> hypothetical one. If you do not want ping to access the network and you are
> not talking about rogue programs, the do not use ping. It is that simple.
> But I suspect that is not the answer you want.
> NOw, you have a concern about some program you are running, presumably on
> purpose, which can sometimes access the net, but you do not want it to.
> How does it access the net? Is it a dns lookup, is it http, or what? Your
> specification is not good enough and your idiotic example is just that.
>
>
>
> >Luca- Hide quoted text -

>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


Why not use kiosktool from inside KDE (If you are using KDE that is)?

http://jriddell.org/programs/kiosk-article.html

Deion "Mule" Christopher

Reply With Quote
  #16 (permalink)  
Old 05-30-2007
Dana Smith
 
Posts: n/a
Default Re: forbid internet access to an application?

Bear with me I'm rather new to this. Are you trying to block
applications from your user's side or from the cloud?
From your user's side - wouldn't it be possible to use rlogin (or
some other method to remote login) to the host and allow Internet access
only from/through the host? If so, wouldn't it also be true you could
set the user/group rights (privileges) to permit only those programs
which match the user/group privileges? That is make ping a root only
executable so no other user/group can execute/use it.
Please excuse me if I missed your point.
Dana
Reply With Quote
  #17 (permalink)  
Old 05-30-2007
lucatrv
 
Posts: n/a
Default Re: forbid internet access to an application?

>>Ok, so let's for instance consider ping.
>
> That one is simple. Don't run it. Then it will not access the net.


1) For instance, I'm not sure if picasa gains access to the internet when I
use it (they say the option "check for upgrades" is always disabled even if
it looks selected... but who knows?). Worse, I'm not sure it doesn't signal
when I'm using it.

2) The same for instace with eclipse. Also if I tell it not to check for
updates, how can I be really sure it never access the network?

3) And what if I would like to prevent skype from connecting to some ips?
(while still keep them available for other applications)

Luca



Reply With Quote
  #18 (permalink)  
Old 05-30-2007
lucatrv
 
Posts: n/a
Default Re: forbid internet access to an application?

> Why not use kiosktool from inside KDE (If you are using KDE that is)?
>
> http://jriddell.org/programs/kiosk-article.html
>


I actually use gnome, and by the way from what I read I couldn't understand
how to get the functionality I was talking about (prevent an application
from gaining access to the network while having the network functional for
the other applications). Thank you anyway, bye.


Reply With Quote
  #19 (permalink)  
Old 05-30-2007
lucatrv
 
Posts: n/a
Default Re: forbid internet access to an application?


> Bear with me I'm rather new to this. Are you trying to block
> applications from your user's side or from the cloud?
> From your user's side - wouldn't it be possible to use rlogin (or
> some other method to remote login) to the host and allow Internet access
> only from/through the host? If so, wouldn't it also be true you could
> set the user/group rights (privileges) to permit only those programs
> which match the user/group privileges? That is make ping a root only
> executable so no other user/group can execute/use it.
> Please excuse me if I missed your point.
> Dana


My question was if it's possible to block only some application/files from
using the network, while using the desktop normally.
As for now, to me it seems the only option could be through selinux (but I'm
not sure), and then I should learn how to set it up under gentoo...


Reply With Quote
  #20 (permalink)  
Old 05-31-2007
MoMule
 
Posts: n/a
Default Re: forbid internet access to an application?

On May 30, 1:04 pm, "lucatrv" <luca...@com.com> wrote:
> > Why not use kiosktool from inside KDE (If you are using KDE that is)?

>
> >http://jriddell.org/programs/kiosk-article.html

>
> I actually use gnome, and by the way from what I read I couldn't understand
> how to get the functionality I was talking about (prevent an application
> from gaining access to the network while having the network functional for
> the other applications). Thank you anyway, bye.


OK then, how about using a SQUID proxy? I believe acl's can be set up
to allow specified logged in users to access the Internet using
specified applications. I once ran a shorewall firewall with a
"manual" SQUID proxy (each user had to type in their name and password
anytime they tried using an application that accessed the Internet) to
block all Internet-bound applications _except_ mail clients.

If I'm not mistaken, I was still able to use ping on those machines
for Intranet work...

Does this sound more like what you are wanting? There is the
possibilty of using GConf:

http://www.gnome.org/learn/admin-gui...ockdown-1.html

but I've never used it before...

Deion "Mule" Christopher

Reply With Quote
Reply
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:30 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0