Advertisement
Guest User

Untitled

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