Advertisement
Guest User

csf config example file

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