View previous topic :: View next topic |
Author |
Message |
IINeOII n00b
Joined: 29 Aug 2003 Posts: 43
|
Posted: Sat Feb 21, 2004 8:35 am Post subject: Mit IPTABLES einen User "einsperren" |
|
|
Hi leute ich habe folgendes problem,
ich versuche seit einiger Zeit einen User (am client) so weit einzuschränken das er nicht aufs internet zugreifen kann, sondern nur auf den server.
quwasi soll er den server einwandfrei erreichen können aber nicht das i-net
so meine frage:
Giebt es möglichkeiten außer iptables (mit denen krieg ichs nich hin) einen User auf ein Bestimmtes Interface zu binden z.b. vm auf eth0:0 mit ip 192.168.1.2 am servert bräuchte ich dann nurnoch das i-face eth0:0 192.168.1.1 und könnte den rest über iptables steuern, hat jemand ne idee hab schon rum gegoogelt finde aber nix. |
|
Back to top |
|
|
Beforegod Bodhisattva
Joined: 10 Apr 2002 Posts: 1494 Location: Frankfurt/Main
|
Posted: Sat Feb 21, 2004 10:23 am Post subject: |
|
|
Läuft der Zugriff aus Internet über nen Proxy oder über NAT? |
|
Back to top |
|
|
IINeOII n00b
Joined: 29 Aug 2003 Posts: 43
|
Posted: Sat Feb 21, 2004 11:46 am Post subject: |
|
|
über NAT mit postrouting fürs subnet |
|
Back to top |
|
|
toskala Advocate
Joined: 14 Dec 2002 Posts: 2080 Location: hamburg, germany
|
Posted: Sat Feb 21, 2004 11:57 am Post subject: |
|
|
also wenn man iptables mich nicht anlügt kann es sowas wohl.
Quote: | owner
This module attempts to match various characteristics of the packet creator, for locally-gener-
ated packets. It is only valid in the OUTPUT chain, and even this some packets (such as ICMP
ping responses) may have no owner, and hence never match.
--uid-owner userid
Matches if the packet was created by a process with the given effective user id.
--gid-owner groupid
Matches if the packet was created by a process with the given effective group id.
--pid-owner processid
Matches if the packet was created by a process with the given process id.
--sid-owner sessionid
Matches if the packet was created by a process in the given session group.
--cmd-owner name
Matches if the packet was created by a process with the given command name. (this option
is present only if iptables was compiled under a kernel supporting this feature) |
_________________ adopt an unanswered post
erst denken, dann posten |
|
Back to top |
|
|
IINeOII n00b
Joined: 29 Aug 2003 Posts: 43
|
Posted: Sat Feb 21, 2004 2:10 pm Post subject: |
|
|
Jo ich kenne das schon habs auch mit owner match probiert aber irgendwie will das nich so wirklich weil wenn ich bsp:
owner vm wird umgeleitet nach 192.168.1.1
dies ist die addresse des alias interfaces eth0:0 aufm server
die packete kommen jetzt zwar nicht mehr ins i-net aber der user kann auch nicht mehr mit dem server kommuniziern schätze das liegt daran das er keine antwort erhalten kann weil der server denkt die ip packete kommen weiterhin von 192.168.0.2 was sie ja auch tun, sowas in der richtung halt bin grad verwirrt |
|
Back to top |
|
|
ruth Retired Dev
Joined: 07 Sep 2003 Posts: 640 Location: M / AN / BY / GER
|
Posted: Sat Feb 21, 2004 5:17 pm Post subject: |
|
|
hi,
geht doch aber ned so out-of-the-box...hihi
schau mal hier:
Code: |
--snip--
The patch allows you to use the owner match in the INPUT chain to match
properties of the receiving socket. It is mainly intended to help filter weird
protocols like H.323 or IIOB without conntrack helpers, but could also come
handy for local user traffic accounting and similar stuff.
Usage:
iptables -A INPUT -m udp/tcp -m owner ...
Example:
# Allow packets on eth0 to sockets owned by local user gnugk
iptables -A INPUT -i eth0 -p udp -m owner --uid-owner gnugk -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -m owner --uid-owner gnugk -j ACCEPT
--snip--
|
zu finden auf www.netfilter.org -> sektion patch-o-matic -> extra repository...
hoffe, geholfen zu haben
also die OUTPUT chain wie im posting von oben schon (toskala), dann INPUT chain mit dem patch.
schon gehts...
gruss
rootshell _________________ "The compiler has tried twice to abort and cannot do so; therefore, compilation will now terminate."
-- IBM PL/I (F) error manual |
|
Back to top |
|
|
henri Apprentice
Joined: 15 Nov 2002 Posts: 182 Location: Germany
|
Posted: Thu Mar 10, 2005 7:09 am Post subject: |
|
|
Hi Ruth,
da Du hier von Patch-o-matic redest und ich bisher auf meine Frage, wie man patch-o-matic am besten mit Gentoo verwendet noch keine Antwort bekommen habe, frag ich einfach mal Dich
Wie verwendest Du denn patch-o-matic mit gentoo? Installierst Du iptables dann manuell (ohne emerge)?
Und wenn ja, wie verhinderst Du ein automatisches Update ohne jedes Mal, wenn eine neue Iptables Version in portage auftaucht, diese zu maskieren? - Ich denke, das wäre notwendig, da patch-o-matic ja auch die Sourcen von Iptables benötigt. Oder liege ich da falsch?
Wäre nett, wenn Du (Nicht nur mir ) diese Frage beantworten könntest.
Mit freundlichem Gruss,
Henri |
|
Back to top |
|
|
moe Veteran
Joined: 28 Mar 2003 Posts: 1289 Location: Potsdam / Germany
|
Posted: Thu Mar 10, 2005 8:27 am Post subject: |
|
|
henri wrote: | Hi Ruth,
Wie verwendest Du denn patch-o-matic mit gentoo?
Wäre nett, wenn Du (Nicht nur mir ) diese Frage beantworten könntest. |
Darf ichs auch tun?
euse -i extensions wrote: |
local use flags (searching: extensions)
************************************************************
[- ] extensions (net-firewall/iptables):
Enable support for 3rd patch-o-matic extensions
|
HTH Maurice |
|
Back to top |
|
|
TheSmallOne Guru
Joined: 22 Jan 2005 Posts: 467 Location: Germany
|
Posted: Thu Mar 10, 2005 9:46 am Post subject: |
|
|
-–- gelöscht -–-
Last edited by TheSmallOne on Sat Dec 22, 2012 12:28 pm; edited 1 time in total |
|
Back to top |
|
|
Anarcho Advocate
Joined: 06 Jun 2004 Posts: 2970 Location: Germany
|
Posted: Thu Mar 10, 2005 10:42 am Post subject: |
|
|
Quote: | für sowas braucht man weder Aliase noch irgendwelche Umleitungen... oder habe ich irgendwas falsch verstanden? |
Das gleiche habe ich auch gerade gedacht ....
Warum einfach, wenn es auch kompliziert geht... _________________ ...it's only Rock'n'Roll, but I like it! |
|
Back to top |
|
|
slick Bodhisattva
Joined: 20 Apr 2003 Posts: 3495
|
Posted: Thu Mar 10, 2005 1:16 pm Post subject: |
|
|
@ IINeOII
Also ich habe das richtig verstanden wenn es um einen "Multi-User-Client" bei dem alle User außer User X ins Internet dürfen. Oder geht es evt. doch darum das ein kompletter Client nicht ins Internet darf, die anderen Clients aber schon.
Wenn das erste Szenario, dann finde ich auch das Post von TheSmallOne sehr passend. |
|
Back to top |
|
|
Ragin l33t
Joined: 14 Apr 2003 Posts: 776
|
Posted: Thu Mar 10, 2005 2:50 pm Post subject: |
|
|
Sollte es das Szenario sein, dass du einfach nur einen anderen PC nicht im Internet frei geben willst kannst du ja die IP Adresse einfach blocken oder generell (je nachdem, wie groß dein Netzwerk ist) nur bestimmte IP-Adressen für das Internet freigeben. _________________ "Innerhalb der Computergemeinschaft lebt man nach der Grundregel, die Gegenwart sei ein Programmfehler, der in der nächsten Ausgabe behoben sein wird."
Clifford Stoll, amerik. Astrophysiker u. Computer- Pionier |
|
Back to top |
|
|
ro Apprentice
Joined: 28 Mar 2003 Posts: 289
|
Posted: Thu Mar 10, 2005 4:57 pm Post subject: |
|
|
zB:
iptables -A OUTPUT -m owner --uid-owner $USERID -p tcp --tcp-flags SYN,ACK,FIN,RST SYN -j REJECT
ist natürlich nicht komplett, aber ne kleine quick'n'dirty lösung. _________________ Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. |
|
Back to top |
|
|
TheSmallOne Guru
Joined: 22 Jan 2005 Posts: 467 Location: Germany
|
Posted: Thu Mar 10, 2005 6:16 pm Post subject: |
|
|
-–- gelöscht -–-
Last edited by TheSmallOne on Sat Dec 22, 2012 12:28 pm; edited 1 time in total |
|
Back to top |
|
|
reptile Guru
Joined: 19 Nov 2002 Posts: 363
|
Posted: Thu Mar 10, 2005 9:30 pm Post subject: |
|
|
oder er hat sich jetzt komplett selbst aus dem internet ausgesperrt |
|
Back to top |
|
|
henri Apprentice
Joined: 15 Nov 2002 Posts: 182 Location: Germany
|
Posted: Mon Mar 14, 2005 5:34 pm Post subject: |
|
|
moe wrote: |
Darf ichs auch tun?
euse -i extensions wrote: |
local use flags (searching: extensions)
************************************************************
[- ] extensions (net-firewall/iptables):
Enable support for 3rd patch-o-matic extensions
|
HTH Maurice |
Ja klar, gerne.
Wenn ich das richtig gesehen habe, werden dann nur zwei zusätzliche patches installiert.
Ich möchte gerne string-match support.
Ich hab natürlich auch schon patch-o-matic-ng installiert, aber ich bekomme es einfach nicht hin, dass "emerge iptables" trotz FEATURES="... keeptmp" die von emerge entpackten und mit den gentoo patches gepatchten Sourcen NICHT löscht damit ich hinterher patch-o-matic darauf loslassen kann.
Wie mach ich das denn bitte am besten?
Vielen Dank schomal im Voraus,
Gruss Henri |
|
Back to top |
|
|
slick Bodhisattva
Joined: 20 Apr 2003 Posts: 3495
|
Posted: Wed Mar 16, 2005 7:56 am Post subject: |
|
|
Also wenns um Patchen "während" des emerge geht habe ich einen "Workaround"... nach dem entpacken und patchen der Quellen (durch emerge) schnell STRG + Z drücken um den Prozess einzufrosten, dann die Quellen in /var/tmp/portage/... entsprechend patchen und dann mit dem Befehl "fg 1" den Prozess weiter machen lassen. Obwohl es hier im Forum sicher einige andere Alternativen gibt. |
|
Back to top |
|
|
|