|Colman Reilly||Jul 5, 1997 3:43 am|
|Adam Shostack||Jul 5, 1997 8:17 am|
|Colman Reilly||Jul 5, 1997 2:33 pm|
|Jordan K. Hubbard||Jul 5, 1997 4:47 pm|
|Christopher Petrilli||Jul 6, 1997 11:27 am|
|Jonathan M. Bresler||Jul 6, 1997 2:50 pm|
|Brian Mitchell||Jul 6, 1997 3:20 pm|
|Jonathan M. Bresler||Jul 6, 1997 5:13 pm|
|Colman Reilly||Jul 7, 1997 1:45 am|
|Duane H. Hesser||Jul 7, 1997 7:48 am|
|Robert N Watson||Jul 7, 1997 10:08 am|
|Brian Mitchell||Jul 7, 1997 10:58 am|
|Adam Shostack||Jul 7, 1997 11:03 am|
|Sean Eric Fagan||Jul 7, 1997 11:37 am|
|Robert N Watson||Jul 7, 1997 11:46 am|
|Jonathan M. Bresler||Jul 7, 1997 11:53 am|
|Robert Watson||Jul 7, 1997 1:04 pm|
|Kenneth Stailey||Jul 7, 1997 1:05 pm|
|Brian Mitchell||Jul 7, 1997 1:38 pm|
|pro...@suburbia.net||Jul 7, 1997 2:29 pm|
|Jim Shankland||Jul 7, 1997 3:46 pm|
|Daniel O'Callaghan||Jul 7, 1997 4:20 pm|
|Mark Newton||Jul 7, 1997 4:47 pm|
|Adam Shostack||Jul 7, 1997 5:58 pm|
|Adam Shostack||Jul 7, 1997 6:09 pm|
|Poul-Henning Kamp||Jul 7, 1997 11:10 pm|
|Robert Watson||Jul 8, 1997 8:45 am|
|Robert Watson||Jul 8, 1997 8:58 am|
|Colman Reilly||Jul 8, 1997 12:33 pm|
|Ollivier Robert||Jul 8, 1997 1:20 pm|
|George Robbins||Jul 8, 1997 1:59 pm|
|Mark Newton||Jul 8, 1997 5:29 pm|
|Robert Watson||Jul 9, 1997 9:09 am|
|Eivind Eklund||Jul 9, 1997 9:57 am|
|David Holland||Jul 9, 1997 3:09 pm|
|Wes Peters||Jul 9, 1997 10:07 pm|
|Subject:||Re: Security Model/Target for FreeBSD or 4.4?|
|From:||Robert N Watson (rn...@andrew.cmu.edu)|
|Date:||Jul 7, 1997 11:46:51 am|
On Mon, 7 Jul 1997, Adam Shostack wrote:
I brough up the idea of doing this on the openbsd list. We agreed that there wasn't a clean way to do it. I'm experimenting with ways of doing it, leaning towords a sysctl controlled list of port, gid pairs. I don't know of anyone who has implemented it.
The overhead should be pretty minimal.
I chose not to depend on files, which is ugly, but not so ugly as having the kernel depend on files during startup.
My assumption was a default boot config of only root being able to bind <1024, but then using syscall adding port,uid pairs. I'm not sure what all the connotations of using port,gid vs port,uid are -- gid does seem to be a better idea, as it seem to fit the existing daemon, mail, bin, www, groupings, and in the context of FreeBSD's default matching of one group per uid, it is just as flexible. Are there any other issues involved here? What daemons would end up running as the same user? fingerd could run as nobody (or a finger user) as it needs minimal access. bind, for example, would benefit more from a seperate dns user (which would be nice also when it comes to implementing a secure resolver and key management system), and sendmail could finally run as group mail, user mail (?) and just have the local delivery agents run as suid root? Not sure what all the implications are there, either. Some rewriting of code would have to take place, and that might not work as well.
The other thought that has occured to me, but I expect it to be more expensive, is to use a packet filter with NAT capabilities to translate port bindings to high numbers for appropriate daemons. Since this has a per packet hit, I expect it to be very expensive on an ongoing basis.
I had also hoped for something a little more flexible/portable, or something based a little more on a traditional interface to the system. I also considered a less open approach to port permissions -- requiring that all port binding in any range be permitted by a system-wide policy. Under such a system, rc.ports would be called by the rc boot sequence (prior to going multi-user) to enable binding access for various gids or uids using sysctl. When the securelevel increased, the default permissions for binding a port would change from default-permit (except <1024) to default-deny, meaning that only explicitely permitted services would be disabled. One can argue that this might cause more prolems than it solved, as it would effectively cripple many of the more useful UNIX daemons, not to mention normal user applications :). In particular, you would lose portmapper-related utilities, not to mention UDP-based query services (like DNS.) Obviously, such an implementation would require a much more significant rewrite of user-side code, and is not feasible for general-release systems in the short term.
A few more comments on implementing port-binding permissions:
Verifying permission on a port would require high-order operations, even allowing for hashing: any attempted bind to a <1024 port would require many comparisons against gid, etc. Would we require the only gid be compared be the first in the gid list? Just to throw out another idea I had floating around, which may not be a useful one: would a /ports filesystem mapping be useful for permissions? All ports < 1024 would have a filesystem entry, and permissions on the port file would determine whether they could be bound or not (possibly overkill on the whole concept, but if we're trhowing around extending the socket facilities..)
Additionally, maybe permissions on port access could be applied to other port ranges than <1024. For example, we could prevent non-root users from binding port 6000-6010, preventing a local denail of service attack. (not very useful, but..) A stricter security policy could then optionally be implemented. I'd rather not have users clog up ports 6000-6010, as they could prevent an X server for running, or break X forwarding in ssh, so could add a requirement that root access be used to bind that port. Again, the securelevel + sysctl could be used to determine the default action.
Well, just some speculation. Finding an elegant way to implement permissions on ports would be nice. Since the filesystem is the traditional approach to permissions, maybe we should be looking at that as a mechanism, similar perhaps to /proc. This seems a bit redundant given that sockets already have a filesystem representation..