summaryrefslogtreecommitdiff
path: root/cfengine/cf.services.harden
blob: 5aa2e4a58b08344274f9351cd67d097784c96a5f (plain)
  1. editfiles:
  2.     # AIDE section
  3. { /etc/aide/aide.conf
  4. #
  5. # Devices = p+i+n+u+g+s+b+md5+sha1
  6. #
  7. # Ignore ctime - some devices change ctime when used (ttySx with hylafax)
  8. #
  9. BeginGroupIfNoLineMatching "^[[:blank:]]*Devices[[:blank:]]*=.*"
  10. Append "Devices = p+i+n+u+g+s+b+md5+sha1 # Added by cfengine"
  11. EndGroup
  12. LocateLineMatching "^[[:blank:]]*Devices[[:blank:]]*=.*"
  13. BeginGroupIfNoLineMatching "^[[:blank:]]*Devices[[:blank:]]*=[[:blank:]][\+pinugsbmd5sha1]*([[:blank:]]+(#.*)?)?"
  14. ReplaceLineWith "Devices = p+i+n+u+g+s+b+md5+sha1 # Edited by cfengine"
  15. EndGroup
  16. #
  17. # #/var/log...
  18. #
  19. # Ignore logfiles - Aide can't handle rotation
  20. #
  21. HashCommentLinesMatching "^/var/log.*"
  22. #
  23. # !/dev/xconsole
  24. # !/dev/core
  25. # !/dev/ttyS*
  26. #
  27. LocateLineMatching "^[[:blank:]]*\!/dev/.*"
  28. CatchAbort
  29. BeginGroupIfNoLineMatching "^[[:blank:]]*\!/dev/.*"
  30. GotoLastLine
  31. EndGroup
  32. DeleteLinesMatching "^\!/dev/xconlsole # Added by cfengine"
  33. BeginGroupIfNoLineMatching "^[[:blank:]]*\!/dev/xconsole([[:blank:]]+(#.*)?)?"
  34. InsertLine "!/dev/xconsole # Added by cfengine"
  35. EndGroup
  36. BeginGroupIfNoLineMatching "^[[:blank:]]*\!/dev/core([[:blank:]]+(#.*)?)?"
  37. InsertLine "!/dev/core # Added by cfengine"
  38. EndGroup
  39. BeginGroupIfNoLineMatching "^[[:blank:]]*\!/dev/ttyS\*([[:blank:]]+(#.*)?)?"
  40. InsertLine "!/dev/ttyS* # Added by cfengine"
  41. EndGroup
  42. }
  43. ## logcheck section
  44. #{ /etc/aide/aide.conf
  45. #}
  46. { /etc/integrit/integrit.conf
  47. #
  48. # Uncomment suggested defaults
  49. #
  50. SetCommentStart "# "
  51. SetCommentEnd ""
  52. UnCommentLinesMatching "^# root=/"
  53. UnCommentLinesMatching "^# known=/var/lib/integrit/.*"
  54. UnCommentLinesMatching "^# current=/var/lib/integrit/.*"
  55. UnCommentLinesMatching "^# !/cdrom"
  56. UnCommentLinesMatching "^# !/dev"
  57. UnCommentLinesMatching "^# !/etc"
  58. UnCommentLinesMatching "^# !/floppy"
  59. UnCommentLinesMatching "^# !/home"
  60. UnCommentLinesMatching "^# !/lost\+found"
  61. UnCommentLinesMatching "^# !/mnt"
  62. UnCommentLinesMatching "^# !/proc"
  63. UnCommentLinesMatching "^# !/root"
  64. UnCommentLinesMatching "^# !/tmp"
  65. UnCommentLinesMatching "^# !/var"
  66. UnCommentLinesMatching "^# =/usr/include"
  67. UnCommentLinesMatching "^# =/usr/X11R6/include"
  68. UnCommentLinesMatching "^# =/usr/doc"
  69. UnCommentLinesMatching "^# =/usr/info"
  70. UnCommentLinesMatching "^# =/usr/share"
  71. UnCommentLinesMatching "^# =/usr/X11R6/man"
  72. UnCommentLinesMatching "^# =/usr/X11R6/lib/X11/fonts"
  73. UnCommentLinesMatching "^# !/usr/local"
  74. UnCommentLinesMatching "^# !/usr/src"
  75. AppendIfNoSuchLine "!/initrd"
  76. AppendIfNoSuchLine "!/.journal"
  77. AppendIfNoSuchLine "!/usr/local"
  78. AppendIfNoSuchLine "!/usr/src"
  79. }
  80. { /etc/cron.daily/integrit
  81. #
  82. # Uncomment defaults
  83. #
  84. SetCommentStart " # ! "
  85. SetCommentEnd ""
  86. UnCommentLinesMatching " # ! if .*"
  87. UnCommentLinesMatching " # ! fi"
  88. }