home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / security / berferd < prev    next >
Text File  |  1998-08-26  |  11KB  |  213 lines

  1. I appreciate the large number of replies and suggestions on this
  2. thread, and ought to reply.
  3.  
  4. First, two clarifications:  (1) "hugin" is no longer Red Hat-based:
  5. I rebuilt it from the ground up, on Debian 2.0, with shadow passwords
  6. and xinetd.  (I'll hold comments about the new Debian until later.)  
  7. I immediately disabled all "r" commands and all other services in 
  8. xinetd.conf except for telnet and ftp, changed all passwords, and
  9. have not yet issued the new ones to my users.  I also have not yet used 
  10. incoming telnet and ftp (except anonymous), pending my securing them
  11. against sniffing (or finding satisfactory substitutes).
  12.  
  13. I've installed Qualcomm qpopper (POP3/APOP), imapd, and poppassd,
  14. but likewise haven't yet used them or added them to xinetd.conf.
  15. I've also taken out just about all the stock CGI, though I haven't
  16. seriously worked on Apache (1.3.0) yet.
  17.  
  18. Since I knew precisely what Berferd had done, and had checksums of
  19. all original files, I didn't _have_ to rebuild, but had independent
  20. reasons to do so.
  21.  
  22. (2) The "problem" I posed to the list was securing incoming shell access, 
  23. and incoming ftp/POP for my shell users (against neighbour machines on
  24. my LAN running TCP sniffers _without driving my users crazy_ (emphasis 
  25. added).  "Securing" in this context means ensuring that no plaintext
  26. passwords useful for break-in can be sniffed.  (Only shell users' 
  27. passwords are particularly useful for break-in, so non-login users' 
  28. passwords aren't an issue, here.)
  29.  
  30. Many of these folks (my users) are clueless Windows/Mac people.  I can't 
  31. tell them all to get ssh/scp.  I do not intend to kick them off.  At 
  32. the same time, I have a frequent need for remote access to my machine
  33. from places that lack anything but generic Windows software facilities,
  34. and I cannot change this.
  35.  
  36. Given the variety of "target" machines at 744 Harrison (mine, Electric
  37. Lichen's, Richard Couture's, The CoffeeNet's, and San Francisco PC Users
  38. Group's), all on the same LAN, it's safest to assume that any of them
  39. might become root-compromised and running a sniffer.  Thus the "problem"
  40. I posed.  "Firewalls" (a vague term that includes filtering routers
  41. and a variety of different types of proxy gateways) are not an option,
  42. for reasons I won't go into.
  43.  
  44. I envision three phases of protection (or of security breakdown, depending
  45. on your perspective) against LAN-based attack:  (1) The cracker must get
  46. one of your user's passwords, either by sniffing on the LAN, social
  47. engineering, or trying a cracked password the user employed on some other
  48. compromised machine (i.e., your user commits the common error of using the
  49. same password on multiple systems).  (2) Once logged in as your user,
  50. the cracker must gain root, using one of a variety of root exploits, or 
  51. sometimes by running crack against /etc/passwd.  (Note that I now run
  52. shadowed passwords.)  (3) You, the sysadmin, have to not detect the prior
  53. two steps & correct them.
  54.  
  55. The "problem" I posed concerned step #1, getting one of your user passwords.
  56. Prevent that, and you've stopped TCP-sniffing attacks, entirely.  (Yes,
  57. I'm aware that there are other caregories.)  Step #2 I've partially 
  58. addressed by having as few security-sensitive binaries, this time around,
  59. as possible.  For example, hugin has no X servers/utils.  (It runs 
  60. headless at the moment, so that's not a problem for me.)  Step #3 I
  61. address by _immediately_ doing "cd / ; find -ls > /root/INSTALLED_FILES",
  62. plus lists of all suid/sgid-root files, and store them offline for later
  63. use in validating files.  Please note that this means I don't have to
  64. rely on RPM/dpkg/etc. to validate files -- _and_ can spot new suid/sgid
  65. files that would not be detected by package managers at all.
  66.  
  67. Yes, I know about tripwire, COPS, SATAN, chkexploits, tiger, etc.  Those 
  68. are available _on_ hugin, in the ftp tree -- by the way.  The idea of
  69. a "security auditing" machine has been kicked around *ix people for some
  70. time:  The machine has no LAN connections, accepts log/auditing information 
  71. on one serial port, and sends out warnings on another.  Difficult to
  72. compromise -- very hardened.  Another idea that I _love_ is putting
  73. static parts of the filesystem (including /etc.) on a SCSI drive whose
  74. write-protect jumper is wired to the (now-useless) front-panel "turbo"
  75. switch.  Mount the drive read-write, but frob the button to render the
  76. drive non-writable.  Thereafter, you can temporarily make it writable
  77. using the switch, do an edit as root, and then switch it back -- no
  78. rebooting.
  79.  
  80. Problem #1 can also be address through hardware -- switching hubs, which
  81. localise traffic.  One such is the 8-port, 10/100 Mbps NetGear FS508.
  82. Suggested retail is $1,650 for the 8-port version.
  83.  
  84. Rafael:  I'm surprised that _you're_ surprised about The CoffeeNet's
  85. LAN getting compromised.  Think about the physical situation, and you'll
  86. see that there's an inherent security problem.
  87.  
  88. Let's discuss each of the three problematic services (that by default
  89. use plaintext passwords) separately:
  90.  
  91. 1.  REMOTE LOGIN:
  92.  
  93. S/Key rules.  I think I'll install it and mandate its use, before handing
  94. users their new passwords.  (Thank you, Mark.)  My clueless users will 
  95. bleat in dismay over having to use sheets of one-time passwords, but 
  96. they'll get over it.  (I'll have to find it, somewhere.)
  97.  
  98. SSH 1.2.26 rules, too.  I just now got sshd going, which is a tremendous
  99. relief, because I can finally answer mail in an xterm again.  (Yay!)
  100.  
  101. I _tried_ to put in ssh 2.0.8.  Misery:  Used the 1.x ssh client at The 
  102. CoffeeNet, and got "no compatible protocols".  Rumour has it that the
  103. free *ix package omits IDEA, Blowfish, and RSA.  That sucketh.  Further 
  104. rumours talk about open-source alternatives that sound extremely unfinished.
  105. I think I'll wait for the dust to settle, before trying again.
  106.  
  107. I will get a hold of the SecureCRT trial Win32 client, and the free client
  108. from http://www.doc.ic.ac.uk/~ci2/ssh/, and check them out.  If necessary,
  109. I'll shell out for the one from DataFellows.  My users can either follow
  110. suit or start learning to love S/KEY.  ;->
  111.  
  112. ssh-agent, by the way (included with ssh) is very handy for top security,
  113. as it prevents having to write security-sensitive data on the client
  114. hard drive.  It keeps all such data in RAM, only, rather than stupidly
  115. putting them in an .ssh directory.  This drastically reduces the 
  116. monitoring risk, even if you ssh into your machine from a compromised
  117. host.  I'm guessing that the only 'Doze client with even a prayer of
  118. having such functionality is the DataFellows one.
  119.  
  120. Marc:  The reason I plan to set non-login users' default shells to
  121. /usr/bin/passwd instead of omitting a shell entirely is that I
  122. consider that binary trustworthy, and it's useful to allow such
  123. users to change their passwords by just telnetting in.
  124.  
  125.  
  126. 2.  FILE ACCESS (ftp):
  127.  
  128. Again, I'm reluctant to turn off non-anonymous ftp entirely and tell users 
  129. to get ssh/scp.  (I'm tempted.)  I'm tempted to even advise them to
  130. file-attach their files to e-mail, instead of ftp-ing them in.  Non-anon
  131. ftp is evil, but it's really tough to eliminate.
  132.  
  133. There's scp.  There's rsync -- which, by the way, you can modify (in the
  134. Makefile) to use ssh instead of r-commands.  The new sshd 2.x includes 
  135. something called "sftpd" -- but I'm staying away from 2.x, for now.
  136.  
  137. Dave Zarzycki asks:  "What's wrong with scp?"  For _me_, not much -- 
  138. assuming I have a compatible client with me at the Windows-weenie sites 
  139. I often need to get my files to.  Somewhat deficient on user amenities,
  140. e.g., you need an ssh window open, too, to see "ls" listings.  However,
  141. the big problem is my other users.  They need to ftp files in.
  142.  
  143. For similar reasons, I cannot ssh-encrypt the ftp command channel.
  144.  
  145. Mark Willey reminded me that S/KEY can be retrofitted to one's ftpd, too.
  146. Thank you once more, Mark.  I may do that.
  147.  
  148. The academe betas of wu-ftpd, which I run, are very full-featured, which
  149. is why they've been the subject of so many attacks (along with their
  150. ubiquity).  I can deal with that by keeping up with new releases.  
  151. Among the nice features is the ability to confine users to a specified
  152. chroot environment.  I will consider doing that along with S/KEY.
  153.  
  154. God, I hope I don't have to do a lot of source-code work to accomplish
  155. that:  It's tough enough contending with an unfamiliar distribution 
  156. plus shadow passwords, plus xinetd for the first time, plus BIND 8.x
  157. for the first time.  I have _enough_ to get used to.
  158.  
  159. Marc:  It's not necessary to recompile wu-ftpd to disallow non-anon
  160. ftp access.  You can do this in /etc/ftp-access.
  161.  
  162. 3.  POP3/APOP/IMAP
  163.  
  164. You know, if I'm able to secure telnet and ftp using S/KEY challenges,
  165. I probably won't have to worry about this one.
  166.  
  167. The reason why I don't do POP over SSH should be obvious from the 
  168. foregoing:  I can't impose it on unsophisticated users.  I _would_
  169. like to find out how to mandate APOP, though.  No idea yet how to
  170. manage the apop database -- haven't had time, yet.  Marc:  My 
  171. understanding is that almost all current POP clients _do_ now support
  172. APOP.  I'm willing to exclude those that don't.
  173.  
  174.  
  175. MISCELLANY:
  176.  
  177. Jonathan:  Debian uses an /etc/pam.d directory, rather than /etc/pam.conf.
  178. By default, it contains just an "other" file, with contents I don't yet
  179. understand.  Note that "r" commands are disabled on my system.  However,
  180. I'm tempted to modify adduser to put root-owned, non-writable, zero-length
  181. .rhosts and .shosts files in user home directories, just in case -- and
  182. audit them frequently.
  183.  
  184. Mark:  Debian 2.0 doesn't appear to come with proper nightly 
  185. security-auditing reports to the root user.  <grumble>  I may have 
  186. to set one up.  I've gotten spoiled by FreeBSD, which does it right.
  187.  
  188. I'll allow myself one additional comment on Debian 2.0 directly:  It
  189. ships with Sendmail 8.8.8 (which is OK) -- with default open SMTP 
  190. relaying: an act of negligence in this day and age.  Bad, bad, bad.
  191. (Yes, I know Debian wants you to use smail, but that's beside the
  192. point.)  The current version is 8.9.1 plus a security patch to
  193. prune excessively long MIME headers that could be used to attack
  194. mail clients (MUAs).
  195.  
  196. One more:  dselect's dependency-checking browbeat me into installing
  197. a bunch of X11 libs, for packages that (if I recall correctly) needed
  198. either X _or_ S-Lang.   As mentioned, I was carefully avoiding 
  199. installing X servers or utilities.  This came back to haunt me, today,
  200. when I compiled ssh:  Autoconf detected the X11 libs, concluded that
  201. mine must be an X-supporting system, and then choked and died when
  202. it failed to find xauth.  (I cured this by renaming the /usr/X11R6/lib
  203. directory.)
  204.  
  205. dselect and I have not tended to get along terribly well.  This last
  206. installation was no exception.  I could say more, but that would be
  207. at the expense of focus, so I won't.
  208.  
  209. -- 
  210. Cheers,
  211. Rick Moen                      "vi is my shepherd; I shall not font."
  212. rick (at) hugin.imat.com                          -- Psalm 0.1 beta
  213.