LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-28-2010, 12:20 PM   #1
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Rep: Reputation: 51
iptables mode not available


hi,

Going by a tutorial found here ( see below quote ).
Quote:
Owner match

The owner match extension is used to match packets based on the identity of the process that created them. The owner can be specified as the process ID either of the user who issued the command in question, that of the group, the process, the session, or that of the command itself. This extension was originally written as an example of what iptables could be used for. The owner match only works within the OUTPUT chain, for obvious reasons: It is pretty much impossible to find out any information about the identity of the instance that sent a packet from the other end, or where there is an intermediate hop to the real destination. Even within the OUTPUT chain it is not very reliable, since certain packets may not have an owner. Notorious packets of that sort are (among other things) the different ICMP responses. ICMP responses will never match.

Table 10-24. Owner match options
Match --cmd-owner
Kernel 2.3, 2.4, 2.5 and 2.6
Example iptables -A OUTPUT -m owner --cmd-owner httpd
Explanation

This is the command owner match, and is used to match based on the command name of the process that is sending the packet. In the example, httpd is matched. This match may also be inverted by using an exclamation sign, for example -m owner ! --cmd-owner ssh.
I tried to add a rule for my torrent client with
Code:
 iptables -A OUTPUT -m owner --cmd-owner transmission -j ACCEPT
However, iptables kicks it back with
Code:
iptables v1.4.4: unknown option `--cmd-owner'
Try `iptables -h' or 'iptables --help' for more information.
The mode isnt even referenced in the iptables man on my system. Am I missing something?

Current System: Ubuntu 10.04
 
Old 07-28-2010, 08:29 PM   #2
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
oops

Ok, so I guess that iptables connection tracking by process has been broken since kernel 2.0.0 ( SMP ) . I want to set up some rules based on the command-name. Any ideas on how I can do this?
 
Old 07-29-2010, 07:06 PM   #3
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
can anyone give some advice on setting up rules in iptables based on the owning PROCESS rather than the process-OWNER? I would like to allow traffic based on the command. Since -m owner --cmd-owner has been broken since the release of the SMP kernels what can i do?
 
Old 07-29-2010, 09:36 PM   #4
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
replacement for -m owner --cmd-owner in iptables??

Is anyone found a way to allow / disallow traffic based on PID or command name since -m owner --cmd-owner is currently broken since kernel release 2.0 ?? I see that i can build rules based on user and group ID. However, I have been unable to figure out a way to build rules based on PID / command.

Could really use some input. I have seen dynamic rule scripts which are not really what I need to do. Is it possible to do this with out needing a "10 pound hammer" ( i.e: using iptables only):?

I could really use the help. At this point i have only been able to find reference to automated rule generation based on user or port. USER based would be to wide open and PORT would cause such a pain to the logs.
 
Old 07-31-2010, 07:00 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I have merged your 2 closely-related threads. One thread per topic, please.
 
Old 09-21-2010, 04:00 PM   #6
LQ-Robert
LQ Newbie
 
Registered: Sep 2010
Posts: 5

Rep: Reputation: 8
I've been looking for this functionality for years and I've never run across it. I just found out about the --cmd-owner IPTables option, so I guess my searches have been poor. But that doesn't work with Xbuntu 9 or Ubuntu 10, so what's the answer? There are several firewalls that work at the app level on Windows - heck even the built Win7 firewall does - and there's a really nice one for iOS (FirewallIP). Surely, oh surely there must be something in Linux that lets you set networking permissions on a per-program basis.
 
Old 09-21-2010, 11:11 PM   #7
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
hi,

the closest I came to finding a way to do this was with L-7 User Space. YOu can read up on it here. Still wasnt what I needed. Then again, my jedi skills are lacking and it may be the fix.
 
Old 09-21-2010, 11:11 PM   #8
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
hi,

the closest I came to finding a way to do this was with L-7 User Space. YOu can read up on it here. Still wasnt what I needed. Then again, my jedi skills are lacking and it may be the fix.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables on a promiscuous mode interface aarondcounts Linux - Networking 3 12-10-2009 03:32 AM
OS X like Stealth Mode - iptables ?? phpinfo Linux - Security 1 02-11-2009 05:52 PM
iptables test mode walidaly Linux - Security 11 03-07-2007 11:54 PM
Iptables in promiscuous mode Barzan Linux - Networking 3 10-23-2005 07:24 AM
IPTables in Stealth mode bentman78 Linux - Networking 1 04-06-2004 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04: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