home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / protocol / tcpip / 5727 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  5.7 KB

  1. Xref: sparky comp.protocols.tcp-ip:5727 comp.unix.bsd:10576
  2. Newsgroups: comp.protocols.tcp-ip,comp.unix.bsd
  3. Path: sparky!uunet!gatech!rpi!think.com!ames!agate!dog.ee.lbl.gov!hellgate.utah.edu!fcom.cc.utah.edu!cs.weber.edu!terry
  4. From: terry@cs.weber.edu (A Wizard of Earth C)
  5. Subject: Re: Limiting Telnet access.
  6. Message-ID: <1992Dec23.025239.2566@fcom.cc.utah.edu>
  7. Sender: news@fcom.cc.utah.edu
  8. Organization: Weber State University  (Ogden, UT)
  9. References: <1992Dec21.211508.9555@mtu.edu> <1992Dec22.183213.10002@mtu.edu>
  10. Date: Wed, 23 Dec 92 02:52:39 GMT
  11. Lines: 113
  12.  
  13. In article <1992Dec22.183213.10002@mtu.edu> tony@mtu.edu (Tony Dal Santo) writes:
  14. >tony@mtu.edu (Tony Dal Santo) writes:
  15. >>
  16. >>Along these lines, I am curious if anyone has an idea how to allow
  17. >>certain users access to the network, and deny others.  Something
  18. >>like putting the user in group "network" to grant them access.  By
  19. >>access, I mean system call level access like socket().  Even better
  20. >>would be to provide a list of addresses/networks that are restricted/
  21. >>allowed.
  22. >>
  23. >>I imagine with a streams implementation of tcp/ip, you could change
  24. >>the perms on /dev/ip or /dev/tcp.
  25. >>
  26. >>Does anyone have any utilities for tracing a TCP port to a process number?
  27. >>
  28. >Evidently I was not too clear since I have received a few pointers
  29. >directing me to inetd wrappers.  I am interested in restricting/granting
  30. >users access TO the network FROM my hosts.  I can restrict access to
  31. >the binaries (telnet, ftp, etc), but this doesn't stop them from compiling
  32. >their own copies of these utilities.  The only way I see to filter access
  33. >is to control system calls like socket(), bind(), accept().  I can limit
  34. >access to networks via routing tables, but this doesn't provide user-level
  35. >granularity.
  36. >
  37. >While inetd wrappers are nice, I don't see them addressing the problem.
  38. >Once I get access to your machine, I will bring my own set of utilities
  39. >with me (inetd), and avoid the administrators attempts at logging.
  40. >Granted that some of the users "daemons" (e.g. ftpd) won't be as functional
  41. >as the real ones because they don't run as root, but they will certainly
  42. >let me gain access and avoid being logged.  Sure, as an administrator I
  43. >can see these processes, and kill them off.  Then the users will restart
  44. >them via cron(8) and at(1).  I don't have the time to play hide and seek
  45. >with users.
  46.  
  47. There is no way to do this short of implementing it in the kernel.  Whether
  48. this is a mod you make to a streams stack or to the Net/2 TCP/IP code is
  49. irrelevant -- as long as it is in the kernel.
  50.  
  51.  
  52. As long as users are allowed access to the C compiler/tools, no matter
  53. what you do, they will be able to directly make system calls; therefore
  54. a user space implementation is not useful.
  55.  
  56. Another implementation doomed to failure is an autopush streams module that
  57. sits between /dev/tcp and the tcp driver.  This is because of the fact that,
  58. even though you may be able to autopush it, the user can I_PEEK and I_POP
  59. it.  An additional difficulty is maintaining the socket assignment state
  60. information for the top layer, since there would not be direct communication
  61. of state information between it and the real TCP stack.
  62.  
  63. This basically leaves real kernel mods as your only choice, unless you are
  64. willing to go to group limitation and have a streams implementation; even
  65. then, if you allow user mountable devices (floppies, tapes in UFS format,
  66. etc.), the user can make their own device nodes.
  67.  
  68.  
  69. Assuming you have a streams implementation, and are willing to go SGID on
  70. all your network utilities, a group "netutil" will work; you can implement
  71. it by removing general permissions to the devices; users will not be able
  72. to implement SGID programs in the "netutil" group without being a member
  73. of the group or superuser.
  74.  
  75. You might also set group membership for those users allowed unrestricted
  76. access to the devices.
  77.  
  78.  
  79. An alternate method is the use of "exclusion groups".  Basically, you set
  80. group ownerships to group "png" of the devices, chmod 606 them.  Since
  81. group access is checked *before* general access, access will be denied
  82. to any member of the group "png".
  83.  
  84.  
  85. Finally, you _can_ modify the system calls used for networking (there are
  86. a lot of them) and rebuild your kernel.  This will do little good if you
  87. have streams in any form at all, since it is still possible to build up
  88. utilities from raw I/O to the streams devices or duplicates of the streams
  89. device nodes.
  90.  
  91. Happy kernel hacking!
  92.  
  93.  
  94. ------------------
  95. All in all, this generally isn't a reasonable thing to want to do.
  96.  
  97. An alternate that everyone else uses is to buy a Cisco (or similar box)
  98. and put it between you and the net.  Use the Cisco to limit outgoing
  99. connects to the standard ports
  100.  
  101. ------------------
  102.  
  103. Tracing a TCP port (or UDP port, since UDP is usable for TFTP style utilities
  104. in user land) is possible, but requires detailed knowledge of the kernel and
  105. the TCP implementation.  If it is a streams implementation, you'd be better
  106. off providing an instrumentation interface in the streams driver itself to
  107. allow you to do this.  Even then, the information would be unreliable, since
  108. the state of /dev/kmem (where you will be getting at least some of the data)
  109. is not fixed for the duration of your access to it; you will end up with
  110. more of a "snapshot", similar to the "ps" command.
  111.  
  112. ------------------
  113.  
  114.  
  115.                     Terry Lambert
  116.                     terry@icarus.weber.edu
  117.                     terry_lambert@novell.com
  118. ---
  119. Any opinions in this posting are my own and not those of my present
  120. or previous employers.
  121. -- 
  122. -------------------------------------------------------------------------------
  123.                                         "I have an 8 user poetic license" - me
  124.  Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
  125. -------------------------------------------------------------------------------
  126.