Advertisement
Guest User

csf.conf

a guest
Sep 30th, 2014
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 83.96 KB | None | 0 0
  1. ###############################################################################
  2. # SECTION:Initial Settings
  3. ###############################################################################
  4. # Testing flag - enables a CRON job that clears iptables incase of
  5. # configuration problems when you start csf. This should be enabled until you
  6. # are sure that the firewall works - i.e. incase you get locked out of your
  7. # server! Then do remember to set it to 0 and restart csf when you're sure
  8. # everything is OK. Stopping csf will remove the line from /etc/crontab
  9. #
  10. # lfd will not start while this is enabled
  11. TESTING = "1"
  12.  
  13. # The interval for the crontab in minutes. Since this uses the system clock the
  14. # CRON job will run at the interval past the hour and not from when you issue
  15. # the start command. Therefore an interval of 5 minutes means the firewall
  16. # will be cleared in 0-5 minutes from the firewall start
  17. TESTING_INTERVAL = "5"
  18.  
  19. # SECURITY WARNING
  20. # ================
  21. #
  22. # Unfortunately, syslog and rsyslog allow end-users to log messages to some
  23. # system logs via the same unix socket that other local services use. This
  24. # means that any log line shown in these system logs that syslog or rsyslog
  25. # maintain can be spoofed (they are exactly the same as real log lines).
  26. #
  27. # Since some of the features of lfd rely on such log lines, spoofed messages
  28. # can cause false-positive matches which can lead to confusion at best, or
  29. # blocking of any innocent IP address or making the server inaccessible at
  30. # worst.
  31. #
  32. # Any option that relies on the log entries in the files listed in
  33. # /etc/syslog.conf and /etc/rsyslog.conf should therefore be considered
  34. # vulnerable to exploitation by end-users and scripts run by end-users.
  35. #
  36. # NOTE: Not all log files are affected as they may not use syslog/rsyslog
  37. #
  38. # The option RESTRICT_SYSLOG disables all these features that rely on affected
  39. # logs. These options are:
  40. # LF_SSHD LF_FTPD LF_IMAPD LF_POP3D LF_BIND LF_SUHOSIN LF_SSH_EMAIL_ALERT
  41. # LF_SU_EMAIL_ALERT LF_CONSOLE_EMAIL_ALERT LF_DISTATTACK LF_DISTFTP
  42. # LT_POP3D LT_IMAPD PS_INTERVAL UID_INTERVAL WEBMIN_LOG LF_WEBMIN_EMAIL_ALERT
  43. # PORTKNOCKING_ALERT
  44. #
  45. # This list of options use the logs but are not disabled by RESTRICT_SYSLOG:
  46. # ST_ENABLE SYSLOG_CHECK LOGSCANNER CUSTOM*_LOG
  47. #
  48. # The following options are still enabled by default on new installations so
  49. # that, on balance, csf/lfd still provides expected levels of security:
  50. # LF_SSHD LF_FTPD LF_POP3D LF_IMAPD LF_SSH_EMAIL_ALERT LF_SU_EMAIL_ALERT
  51. #
  52. # If you set RESTRICT_SYSLOG to "0" or "2" and enable any of the options listed
  53. # above, it should be done with the knowledge that any of the those options
  54. # that are enabled could be triggered by spoofed log lines and lead to the
  55. # server being inaccessible in the worst case. If you do not want to take that
  56. # risk you should set RESTRICT_SYSLOG to "1" and those features will not work
  57. # but you will not be protected from the exploits that they normally help block
  58. #
  59. # The recommended setting for RESTRICT_SYSLOG is "3" to restrict who can access
  60. # the syslog/rsyslog unix socket.
  61. #
  62. # For further advice on how to help mitigate these issues, see
  63. # /etc/csf/readme.txt
  64. #
  65. # 0 = Allow those options listed above to be used and configured
  66. # 1 = Disable all the options listed above and prevent them from being used
  67. # 2 = Disable only alerts about this feature and do nothing else
  68. # 3 = Restrict syslog/rsyslog access to RESTRICT_SYSLOG_GROUP
  69. RESTRICT_SYSLOG = "0"
  70.  
  71. # The following setting is used if RESTRICT_SYSLOG is set to 3. It restricts
  72. # write access to the syslog/rsyslog unix socket(s). The group must not already
  73. # exists in /etc/groups before setting RESTRICT_SYSLOG to 3, so set the option
  74. # to a unique name for the server
  75. #
  76. # You can add users to this group by changing /etc/csf/csf.syslogusers and then
  77. # restarting lfd afterwards. This will create the system group and add the
  78. # users from csf.syslogusers if they exist to that group and will change the
  79. # permissions on the syslog/rsyslog unix socket(s). The socket(s) will be
  80. # monitored and the permissions re-applied should syslog/rsyslog be restarted
  81. #
  82. # Using this option will prevent some legitimate logging, e.g. end-user cron
  83. # job logs
  84. #
  85. # If you want to revert RESTRICT_SYSLOG to another option and disable this
  86. # feature, change the setting of RESTRICT_SYSLOG and then restart lfd and then
  87. # syslog/rsyslog and the unix sockets will be reset
  88. RESTRICT_SYSLOG_GROUP = "mysyslog"
  89.  
  90. # This options restricts the ability to modify settings within this file from
  91. # the csf UI. Should the parent control panel be compromised, these restricted
  92. # options could be used to further compromise the server. For this reason we
  93. # recommend leaving this option set to at least "1" and if any of the
  94. # restricted items need to be changed, they are done so from the root shell
  95. #
  96. # 0 = Unrestricted UI
  97. # 1 = Restricted UI
  98. # 2 = Disabled UI
  99. RESTRICT_UI = "1"
  100.  
  101. # Enabling auto updates creates a cron job called /etc/cron.d/csf_update which
  102. # runs once per day to see if there is an update to csf+lfd and upgrades if
  103. # available and restarts csf and lfd
  104. #
  105. # You should check for new version announcements at http://blog.configserver.com
  106. AUTO_UPDATES = "1"
  107.  
  108. ###############################################################################
  109. # SECTION:IPv4 Port Settings
  110. ###############################################################################
  111. # Lists of ports in the following comma separated lists can be added using a
  112. # colon (e.g. 30000:35000).
  113.  
  114. # Allow incoming TCP ports
  115. TCP_IN = "20,21,22,25,53,80,110,143,443,7171,7172,465,587,993,995"
  116.  
  117. # Allow outgoing TCP ports
  118. TCP_OUT = "20,21,22,25,53,80,110,113,443"
  119.  
  120. # Allow incoming UDP ports
  121. UDP_IN = "20,21,53"
  122.  
  123. # Allow outgoing UDP ports
  124. # To allow outgoing traceroute add 33434:33523 to this list
  125. UDP_OUT = "20,21,53,113,123"
  126.  
  127. # Allow incoming PING
  128. ICMP_IN = "1"
  129.  
  130. # Set the per IP address incoming ICMP packet rate
  131. # To disable rate limiting set to "0"
  132. ICMP_IN_RATE = "1/s"
  133.  
  134. # Allow outgoing PING
  135. ICMP_OUT = "1"
  136.  
  137. # Set the per IP address outgoing ICMP packet rate (hits per second allowed),
  138. # e.g. "1/s"
  139. # To disable rate limiting set to "0"
  140. ICMP_OUT_RATE = "0"
  141.  
  142. ###############################################################################
  143. # SECTION:IPv6 Port Settings
  144. ###############################################################################
  145. # IPv6: (Requires ip6tables)
  146. #
  147. # Pre v2.6.20 kernels do not perform stateful connection tracking, so a static
  148. # firewall is configured as a fallback instead if IPV6_SPI is set to 0 below
  149. #
  150. # Supported:
  151. # Temporary ACCEPT/DENY, GLOBAL_DENY, GLOBAL_ALLOW, SMTP_BLOCK, LF_PERMBLOCK,
  152. # PACKET_FILTER, WATCH_MODE, Advanced Allow/Deny Filters, RELAY_*, CLUSTER_*
  153. #
  154. # Not supported:
  155. # DYNDNS, CC_DENY, CC_ALLOW, CC_ALLOW_FILTER, SYNFLOOD, PORTFLOOD, DYNDNS,
  156. # ICMP_IN, ICMP_OUT, LF_NETBLOCK, MESSENGER, CC_IGNORE, CONNLIMIT,
  157. # CC_ALLOW_PORTS, CC_DENY_PORTS
  158. #
  159. # Partially supported:
  160. # CC_LOOKUPS - reverse DNS only and requires the perl module Socket6 from cpan
  161. #
  162. # MESSENGER service - not supported: no REDIRECT support in ip6tables as yet
  163. #
  164. IPV6 = "1"
  165.  
  166. # IPv6 uses icmpv6 packets very heavily. By default, csf will allow all icmpv6
  167. # traffic in the INPUT and OUTPUT chains. However, this could increase the risk
  168. # of icmpv6 attacks. To restrict incoming icmpv6, set to "1" but may break some
  169. # connection types
  170. IPV6_ICMP_STRICT = "0"
  171.  
  172. # Pre v2.6.20 kernel must set this option to "0" as no working state module is
  173. # present, so a static firewall is configured as a fallback
  174. #
  175. # A workaround has been added for CentOS/RedHat v5 and custom kernels that do
  176. # not support IPv6 connection tracking by opening ephemeral port range
  177. # 32768:61000. This is only applied if IPV6_SPI is not enabled. This is the
  178. # same workaround implemented by RedHat in the sample default IPv6 rules
  179. #
  180. # Because connection tracking does not work on such kernels, applications that
  181. # rely on it (e.g. apache, passive ftp, etc) will not function unless you open
  182. # all outgoing ports. To do this set the following:
  183. #
  184. # TCP6_OUT = "0:65535"
  185. # UDP6_OUT = "0:65535"
  186. #
  187. # If you allow incoming ipv6 DNS lookups you will need to use the following
  188. # directive in the options{} section of your named.conf:
  189. #
  190. #        query-source-v6 port 53;
  191. #
  192. # This will force ipv6 incoming DNS traffic only through port 53
  193. #
  194. # These changes are not necessary if the SPI firewall is used
  195. IPV6_SPI = "1"
  196.  
  197. # Allow incoming IPv6 TCP ports
  198. TCP6_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995"
  199.  
  200. # Allow outgoing TCP ports
  201. TCP6_OUT = "20,21,22,25,53,80,110,113,443"
  202.  
  203. # Allow incoming UDP ports
  204. UDP6_IN = "20,21,53"
  205.  
  206. # Allow outgoing UDP ports
  207. # To allow outgoing traceroute add 33434:33523 to this list
  208. UDP6_OUT = "20,21,53,113,123"
  209.  
  210. ###############################################################################
  211. # SECTION:General Settings
  212. ###############################################################################
  213. # By default, csf will auto-configure iptables to filter all traffic except on
  214. # the loopback device. If you only want iptables rules applied to a specific
  215. # NIC, then list it here (e.g. eth1, or eth+)
  216. ETH_DEVICE = ""
  217.  
  218. # By adding a device to this option, ip6tables can be configured only on the
  219. # specified device. Otherwise, ETH_DEVICE and then the default setting will be
  220. # used
  221. ETH6_DEVICE = ""
  222.  
  223. # If you don't want iptables rules applied to specific NICs, then list them in
  224. # a comma separated list (e.g "eth1,eth2")
  225. ETH_DEVICE_SKIP = ""
  226.  
  227. # To switch from the deprecated iptables "state" module to the "conntrack"
  228. # module, change this to 1
  229. USE_CONNTRACK = "1"
  230.  
  231. # Check whether syslog is running. Many of the lfd checks require syslog to be
  232. # running correctly. This test will send a coded message to syslog every
  233. # SYSLOG_CHECK seconds. lfd will check SYSLOG_LOG log lines for the coded
  234. # message. If it fails to do so within SYSLOG_CHECK seconds an alert using
  235. # syslogalert.txt is sent
  236. #
  237. # A value of betwen 300 and 3600 seconds is suggested. Set to 0 to disable
  238. SYSLOG_CHECK = "0"
  239.  
  240. # Enable this option if you want lfd to ignore (i.e. don't block) IP addresses
  241. # listed in csf.allow in addition to csf.ignore (the default). This option
  242. # should be used with caution as it would mean that IP's allowed through the
  243. # firewall from infected PC's could launch attacks on the server that lfd
  244. # would ignore
  245. IGNORE_ALLOW = "0"
  246.  
  247. # Enable the following option if you want to apply strict iptables rules to DNS
  248. # traffic (i.e. relying on iptables connection tracking). Enabling this option
  249. # could cause DNS resolution issues both to and from the server but could help
  250. # prevent abuse of the local DNS server
  251. DNS_STRICT = "0"
  252.  
  253. # Enable the following option if you want to apply strict iptables rules to DNS
  254. # traffic between the server and the nameservers listed in /etc/resolv.conf
  255. # Enabling this option could cause DNS resolution issues both to and from the
  256. # server but could help prevent abuse of the local DNS server
  257. DNS_STRICT_NS = "0"
  258.  
  259. # Limit the number of IP's kept in the /etc/csf/csf.deny file. This can be
  260. # important as a large number of IP addresses create a large number of iptables
  261. # rules (4 times the number of IP's) which can cause problems on some systems
  262. # where either the the number of iptables entries has been limited (esp VPS's)
  263. # or where resources are limited. This can result in slow network performance,
  264. # or, in the case of iptables entry limits, can prevent your server from
  265. # booting as not all the required iptables chain settings will be correctly
  266. # configured. The value set here is the maximum number of IPs/CIDRs allowed
  267. # if the limit is reached, the entries will be rotated so that the oldest
  268. # entries (i.e. the ones at the top) will be removed and the latest is added.
  269. # The limit is only checked when using csf -d (which is what lfd also uses)
  270. # Set to 0 to disable limiting
  271. DENY_IP_LIMIT = "200"
  272.  
  273. # Limit the number of IP's kept in the temprary IP ban list. If the limit is
  274. # reached the oldest IP's in the ban list will be removed and allowed
  275. # regardless of the amount of time remaining for the block
  276. # Set to 0 to disable limiting
  277. DENY_TEMP_IP_LIMIT = "100"
  278.  
  279. # Enable login failure detection daemon (lfd). If set to 0 none of the
  280. # following settings will have any effect as the daemon won't start.
  281. LF_DAEMON = "1"
  282.  
  283. # Check whether csf appears to have been stopped and restart if necessary,
  284. # unless TESTING is enabled above. The check is done every 300 seconds
  285. LF_CSF = "1"
  286.  
  287. # This option uses IPTABLES_SAVE, IPTABLES_RESTORE and IP6TABLES_SAVE,
  288. # IP6TABLES_RESTORE in two ways:
  289. #
  290. # 1. On a clean server reboot the entire csf iptables configuration is saved
  291. #    and then restored where possible to provide a near instant firewall
  292. #    startup[*]
  293. #
  294. # 2. On csf restart or lfd reloading tables, CC_* as well as SPAMHAUS, DSHIELD,
  295. #    BOGON, TOR are loaded using this method in a fraction of the time than if
  296. #    this setting is disabled
  297. #
  298. # [*]Not supported on all OS platforms
  299. #
  300. # Set to "0" to disable this functionality
  301. FASTSTART = "1"
  302.  
  303. # If you enable this option then whenever a CLI request to restart csf is used
  304. # lfd will restart csf instead within LF_PARSE seconds
  305. #
  306. # This feature can be helpful for restarting configurations that cannot use
  307. # FASTSTART
  308. LFDSTART = "0"
  309.  
  310. # Enable verbose output of iptables commands
  311. VERBOSE = "1"
  312.  
  313. # Enable packet filtering for unwanted or illegal packets. This will drop
  314. # packets that iptables has deemed INVALID (i.e. there is no established TCP
  315. # connection in the state table), or if the TCP flags in the packet are out of
  316. # sequence or illegal in the protocol exchange.
  317. #
  318. # If you see packets being dropped that you would rather allow then disable
  319. # this option by setting it to "0"
  320. PACKET_FILTER = "1"
  321.  
  322. # Perform reverse DNS lookups on IP addresses. (See also CC_LOOKUPS)
  323. LF_LOOKUPS = "1"
  324.  
  325. ###############################################################################
  326. # SECTION:SMTP Settings
  327. ###############################################################################
  328. # Block outgoing SMTP except for root, exim and mailman (forces scripts/users
  329. # to use the exim/sendmail binary instead of sockets access). This replaces the
  330. # protection as WHM > Tweak Settings > SMTP Tweaks
  331. #
  332. # This option uses the iptables ipt_owner/xt_owner module and must be loaded
  333. # for it to work. It may not be available on some VPS platforms
  334. #
  335. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  336. # this server
  337. SMTP_BLOCK = "0"
  338.  
  339. # If SMTP_BLOCK is enabled but you want to allow local connections to port 25
  340. # on the server (e.g. for webmail or web scripts) then enable this option to
  341. # allow outgoing SMTP connections to the loopback device
  342. SMTP_ALLOWLOCAL = "1"
  343.  
  344. # This is a comma separated list of the ports to block. You should list all
  345. # ports that exim is configured to listen on
  346. SMTP_PORTS = "25,465,587"
  347.  
  348. # Always allow the following comma separated users and groups to bypass
  349. # SMTP_BLOCK
  350. #
  351. # Note: root (UID:0) is always allowed
  352. SMTP_ALLOWUSER = ""
  353. SMTP_ALLOWGROUP = "mail,mailman"
  354.  
  355. # This option will only allow SMTP AUTH to be advertised to the IP addresses
  356. # listed in /etc/csf/csf.smtpauth on EXIM mail servers
  357. #
  358. # The additional option CC_ALLOW_SMTPAUTH can be used with this option to
  359. # additionally restrict access to specific countries
  360. #
  361. # This is to help limit attempts at distributed attacks against SMTP AUTH which
  362. # are difficult to achive since port 25 needs to be open to relay email
  363. #
  364. # The reason why this works is that if EXIM does not advertise SMTP AUTH on a
  365. # connection, then SMTP AUTH will not accept logins, defeating the attacks
  366. # without restricting mail relaying
  367. #
  368. # Note: csf and lfd must be restarted if /etc/csf/csf.smtpauth is modified so
  369. # that the lookup file in /etc/exim.smtpauth is regenerated from the
  370. # information from /etc/csf/csf.smtpauth plus any countries listed in
  371. # CC_ALLOW_SMTPAUTH
  372. #
  373. # NOTE: To make this option work you MUST make the modifications to exim.conf
  374. # as explained in "Exim SMTP AUTH Restriction" section in /etc/csf/readme.txt
  375. # after enabling the option here, otherwise this option will not work
  376. #
  377. # To enable this option, set to 1 and make the exim configuration changes
  378. # To disable this option, set to 0 and undo the exim configuration changes
  379. SMTPAUTH_RESTRICT = "0"
  380.  
  381. ###############################################################################
  382. # SECTION:Port Flood Settings
  383. ###############################################################################
  384. # Enable SYN Flood Protection. This option configures iptables to offer some
  385. # protection from tcp SYN packet DOS attempts. You should set the RATE so that
  386. # false-positives are kept to a minimum otherwise visitors may see connection
  387. # issues (check /var/log/messages for *SYNFLOOD Blocked*). See the iptables
  388. # man page for the correct --limit rate syntax
  389. #
  390. # Note: This option should ONLY be enabled if you know you are under a SYN
  391. # flood attack as it will slow down all new connections from any IP address to
  392. # the server if triggered
  393. SYNFLOOD = "1"
  394. SYNFLOOD_RATE = "100/s"
  395. SYNFLOOD_BURST = "150"
  396.  
  397. # Connection Limit Protection. This option configures iptables to offer more
  398. # protection from DOS attacks against specific ports. It can also be used as a
  399. # way to simply limit resource usage by IP address to specific server services.
  400. # This option limits the number of concurrent new connections per IP address
  401. # that can be made to specific ports
  402. #
  403. # This feature does not work on servers that do not have the iptables module
  404. # xt_connlimit loaded. Typically, this will be with MONOLITHIC kernels. VPS
  405. # server admins should check with their VPS host provider that the iptables
  406. # module is included
  407. #
  408. # For further information and syntax refer to the Connection Limit Protection
  409. # section of the csf readme.txt
  410. #
  411. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  412. # this server
  413. CONNLIMIT = "80;30,22;30,7171;30,7172;30"
  414.  
  415. # Port Flood Protection. This option configures iptables to offer protection
  416. # from DOS attacks against specific ports. This option limits the number of
  417. # new connections per time interval that can be made to specific ports
  418. #
  419. # This feature does not work on servers that do not have the iptables module
  420. # ipt_recent loaded. Typically, this will be with MONOLITHIC kernels. VPS
  421. # server admins should check with their VPS host provider that the iptables
  422. # module is included
  423. #
  424. # For further information and syntax refer to the Port Flood Protection
  425. # section of the csf readme.txt
  426. #
  427. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  428. # this server
  429. PORTFLOOD = "7171;tcp;30;150,7172;tcp;30;150,80;tcp;30;40,22;tcp;30;40"
  430.  
  431. # Outgoing UDP Flood Protection. This option limits outbound UDP packet floods.
  432. # These typically originate from exploit scripts uploaded through vulnerable
  433. # web scripts. Care should be taken on servers that use services that utilise
  434. # high levels of UDP outbound traffic, such as SNMP, so you may need to alter
  435. # the UDPFLOOD_LIMIT and UDPFLOOD_BURST options to suit your environment
  436. #
  437. # We recommend enabling User ID Tracking (UID_INTERVAL) with this feature
  438. UDPFLOOD = "1"
  439. UDPFLOOD_LIMIT = "100/s"
  440. UDPFLOOD_BURST = "500"
  441.  
  442. # This is a list of usernames that should not be rate limited, such as "named"
  443. # to prevent bind traffic from being limited.
  444. #
  445. # Note: root (UID:0) is always allowed
  446. UDPFLOOD_ALLOWUSER = "named"
  447.  
  448. ###############################################################################
  449. # SECTION:Logging Settings
  450. ###############################################################################
  451. # Log lfd messages to SYSLOG in addition to /var/log/lfd.log. You must have the
  452. # perl module Sys::Syslog installed to use this feature
  453. SYSLOG = "0"
  454.  
  455. # Drop target for iptables rules. This can be set to either DROP ot REJECT.
  456. # REJECT will send back an error packet, DROP will not respond at all. REJECT
  457. # is more polite, however it does provide extra information to a hacker and
  458. # lets them know that a firewall is blocking their attempts. DROP hangs their
  459. # connection, thereby frustrating attempts to port scan the server.
  460. DROP = "DROP"
  461.  
  462. # Enable logging of dropped connections to blocked ports to syslog, usually
  463. # /var/log/messages. This option needs to be enabled to use Port Scan Tracking
  464. DROP_LOGGING = "1"
  465.  
  466. # Enable logging of dropped incoming connections from blocked IP addresses
  467. #
  468. # This option will be disabled if you enable Port Scan Tracking (PS_INTERVAL)
  469. DROP_IP_LOGGING = "0"
  470.  
  471. # Enable logging of dropped outgoing connections
  472. #
  473. # Note: Only outgoing SYN packets for TCP connections are logged, other
  474. # protocols log all packets
  475. #
  476. # We recommend that you enable this option
  477. DROP_OUT_LOGGING = "1"
  478.  
  479. # Together with DROP_OUT_LOGGING enabled, this option logs the UID connecting
  480. # out (where available) which can help track abuse
  481. DROP_UID_LOGGING = "1"
  482.  
  483. # Only log incoming reserved port dropped connections (0:1023). This can reduce
  484. # the amount of log noise from dropped connections, but will affect options
  485. # such as Port Scan Tracking (PS_INTERVAL)
  486. DROP_ONLYRES = "0"
  487.  
  488. # Commonly blocked ports that you do not want logging as they tend to just fill
  489. # up the log file. These ports are specifically blocked (applied to TCP and UDP
  490. # protocols) for incoming connections
  491. DROP_NOLOG = "67,68,111,113,135:139,445,500,513,520"
  492.  
  493. # Log packets dropped by the packet filtering option PACKET_FILTER
  494. DROP_PF_LOGGING = "0"
  495.  
  496. # Log packets dropped by the Connection Limit Protection option CONNLIMIT. If
  497. # this is enabled and Port Scan Tracking (PS_INTERVAL) is also enabled, IP
  498. # addresses breaking the Connection Limit Protection will be blocked
  499. CONNLIMIT_LOGGING = "0"
  500.  
  501. # Enable logging of UDP floods. This should be enabled, especially with User ID
  502. # Tracking enabled
  503. UDPFLOOD_LOGGING = "1"
  504.  
  505. # Send an alert if log file flooding is detected which causes lfd to skip log
  506. # lines to prevent lfd from looping. If this alert is sent you should check the
  507. # reported log file for the reason for the flooding
  508. LOGFLOOD_ALERT = "0"
  509.  
  510. # Configure csf to watch IP addresses (with csf -w [ip]). This option will add
  511. # overhead to packet traversal through iptables and syslog logging, so should
  512. # only be enabled while actively watching IP addresses. See readme.txt for more
  513. # information on the use of this option
  514. WATCH_MODE = "0"
  515.  
  516. ###############################################################################
  517. # SECTION:Reporting Settings
  518. ###############################################################################
  519. # By default, lfd will send alert emails using the relevant alert template to
  520. # the To: address configured within that template. Setting the following
  521. # option will override the configured To: field in all lfd alert emails
  522. #
  523. # Leave this option empty to use the To: field setting in each alert template
  524. LF_ALERT_TO = ""
  525.  
  526. # By default, lfd will send alert emails using the relevant alert template from
  527. # the From: address configured within that template. Setting the following
  528. # option will override the configured From: field in all lfd alert emails
  529. #
  530. # Leave this option empty to use the From: field setting in each alert template
  531. LF_ALERT_FROM = ""
  532.  
  533. # By default, lfd will send all alerts using the SENDMAIL binary. To send using
  534. # SMTP directly, you can set the following to a relaying SMTP server, e.g.
  535. # "127.0.0.1". Leave this setting blank to use SENDMAIL
  536. LF_ALERT_SMTP = ""
  537.  
  538. # Block Reporting. lfd can run an external script when it performs and IP
  539. # address block following for example a login failure. The following setting
  540. # is to the full path of the external script which must be executable. See
  541. # readme.txt for format details
  542. #
  543. # Leave this setting blank to disable
  544. BLOCK_REPORT = ""
  545.  
  546. # To also run an external script when a temporary block is unblocked. The
  547. # following setting can be the full path of the external script which must be
  548. # executable. See readme.txt for format details
  549. #
  550. # Leave this setting blank to disable
  551. UNBLOCK_REPORT = ""
  552.  
  553. # In addition to the standard lfd email alerts, you can additionally enable the
  554. # sending of X-ARF reports (see http://www.x-arf.org/specification.html). Only
  555. # block alert messages will be sent.
  556. #
  557. # These reports are in a format accepted by many Netblock owners and should
  558. # help them investigate abuse. This option is not designed to automatically
  559. # forward these reports to the Netblock owners and should be checked for
  560. # false-positive blocks before reporting
  561. #
  562. # Note: The following block types are not reported through this feature:
  563. #       LF_PERMBLOCK, LF_NETBLOCK, LF_DISTATTACK, LF_DISTFTP, RT_*_ALERT
  564. X_ARF = "0"
  565.  
  566. # By default, lfd will send emails from the root forwarder. Setting the
  567. # following option will override this
  568. X_ARF_FROM = ""
  569.  
  570. # By default, lfd will send emails to the root forwarder. Setting the following
  571. # option will override this
  572. X_ARF_TO = ""
  573.  
  574. ###############################################################################
  575. # SECTION:Temp to Perm/Netblock Settings
  576. ###############################################################################
  577. # Temporary to Permanent IP blocking. The following enables this feature to
  578. # permanently block IP addresses that have been temporarily blocked more than
  579. # LF_PERMBLOCK_COUNT times in the last LF_PERMBLOCK_INTERVAL seconds. Set
  580. # LF_PERMBLOCK  to "1" to enable this feature
  581. #
  582. # Care needs to be taken when setting LF_PERMBLOCK_INTERVAL as it needs to be
  583. # at least LF_PERMBLOCK_COUNT multiplied by the longest temporary time setting
  584. # (TTL) for blocked IPs, to be effective
  585. #
  586. # Set LF_PERMBLOCK to "0" to disable this feature
  587. LF_PERMBLOCK = "1"
  588. LF_PERMBLOCK_INTERVAL = "86400"
  589. LF_PERMBLOCK_COUNT = "4"
  590. LF_PERMBLOCK_ALERT = "1"
  591.  
  592. # Permanently block IPs by network class. The following enables this feature
  593. # to permanently block classes of IP address where individual IP addresses
  594. # within the same class LF_NETBLOCK_CLASS have already been blocked more than
  595. # LF_NETBLOCK_COUNT times in the last LF_NETBLOCK_INTERVAL seconds. Set
  596. # LF_NETBLOCK  to "1" to enable this feature
  597. #
  598. # This can be an affective way of blocking DDOS attacks launched from within
  599. # the same network class
  600. #
  601. # Valid settings for LF_NETBLOCK_CLASS are "A", "B" and "C", care and
  602. # consideration is required when blocking network classes A or B
  603. #
  604. # Set LF_NETBLOCK to "0" to disable this feature
  605. LF_NETBLOCK = "0"
  606. LF_NETBLOCK_INTERVAL = "86400"
  607. LF_NETBLOCK_COUNT = "4"
  608. LF_NETBLOCK_CLASS = "C"
  609. LF_NETBLOCK_ALERT = "1"
  610.  
  611. ###############################################################################
  612. # SECTION:Global Lists/DYNDNS/Blocklists
  613. ###############################################################################
  614. # Safe Chain Update. If enabled, all dynamic update chains (GALLOW*, GDENY*,
  615. # SPAMHAUS, DSHIELD, BOGON, CC_ALLOW, CC_DENY, ALLOWDYN*) will create a new
  616. # chain when updating, and insert it into the relevant LOCALINPUT/LOCALOUTPUT
  617. # chain, then flush and delete the old dynamic chain and rename the new chain.
  618. #
  619. # This prevents a small window of opportunity opening when an update occurs and
  620. # the dynamic chain is flushed for the new rules.
  621. #
  622. # This option should not be enabled on servers with long dynamic chains (e.g.
  623. # CC_DENY/CC_ALLOW lists) and low memory. It should also not be enabled on
  624. # Virtuozzo VPS servers with a restricted numiptent value. This is because each
  625. # chain will effectively be duplicated while the update occurs, doubling the
  626. # number of iptables rules
  627. SAFECHAINUPDATE = "0"
  628.  
  629. # If you wish to allow access from dynamic DNS records (for example if your IP
  630. # address changes whenever you connect to the internet but you have a dedicated
  631. # dynamic DNS record from the likes of dyndns.org) then you can list the FQDN
  632. # records in csf.dyndns and then set the following to the number of seconds to
  633. # poll for a change in the IP address. If the IP address has changed iptables
  634. # will be updated.
  635. #
  636. # A setting of 600 would check for IP updates every 10 minutes. Set the value
  637. # to 0 to disable the feature
  638. DYNDNS = "0"
  639.  
  640. # To always ignore DYNDNS IP addresses in lfd blocking, set the following
  641. # option to 1
  642. DYNDNS_IGNORE = "0"
  643.  
  644. # The follow Global options allow you to specify a URL where csf can grab a
  645. # centralised copy of an IP allow or deny block list of your own. You need to
  646. # specify the full URL in the following options, i.e.:
  647. # http://www.somelocation.com/allow.txt
  648. #
  649. # The actual retrieval of these IP's is controlled by lfd, so you need to set
  650. # LF_GLOBAL to the interval (in seconds) when you want lfd to retrieve. lfd
  651. # will perform the retrieval when it runs and then again at the specified
  652. # interval. A sensible interval would probably be every 3600 seconds (1 hour).
  653. # A minimum value of 300 is enforced for LF_GLOBAL if enabled
  654. #
  655. # You do not have to specify both an allow and a deny file
  656. #
  657. # You can also configure a global ignore file for IP's that lfd should ignore
  658. LF_GLOBAL = "0"
  659.  
  660. GLOBAL_ALLOW = ""
  661. GLOBAL_DENY = ""
  662. GLOBAL_IGNORE = ""
  663.  
  664. # Provides the same functionality as DYNDNS but with a GLOBAL URL file. Set
  665. # this to the URL of the file containing DYNDNS entries
  666. GLOBAL_DYNDNS = ""
  667.  
  668. # Set the following to the number of seconds to poll for a change in the IP
  669. # address resoved from GLOBAL_DYNDNS
  670. GLOBAL_DYNDNS_INTERVAL = "600"
  671.  
  672. # To always ignore GLOBAL_DYNDNS IP addresses in lfd blocking, set the following
  673. # option to 1
  674. GLOBAL_DYNDNS_IGNORE = "0"
  675.  
  676. # Blocklists are controlled by modifying /etc/csf/csf.blocklists
  677. #
  678. # If you don't want BOGON rules applied to specific NICs, then list them in
  679. # a comma separated list (e.g "eth1,eth2")
  680. LF_BOGON_SKIP = ""
  681.  
  682. # The following option can be used to select either HTTP::Tiny or
  683. # LWP::UserAgent to retrieve URL data. HTTP::Tiny is much faster than
  684. # LWP::UserAgent and is included in the csf distribution. LWP::UserAgent may
  685. # have to be installed manually, but it can better support https:// URL's
  686. #
  687. # Unless https:// URL's are manually configured, we recommend leaving this set
  688. # to "1"
  689. #
  690. # "1" = HTTP::Tiny
  691. # "2" = LWP::UserAgent
  692. URLGET = "1"
  693.  
  694. ###############################################################################
  695. # SECTION:Country Code Lists and Settings
  696. ###############################################################################
  697. # Country Code to CIDR allow/deny. In the following two options you can allow
  698. # or deny whole country CIDR ranges. The CIDR blocks are generated from the
  699. # Maxmind GeoLite Country database http://www.maxmind.com/app/geolitecountry
  700. # and entirely relies on that service being available
  701. #
  702. # Specify the the two-letter ISO Country Code(s). The iptables rules are for
  703. # incoming connections only
  704. #
  705. # WARNING: These lists are never 100% accurate and some ISP's (e.g. AOL) use
  706. # non-geographic IP address designations for their clients
  707. #
  708. # WARNING: Some of the CIDR lists are huge and each one requires a rule within
  709. # the incoming iptables chain. This can result in significant performance
  710. # overheads and could render the server inaccessible in some circumstances. For
  711. # this reason (amongst others) we do not recommend using these options
  712. #
  713. # WARNING: Due to the resource constraints on VPS servers this feature should
  714. # not be used on such systems unless you choose very small CC zones
  715. #
  716. # WARNING: CC_ALLOW allows access through all ports in the firewall. For this
  717. # reason CC_ALLOW probably has very limited use and CC_ALLOW_FILTER is
  718. # preferred
  719. #
  720. # Each option is a comma separated list of CC's, e.g. "US,GB,DE"
  721. CC_DENY = ""
  722. CC_ALLOW = ""
  723.  
  724. # An alternative to CC_ALLOW is to only allow access from the following
  725. # countries but still filter based on the port and packets rules. All other
  726. # connections are dropped
  727. CC_ALLOW_FILTER = ""
  728.  
  729. # This option allows access from the following countries to specific ports
  730. # listed in CC_ALLOW_PORTS_TCP and CC_ALLOW_PORTS_UDP
  731. #
  732. # Note: The rules for this feature are inserted after the allow and deny
  733. # rules to still allow blocking of IP addresses
  734. #
  735. # Each option is a comma separated list of CC's, e.g. "US,GB,DE"
  736. CC_ALLOW_PORTS = ""
  737.  
  738. # All listed ports should be removed from TCP_IN/UDP_IN to block access from
  739. # elsewhere. This option uses the same format as TCP_IN/UDP_IN
  740. #
  741. # An example would be to list port 21 here and remove it from TCP_IN/UDP_IN
  742. # then only counties listed in CC_ALLOW_PORTS can access FTP
  743. CC_ALLOW_PORTS_TCP = ""
  744. CC_ALLOW_PORTS_UDP = ""
  745.  
  746. # This option denies access from the following countries to specific ports
  747. # listed in CC_DENY_PORTS_TCP and CC_DENY_PORTS_UDP
  748. #
  749. # Note: The rules for this feature are inserted after the allow and deny
  750. # rules to still allow allowing of IP addresses
  751. #
  752. # Each option is a comma separated list of CC's, e.g. "US,GB,DE"
  753. CC_DENY_PORTS = ""
  754.  
  755. # This option uses the same format as TCP_IN/UDP_IN. The ports listed should
  756. # NOT be removed from TCP_IN/UDP_IN
  757. #
  758. # An example would be to list port 21 here then counties listed in
  759. # CC_DENY_PORTS cannot access FTP
  760. CC_DENY_PORTS_TCP = ""
  761. CC_DENY_PORTS_UDP = ""
  762.  
  763. # This Country Code list will prevent lfd from blocking IP address hits for the
  764. # listed CC's
  765. #
  766. # CC_LOOKUPS must be enabled to use this option
  767. CC_IGNORE = ""
  768.  
  769. # This Country Code list will only allow SMTP AUTH to be advertised to the
  770. # listed countries in EXIM. This is to help limit attempts at distributed
  771. # attacks against SMTP AUTH which are difficult to achive since port 25 needs
  772. # to be open to relay email
  773. #
  774. # The reason why this works is that if EXIM does not advertise SMTP AUTH on a
  775. # connection, then SMTP AUTH will not accept logins, defeating the attacks
  776. # without restricting mail relaying
  777. #
  778. # This option can generate a very large list of IP addresses that could easily
  779. # severely impact on SMTP (mail) performance, so care must be taken when
  780. # selecting countries and if performance issues ensue
  781. #
  782. # The option SMTPAUTH_RESTRICT must be enabled to use this option
  783. CC_ALLOW_SMTPAUTH = ""
  784.  
  785. # Set this option to a valid CIDR (i.e. 1 to 32) to ignore CIDR blocks smaller
  786. # than this value when implementing CC_DENY/CC_ALLOW/CC_ALLOW_FILTER. This can
  787. # help reduce the number of CC entries and may improve iptables throughput.
  788. # Obviously, this will deny/allow fewer IP addresses depending on how small you
  789. # configure the option
  790. #
  791. # For example, to ignore all CIDR (and single IP) entries small than a /16, set
  792. # this option to "16". Set to "" to block all CC IP addresses
  793. CC_DROP_CIDR = ""
  794.  
  795. # Display Country Code and Country for reported IP addresses. This option can
  796. # be configured to use the MaxMind Country Database or the more detailed (and
  797. # much larger and therefore slower) MaxMind City Database
  798. #
  799. # "0" - disable
  800. # "1" - Reports: Country Code and Country
  801. # "2" - Reports: Country Code and Country and Region and City
  802. CC_LOOKUPS = "1"
  803.  
  804. # This option tells lfd how often to retrieve the Maxmind GeoLite Country
  805. # database for CC_ALLOW, CC_ALLOW_FILTER, CC_DENY, CC_IGNORE and CC_LOOKUPS (in
  806. # days)
  807. CC_INTERVAL = "7"
  808.  
  809. ###############################################################################
  810. # SECTION:Login Failure Blocking and Alerts
  811. ###############################################################################
  812. # The following[*] triggers are application specific. If you set LF_TRIGGER to
  813. # "0" the value of each trigger is the number of failures against that
  814. # application that will trigger lfd to block the IP address
  815. #
  816. # If you set LF_TRIGGER to a value greater than "0" then the following[*]
  817. # application triggers are simply on or off ("0" or "1") and the value of
  818. # LF_TRIGGER is the total cumulative number of failures that will trigger lfd
  819. # to block the IP address
  820. #
  821. # Setting the application trigger to "0" disables it
  822. LF_TRIGGER = "0"
  823.  
  824. # If LF_TRIGGER is > "0" then LF_TRIGGER_PERM can be set to "1" to permanently
  825. # block the IP address, or LF_TRIGGER_PERM can be set to a value greater than
  826. # "1" and the IP address will be blocked temporarily for that value in seconds.
  827. # For example:
  828. # LF_TRIGGER_PERM = "1" => the IP is blocked permanently
  829. # LF_TRIGGER_PERM = "3600" => the IP is blocked temporarily for 1 hour
  830. #
  831. # If LF_TRIGGER is "0", then the application LF_[application]_PERM value works
  832. # in the same way as above and LF_TRIGGER_PERM serves no function
  833. LF_TRIGGER_PERM = "1"
  834.  
  835. # To only block access to the failed application instead of a complete block
  836. # for an ip address, you can set the following to "1", but LF_TRIGGER must be
  837. # set to "0" with specific application[*] trigger levels also set appropriately
  838. #
  839. # The ports that are blocked can be configured by changing the PORTS_* options
  840. LF_SELECT = "0"
  841.  
  842. # Send an email alert if an IP address is blocked by one of the [*] triggers
  843. LF_EMAIL_ALERT = "1"
  844.  
  845. # [*]Enable login failure detection of sshd connections
  846. #
  847. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  848. # this file about RESTRICT_SYSLOG before enabling this option:
  849. LF_SSHD = "5"
  850. LF_SSHD_PERM = "1"
  851.  
  852. # [*]Enable login failure detection of ftp connections
  853. #
  854. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  855. # this file about RESTRICT_SYSLOG before enabling this option:
  856. LF_FTPD = "10"
  857. LF_FTPD_PERM = "1"
  858.  
  859. # [*]Enable login failure detection of SMTP AUTH connections
  860. LF_SMTPAUTH = "5"
  861. LF_SMTPAUTH_PERM = "1"
  862.  
  863. # [*]Enable syntax failure detection of Exim connections
  864. LF_EXIMSYNTAX = "10"
  865. LF_EXIMSYNTAX_PERM = "1"
  866.  
  867. # [*]Enable login failure detection of pop3 connections
  868. #
  869. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  870. # this file about RESTRICT_SYSLOG before enabling this option:
  871. LF_POP3D = "0"
  872. LF_POP3D_PERM = "1"
  873.  
  874. # [*]Enable login failure detection of imap connections
  875. #
  876. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  877. # this file about RESTRICT_SYSLOG before enabling this option:
  878. LF_IMAPD = "0"
  879. LF_IMAPD_PERM = "1"
  880.  
  881. # [*]Enable login failure detection of Apache .htpasswd connections
  882. # Due to the often high logging rate in the Apache error log, you might want to
  883. # enable this option only if you know you are suffering from attacks against
  884. # password protected directories
  885. LF_HTACCESS = "5"
  886. LF_HTACCESS_PERM = "1"
  887.  
  888. # [*]Enable failure detection of repeated Apache mod_security rule triggers
  889. LF_MODSEC = "5"
  890. LF_MODSEC_PERM = "1"
  891.  
  892. # [*]Enable detection of repeated BIND denied requests
  893. # This option should be enabled with care as it will prevent blocked IPs from
  894. # resolving any domains on the server. You might want to set the trigger value
  895. # reasonably high to avoid this
  896. # Example: LF_BIND = "100"
  897. LF_BIND = "0"
  898. LF_BIND_PERM = "1"
  899.  
  900. # [*]Enable detection of repeated suhosin ALERTs
  901. # Example: LF_SUHOSIN = "5"
  902. #
  903. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  904. # this file about RESTRICT_SYSLOG before enabling this option:
  905. LF_SUHOSIN = "0"
  906. LF_SUHOSIN_PERM = "1"
  907.  
  908. # [*]Enable detection of repeated cxs ModSecurity mod_security rule triggers
  909. # This option will block IP addresses if cxs detects a hits from the
  910. # ModSecurity rule associated with it
  911. #
  912. # Note: This option takes precedence over LF_MODSEC and removes any hits
  913. # counted towards LF_MODSEC for the cxs rule
  914. #
  915. # This setting should probably set very low, perhaps to 1, if you want to
  916. # effectively block IP addresses for this trigger option
  917. LF_CXS = "0"
  918. LF_CXS_PERM = "1"
  919.  
  920. # [*]Enable detection of repeated Apache mod_qos rule triggers
  921. LF_QOS = "0"
  922. LF_QOS_PERM = "1"
  923.  
  924. # [*]Enable detection of repeated Apache symlink race condition triggers from
  925. # the Apache patch provided by:
  926. # http://www.mail-archive.com/[email protected]/msg55666.html
  927. # This patch has also been included by cPanel via the easyapache option:
  928. # "Symlink Race Condition Protection"
  929. LF_SYMLINK = "0"
  930. LF_SYMLINK_PERM = "1"
  931.  
  932. # [*]Enable login failure detection of webmin connections
  933. #
  934. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  935. # this file about RESTRICT_SYSLOG before enabling this option:
  936. LF_WEBMIN = "0"
  937. LF_WEBMIN_PERM = "1"
  938.  
  939. # Send an email alert if anyone logs in successfully using SSH
  940. #
  941. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  942. # this file about RESTRICT_SYSLOG before enabling this option:
  943. LF_SSH_EMAIL_ALERT = "1"
  944.  
  945. # Send an email alert if anyone uses su to access another account. This will
  946. # send an email alert whether the attempt to use su was successful or not
  947. #
  948. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  949. # this file about RESTRICT_SYSLOG before enabling this option:
  950. LF_SU_EMAIL_ALERT = "1"
  951.  
  952. # Send an email alert if anyone accesses webmin
  953. #
  954. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  955. # this file about RESTRICT_SYSLOG before enabling this option:
  956. LF_WEBMIN_EMAIL_ALERT = "0"
  957.  
  958. # Send an email alert if anyone logs in successfully to root on the console
  959. #
  960. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  961. # this file about RESTRICT_SYSLOG before enabling this option:
  962. LF_CONSOLE_EMAIL_ALERT = "0"
  963.  
  964. # This option will keep track of the number of "File does not exist" errors in
  965. # HTACCESS_LOG. If the number of hits is more than LF_APACHE_404 in LF_INTERVAL
  966. # seconds then the IP address will be blocked
  967. #
  968. # Care should be used with this option as it could generate many
  969. # false-positives, especially Search Bots (use csf.rignore to ignore such bots)
  970. # so only use this option if you know you are under this type of attack
  971. #
  972. # A sensible setting for this would be quite high, perhaps 200
  973. #
  974. # To disable set to "0"
  975. LF_APACHE_404 = "0"
  976.  
  977. # If this option is set to 1 the blocks will be permanent
  978. # If this option is > 1, the blocks will be temporary for the specified number
  979. # of seconds
  980. LF_APACHE_404_PERM = "3600"
  981.  
  982. # This option will keep track of the number of "client denied by server
  983. # configuration" errors in HTACCESS_LOG. If the number of hits is more than
  984. # LF_APACHE_403 in LF_INTERVAL seconds then the IP address will be blocked
  985. #
  986. # Care should be used with this option as it could generate many
  987. # false-positives, especially Search Bots (use csf.rignore to ignore such bots)
  988. # so only use this option if you know you are under this type of attack
  989. #
  990. # A sensible setting for this would be quite high, perhaps 200
  991. #
  992. # To disable set to "0"
  993. LF_APACHE_403 = "0"
  994.  
  995. # If this option is set to 1 the blocks will be permanent
  996. # If this option is > 1, the blocks will be temporary for the specified number
  997. # of seconds
  998. LF_APACHE_403_PERM = "3600"
  999.  
  1000. # System Exploit Checking. This option is designed to perform a series of tests
  1001. # to send an alert in case a possible server compromise is detected
  1002. #
  1003. # To enable this feature set the following to the checking interval in seconds
  1004. # (a value of 300 would seem sensible).
  1005. #
  1006. # To disable set to "0"
  1007. LF_EXPLOIT = "300"
  1008.  
  1009. # This comma separated list allows you to ignore tests LF_EXPLOIT performs
  1010. #
  1011. # For the SUPERUSER check, you can list usernames in csf.suignore to have them
  1012. # ignored for that test
  1013. #
  1014. # Valid tests are:
  1015. # SUPERUSER,SSHDSPAM
  1016. #
  1017. # If you want to ignore a test add it to this as a comma separated list, e.g.
  1018. # "SUPERUSER,SSHDSPAM"
  1019. LF_EXPLOIT_IGNORE = ""
  1020.  
  1021. # Set the time interval to track login and other LF_ failures within (seconds),
  1022. # i.e. LF_TRIGGER failures within the last LF_INTERVAL seconds
  1023. LF_INTERVAL = "3600"
  1024.  
  1025. # This is how long the lfd process sleeps (in seconds) before processing the
  1026. # log file entries and checking whether other events need to be triggered
  1027. LF_PARSE = "5"
  1028.  
  1029. # This is the interval that is used to flush reports of usernames, files and
  1030. # pids so that persistent problems continue to be reported, in seconds.
  1031. # A value of 3600 seems sensible
  1032. LF_FLUSH = "3600"
  1033.  
  1034. # Under some circumstances iptables can fail to include a rule instruction,
  1035. # especially if more than one request is made concurrently. In this event, a
  1036. # permanent block entry may exist in csf.deny, but not in iptables.
  1037. #
  1038. # This option instructs csf to deny an already blocked IP address the number
  1039. # of times set. The downside, is that there will be multiple entries for an IP
  1040. # address in csf.deny and possibly multiple rules for the same IP address in
  1041. # iptables. This needs to be taken into consideration when unblocking such IP
  1042. # addresses.
  1043. #
  1044. # Set to "0" to disable this feature. Do not set this too high for the reasons
  1045. # detailed above (e.g. "5" should be more than enough)
  1046. LF_REPEATBLOCK = "0"
  1047.  
  1048. # By default csf will create both an inbound and outbound blocks from/to an IP
  1049. # unless otherwise specified in csf.deny and GLOBAL_DENY. This is the most
  1050. # effective way to block IP traffic. This option instructs csf to only block
  1051. # inbound traffic from those IP's and so reduces the number of iptables rules,
  1052. # but at the expense of less effectiveness. For this reason we recommend
  1053. # leaving this option disabled
  1054. #
  1055. # Set to "0" to disable this feature - the default
  1056. LF_BLOCKINONLY = "0"
  1057.  
  1058. ###############################################################################
  1059. # SECTION:Directory Watching & Integrity
  1060. ###############################################################################
  1061. # Enable Directory Watching. This enables lfd to check /tmp and /dev/shm
  1062. # directories for suspicious files, i.e. script exploits. If a suspicious
  1063. # file is found an email alert is sent. One alert per file per LF_FLUSH
  1064. # interval is sent
  1065. #
  1066. # To enable this feature set the following to the checking interval in seconds.
  1067. # To disable set to "0"
  1068. LF_DIRWATCH = "300"
  1069.  
  1070. # To remove any suspicious files found during directory watching, enable the
  1071. # following. These files will be appended to a tarball in
  1072. # /var/lib/csf/suspicious.tar
  1073. LF_DIRWATCH_DISABLE = "0"
  1074.  
  1075. # This option allows you to have lfd watch a particular file or directory for
  1076. # changes and should they change and email alert using watchalert.txt is sent
  1077. #
  1078. # To enable this feature set the following to the checking interval in seconds
  1079. # (a value of 60 would seem sensible) and add your entries to csf.dirwatch
  1080. #
  1081. # Set to disable set to "0"
  1082. LF_DIRWATCH_FILE = "0"
  1083.  
  1084. # System Integrity Checking. This enables lfd to compare md5sums of the
  1085. # servers OS binary application files from the time when lfd starts. If the
  1086. # md5sum of a monitored file changes an alert is sent. This option is intended
  1087. # as an IDS (Intrusion Detection System) and is the last line of detection for
  1088. # a possible root compromise.
  1089. #
  1090. # There will be constant false-positives as the servers OS is updated or
  1091. # monitored application binaries are updated. However, unexpected changes
  1092. # should be carefully inspected.
  1093. #
  1094. # Modified files will only be reported via email once.
  1095. #
  1096. # To enable this feature set the following to the checking interval in seconds
  1097. # (a value of 3600 would seem sensible). This option may increase server I/O
  1098. # load onto the server as it checks system binaries.
  1099. #
  1100. # To disable set to "0"
  1101. LF_INTEGRITY = "3600"
  1102.  
  1103. ###############################################################################
  1104. # SECTION:Distributed Attacks
  1105. ###############################################################################
  1106. # Distributed Account Attack. This option will keep track of login failures
  1107. # from distributed IP addresses to a specific application account. If the
  1108. # number of failures matches the trigger value above, ALL of the IP addresses
  1109. # involved in the attack will be blocked according to the temp/perm rules above
  1110. #
  1111. # Tracking applies to LF_SSHD, LF_FTPD, LF_SMTPAUTH, LF_POP3D, LF_IMAPD,
  1112. # LF_HTACCESS
  1113. #
  1114. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  1115. # this file about RESTRICT_SYSLOG before enabling this option:
  1116. LF_DISTATTACK = "0"
  1117.  
  1118. # Set the following to the minimum number of unique IP addresses that trigger
  1119. # LF_DISTATTACK
  1120. LF_DISTATTACK_UNIQ = "2"
  1121.  
  1122. # Distributed FTP Logins. This option will keep track of successful FTP logins.
  1123. # If the number of successful logins to an individual account is at least
  1124. # LF_DISTFTP in LF_DIST_INTERVAL from at least LF_DISTFTP_UNIQ IP addresses,
  1125. # then all of the IP addresses will be blocked
  1126. #
  1127. # This option can help mitigate the common FTP account compromise attacks that
  1128. # use a distributed network of zombies to deface websites
  1129. #
  1130. # A sensible setting for this might be 5, depending on how many different
  1131. # IP addresses you expect to an individual FTP account within LF_DIST_INTERVAL
  1132. #
  1133. # To disable set to "0"
  1134. #
  1135. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  1136. # this file about RESTRICT_SYSLOG before enabling this option:
  1137. LF_DISTFTP = "0"
  1138.  
  1139. # Set the following to the minimum number of unique IP addresses that trigger
  1140. # LF_DISTFTP. LF_DISTFTP_UNIQ must be <= LF_DISTFTP for this to work
  1141. LF_DISTFTP_UNIQ = "3"
  1142.  
  1143. # If this option is set to 1 the blocks will be permanent
  1144. # If this option is > 1, the blocks will be temporary for the specified number
  1145. # of seconds
  1146. LF_DISTFTP_PERM = "1"
  1147.  
  1148. # Distributed SMTP Logins. This option will keep track of successful SMTP
  1149. # logins. If the number of successful logins to an individual account is at
  1150. # least LF_DISTSMTP in LF_DIST_INTERVAL from at least LF_DISTSMTP_UNIQ IP
  1151. # addresses, then all of the IP addresses will be blocked. These options only
  1152. # apply to the exim MTA
  1153. #
  1154. # This option can help mitigate the common SMTP account compromise attacks that
  1155. # use a distributed network of zombies to send spam
  1156. #
  1157. # A sensible setting for this might be 5, depending on how many different
  1158. # IP addresses you expect to an individual SMTP account within LF_DIST_INTERVAL
  1159. #
  1160. # To disable set to "0"
  1161. LF_DISTSMTP = "0"
  1162.  
  1163. # Set the following to the minimum number of unique IP addresses that trigger
  1164. # LF_DISTSMTP. LF_DISTSMTP_UNIQ must be <= LF_DISTSMTP for this to work
  1165. LF_DISTSMTP_UNIQ = "3"
  1166.  
  1167. # If this option is set to 1 the blocks will be permanent
  1168. # If this option is > 1, the blocks will be temporary for the specified number
  1169. # of seconds
  1170. LF_DISTSMTP_PERM = "1"
  1171.  
  1172. # This is the interval during which a distributed FTP or SMTP attack is
  1173. # measured
  1174. LF_DIST_INTERVAL = "300"
  1175.  
  1176. ###############################################################################
  1177. # SECTION:Login Tracking
  1178. ###############################################################################
  1179. # Block POP3 logins if greater than LT_POP3D times per hour per account per IP
  1180. # address (0=disabled)
  1181. #
  1182. # This is a temporary block for the rest of the hour, afterwhich the IP is
  1183. # unblocked
  1184. #
  1185. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  1186. # this file about RESTRICT_SYSLOG before enabling this option:
  1187. LT_POP3D = "0"
  1188.  
  1189. # Block IMAP logins if greater than LT_IMAPD times per hour per account per IP
  1190. # address (0=disabled) - not recommended for IMAP logins due to the ethos
  1191. # within which IMAP works. If you want to use this, setting it quite high is
  1192. # probably a good idea
  1193. #
  1194. # This is a temporary block for the rest of the hour, afterwhich the IP is
  1195. # unblocked
  1196. #
  1197. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  1198. # this file about RESTRICT_SYSLOG before enabling this option:
  1199. LT_IMAPD = "0"
  1200.  
  1201. # Send an email alert if an account exceeds LT_POP3D/LT_IMAPD logins per hour
  1202. # per IP
  1203. LT_EMAIL_ALERT = "1"
  1204.  
  1205. # If LF_PERMBLOCK is enabled but you do not want this to apply to
  1206. # LT_POP3D/LT_IMAPD, then enable this option
  1207. LT_SKIPPERMBLOCK = "0"
  1208.  
  1209. ###############################################################################
  1210. # SECTION:Connection Tracking
  1211. ###############################################################################
  1212. # Connection Tracking. This option enables tracking of all connections from IP
  1213. # addresses to the server. If the total number of connections is greater than
  1214. # this value then the offending IP address is blocked. This can be used to help
  1215. # prevent some types of DOS attack.
  1216. #
  1217. # Care should be taken with this option. It's entirely possible that you will
  1218. # see false-positives. Some protocols can be connection hungry, e.g. FTP, IMAPD
  1219. # and HTTP so it could be quite easy to trigger, especially with a lot of
  1220. # closed connections in TIME_WAIT. However, for a server that is prone to DOS
  1221. # attacks this may be very useful. A reasonable setting for this option might
  1222. # be around 300.
  1223. #
  1224. # To disable this feature, set this to 0
  1225. CT_LIMIT = "0"
  1226.  
  1227. # Connection Tracking interval. Set this to the the number of seconds between
  1228. # connection tracking scans
  1229. CT_INTERVAL = "30"
  1230.  
  1231. # Send an email alert if an IP address is blocked due to connection tracking
  1232. CT_EMAIL_ALERT = "1"
  1233.  
  1234. # If you want to make IP blocks permanent then set this to 1, otherwise blocks
  1235. # will be temporary and will be cleared after CT_BLOCK_TIME seconds
  1236. CT_PERMANENT = "0"
  1237.  
  1238. # If you opt for temporary IP blocks for CT, then the following is the interval
  1239. # in seconds that the IP will remained blocked for (e.g. 1800 = 30 mins)
  1240. CT_BLOCK_TIME = "1800"
  1241.  
  1242. # If you don't want to count the TIME_WAIT state against the connection count
  1243. # then set the following to "1"
  1244. CT_SKIP_TIME_WAIT = "0"
  1245.  
  1246. # If you only want to count specific states (e.g. SYN_RECV) then add the states
  1247. # to the following as a comma separated list. E.g. "SYN_RECV,TIME_WAIT"
  1248. #
  1249. # Leave this option empty to count all states against CT_LIMIT
  1250. CT_STATES = ""
  1251.  
  1252. # If you only want to count specific ports (e.g. 80,443) then add the ports
  1253. # to the following as a comma separated list. E.g. "80,443"
  1254. #
  1255. # Leave this option empty to count all ports against CT_LIMIT
  1256. CT_PORTS = "80,7171,7172"
  1257.  
  1258. ###############################################################################
  1259. # SECTION:Process Tracking
  1260. ###############################################################################
  1261. # Process Tracking. This option enables tracking of user and nobody processes
  1262. # and examines them for suspicious executables or open network ports. Its
  1263. # purpose is to identify potential exploit processes that are running on the
  1264. # server, even if they are obfuscated to appear as system services. If a
  1265. # suspicious process is found an alert email is sent with relevant information.
  1266. # It is then the responsibility of the recipient to investigate the process
  1267. # further as the script takes no further action
  1268. #
  1269. # The following is the number of seconds a process has to be active before it
  1270. # is inspected. If you set this time too low, then you will likely trigger
  1271. # false-positives with CGI or PHP scripts.
  1272. # Set the value to 0 to disable this feature
  1273. PT_LIMIT = "60"
  1274.  
  1275. # How frequently processes are checked in seconds
  1276. PT_INTERVAL = "60"
  1277.  
  1278. # If you want process tracking to highlight php or perl scripts that are run
  1279. # through apache then disable the following,
  1280. # i.e. set it to 0
  1281. #
  1282. # While enabling this setting will reduce false-positives, having it set to 0
  1283. # does provide better checking for exploits running on the server
  1284. PT_SKIP_HTTP = "0"
  1285.  
  1286. # lfd will report processes, even if they're listed in csf.pignore, if they're
  1287. # tagged as (deleted) by Linux. This information is provided in Linux under
  1288. # /proc/PID/exe. A (deleted) process is one that is running a binary that has
  1289. # the inode for the file removed from the file system directory. This usually
  1290. # happens when the binary has been replaced due to an upgrade for it by the OS
  1291. # vendor or another third party (e.g. cPanel). You need to investigate whether
  1292. # this is indeed the case to be sure that the original binary has not been
  1293. # replaced by a rootkit or is running an exploit.
  1294. #
  1295. # Note: If a deleted executable process is detected and reported then lfd will
  1296. # not report children of the parent (or the parent itself if a child triggered
  1297. # the report) if the parent is also a deleted executable process
  1298. #
  1299. # To stop lfd reporting such process you need to restart the daemon to which it
  1300. # belongs and therefore run the process using the replacement binary (presuming
  1301. # one exists). This will normally mean running the associated startup script in
  1302. # /etc/init.d/
  1303. #
  1304. # If you do want lfd to report deleted binary processes, set to 1
  1305. PT_DELETED = "0"
  1306.  
  1307. # If a PT_DELETED event is triggered, then if the following contains the path to
  1308. # a script, it will be run in a child process and passed the executable, pid,
  1309. # account for the process, and parent pid
  1310. #
  1311. # The action script must have the execute bit and interpreter (shebang) set. An
  1312. # example is provided in /usr/local/csf/bin/pt_deleted_action.pl
  1313. #
  1314. # WARNING: Make sure you read and understand the potential security
  1315. # implications of such processes in PT_DELETED above before simply restarting
  1316. # such processes with a script
  1317. PT_DELETED_ACTION = ""
  1318.  
  1319. # User Process Tracking. This option enables the tracking of the number of
  1320. # process any given account is running at one time. If the number of processes
  1321. # exceeds the value of the following setting an email alert is sent with
  1322. # details of those processes. If you specify a user in csf.pignore it will be
  1323. # ignored
  1324. #
  1325. # Set to 0 to disable this feature
  1326. PT_USERPROC = "10"
  1327.  
  1328. # This User Process Tracking option sends an alert if any linux user process
  1329. # exceeds the memory usage set (MB). To ignore specific processes or users use
  1330. # csf.pignore
  1331. #
  1332. # Set to 0 to disable this feature
  1333. PT_USERMEM = "200"
  1334.  
  1335. # This User Process Tracking option sends an alert if any linux user process
  1336. # exceeds the time usage set (seconds). To ignore specific processes or users
  1337. # use csf.pignore
  1338. #
  1339. # Set to 0 to disable this feature
  1340. PT_USERTIME = "1800"
  1341.  
  1342. # If this option is set then processes detected by PT_USERMEM, PT_USERTIME or
  1343. # PT_USERPROC are killed
  1344. #
  1345. # Warning: We don't recommend enabling this option unless absolutely necessary
  1346. # as it can cause unexpected problems when processes are suddenly terminated.
  1347. # It can also lead to system processes being terminated which could cause
  1348. # stability issues. It is much better to leave this option disabled and to
  1349. # investigate each case as it is reported when the triggers above are breached
  1350. #
  1351. # Note: Processes that are running deleted excecutables (see PT_DELETED) will
  1352. # not be killed by lfd
  1353. PT_USERKILL = "0"
  1354.  
  1355. # If you want to disable email alerts if PT_USERKILL is triggered, then set
  1356. # this option to 0
  1357. PT_USERKILL_ALERT = "1"
  1358.  
  1359. # If a PT_* event is triggered, then if the following contains the path to
  1360. # a script, it will be run in a child process and passed the PID(s) of the
  1361. # process(es) in a comma separated list.
  1362. #
  1363. # The action script must have the execute bit and interpreter (shebang) set
  1364. PT_USER_ACTION = ""
  1365.  
  1366. # Check the PT_LOAD_AVG minute Load Average (can be set to 1 5 or 15 and
  1367. # defaults to 5 if set otherwise) on the server every PT_LOAD seconds. If the
  1368. # load average is greater than or equal to PT_LOAD_LEVEL then an email alert is
  1369. # sent. lfd then does not report subsequent high load until PT_LOAD_SKIP
  1370. # seconds has passed to prevent email floods.
  1371. #
  1372. # Set PT_LOAD to "0" to disable this feature
  1373. PT_LOAD = "30"
  1374. PT_LOAD_AVG = "5"
  1375. PT_LOAD_LEVEL = "6"
  1376. PT_LOAD_SKIP = "3600"
  1377.  
  1378. # This is the Apache Server Status URL used in the email alert. Requires the
  1379. # Apache mod_status module to be installed and configured correctly
  1380. PT_APACHESTATUS = "http://127.0.0.1/server-status"
  1381.  
  1382. # If a PT_LOAD event is triggered, then if the following contains the path to
  1383. # a script, it will be run in a child process. For example, the script could
  1384. # contain commands to terminate and restart httpd, php, exim, etc incase of
  1385. # looping processes. The action script must have the execute bit an
  1386. # interpreter (shebang) set
  1387. PT_LOAD_ACTION = ""
  1388.  
  1389. # Fork Bomb Protection. This option checks the number of processes with the
  1390. # same session id and if greater than the value set, the whole session tree is
  1391. # terminated and an alert sent
  1392. #
  1393. # You can see an example of common session id processes on most Linux systems
  1394. # using: "ps axf -O sid"
  1395. #
  1396. # On cPanel servers, PT_ALL_USERS should be enabled to use this option
  1397. # effectively
  1398. #
  1399. # This option will check root owned processes. Session id 0 and 1 will always
  1400. # be ignored as they represent kernel and init processes. csf.pignore will be
  1401. # honoured, but bear in mind that a session tree can contain a variety of users
  1402. # and executables
  1403. #
  1404. # Care needs to be taken to ensure that this option only detects runaway fork
  1405. # bombs, so should be set higher than any session tree is likely to get (e.g.
  1406. # httpd could have 100s of legitimate children on very busy systems). A
  1407. # sensible starting point on most servers might be 250
  1408. PT_FORKBOMB = "0"
  1409.  
  1410. ###############################################################################
  1411. # SECTION:Port Scan Tracking
  1412. ###############################################################################
  1413. # Port Scan Tracking. This feature tracks port blocks logged by iptables to
  1414. # syslog. If an IP address generates a port block that is logged more than
  1415. # PS_LIMIT within PS_INTERVAL seconds, the IP address will be blocked.
  1416. #
  1417. # This feature could, for example, be useful for blocking hackers attempting
  1418. # to access the standard SSH port if you have moved it to a port other than 22
  1419. # and have removed 22 from the TCP_IN list so that connection attempts to the
  1420. # old port are being logged
  1421. #
  1422. # This feature blocks all iptables blocks from the iptables logs, including
  1423. # repeated attempts to one port or SYN flood blocks, etc
  1424. #
  1425. # Note: This feature will only track iptables blocks from the log file set in
  1426. # IPTABLES_LOG below and if you have DROP_LOGGING enabled. However, it will
  1427. # cause redundant blocking with DROP_IP_LOGGING enabled
  1428. #
  1429. # Warning: It's possible that an elaborate DDOS (i.e. from multiple IP's)
  1430. # could very quickly fill the iptables rule chains and cause a DOS in itself.
  1431. # The DENY_IP_LIMIT should help to mitigate such problems with permanent blocks
  1432. # and the DENY_TEMP_IP_LIMIT with temporary blocks
  1433. #
  1434. # Set PS_INTERVAL to "0" to disable this feature. A value of between 60 and 300
  1435. # would be sensible to enable this feature
  1436. #
  1437. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  1438. # this file about RESTRICT_SYSLOG before enabling this option:
  1439. PS_INTERVAL = "0"
  1440. PS_LIMIT = "10"
  1441.  
  1442. # You can specify the ports and/or port ranges that should be tracked by the
  1443. # Port Scan Tracking feature. The following setting is a comma separated list
  1444. # of those ports and uses the same format as TCP_IN. The default setting of
  1445. # 0:65535,ICMP covers all ports
  1446. PS_PORTS = "0:65535,ICMP"
  1447.  
  1448. # To specify how many different ports qualifies as a Port Scan you can increase
  1449. # the following from the default value of 1. The risk in doing so will mean
  1450. # that persistent attempts to attack a specific closed port will not be
  1451. # detected and blocked
  1452. PS_DIVERSITY = "1"
  1453.  
  1454. # You can select whether IP blocks for Port Scan Tracking should be temporary
  1455. # or permanent. Set PS_PERMANENT to "0" for temporary and "1" for permanent
  1456. # blocking. If set to "0" PS_BLOCK_TIME is the amount of time in seconds to
  1457. # temporarily block the IP address for
  1458. PS_PERMANENT = "0"
  1459. PS_BLOCK_TIME = "3600"
  1460.  
  1461. # Set the following to "1" to enable Port Scan Tracking email alerts, set to
  1462. # "0" to disable them
  1463. PS_EMAIL_ALERT = "1"
  1464.  
  1465. ###############################################################################
  1466. # SECTION:User ID Tracking
  1467. ###############################################################################
  1468. # User ID Tracking. This feature tracks UID blocks logged by iptables to
  1469. # syslog. If a UID generates a port block that is logged more than UID_LIMIT
  1470. # times within UID_INTERVAL seconds, an alert will be sent
  1471. #
  1472. # Note: This feature will only track iptables blocks from the log file set in
  1473. # IPTABLES_LOG and if DROP_OUT_LOGGING and DROP_UID_LOGGING are enabled.
  1474. #
  1475. # To ignore specific UIDs list them in csf.uidignore and then restart lfd
  1476. #
  1477. # Set UID_INTERVAL to "0" to disable this feature. A value of between 60 and 300
  1478. # would be sensible to enable this feature
  1479. #
  1480. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  1481. # this file about RESTRICT_SYSLOG before enabling this option:
  1482. UID_INTERVAL = "0"
  1483. UID_LIMIT = "10"
  1484.  
  1485. # You can specify the ports and/or port ranges that should be tracked by the
  1486. # User ID Tracking feature. The following setting is a comma separated list
  1487. # of those ports and uses the same format as TCP_OUT. The default setting of
  1488. # 0:65535,ICMP covers all ports
  1489. UID_PORTS = "0:65535,ICMP"
  1490.  
  1491. ###############################################################################
  1492. # SECTION:Account Tracking
  1493. ###############################################################################
  1494. # Account Tracking. The following options enable the tracking of modifications
  1495. # to the accounts on a server. If any of the enabled options are triggered by
  1496. # a modifications to an account, an alert email is sent. Only the modification
  1497. # is reported. The cause of the modification will have to be investigated
  1498. # manually
  1499. #
  1500. # You can set AT_ALERT to the following:
  1501. # 0 = disable this feature
  1502. # 1 = enable this feature for all accounts
  1503. # 2 = enable this feature only for superuser accounts (UID = 0, e.g. root, etc)
  1504. # 3 = enable this feature only for the root account
  1505. AT_ALERT = "2"
  1506.  
  1507. # This options is the interval between checks in seconds
  1508. AT_INTERVAL = "60"
  1509.  
  1510. # Send alert if a new account is created
  1511. AT_NEW = "1"
  1512.  
  1513. # Send alert if an existing account is deleted
  1514. AT_OLD = "1"
  1515.  
  1516. # Send alert if an account password has changed
  1517. AT_PASSWD = "1"
  1518.  
  1519. # Send alert if an account uid has changed
  1520. AT_UID = "1"
  1521.  
  1522. # Send alert if an account gid has changed
  1523. AT_GID = "1"
  1524.  
  1525. # Send alert if an account login directory has changed
  1526. AT_DIR = "1"
  1527.  
  1528. # Send alert if an account login shell has changed
  1529. AT_SHELL = "1"
  1530.  
  1531. ###############################################################################
  1532. # SECTION:Integrated User Interface
  1533. ###############################################################################
  1534. # Integrated User Interface. This feature provides a HTML UI to csf and lfd,
  1535. # without requiring a control panel or web server. The UI runs as a sub process
  1536. # to the lfd daemon
  1537. #
  1538. # As it runs under the root account and successful login provides root access
  1539. # to the server, great care should be taken when configuring and using this
  1540. # feature. There are additional restrictions to enhance secure access to the UI
  1541. #
  1542. # See readme.txt for more information about using this feature BEFORE enabling
  1543. # it for security and access reasons
  1544. #
  1545. # 1 to enable, 0 to disable
  1546. UI = "0"
  1547.  
  1548. # Set this to the port that want to bind this service to. You should configure
  1549. # this port to be >1023 and different from any other port already being used
  1550. #
  1551. # Do NOT enable access to this port in TCP_IN, instead only allow trusted IP's
  1552. # to the port using Advanced Allow Filters (see readme.txt)
  1553. UI_PORT = "6666"
  1554.  
  1555. # This should be a secure, hard to guess username
  1556. #
  1557. # This must be changed from the default
  1558. UI_USER = "username"
  1559.  
  1560. # This should be a secure, hard to guess password. That is, at least 8
  1561. # characters long with a mixture of upper and lowercase characters plus
  1562. # numbers and non-alphanumeric characters
  1563. #
  1564. # This must be changed from the default
  1565. UI_PASS = "password"
  1566.  
  1567. # This is the login session timeout. If there is no activity for a logged in
  1568. # session within this number of seconds, the session will timeout and a new
  1569. # login will be required
  1570. #
  1571. # For security reasons, you should always keep this option low (i.e 60-300)
  1572. UI_TIMEOUT = "300"
  1573.  
  1574. # This is the maximum concurrent connections allowed to the server. The default
  1575. # value should be sufficient
  1576. UI_CHILDREN = "5"
  1577.  
  1578. # The number of login retries allowed within a 24 hour period. A successful
  1579. # login from the IP address will clear the failures
  1580. #
  1581. # For security reasons, you should always keep this option low (i.e 0-10)
  1582. UI_RETRY = "5"
  1583.  
  1584. # If enabled, this option will add the connecting IP address to the file
  1585. # /etc/csf/ui/ui.ban after UI_RETRY login failures. The IP address will not be
  1586. # able to login to the UI while it is listed in this file. The UI_BAN setting
  1587. # does not refer to any of the csf/lfd allow or ignore files, e.g. csf.allow,
  1588. # csf.ignore, etc.
  1589. #
  1590. # For security reasons, you should always enable this option
  1591. UI_BAN = "1"
  1592.  
  1593. # If enabled, only IPs (or CIDR's) listed in the file /etc/csf/ui/ui.allow will
  1594. # be allowed to login to the UI. The UI_ALLOW setting does not refer to any of
  1595. # the csf/lfd allow or ignore files, e.g. csf.allow, csf.ignore, etc.
  1596. #
  1597. # For security reasons, you should always enable this option and use ui.allow
  1598. UI_ALLOW = "1"
  1599.  
  1600. # If enabled, this option will trigger an iptables block through csf after
  1601. # UI_RETRY login failures
  1602. #
  1603. # 0 = no block;1 = perm block;nn=temp block for nn secs
  1604. UI_BLOCK = "1"
  1605.  
  1606. # This controls what email alerts are sent with regards to logins to the UI. It
  1607. # uses the uialert.txt template
  1608. #
  1609. # 4 = login success + login failure/ban/block + login attempts
  1610. # 3 = login success + login failure/ban/block
  1611. # 2 = login failure/ban/block
  1612. # 1 = login ban/block
  1613. # 0 = disabled
  1614. UI_ALERT = "4"
  1615.  
  1616. # This is the SSL cipher list that the Integrated UI will negotiate from
  1617. UI_CIPHER = "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP:!kEDH"
  1618.  
  1619. # This is the SSL protocol version used. See IO::Socket::SSL if you wish to
  1620. # change this and to understand the implications of changing it
  1621. UI_SSL_VERSION = "SSLv23:!SSLv2"
  1622.  
  1623. # If cxs is installed then enabling this option will provide a dropdown box to
  1624. # switch between applications
  1625. UI_CXS = "0"
  1626.  
  1627. # There is a modified installation of ConfigServer Explorer (cse) provided with
  1628. # the csf distribution. If this option is enabled it will provide a dropdown
  1629. # box to switch between applications
  1630. UI_CSE = "0"
  1631.  
  1632. ###############################################################################
  1633. # SECTION:Messenger service
  1634. ###############################################################################
  1635. # Messenger service. This feature allows the display of a message to a blocked
  1636. # connecting IP address to inform the user that they are blocked in the
  1637. # firewall. This can help when users get themselves blocked, e.g. due to
  1638. # multiple login failures. The service is provided by two daemons running on
  1639. # ports providing either an HTML or TEXT message.
  1640. #
  1641. # This feature does not work on servers that do not have the iptables module
  1642. # ipt_REDIRECT loaded. Typically, this will be with MONOLITHIC kernels. VPS
  1643. # server admins should check with their VPS host provider that the iptables
  1644. # module is included.
  1645. #
  1646. # For further information on features and limitations refer to the csf
  1647. # readme.txt
  1648. #
  1649. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  1650. # this server
  1651. #
  1652. # 1 to enable, 0 to disable
  1653. MESSENGER = "0"
  1654.  
  1655. # Provide this service to temporary IP address blocks
  1656. MESSENGER_TEMP = "1"
  1657.  
  1658. # Provide this service to permanent IP address blocks
  1659. MESSENGER_PERM = "1"
  1660.  
  1661. # User account to run the service servers under. We recommend creating a
  1662. # specific non-priv, non-shell account for this purpose
  1663. MESSENGER_USER = "csf"
  1664.  
  1665. # This is the maximum concurrent connections allowed to each service server
  1666. MESSENGER_CHILDREN = "10"
  1667.  
  1668. # Set this to the port that will receive the HTML message. You should configure
  1669. # this port to be >1023 and different from the TEXT port. Do NOT enable access
  1670. # to this port in TCP_IN
  1671. MESSENGER_HTML = "8888"
  1672.  
  1673. # This comma separated list are the HTML ports that will be redirected for the
  1674. # blocked IP address. If you are using per application blocking (LF_TRIGGER)
  1675. # then only the relevant block port will be redirected to the messenger port
  1676. MESSENGER_HTML_IN = "80,2082,2095"
  1677.  
  1678. # Set this to the port that will receive the TEXT message. You should configure
  1679. # this port to be >1023 and different from the HTML port. Do NOT enable access
  1680. # to this port in TCP_IN
  1681. MESSENGER_TEXT = "8889"
  1682.  
  1683. # This comma separated list are the TEXT ports that will be redirected for the
  1684. # blocked IP address. If you are using per application blocking (LF_TRIGGER)
  1685. # then only the relevant block port will be redirected to the messenger port
  1686. MESSENGER_TEXT_IN = "21"
  1687.  
  1688. # These settings limit the rate at which connections can be made to the
  1689. # messenger service servers. Its intention is to provide protection from
  1690. # attacks or excessive connections to the servers. If the rate is exceeded then
  1691. # iptables will revert for the duration to the normal blocking actiity
  1692. #
  1693. # See the iptables man page for the correct --limit rate syntax
  1694. MESSENGER_RATE = "30/m"
  1695. MESSENGER_BURST = "5"
  1696.  
  1697. ###############################################################################
  1698. # SECTION:lfd Clustering
  1699. ###############################################################################
  1700. # lfd Clustering. This allows the configuration of an lfd cluster environment
  1701. # where a group of servers can share blocks and configuration option changes.
  1702. # Included are CLI and UI options to send requests to the cluster.
  1703. #
  1704. # See the readme.txt file for more information and details on setup and
  1705. # security risks.
  1706. #
  1707. # Comma separated list of cluster member IP addresses to send requests to
  1708. CLUSTER_SENDTO = ""
  1709.  
  1710. # Comma separated list of cluster member IP addresses to receive requests from
  1711. CLUSTER_RECVFROM = ""
  1712.  
  1713. # IP address of the master node in the cluster allowed to send CLUSTER_CONFIG
  1714. # changes
  1715. CLUSTER_MASTER = ""
  1716.  
  1717. # If this is a NAT server, set this to the public IP address of this server
  1718. CLUSTER_NAT = ""
  1719.  
  1720. # If a cluster member should send requests on an IP other than the default IP,
  1721. # set it here
  1722. CLUSTER_LOCALADDR = ""
  1723.  
  1724. # Cluster communication port (must be the same on all member servers). There
  1725. # is no need to open this port in the firewall as csf will automatically add
  1726. # in and out bound rules to allow communication between cluster members
  1727. CLUSTER_PORT = "7777"
  1728.  
  1729. # This is a secret key used to encrypt cluster communications using the
  1730. # Blowfish algorithm. It should be between 8 and 56 characters long,
  1731. # preferably > 20 random characters
  1732. # 56 chars:    01234567890123456789012345678901234567890123456789012345
  1733. CLUSTER_KEY = ""
  1734.  
  1735. # Automatically send lfd blocks to all members of CLUSTER_SENDTO. Those
  1736. # servers must have this servers IP address listed in their CLUSTER_RECVFROM
  1737. #
  1738. # Set to 0 to disable this feature
  1739. CLUSTER_BLOCK = "1"
  1740.  
  1741. # This option allows the enabling and disabling of the Cluster configuration
  1742. # changing options --cconfig, --cconfigr, --cfile, --ccfile sent from the
  1743. # CLUSTER_MASTER server
  1744. #
  1745. # Set this option to 1 to allow Cluster configurations to be received
  1746. CLUSTER_CONFIG = "0"
  1747.  
  1748. # Maximum number of child processes to listen on. High blocking rates or large
  1749. # clusters may need to increase this
  1750. CLUSTER_CHILDREN = "10"
  1751.  
  1752. ###############################################################################
  1753. # SECTION:Port Knocking
  1754. ###############################################################################
  1755. # Port Knocking. This feature allows port knocking to be enabled on multiple
  1756. # ports with a variable number of knocked ports and a timeout. There must be a
  1757. # minimum of 3 ports to knock for an entry to be valid
  1758. #
  1759. # See the following for information regarding Port Knocking:
  1760. # http://www.portknocking.org/
  1761. #
  1762. # This feature does not work on servers that do not have the iptables module
  1763. # ipt_recent loaded. Typically, this will be with MONOLITHIC kernels. VPS
  1764. # server admins should check with their VPS host provider that the iptables
  1765. # module is included
  1766. #
  1767. # For further information and syntax refer to the Port Knocking section of the
  1768. # csf readme.txt
  1769. #
  1770. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  1771. # this server
  1772. #
  1773. # openport;protocol;timeout;kport1;kport2;kport3[...;kportN],...
  1774. # e.g.: 22;TCP;20;100;200;300;400
  1775. PORTKNOCKING = ""
  1776.  
  1777. # Enable PORTKNOCKING logging by iptables
  1778. PORTKNOCKING_LOG = "1"
  1779.  
  1780. # Send an email alert if the PORTKNOCKING port is opened. PORTKNOCKING_LOG must
  1781. # also be enabled to use this option
  1782. #
  1783. # SECURITY NOTE: This option is affected by the RESTRICT_SYSLOG option. Read
  1784. # this file about RESTRICT_SYSLOG before enabling this option:
  1785. PORTKNOCKING_ALERT = "0"
  1786.  
  1787. ###############################################################################
  1788. # SECTION:Log Scanner
  1789. ###############################################################################
  1790. # Log Scanner. This feature will send out an email summary of the log lines of
  1791. # each log listed in /etc/csf/csf.logfiles. All lines will be reported unless
  1792. # they match a regular expression in /etc/csf/csf.logignore
  1793. #
  1794. # File globbing is supported for logs listed in /etc/csf/csf.logfiles. However,
  1795. # be aware that the more files lfd has to track, the greater the performance
  1796. # hit. Note: File globs are only evaluated when lfd is started
  1797. #
  1798. # Note: lfd builds the report continuously from lines logged after lfd has
  1799. # started, so any lines logged when lfd is not running will not be reported
  1800. # (e.g. during reboot). If lfd is restarted, then the report will include any
  1801. # lines logged during the previous lfd logging period that weren't reported
  1802. #
  1803. # 1 to enable, 0 to disable
  1804. LOGSCANNER = "0"
  1805.  
  1806. # This is the interval each report will be sent based on the logalert.txt
  1807. # template
  1808. #
  1809. # The interval can be set to:
  1810. # "hourly" - sent on the hour
  1811. # "daily"  - sent at midnight (00:00)
  1812. # "manual" - sent whenever "csf --logrun" is run. This allows for scheduling
  1813. #            via cron job
  1814. LOGSCANNER_INTERVAL = "hourly"
  1815.  
  1816. # Report Style
  1817. # 1 = Separate chronological log lines per log file
  1818. # 2 = Simply chronological log of all lines
  1819. LOGSCANNER_STYLE = "1"
  1820.  
  1821. # Send the report email even if no log lines reported
  1822. # 1 to enable, 0 to disable
  1823. LOGSCANNER_EMPTY = "1"
  1824.  
  1825. # Maximum number of lines in the report before it is truncated. This is to
  1826. # prevent log lines flooding resulting in an excessively large report. This
  1827. # might need to be increased if you choose a daily report
  1828. LOGSCANNER_LINES = "5000"
  1829.  
  1830. ###############################################################################
  1831. # SECTION:Statistics Settings
  1832. ###############################################################################
  1833. # Statistics
  1834. #
  1835. # Some of the Statistics output requires the gd graphics library and the
  1836. # GD::Graph perl module with all dependent modules to be installed for the UI
  1837. # for them to be displayed
  1838. #
  1839. # This option enabled statistical data gathering
  1840. ST_ENABLE = "1"
  1841.  
  1842. # This option determines how many iptables log lines to store for reports
  1843. ST_IPTABLES = "100"
  1844.  
  1845. # This option indicates whether rDNS and CC lookups are performed at the time
  1846. # the log line is recorded (this is not performed when viewing the reports)
  1847. #
  1848. # Warning: If DROP_IP_LOGGING is enabled and there are frequent iptables hits,
  1849. # then enabling this setting could cause serious performance problems
  1850. ST_LOOKUP = "0"
  1851.  
  1852. # This option will gather basic system statstics. Through the UI it displays
  1853. # various graphs for disk, cpu, memory, network, etc usage over 4 intervals:
  1854. #  . Hourly (per minute)
  1855. #  . 24 hours (per minute)
  1856. #  . 7 days (per minute averaged over an hour)
  1857. #  . 30 days (per minute averaged over an hour) - user definable
  1858. # The data is stored in /var/lib/csf/stats/system and the option requires the
  1859. # perl GD::Graph module
  1860. #
  1861. # Note: Disk graphs do not show on Virtuozzo/OpenVZ servers as the kernel on
  1862. # those systems do not store the required information in /proc/diskstats
  1863. # On new installations or when enabling this option it will take time for these
  1864. # graphs to be populated
  1865. ST_SYSTEM = "0"
  1866.  
  1867. # Set the maximum days to collect statistics for. The default is 30 days, the
  1868. # more data that is collected the longer it will take for each of the graphs to
  1869. # be generated
  1870. ST_SYSTEM_MAXDAYS = "30"
  1871.  
  1872. # If ST_SYSTEM is enabled, then these options can collect MySQL statistical
  1873. # data. To use this option the server must have the perl modules DBI and
  1874. # DBD::mysql installed.
  1875. #
  1876. # Set this option to "0" to disable MySQL data collection
  1877. ST_MYSQL = "0"
  1878.  
  1879. # The following options are for authentication for MySQL data collection. If
  1880. # the password is left blank and the user set to "root" then the procedure will
  1881. # look for authentication data in /root/.my.cnf. Otherwise, you will need to
  1882. # provide a MySQL username and password to collect the data. Any MySQL user
  1883. # account can be used
  1884. ST_MYSQL_USER = "root"
  1885. ST_MYSQL_PASS = ""
  1886. ST_MYSQL_HOST = "localhost"
  1887.  
  1888. # If ST_SYSTEM is enabled, then this option can collect Apache statistical data
  1889. # The value for PT_APACHESTATUS must be correctly set
  1890. ST_APACHE = "0"
  1891.  
  1892. # The following options measure disk write performance using dd (location set
  1893. # via the DD setting). It creates a 64MB file called /var/lib/dd_write_test and
  1894. # the statistics will plot the MB/s response time of the disk. As this is an IO
  1895. # intensive operation, it may not be prudent to run this test too often, so by
  1896. # default it is only run every 5 minutes and the result duplicated for each
  1897. # intervening minute for the statistics
  1898. #
  1899. # This is not necessrily a good measure of disk performance, primarily because
  1900. # the measurements are for relatively small amounts of data over a small amount
  1901. # of time. To properly test disk performance there are a variety of tools
  1902. # available that should be run for extended periods of time to obtain an
  1903. # accurate measurement. This metric is provided to give an idea of how the disk
  1904. # is performing over time
  1905. #
  1906. # Note: There is a 15 second timeout performing the check
  1907. #
  1908. # Set to 0 to disable, 1 to enable
  1909. ST_DISKW = "0"
  1910.  
  1911. # The number of minutes that elapse between tests. Default is 5, minimum is 1.
  1912. ST_DISKW_FREQ = "5"
  1913.  
  1914. # This is the command line passed to dd. If you are familiar with dd, or wish
  1915. # to move the output file (of) to a different disk, then you can alter this
  1916. # command. Take great care when making any changes to this command as it is
  1917. # very easy to overwrite a disk using dd if you make a mistake
  1918. ST_DISKW_DD = "if=/dev/zero of=/var/lib/csf/dd_test bs=1MB count=64 conv=fdatasync"
  1919.  
  1920. ###############################################################################
  1921. # SECTION:OS Specific Settings
  1922. ###############################################################################
  1923. # Binary locations
  1924. IPTABLES = "/sbin/iptables"
  1925. IPTABLES_SAVE = "/sbin/iptables-save"
  1926. IPTABLES_RESTORE = "/sbin/iptables-restore"
  1927. IP6TABLES = "/sbin/ip6tables"
  1928. IP6TABLES_SAVE = "/sbin/ip6tables-save"
  1929. IP6TABLES_RESTORE = "/sbin/ip6tables-restore"
  1930. MODPROBE = "/sbin/modprobe"
  1931. IFCONFIG = "/sbin/ifconfig"
  1932. SENDMAIL = "/usr/sbin/sendmail"
  1933. PS = "/bin/ps"
  1934. VMSTAT = "/usr/bin/vmstat"
  1935. LS = "/bin/ls"
  1936. MD5SUM = "/usr/bin/md5sum"
  1937. TAR = "/bin/tar"
  1938. CHATTR = "/usr/bin/chattr"
  1939. UNZIP = "/usr/bin/unzip"
  1940. GUNZIP = "/bin/gunzip"
  1941. DD = "/bin/dd"
  1942. TAIL = "/usr/bin/tail"
  1943. GREP = "/bin/grep"
  1944.  
  1945. # Log file locations
  1946. #
  1947. # File globbing is allowed for the following logs. However, be aware that the
  1948. # more files lfd has to track, the greater the performance hit
  1949. #
  1950. # Note: File globs are only evaluated when lfd is started
  1951. #
  1952. HTACCESS_LOG = "/var/log/apache2/error.log"
  1953. MODSEC_LOG = "/var/log/apache2/error.log"
  1954. SSHD_LOG = "/var/log/auth.log"
  1955. SU_LOG = "/var/log/messages"
  1956. FTPD_LOG = "/var/log/messages"
  1957. SMTPAUTH_LOG = "/var/log/secure"
  1958. POP3D_LOG = "/var/log/mail.log"
  1959. IMAPD_LOG = "/var/log/mail.log"
  1960. IPTABLES_LOG = "/var/log/messages"
  1961. SUHOSIN_LOG = "/var/log/messages"
  1962. BIND_LOG = "/var/log/messages"
  1963. SYSLOG_LOG = "/var/log/messages"
  1964. WEBMIN_LOG = "/var/log/auth.log"
  1965.  
  1966. CUSTOM1_LOG = "/var/log/customlog"
  1967. CUSTOM2_LOG = "/var/log/customlog"
  1968. CUSTOM3_LOG = "/var/log/customlog"
  1969. CUSTOM4_LOG = "/var/log/customlog"
  1970. CUSTOM5_LOG = "/var/log/customlog"
  1971. CUSTOM6_LOG = "/var/log/customlog"
  1972. CUSTOM7_LOG = "/var/log/customlog"
  1973. CUSTOM8_LOG = "/var/log/customlog"
  1974. CUSTOM9_LOG = "/var/log/customlog"
  1975.  
  1976. # The following are comma separated lists used if LF_SELECT is enabled,
  1977. # otherwise they are not used. They are derived from the application returned
  1978. # from a regex match in /usr/local/csf/bin/regex.pm
  1979. PORTS_pop3d = "110,995"
  1980. PORTS_imapd = "143,993"
  1981. PORTS_htpasswd = "80,443"
  1982. PORTS_mod_security = "80,443"
  1983. PORTS_mod_qos = "80,443"
  1984. PORTS_symlink = "80,443"
  1985. PORTS_suhosin = "80,443"
  1986. PORTS_cxs = "80,443"
  1987. PORTS_bind = "53"
  1988. PORTS_ftpd = "20,21"
  1989. PORTS_webmin = "10000"
  1990. # This list is extended, if present, by the ports defined by
  1991. # /etc/chkservd/exim-*
  1992. PORTS_smtpauth = "25,465,587"
  1993. PORTS_eximsyntax = "25,465,587"
  1994. # This list is replaced, if present, by "Port" definitions in
  1995. # /etc/ssh/sshd_config
  1996. PORTS_sshd = "22"
  1997.  
  1998. # This configuration is for use with generic Linux servers, do not change the
  1999. # following setting:
  2000. GENERIC = "1"
  2001.  
  2002. # If you find ever increasing numbers of zombie lfd processes you may need to
  2003. # revert to the old child reaper code by enabling this option
  2004. OLD_REAPER = "0"
  2005.  
  2006. # For internal use only. You should not enable this option as it could cause
  2007. # instability in csf and lfd
  2008. DEBUG = "0"
  2009. ###############################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement