Networking Forums

Networking Forums > Computer Networking > Linux Networking > forbid internet access to an application?

Reply
Thread Tools Display Modes

forbid internet access to an application?

 
 
lucatrv
Guest
Posts: n/a

 
      05-26-2007, 03:02 PM
Hi, I'd like to ask if it's possible to restrict access to the internet to
an application (i.e. the list of files which belongs to a package).
Under windows there are plenty of firewall programs, which make you decide
if an application should access the internet or not.
I looked on internet and didn't find anything similar under linux. For what
I could understand, neither apparmor or selinux can do that...

Thank you.




 
Reply With Quote
 
 
 
 
David M
Guest
Posts: n/a

 
      05-26-2007, 04:02 PM
On Sat, 26 May 2007 15:02:16 +0000, lucatrv rearranged some electrons to
form:

> Hi, I'd like to ask if it's possible to restrict access to the internet to
> an application (i.e. the list of files which belongs to a package).
> Under windows there are plenty of firewall programs, which make you decide
> if an application should access the internet or not.
> I looked on internet and didn't find anything similar under linux. For what
> I could understand, neither apparmor or selinux can do that...
>
> Thank you.



man hosts.deny


--
David M (dmacchiarolo)
http://home.triad.rr.com/redsled
T/S 53
sled351 Linux 2.4.18-14 has been up 2 days 9:54

 
Reply With Quote
 
Michael Heiming
Guest
Posts: n/a

 
      05-26-2007, 05:54 PM
In comp.os.linux.networking David M <(E-Mail Removed)>:
> On Sat, 26 May 2007 15:02:16 +0000, lucatrv rearranged some electrons to
> form:


>> Hi, I'd like to ask if it's possible to restrict access to the internet to
>> an application (i.e. the list of files which belongs to a package).
>> Under windows there are plenty of firewall programs, which make you decide
>> if an application should access the internet or not.
>> I looked on internet and didn't find anything similar under linux. For what
>> I could understand, neither apparmor or selinux can do that...
>>
>> Thank you.



> man hosts.deny


This is thought to restrict incoming connections not outgoing. A
typical Linux installation isn't infested with spy and malware,
so there might not be demand for such an application?

Though one could run some cron job, checking for apps opening
outgoing connections and kill them if they can't be found in a
given file with allowed apps. I suppose it shouldn't take more
then 20 minutes to stick a halfway working script together.

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.

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 50: Change in Earth's rotational speed
 
Reply With Quote
 
Allen Kistler
Guest
Posts: n/a

 
      05-26-2007, 07:24 PM
lucatrv wrote:
> Hi, I'd like to ask if it's possible to restrict access to the internet to
> an application (i.e. the list of files which belongs to a package).
> Under windows there are plenty of firewall programs, which make you decide
> if an application should access the internet or not.
> I looked on internet and didn't find anything similar under linux. For what
> I could understand, neither apparmor or selinux can do that...


The netfilter owner module can accomplish this objective (according to
the man page, though I've never used it). The switch you want is
--cmd-owner, however the man page also states that cmd matching is
broken on SMP machines. YMMV
 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      05-26-2007, 07:36 PM
Hello,

Allen Kistler a écrit :
>
> The netfilter owner module can accomplish this objective (according to
> the man page, though I've never used it). The switch you want is
> --cmd-owner, however the man page also states that cmd matching is
> broken on SMP machines.


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

[NETFILTER]: Remove tasklist_lock abuse in ipt{,6}owner

Rip out cmd/sid/pid matching since its unfixable broken and stands in
the way of locking changes to tasklist_lock.
 
Reply With Quote
 
David M
Guest
Posts: n/a

 
      05-26-2007, 07:42 PM
On Sat, 26 May 2007 19:54:25 +0200, Michael Heiming rearranged some
electrons to form:

> In comp.os.linux.networking David M <(E-Mail Removed)>:
>> On Sat, 26 May 2007 15:02:16 +0000, lucatrv rearranged some electrons to
>> form:

>
>>> Hi, I'd like to ask if it's possible to restrict access to the internet to
>>> an application (i.e. the list of files which belongs to a package).
>>> Under windows there are plenty of firewall programs, which make you decide
>>> if an application should access the internet or not.
>>> I looked on internet and didn't find anything similar under linux. For what
>>> I could understand, neither apparmor or selinux can do that...
>>>
>>> Thank you.

>
>
>> man hosts.deny

>
> This is thought to restrict incoming connections not outgoing. A
> typical Linux installation isn't infested with spy and malware,
> so there might not be demand for such an application?
>
> Though one could run some cron job, checking for apps opening
> outgoing connections and kill them if they can't be found in a
> given file with allowed apps. I suppose it shouldn't take more
> then 20 minutes to stick a halfway working script together.
>
> 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.


I misread the OP, I thought he was trying to block incoming
connections. My mistake.


--
David M (dmacchiarolo)


 
Reply With Quote
 
Michael Heiming
Guest
Posts: n/a

 
      05-26-2007, 07:45 PM
In comp.os.linux.networking Allen Kistler <(E-Mail Removed)>:
> lucatrv wrote:
>> Hi, I'd like to ask if it's possible to restrict access to the internet to
>> an application (i.e. the list of files which belongs to a package).
>> Under windows there are plenty of firewall programs, which make you decide
>> if an application should access the internet or not.
>> I looked on internet and didn't find anything similar under linux. For what
>> I could understand, neither apparmor or selinux can do that...


> The netfilter owner module can accomplish this objective (according to
> the man page, though I've never used it). The switch you want is
> --cmd-owner, however the man page also states that cmd matching is
> broken on SMP machines. YMMV


Indeed, nice shot. I see other options I hadn't seen last time
checking the man page. Presuming the OP had done his homework, I
didn't bother to take a look before replying...

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 4: static from nylon underwear
 
Reply With Quote
 
Michael Heiming
Guest
Posts: n/a

 
      05-26-2007, 07:48 PM
In comp.os.linux.networking Pascal Hambourg <boite-a-(E-Mail Removed)>:
> Hello,


> Allen Kistler a écrit :


>> The netfilter owner module can accomplish this objective (according to
>> the man page, though I've never used it). The switch you want is
>> --cmd-owner, however the man page also states that cmd matching is
>> broken on SMP machines.


> 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 and the OP back to the
script I had already recommended. ;-)

> [NETFILTER]: Remove tasklist_lock abuse in ipt{,6}owner


> Rip out cmd/sid/pid matching since its unfixable broken and stands in
> the way of locking changes to tasklist_lock.


--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 338: old inkjet cartridges emanate barium-based
fumes
 
Reply With Quote
 
Dave Uhring
Guest
Posts: n/a

 
      05-26-2007, 08:42 PM
On Sat, 26 May 2007 21:45:07 +0200, Michael Heiming wrote:

> Indeed, nice shot. I see other options I hadn't seen last time
> checking the man page. Presuming the OP had done his homework, I
> didn't bother to take a look before replying...


One should never make such assumptions regarding outhouse excess users

 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      05-27-2007, 11:41 PM
Allen Kistler <(E-Mail Removed)> writes:

>lucatrv wrote:
>> Hi, I'd like to ask if it's possible to restrict access to the internet to
>> an application (i.e. the list of files which belongs to a package).
>> Under windows there are plenty of firewall programs, which make you decide
>> if an application should access the internet or not.


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?

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

>> I looked on internet and didn't find anything similar under linux. For what
>> I could understand, neither apparmor or selinux can do that...


>The netfilter owner module can accomplish this objective (according to
>the man page, though I've never used it). The switch you want is
>--cmd-owner, however the man page also states that cmd matching is
>broken on SMP machines. YMMV

 
Reply With Quote
 
 
 
Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Propriatpry Access Application and Network Access Tom Windows Networking 4 10-26-2008 01:52 AM
Allowing a given port to only be access by a given application nathanjlaw@yahoo.com Windows Networking 2 06-18-2008 11:17 PM
Application access using TS and Virtual Private Server ThomasAJ Windows Networking 3 01-13-2008 10:34 PM
Forbid connections on 0.0.0.0 address. Pavel Vasilyev Linux Networking 16 04-10-2007 04:28 AM
Delay while application resolves first access to server Jane D Broadband 11 12-10-2005 01:24 PM



1 2 3 4 5 6 7 8 9 10 11