Advertisement
khalequzzaman17

CSF Strict Configuration

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