home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / cops_104.zip / cops_104 / README.2.sh < prev    next >
Text File  |  1992-03-10  |  8KB  |  162 lines

  1.  
  2.   This file covers the configuration and execution of the shell/C
  3. version of COPS.  As a rough time estimate, it took about 6.5 minutes on
  4. my host (a SPARCstation 2) to make the programs and generate a report
  5. (not including the SUID checker, which does a find on "/").
  6.  
  7. 1) How to Configure COPS
  8. -------------------------
  9.  
  10.   System V users, other Non-BSD systems, or sites with commands in
  11. strange places may have to run a shell script called "reconfig" to
  12. change the pathnames of the executable programs called when using COPS.
  13. In general, if your system does not use the paths listed in the shell
  14. scripts, try running "reconfig".  COPS should run fine then, if it can
  15. find all of the commands (reconfig will tell you if it cannot).  If
  16. trouble persists, you will have to change the paths to your executable
  17. files (awk, sed, etc) by hand.  A drag, I know.  If in doubt, run the
  18. shell script.  It can't hurt.  Or at least shouldn't.  If it does hurt,
  19. you're probably in trouble anyway.
  20.  
  21.   With all the varieties of unix, there are a few types that may need
  22. extra help to run the system.  There are "readme" files for several
  23. systems in the distribution (see the files "readme.*" in the "docs"
  24. directory).  If you have any troubles, drop me a line and I'll see what
  25. I can do about working out a patch/fix/workaround with you.  Some
  26. problems might arise with some SYSV machines (heck, or any machine :-)),
  27. due to weird files and names for stuff.  What can I say?  Portability
  28. is a problem.
  29.  
  30.   C2 (as in NCSC standards -- B1, C2, etc.), NIS/YP, or shadow password
  31. users can also look at "readme.*" files for suggestions on how to best
  32. run/utilize COPS.
  33.  
  34. 2) Running COPS for the First Time
  35. -----------------------------------
  36.  
  37.    Since most of COPS was written and tested on just a few machines (at
  38. least compared to the total number out there!), you may have significant
  39. differences that were not anticipated -- unfortunately (or fortunately)
  40. UNIX is not quite standardized yet.  However, I haven't run into a UNIX
  41. that I haven't been able to get it running on, with just a small amount
  42. of change (at least for the shell version -- perl is another story :-(
  43. ), so feel free to mail to me for help.  Note that the following info is
  44. for the shell version only -- read "README.perl" for information on how
  45. to install and run the perl version.
  46.  
  47.    COPS is run by simply typing "cops".  "cops" is a Bourne shell script
  48. that runs each of the programs, accumulates the output, and then either
  49. mails any results or stores them in a file.  "suid.chk" (and possibly
  50. "crc.chk") is the only package that is meant to be run separately, both
  51. because it can take a long time to run and because it needs a privileged
  52. account (i.e. root) to run it; look at "suid.man" for more information.
  53. By all means, however, do not ignore the SUID checker!  Run it at least
  54. once a week, more (daily?) if possible; intruders often leave SUID files
  55. to gain privileges later.  You should also run "crc.chk".  It can either
  56. be run as a standalone program (preferred), or as part of the COPS
  57. package; read the file "CRC.README" and the man page for more
  58. information.
  59.  
  60.    To run COPS for the first time, follow these steps:
  61.  
  62.    -- Look at the disclaimer, file "disclaimer".  Don't sue me.
  63.  
  64.    -- Type "make" to compile the C programs and to make the shell programs
  65.       executable, "make man" to create the formatted manual pages, or "make
  66.       all" to make both the programs and documentation.
  67.  
  68.       A couple of potential (hopefully minor problems), probably only
  69.       for SysV based machines:
  70.  
  71.       If you don't have the "-ms" package for nroff (i.e. you, get an
  72.       error message about it after typing "make"), just remove the "-ms"
  73.       flag -- change line 15 of the "docs/makefile" file, from:
  74.  
  75.       ROFFLAGS   = -ms
  76.         to
  77.       ROFFLAGS   =
  78.  
  79.       The password checking program may fail to compile.  If so, try 
  80.       uncommenting line 29 in "makefile" -- this will enable the
  81.       "BRAINDEADFLAGS = -lcrypt" flag.  If this doesn't work, you can
  82.       either work it out (and tell me about your solution) or e-mail me,
  83.       and we'll work it together.
  84.  
  85.    -- Read the technical report (in the "docs" directory) to understand
  86.       what COPS is doing and what is going on -- "COPS.report".  Although
  87.       this is out of date, this does give a look at the philosophies,
  88.       design, and general outlay of the COPS system and UNIX security.
  89.       This can be forsaken by those who just want to get to the results/see
  90.       some action (people like me), but it might prove interesting to some. 
  91.  
  92.    -- Change lines 93 and 94 in the "cops" shell file.  They are
  93.       originally:
  94.  
  95.         SECURE=/usr/foo/bar
  96.         SECURE_USERS="foo@bar.edu"
  97.  
  98.       SECURE should be the same directory as the directory that contains 
  99.       the COPS programs, and SECURE_USERS should be your own login id,
  100.       or whomever you designate as the recipient of the output.
  101.  
  102.       Alternately, you can use the "-s" flag to "cops" to specify the
  103.       secure directory, and the "-m" flag will make cops both mail the
  104.       report (see next item) and specify the user to be mailed to.
  105.  
  106.    -- Set "MMAIL=NO" in the "cops" shell file (line 42; it is this by
  107.       default).  This will prevent a large mail file of warnings from
  108.       choking the mailer.  All of the output will be put into a file
  109.       called "year_month_day" (obviously, that's like: "1991_Dec_31",
  110.       not actually the words, "year_month_day" :-)), which is
  111.       automatically placed by COPS in a directory that has the same name
  112.       as the host it was run on (e.g., your own hostname.)  Hence, the
  113.       final report will be in "./hostname/year_month_day".
  114.  
  115.       If you prefer to have the report mailed (don't do this the first
  116.       time) set this variable to YES and the report will be mailed to
  117.       $SECURE_USERS, or use the "-m" flag and specify the user on the
  118.       command line.
  119.  
  120.    -- Look at the directory and file configuration file, "is_able.lst" 
  121.       This contains critical files that COPS checks for group- and
  122.       world-writability and readability.  Add or delete whatever files
  123.       or directories you wish; if a file doesn't exist, COPS will ignore
  124.       it. (If you don't know or are uncertain what files/directories are 
  125.       important, what is given there is a good set to start with on most
  126.       systems.)
  127.  
  128.    -- If you allow anonymous ftp access to your system, add a "-a" flag
  129.       to "ftp.chk" on line 193 of "cops".  Right now, it is set up so
  130.       that key files and directories are expected to be owned by root;
  131.       however, it has provisions for two owners, $primary and $secondary
  132.       -- some may wish to change the second to "ftp", or some other
  133.       user. Read the man page for ftp.chk or look at "ftp.chk" for
  134.       further notes. 
  135.  
  136.    -- You may wish to comment out the password checker (line 200 in the 
  137.       "cops" shell file), for immediate gratification.  However, it is 
  138.       generally a very bad idea to do this unless you plan to use
  139.       another password cracker, such as "crack" (see the "extensions"
  140.       directory for more info).  If you are using yellow pages/NIS, read
  141.       "readme.yp" for tips on how to check passwords with it; if you are
  142.       using shadow passwords, read "readme.shadow".
  143.  
  144.    -- Uncomment out the crc checker, "crc.chk" (lines 218-220 and
  145.       224-226), if you desire to run it as part of the normal COPS run --
  146.       highly recommended!
  147.  
  148.    You should be ready to roll.  COPS is run by simply typing "cops"
  149. (you may wish to put it in the background).  If you followed my advice
  150. and set "MMAIL=NO" in the "cops" shell file, after COPS is finished
  151. there will be a report file created ("year_month_day") that includes the
  152. time and machine it was created on.  Otherwise, COPS will mail the
  153. report to the user(s) listed on the line 'SECURE_USERS="foo@bar.edu"'
  154. (or by the -m flag.)  There is a file called "warnings" which contains most
  155. of the warning messages that COPS uses, a brief explanation of how the
  156. message might pertain to your system, and finally a suggestion as how to
  157. "fix" any problem.
  158.  
  159. WARNING NOTE: Change the shell script "cops" to reflect who you want the
  160. output sent to and where the location of the program is BEFORE running the
  161. program!
  162.