summaryrefslogtreecommitdiff
path: root/cfengine/cf.services.harden
blob: bca0aa83dcb24e277c01b57bb008f426ea9399e9 (plain)
  1. control:
  2.     logcheck = ( /etc/logcheck )
  3. # type viser om maskinen er workstation eller server. Bruges til at linke de rigtige steder
  4. # hen i logcheck
  5. Standalone_xenux:: type = ( workstation )
  6. !Standalone_xenux:: type = ( server )
  7. editfiles:
  8. # AIDE section
  9. { /etc/aide/aide.conf
  10. #
  11. # Devices = p+i+n+u+g+s+b+md5+sha1
  12. #
  13. # Ignore ctime - some devices change ctime when used (ttySx with hylafax)
  14. #
  15. BeginGroupIfNoLineMatching "^[[:blank:]]*Devices[[:blank:]]*=.*"
  16. Append "Devices = p+i+n+u+g+s+b+md5+sha1 # Added by cfengine"
  17. EndGroup
  18. LocateLineMatching "^[[:blank:]]*Devices[[:blank:]]*=.*"
  19. BeginGroupIfNoLineMatching "^[[:blank:]]*Devices[[:blank:]]*=[[:blank:]][\+pinugsbmd5sha1]*([[:blank:]]+(#.*)?)?"
  20. ReplaceLineWith "Devices = p+i+n+u+g+s+b+md5+sha1 # Edited by cfengine"
  21. EndGroup
  22. #
  23. # #/var/log...
  24. #
  25. # Ignore logfiles - Aide can't handle rotation
  26. #
  27. HashCommentLinesMatching "^/var/log.*"
  28. #
  29. # !/dev/xconsole
  30. # !/dev/core
  31. # !/dev/ttyS*
  32. #
  33. LocateLineMatching "^[[:blank:]]*\!/dev/.*"
  34. CatchAbort
  35. BeginGroupIfNoLineMatching "^[[:blank:]]*\!/dev/.*"
  36. GotoLastLine
  37. EndGroup
  38. DeleteLinesMatching "^\!/dev/xconlsole # Added by cfengine"
  39. BeginGroupIfNoLineMatching "^[[:blank:]]*\!/dev/xconsole([[:blank:]]+(#.*)?)?"
  40. InsertLine "!/dev/xconsole # Added by cfengine"
  41. EndGroup
  42. BeginGroupIfNoLineMatching "^[[:blank:]]*\!/dev/core([[:blank:]]+(#.*)?)?"
  43. InsertLine "!/dev/core # Added by cfengine"
  44. EndGroup
  45. BeginGroupIfNoLineMatching "^[[:blank:]]*\!/dev/ttyS\*([[:blank:]]+(#.*)?)?"
  46. InsertLine "!/dev/ttyS* # Added by cfengine"
  47. EndGroup
  48. }
  49. ## logcheck section
  50. #{ /etc/aide/aide.conf
  51. #}
  52. { /etc/integrit/integrit.conf
  53. #
  54. # Uncomment suggested defaults
  55. #
  56. SetCommentStart "# "
  57. SetCommentEnd ""
  58. UnCommentLinesMatching "^# root=/"
  59. UnCommentLinesMatching "^# known=/var/lib/integrit/.*"
  60. UnCommentLinesMatching "^# current=/var/lib/integrit/.*"
  61. UnCommentLinesMatching "^# !/cdrom"
  62. UnCommentLinesMatching "^# !/dev"
  63. UnCommentLinesMatching "^# !/etc"
  64. UnCommentLinesMatching "^# !/floppy"
  65. UnCommentLinesMatching "^# !/home"
  66. UnCommentLinesMatching "^# !/lost\+found"
  67. UnCommentLinesMatching "^# !/mnt"
  68. UnCommentLinesMatching "^# !/proc"
  69. UnCommentLinesMatching "^# !/root"
  70. UnCommentLinesMatching "^# !/tmp"
  71. UnCommentLinesMatching "^# !/var"
  72. UnCommentLinesMatching "^# =/usr/include"
  73. UnCommentLinesMatching "^# =/usr/X11R6/include"
  74. UnCommentLinesMatching "^# =/usr/doc"
  75. UnCommentLinesMatching "^# =/usr/info"
  76. UnCommentLinesMatching "^# =/usr/share"
  77. UnCommentLinesMatching "^# =/usr/X11R6/man"
  78. UnCommentLinesMatching "^# =/usr/X11R6/lib/X11/fonts"
  79. UnCommentLinesMatching "^# !/usr/local"
  80. UnCommentLinesMatching "^# !/usr/src"
  81. AppendIfNoSuchLine "!/initrd"
  82. AppendIfNoSuchLine "!/.journal"
  83. AppendIfNoSuchLine "!/usr/local"
  84. AppendIfNoSuchLine "!/usr/src"
  85. AppendIfNoSuchLine "!/dev/cpu/mtrr"
  86. }
  87. { /etc/cron.daily/integrit
  88. #
  89. # Uncomment defaults
  90. #
  91. SetCommentStart " # ! "
  92. SetCommentEnd ""
  93. UnCommentLinesMatching " # ! if .*"
  94. UnCommentLinesMatching " # ! fi"
  95. }
  96. links:
  97. NameServer::
  98. $(logcheck)/ignore.d/local-bind -> $(LocalCommon)/logcheck/ignore.d.$(type)/bind
  99. $(logcheck)/violations.ignore.d/local-bind -> $(LocalCommon)/logcheck/violations.ignore.d/bind
  100. FileServer::
  101. $(logcheck)/ignore.d/local-samba -> $(LocalCommon)/logcheck/ignore.d.$(type)/samba
  102. $(logcheck)/ignore.d/local-netatalk -> $(LocalCommon)/logcheck/ignore.d.$(type)/netatalk
  103. $(logcheck)/violations.ignore.d/local-samba -> $(LocalCommon)/logcheck/violations.ignore.d/samba
  104. DHCPServer::
  105. $(logcheck)/ignore.d/local-dhcp -> $(LocalCommon)/logcheck/ignore.d.$(type)/dhcp
  106. $(logcheck)/ignore.d/local-dhcp3-common -> $(LocalCommon)/logcheck/ignore.d.$(type)/dhcp3-common
  107. WWWServer::
  108. FTPServer::
  109. $(logcheck)/ignore.d/local-proftpd -> $(LocalCommon)/logcheck/ignore.d.$(type)/proftpd
  110. $(logcheck)/violations.ignore.d/local-proftpd -> $(LocalCommon)/logcheck/violations.ignore.d/proftpd
  111. IMAPServer::
  112. $(logcheck)/ignore.d/local-uw-imap -> $(LocalCommon)/logcheck/ignore.d.$(type)/uw-imap
  113. any::
  114. # Sættes alt efter om det er server eller workstation. Pakken peger på workstation
  115. $(logcheck)/ignore.d ->! $(logcheck)/ignore.d.$(type)
  116. $(logcheck)/logcheck.ignore ->! $(logcheck)/logcheck.ignore.$(type)
  117. $(logcheck)/ignore.d/local-ssh -> $(LocalCommon)/logcheck/ignore.d.$(type)/ssh
  118. $(logcheck)/ignore.d/local-postfix -> $(LocalCommon)/logcheck/ignore.d.$(type)/postfix
  119. $(logcheck)/violations.ignore.d/local-ssh -> $(LocalCommon)/logcheck/violations.ignore.d/ssh
  120. $(logcheck)/violations.ignore.d/local-postfix -> $(LocalCommon)/logcheck/violations.ignore.d/postfix