netfilter as ACL for SOCK_RAW, binding, netadmin
I am aware of at least one kernel patch to introduce some type of ACLs into port binding, making raw sockets, and doing assorted administrative work. Ie:
http://killa.net/infosec/acls/
http://folk.sourceforge.net/
However, this mechanism is clunky and inflexible.
Linux capabilities theoretically allow administrators to do similar things. But this approach requires FS support and login hooks that either don't exist or are not in mainstream kernels.
Suggestion: it would make a lot of sense if there were a netfilter hook that allowed the existing flexible netfilter/iptables policy mechanisms to make these decisions.
For example, the following sort of command might allow httpd to be run without root:
iptables -t ACL -A BIND -m owner --uid-owner www -p tcp --sport 80 -j ACCEPT
And something like this might give all users the ability to run ping without SUID:
iptable -t ACL -A SOCK_RAW -m owner --exec-owner /bin/ping -j ACCEPT
It would be great for Linux security to be able to remove SUID and SGID from a bunch (or all!) of the networking commands, and it would be great to be able to use tcpdump and ethereal under Linux without root. Performance for such calls is rarely critical.
- Morty
Quoted 12 lines · Mordechai T. Abzug
Suggestion: it would make a lot of sense if there were a netfilter hook that allowed the existing flexible netfilter/iptables policy mechanisms to make these decisions.
For example, the following sort of command might allow httpd to be run without root:
iptables -t ACL -A BIND -m owner --uid-owner www -p tcp --sport 80 -j ACCEPT
And something like this might give all users the ability to run ping without SUID:
Quoted 6 lines
iptable -t ACL -A
SOCK_RAW-m owner --exec-owner/bin/ping-j ACCEPTIt would be great for Linux security to be able to remove SUID and SGID from a bunch (or all!) of the networking commands, and it would be great to be able to use tcpdump and ethereal under Linux without root. Performance for such calls is rarely critical.
the problem is that iptables is a packet filter. it operates on packets. In short, it is a black box that compares a packet with a set of rules. If there is no packet, you cannot make any decision.
So if you would base your policy on iptables, every process is still able to bind, but all the packets you send get discarded.
Quoted 2 lines
- Morty
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie