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 / carp / README < prev   
Text File  |  1992-03-10  |  4KB  |  84 lines

  1.  
  2. CARP (COPS Analysis and Report Program)
  3.  
  4.   A new idea for cops... at usenix, everyone was griping about big
  5. networks, and how to keep an eye on things, so I thought of a potential
  6. partial solution...
  7.  
  8.   IMPORTANT!!!  The program described here will *ONLY* work on cops
  9. report files if the report files were created with the "-v" flag to cops!
  10.  
  11.   Let's assume you use cops (or this won't do you a hell of a lot of
  12. good :-)) on your network.  You use NFS to mount the cops stuff, or
  13. you just mail/copy the report files back to the cops directory;
  14. assume you have something like:
  15.  
  16. /path/to/cops ----  sun3_subdirectory_with_binaries (and subdirs sun3a,
  17.               \                    sun3b, etc., each holding result files)
  18.                \
  19.                 \--  sun4_subdir (+subdirs...)
  20.                  \
  21.                   \-- dec_mips_subdir (+...)
  22.                    \
  23.                     \-- ad nausaeum.
  24.  
  25.   Here's what happens; carp does a 'find' on the cops dir for all sub-
  26. directories containing the standard "year_month_day" types of cops report
  27. files.  This gives a list of all the subdirs (e.g. hosts) that have cops
  28. reports in them.  I then take the newest one in each directory, scan it for
  29. problems, and then output a summary that looks something like this (a 0 == a
  30. problem that gives instant root access, 1 == a miscellaneous serious problem
  31. (guessed password, whatever), 2 == who knows -- something cops reports
  32. but I can't determine on an arbitrary machine (/etc/foo world writable,
  33. or whatever)):
  34.  
  35. COPS warning summary, Mon Jan 27 16:47:42 PST 1992
  36.  
  37. hostname      rep date     crn dev ftp grp hme is pass msc pwd rc  rot usr
  38. ===========================================================================
  39. sunshine     1992_Jan_14  |   |   |   |   | 1 | 2 |   |   | 2 | 2 | 2 |   |
  40. rayban       1992_Jan_26  | 1 |   |   | 2 |   | 2 |   |   | 2 | 2 | 2 | 1 |
  41. neuromancer  1992_Jan_27  |   |   | 2 |   | 1 | 2 |   |   | 2 | 2 | 2 |   |
  42. sun          1992_Jan_26  |   |   | 2 | 2 | 1 | 2 |   |   | 2 | 2 |   | 1 |
  43. foo_eng      1992_Jan_26  |   | 2 |   |   |   | 2 |   |   |   | 2 |   |   |
  44. death        1992_Jan_15  |   |   |   | 2 | 1 | 2 |   |   | 2 | 2 | 0 |   |
  45.  
  46.   This way you can scan your whole net at a glance, and see where the most
  47. serious and/or reoccuring problems are on your net (the number in the
  48. columns gives you the most serious warning of the check in question, of
  49. course.)  The X version ("xcarp") of this program (due out within a
  50. month or so) will do the same thing, plus you'll be able to click on a
  51. host or host problem area and have it pull up the host report(s); click on
  52. a specific problem header, you get the report for that problem (guessed
  53. passwords, whatever.)  Instead of numbers, it uses round circles (filled,
  54. half filled, or empty, corresponding to 0, 1, 2.)
  55.  
  56.   The key is that all of the numbers are generated by awk filters that
  57. are easily modifiable, and include an exception filter handling device
  58. to delete things you don't want to hear about; for instance, if you run
  59. tftp, know about it, and don't *care* that COPS keeps bitching about it,
  60. you can put a line in the report generating file like:
  61.  
  62. /tftp is enabled on/ { next }
  63.  
  64.   That says everytime that (regexp) line is encountered, awk will just
  65. skip over it, so it won't trigger the usual warning on the summary sheet.
  66. Caution, though, this is real awk code, so position is important in the file --
  67. for instance, to check for tftp, the filter has a line like:
  68.  
  69. /tftp is enabled on/ {print FILENAME, check, "1"; next }
  70.  
  71.   ("1" is the warning level it prints out.)  If you put the first line
  72. after the second line, then it will never see the second line, since
  73. the "next" says to go to the next line in the cops result file.  "*"'s
  74. and "?"'s and the lot are all cool, of course, since it's all in awk,
  75. but they slow things down, of course.  It's deathly slow right now --
  76. about 10 seconds to process each host on a sparc2, but speed doesn't
  77. matter that much here, IMHO (plus I can optimize it by just moving
  78. around the regexp's in awk (that's what sucks in all the time) and/or
  79. rewriting the code.  Try using [gmn]awk for a bit of speed increase
  80. as well.
  81.  
  82.   Now you can read the man page :-)
  83.  
  84.