Advertisement
Guest User

Untitled

a guest
Feb 9th, 2012
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.09 KB | None | 0 0
  1. ###############################################################################
  2. # SECTION:Initial Settings
  3. ###############################################################################
  4. # ConfigServer Firewall & Security Configuration File
  5. #
  6. # Copyright 2006-2012, Way to the Web Limited
  7. # URL: http://www.configserver.com
  8. ###############################################################################
  9.  
  10. # Testing flag - enables a CRON job that clears iptables incase of
  11. # configuration problems when you start csf. This should be enabled until you
  12. # are sure that the firewall works - i.e. incase you get locked out of your
  13. # server! Then do remember to set it to 0 and restart csf when you're sure
  14. # everything is OK. Stopping csf will remove the line from /etc/crontab
  15. #
  16. # lfd will not start while this is enabled
  17. TESTING = "0"
  18.  
  19. # The interval for the crontab in minutes. Since this uses the system clock the
  20. # CRON job will run at the interval past the hour and not from when you issue
  21. # the start command. Therefore an interval of 5 minutes means the firewall
  22. # will be cleared in 0-5 minutes from the firewall start
  23. TESTING_INTERVAL = "5"
  24.  
  25. # Enabling auto updates creates a cron job called /etc/cron.d/csf_update which
  26. # runs once per day to see if there is an update to csf+lfd and upgrades if
  27. # available and restarts csf and lfd. Updates do not overwrite configuration
  28. # files or email templates. An email will be sent to the root account if an
  29. # update is performed
  30. #
  31. # You should check for new version announcements at http://blog.configserver.com
  32. AUTO_UPDATES = "1"
  33.  
  34. ###############################################################################
  35. # SECTION:Port Settings
  36. ###############################################################################
  37. # Lists of ports in the following comma separated lists can be added using a
  38. # colon (e.g. 30000:35000).
  39.  
  40. # Allow incoming TCP ports
  41. TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,5122,6122,6901,5121,6900,6121,3306"
  42. #
  43. # # Allow outgoing TCP ports
  44. TCP_OUT = "20,21,22,25,53,80,110,113,443,5121,6121,6900,5122,6122,6901"
  45. #
  46. # # Allow incoming UDP ports
  47. UDP_IN = "20,21,53"
  48. #
  49. # # Allow outgoing UDP ports
  50. # # To allow outgoing traceroute add 33434:33523 to this list
  51. UDP_OUT = "20,21,53,113,123"
  52. #
  53. ICMP_IN = "1"
  54.  
  55. # Set the per IP address incoming ICMP packet rate
  56. # To disable rate limiting set to "0"
  57. ICMP_IN_RATE = "1/s"
  58.  
  59. # Allow outgoing PING
  60. ICMP_OUT = "1"
  61.  
  62. # Set the per IP address outgoing ICMP packet rate (hits per second allowed),
  63. # e.g. "1/s"
  64. # To disable rate limiting set to "0"
  65. ICMP_OUT_RATE = "0"
  66.  
  67. ###############################################################################
  68. # SECTION:General Settings
  69. ###############################################################################
  70. # By default, csf will auto-configure iptables to filter all traffic except on
  71. # the loopback device. If you only want iptables rules applied to a specific
  72. # NIC, then list it here (e.g. eth1, or eth+)
  73. ETH_DEVICE = ""
  74.  
  75. # If you don't want iptables rules applied to specific NICs, then list them in
  76. # a comma separated list (e.g "eth1,eth2")
  77. ETH_DEVICE_SKIP = ""
  78.  
  79. # Enable this option if you want lfd to ignore (i.e. don't block) IP addresses
  80. # listed in csf.allow in addition to csf.ignore (the default). This option
  81. # should be used with caution as it would mean that IP's allowed through the
  82. # firewall from infected PC's could launch attacks on the server that lfd
  83. # would ignore
  84. IGNORE_ALLOW = "0"
  85.  
  86. # Enable the following option if you want to apply strict iptables rules to DNS
  87. # traffic (i.e. relying on iptables connection tracking). Enabling this option
  88. # could cause DNS resolution issues both to and from the server but could help
  89. # prevent abuse of the local DNS server
  90. DNS_STRICT = "0"
  91.  
  92. # Limit the number of IP's kept in the /etc/csf/csf.deny file. This can be
  93. # important as a large number of IP addresses create a large number of iptables
  94. # rules (4 times the number of IP's) which can cause problems on some systems
  95. # where either the the number of iptables entries has been limited (esp VPS's)
  96. # or where resources are limited. This can result in slow network performance,
  97. # or, in the case of iptables entry limits, can prevent your server from
  98. # booting as not all the required iptables chain settings will be correctly
  99. # configured. The value set here is the maximum number of IPs/CIDRs allowed
  100. # if the limit is reached, the entries will be rotated so that the oldest
  101. # entries (i.e. the ones at the top) will be removed and the latest is added.
  102. # The limit is only checked when using csf -d (which is what lfd also uses)
  103. # Set to 0 to disable limiting
  104. DENY_IP_LIMIT = "100"
  105.  
  106. # Limit the number of IP's kept in the temprary IP ban list. If the limit is
  107. # reached the oldest IP's in the ban list will be removed and allowed
  108. # regardless of the amount of time remaining for the block
  109. # Set to 0 to disable limiting
  110. DENY_TEMP_IP_LIMIT = "100"
  111.  
  112. # Enable login failure detection daemon (lfd). If set to 0 none of the
  113. # following settings will have any effect as the daemon won't start.
  114. LF_DAEMON = "1"
  115.  
  116. # Check whether csf appears to have been stopped and restart if necessary,
  117. # unless TESTING is enabled above. The check is done every 300 seconds
  118. LF_CSF = "1"
  119.  
  120. # If you enable this option then whenever a CLI request to restart csf is used
  121. # (i.e. -s, --start, -r, --restart, -q, --startq) then instead of csf
  122. # rebuilding the iptables rules, csf will indicate to lfd to rebuild them
  123. # instead, within LF_PARSE seconds
  124. #
  125. # This feature can be particularly helpful for (re)starting configurations with
  126. # a large number of rules, e.g. those using CC block/allow lists. It can also
  127. # speed up boot times by deferring csf startup to the lfd process rather than
  128. # the init process
  129. LF_QUICKSTART = "0"
  130.  
  131. # Enable verbose output of iptables commands
  132. VERBOSE = "1"
  133.  
  134. # Enable packet filtering for unwanted or illegal packets. This will drop
  135. # packets that iptables has deemed INVALID (i.e. there is no established TCP
  136. # connection in the state table), or if the TCP flags in the packet are out of
  137. # sequence or illegal in the protocol exchange.
  138. #
  139. # If you see packets being dropped that you would rather allow then disable
  140. # this option by setting it to "0"
  141. PACKET_FILTER = "1"
  142.  
  143. # Perform reverse DNS lookups on IP addresses. (See also CC_LOOKUPS)
  144. LF_LOOKUPS = "1"
  145.  
  146. ###############################################################################
  147. # SECTION:IPv6 Settings
  148. ###############################################################################
  149. # IPv6: (Requires ip6tables)
  150. #
  151. # Pre v2.6.20 kernels do not perform stateful connection tracking, so a static
  152. # firewall is configured as a fallback instead if IPV6_SPI is set to 0 below
  153. #
  154. # Supported:
  155. # Temporary ACCEPT/DENY, GLOBAL_DENY, GLOBAL_ALLOW, SMTP_BLOCK, LF_PERMBLOCK,
  156. # PACKET_FILTER, WATCH_MODE, Advanced Allow/Deny Filters, RELAY_*, CLUSTER_*
  157. #
  158. # SMTP_BLOCK is only applied if port 25 is included in TCP6_OUT
  159. #
  160. # Not supported:
  161. # DYNDNS, CC_DENY, CC_ALLOW, CC_ALLOW_FILTER, LF_DSHIELD, LF_SPAMHAUS,
  162. # SYNFLOOD, PORTFLOOD, DYNDNS, ICMP_IN, ICMP_OUT, LF_NETBLOCK, MESSENGER,
  163. # CC_IGNORE, CONNLIMIT
  164. #
  165. # Partially supported:
  166. # CC_LOOKUPS - reverse DNS only and requires the perl module Socket6 from cpan
  167. #
  168. # MESSENGER service - not supported: no REDIRECT support in ip6tables as yet
  169. #
  170. IPV6 = "1"
  171.  
  172. # IPv6 uses icmpv6 packets very heavily. By default, csf will allow all icmpv6
  173. # traffic in the INPUT and OUTPUT chains. However, this could increase the risk
  174. # of icmpv6 attacks. To restrict incoming icmpv6, set to "1" but may break some
  175. # connection types
  176. IPV6_ICMP_STRICT = "0"
  177.  
  178. # Pre v2.6.20 kernel must set this option to "0" as no working state module is
  179. # present, so a static firewall is configured as a fallback
  180. #
  181. # Because connection tracking does not work on such kernels, applications that
  182. # rely on it (e.g. apache, passive ftp, etc) will not function unless you open
  183. # all outgoing ports. To do this set the following:
  184. #
  185. # TCP6_OUT = "0:65535"
  186. # UDP6_OUT = "0:65535"
  187. #
  188. # If you allow incoming ipv6 DNS lookups you will need to use the following
  189. # directive in the options{} section of your named.conf:
  190. #
  191. # query-source-v6 port 53;
  192. #
  193. # This will force ipv6 incoming DNS traffic only through port 53
  194. #
  195. # These changes are note necessary if the SPI firewall is used
  196. IPV6_SPI = "1"
  197.  
  198. # Allow incoming IPv6 TCP ports
  199. TCP6_IN = "22,25,53,80,110,143,443,465,587"
  200.  
  201. # Allow outgoing IPv6 TCP ports
  202. TCP6_OUT = "22,25,53,80,110,113,443,587"
  203.  
  204. # Allow incoming IPv6 UDP ports
  205. UDP6_IN = "53"
  206.  
  207. # Allow outgoing IPv6 UDP ports
  208. # To allow outgoing traceroute add 33434:33523 to this list
  209. UDP6_OUT = "53,113"
  210.  
  211. ###############################################################################
  212. # SECTION:SMTP Settings
  213. ###############################################################################
  214. # Block outgoing SMTP except for root, exim and mailman (forces scripts/users
  215. # to use the exim/sendmail binary instead of sockets access). This replaces the
  216. # protection as WHM > Tweak Settings > SMTP Tweaks
  217. #
  218. # This option uses the iptables ipt_owner/xt_owner module and must be loaded
  219. # for it to work. It may not be available on some VPS platforms
  220. #
  221. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  222. # this server
  223. SMTP_BLOCK = "0"
  224.  
  225. # If SMTP_BLOCK is enabled but you want to allow local connections to port 25
  226. # on the server (e.g. for webmail or web scripts) then enable this option to
  227. # allow outgoing SMTP connections to the loopback device
  228. SMTP_ALLOWLOCAL = "1"
  229.  
  230. # This is a comma separated list of the ports to block. You should list all
  231. # ports that exim is configured to listen on
  232. SMTP_PORTS = "25"
  233.  
  234. # Always allow the following comma separated users and groups to bypass
  235. # SMTP_BLOCK
  236. #
  237. # Note: root (UID:0) is always allowed
  238. SMTP_ALLOWUSER = ""
  239. SMTP_ALLOWGROUP = "mail,mailman"
  240.  
  241. ###############################################################################
  242. # SECTION:Port Flood Settings
  243. ###############################################################################
  244. # Enable SYN Flood Protection. This option configures iptables to offer some
  245. # protection from tcp SYN packet DOS attempts. You should set the RATE so that
  246. # false-positives are kept to a minimum otherwise visitors may see connection
  247. # issues (check /var/log/messages for *SYNFLOOD Blocked*). See the iptables
  248. # man page for the correct --limit rate syntax
  249. #
  250. # Note: This option should ONLY be enabled if you know you are under a SYN
  251. # flood attack as it will slow down all new connections from any IP address to
  252. # the server if triggered
  253. SYNFLOOD = "0"
  254. SYNFLOOD_RATE = "100/s"
  255. SYNFLOOD_BURST = "150"
  256.  
  257. # Connection Limit Protection. This option configures iptables to offer more
  258. # protection from DOS attacks against specific ports. It can also be used as a
  259. # way to simply limit resource usage by IP address to specific server services.
  260. # This option limits the number of concurrent new connections per IP address
  261. # that can be made to specific ports
  262. #
  263. # This feature does not work on servers that do not have the iptables module
  264. # xt_connlimit loaded. Typically, this will be with MONOLITHIC kernels. VPS
  265. # server admins should check with their VPS host provider that the iptables
  266. # module is included
  267. #
  268. # For further information and syntax refer to the Connection Limit Protection
  269. # section of the csf readme.txt
  270. #
  271. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  272. # this server
  273. CONNLIMIT = ""
  274.  
  275. # Port Flood Protection. This option configures iptables to offer protection
  276. # from DOS attacks against specific ports. This option limits the number of
  277. # new connections per time interval that can be made to specific ports
  278. #
  279. # This feature does not work on servers that do not have the iptables module
  280. # ipt_recent loaded. Typically, this will be with MONOLITHIC kernels. VPS
  281. # server admins should check with their VPS host provider that the iptables
  282. # module is included
  283. #
  284. # For further information and syntax refer to the Port Flood Protection
  285. # section of the csf readme.txt
  286. #
  287. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  288. # this server
  289. PORTFLOOD = ""
  290.  
  291. ###############################################################################
  292. # SECTION:Logging Settings
  293. ###############################################################################
  294. # Log lfd messages to SYSLOG in addition to /var/log/lfd.log. You must have the
  295. # perl module Sys::Syslog installed to use this feature
  296. SYSLOG = "0"
  297.  
  298. # Drop target for iptables rules. This can be set to either DROP ot REJECT.
  299. # REJECT will send back an error packet, DROP will not respond at all. REJECT
  300. # is more polite, however it does provide extra information to a hacker and
  301. # lets them know that a firewall is blocking their attempts. DROP hangs their
  302. # connection, thereby frustrating attempts to port scan the server.
  303. DROP = "DROP"
  304.  
  305. # Enable logging of dropped connections to blocked ports to syslog, usually
  306. # /var/log/messages. This option needs to be enabled to use Port Scan Tracking
  307. DROP_LOGGING = "1"
  308.  
  309. # Enable logging of dropped connections to blocked IP addresses in csf.deny or
  310. # by lfd with temporary connection tracking blocks
  311. #
  312. # This option will be disabled if you enable Port Scan Tracking (PS_INTERVAL)
  313. DROP_IP_LOGGING = "0"
  314.  
  315. # Only log reserved port dropped connections (0:1023). Useful since you're not
  316. # usually bothered about ephemeral port drops
  317. DROP_ONLYRES = "0"
  318.  
  319. # Commonly blocked ports that you do not want logging as they tend to just fill
  320. # up the log file. These ports are specifically blocked (applied to TCP and UDP
  321. # protocols) for incoming connections
  322. DROP_NOLOG = "67,68,111,113,135:139,445,500,513,520"
  323.  
  324. # Log packets dropped by the packet filtering option PACKET_FILTER
  325. DROP_PF_LOGGING = "0"
  326.  
  327. # Log packets dropped by the Connection Limit Protection option CONNLIMIT. If
  328. # this is enabled and Port Scan Tracking (PS_INTERVAL) is also enabled, IP
  329. # addresses breaking the Connection Limit Protection will be blocked
  330. CONNLIMIT_LOGGING = "0"
  331.  
  332. # Send an alert if log file flooding is detected which causes lfd to skip log
  333. # lines to prevent lfd from looping. If this alert is sent you should check the
  334. # reported log file for the reason for the flooding
  335. LOGFLOOD_ALERT = "0"
  336.  
  337. # Configure csf to watch IP addresses (with csf -w [ip]). This option will add
  338. # overhead to packet traversal through iptables and syslog logging, so should
  339. # only be enabled while actively watching IP addresses. See readme.txt for more
  340. # information on the use of this option
  341. WATCH_MODE = "0"
  342.  
  343. ###############################################################################
  344. # SECTION:Reporting Settings
  345. ###############################################################################
  346. # By default, lfd will send alert emails using the relevant alert template to
  347. # the To: address configured within that template. Setting the following
  348. # option will override the configured To: field in all lfd alert emails
  349. #
  350. # Leave this option empty to use the To: field setting in each alert template
  351. LF_ALERT_TO = ""
  352.  
  353. # By default, lfd will send alert emails using the relevant alert template from
  354. # the From: address configured within that template. Setting the following
  355. # option will override the configured From: field in all lfd alert emails
  356. #
  357. # Leave this option empty to use the From: field setting in each alert template
  358. LF_ALERT_FROM = ""
  359.  
  360. # In addition to the standard lfd email alerts, you can additionally enable the
  361. # sending of X-ARF reports (see http://www.x-arf.org/specification.html). Only
  362. # block alert messages will be sent.
  363. #
  364. # These reports are in a format accepted by many Netblock owners and should
  365. # help them investigate abuse. This option is not designed to automatically
  366. # forward these reports to the Netblock owners and should be checked for
  367. # false-positive blocks before reporting
  368. #
  369. # Note: The following block types are not reported through this feature:
  370. # LF_PERMBLOCK, LF_NETBLOCK, LF_DISTATTACK, LF_DISTFTP, RT_*_ALERT
  371. X_ARF = "0"
  372.  
  373. # By default, lfd will send emails from the root forwarder. Setting the
  374. # following option will override this
  375. X_ARF_FROM = ""
  376.  
  377. # By default, lfd will send emails to the root forwarder. Setting the following
  378. # option will override this
  379. X_ARF_TO = ""
  380.  
  381. # Block Reporting. lfd can run an external script when it performs and IP
  382. # address block following for example a login failure. The following setting
  383. # is to the full path of the external script which must be executable. See
  384. # readme.txt for format details
  385. #
  386. # Leave this setting blank to disable
  387. BLOCK_REPORT = ""
  388.  
  389. ###############################################################################
  390. # SECTION:Temp to Perm/Netblock Settings
  391. ###############################################################################
  392. # Temporary to Permanent IP blocking. The following enables this feature to
  393. # permanently block IP addresses that have been temporarily blocked more than
  394. # LF_PERMBLOCK_COUNT times in the last LF_PERMBLOCK_INTERVAL seconds. Set
  395. # LF_PERMBLOCK to "1" to enable this feature
  396. #
  397. # Care needs to be taken when setting LF_PERMBLOCK_INTERVAL as it needs to be
  398. # at least LF_PERMBLOCK_COUNT multiplied by the longest temporary time setting
  399. # (TTL) for blocked IPs, to be effective
  400. #
  401. # Set LF_PERMBLOCK to "0" to disable this feature
  402. LF_PERMBLOCK = "1"
  403. LF_PERMBLOCK_INTERVAL = "86400"
  404. LF_PERMBLOCK_COUNT = "4"
  405. LF_PERMBLOCK_ALERT = "1"
  406.  
  407. # Permanently block IPs by network class. The following enables this feature
  408. # to permanently block classes of IP address where individual IP addresses
  409. # within the same class LF_NETBLOCK_CLASS have already been blocked more than
  410. # LF_NETBLOCK_COUNT times in the last LF_NETBLOCK_INTERVAL seconds. Set
  411. # LF_NETBLOCK to "1" to enable this feature
  412. #
  413. # This can be an affective way of blocking DDOS attacks launched from within
  414. # the same networ class
  415. #
  416. # Valid settings for LF_NETBLOCK_CLASS are "A", "B" and "C", care and
  417. # consideration is required when blocking network classes A or B
  418. #
  419. # Set LF_NETBLOCK to "0" to disable this feature
  420. LF_NETBLOCK = "0"
  421. LF_NETBLOCK_INTERVAL = "86400"
  422. LF_NETBLOCK_COUNT = "4"
  423. LF_NETBLOCK_CLASS = "C"
  424. LF_NETBLOCK_ALERT = "1"
  425.  
  426. ###############################################################################
  427. # SECTION:Global Lists/DYNDNS/Blacklists
  428. ###############################################################################
  429. # Safe Chain Update. If enabled, all dynamic update chains (GALLOW*, GDENY*,
  430. # SPAMHAUS, DSHIELD, BOGON, CC_ALLOW, CC_DENY, ALLOWDYN*) will create a new
  431. # chain when updating, and insert it into the relevant LOCALINPUT/LOCALOUTPUT
  432. # chain, then flush and delete the old dynamic chain and rename the new chain.
  433. #
  434. # This prevents a small window of opportunity opening when an update occurs and
  435. # the dynamic chain is flushed for the new rules.
  436. #
  437. # This option should not be enabled on servers with long dynamic chains (e.g.
  438. # CC_DENY/CC_ALLOW lists) and low memory. It should also not be enabled on
  439. # Virtuozzo VPS servers with a restricted numiptent value. This is because each
  440. # chain will effectively be duplicated while the update occurs, doubling the
  441. # number of iptables rules
  442. SAFECHAINUPDATE = "0"
  443.  
  444. # If you wish to allow access from dynamic DNS records (for example if your IP
  445. # address changes whenever you connect to the internet but you have a dedicated
  446. # dynamic DNS record from the likes of dyndns.org) then you can list the FQDN
  447. # records in csf.dyndns and then set the following to the number of seconds to
  448. # poll for a change in the IP address. If the IP address has changed iptables
  449. # will be updated.
  450. #
  451. # A setting of 600 would check for IP updates every 10 minutes. Set the value
  452. # to 0 to disable the feature
  453. DYNDNS = "0"
  454.  
  455. # To always ignore DYNDNS IP addresses in lfd blocking, set the following
  456. # option to 1
  457. DYNDNS_IGNORE = "0"
  458.  
  459. # The follow Global options allow you to specify a URL where csf can grab a
  460. # centralised copy of an IP allow or deny block list of your own. You need to
  461. # specify the full URL in the following options, i.e.:
  462. # http://www.somelocation.com/allow.txt
  463. #
  464. # The actual retrieval of these IP's is controlled by lfd, so you need to set
  465. # LF_GLOBAL to the interval (in seconds) when you want lfd to retrieve. lfd
  466. # will perform the retrieval when it runs and then again at the specified
  467. # interval. A sensible interval would probably be every 3600 seconds (1 hour).
  468. # A minimum value of 300 is enforced for LF_GLOBAL if enabled
  469. #
  470. # You do not have to specify both an allow and a deny file
  471. #
  472. # You can also configure a global ignore file for IP's that lfd should ignore
  473. LF_GLOBAL = "0"
  474.  
  475. GLOBAL_ALLOW = ""
  476. GLOBAL_DENY = ""
  477. GLOBAL_IGNORE = ""
  478.  
  479. # Provides the same functionality as DYNDNS but with a GLOBAL URL file. Set
  480. # this to the URL of the file containing DYNDNS entries
  481. GLOBAL_DYNDNS = ""
  482.  
  483. # Set the following to the number of seconds to poll for a change in the IP
  484. # address resoved from GLOBAL_DYNDNS
  485. GLOBAL_DYNDNS_INTERVAL = "600"
  486.  
  487. # To always ignore GLOBAL_DYNDNS IP addresses in lfd blocking, set the following
  488. # option to 1
  489. GLOBAL_DYNDNS_IGNORE = "0"
  490.  
  491. # Enable IP range blocking using the DShield Block List at
  492. # http://feeds.dshield.org/block.txt
  493. # To enable this feature, set the following to the interval in seconds that you
  494. # want the block list updated. The list is reasonably static during the length
  495. # of a day, so it would be appropriate to only update once every 24 hours, so
  496. # a value of "86400" is recommended
  497. LF_DSHIELD = "0"
  498.  
  499. # The DShield block list URL. If you change this to something else be sure it
  500. # is in the same format as the block list
  501. LF_DSHIELD_URL = "http://feeds.dshield.org/block.txt"
  502.  
  503. # Enable IP range blocking using the Spamhaus DROP List at
  504. # http://www.spamhaus.org/drop/index.lasso
  505. # To enable this feature, set the following to the interval in seconds that you
  506. # want the block list updated. The list is reasonably static during the length
  507. # of a day, so it would be appropriate to only update once every 24 hours, so
  508. # a value of "86400" is recommended
  509. LF_SPAMHAUS = "0"
  510.  
  511. # The Spamhaus DROP List URL. If you change this to something else be sure it
  512. # is in the same format as the drop list
  513. LF_SPAMHAUS_URL = "http://www.spamhaus.org/drop/drop.lasso"
  514.  
  515. # Enable IP range blocking using the BOGON List at
  516. # http://www.cymru.com/Bogons/
  517. # To enable this feature, set the following to the interval in seconds that you
  518. # want the block list updated. The list is reasonably static during the length
  519. # of a day, so it would be appropriate to only update once every 24 hours, so
  520. # a value of "86400" is recommended
  521. #
  522. # If your server uses IP's on the BOGON list then you will need to list the
  523. # affected NICs in LF_BOGON_SKIP
  524. LF_BOGON = "0"
  525.  
  526. # The BOGON List URL. If you change this to something else be sure it
  527. # is in the same format as the drop list
  528. LF_BOGON_URL = "http://www.cymru.com/Documents/bogon-bn-agg.txt"
  529.  
  530. # If you don't want BOGON rules applied to specific NICs, then list them in
  531. # a comma separated list (e.g "eth1,eth2")
  532. LF_BOGON_SKIP = ""
  533.  
  534. ###############################################################################
  535. # SECTION:Country Code Lists and Settings
  536. ###############################################################################
  537. # Country Code to CIDR allow/deny. In the following two options you can allow
  538. # or deny whole country CIDR ranges. The CIDR blocks are generated from the
  539. # Maxmind GeoLite Country database http://www.maxmind.com/app/geolitecountry
  540. # and entirely relies on that service being available
  541. #
  542. # Specify the the two-letter ISO Country Code(s). The iptables rules are for
  543. # incoming connections only
  544. #
  545. # Warning: These lists are never 100% accurate and some ISP's (e.g. AOL) use
  546. # non-geographic IP address designations for their clients
  547. #
  548. # Warning: Some of the CIDR lists are huge and each one requires a rule within
  549. # the incoming iptables chain. This can result in significant performance
  550. # overheads and could render the server inaccessible in some circumstances. For
  551. # this reason (amongst others) we do not recommend using these options
  552. #
  553. # Warning: Due to the resource constraints on VPS servers this feature should
  554. # not be used on such systems unless you choose very small CC zones
  555. #
  556. # Warning: CC_ALLOW allows access through all ports in the firewall. For this
  557. # reason CC_ALLOW probably has very limited use
  558. #
  559. # Each option is a comma separated list of CC's, e.g. "US,GB,DE"
  560. CC_DENY = ""
  561. CC_ALLOW = ""
  562.  
  563. # An alternative to CC_ALLOW is to only allow access from the following
  564. # countries but still filter based on the port and packets rules. All other
  565. # connections are dropped
  566. CC_ALLOW_FILTER = ""
  567.  
  568. # This Country Code list will prevent lfd from blocking IP address hits for the
  569. # listed CC's
  570. CC_IGNORE = ""
  571.  
  572. # Display Country Code and Country for reported IP addresses. This option can
  573. # be configured to use the MaxMind Country Database or the more detailed (and
  574. # much larger and therefore slower) MaxMind City Database
  575. #
  576. # "0" - disable
  577. # "1" - Reports: Country Code and Country
  578. # "2" - Reports: Country Code and Country and Region and City
  579. CC_LOOKUPS = "1"
  580.  
  581. # This option tells lfd how often to retrieve the Maxmind GeoLite Country
  582. # database for CC_ALLOW, CC_ALLOW_FILTER, CC_DENY, CC_IGNORE and CC_LOOKUPS (in
  583. # days)
  584. CC_INTERVAL = "7"
  585.  
  586. ###############################################################################
  587. # SECTION:Login Failure Blocking and Alerts
  588. ###############################################################################
  589. # The following[*] triggers are application specific. If you set LF_TRIGGER to
  590. # "0" the value of each trigger is the number of failures against that
  591. # application that will trigger lfd to block the IP address
  592. #
  593. # If you set LF_TRIGGER to a value greater than "0" then the following[*]
  594. # application triggers are simply on or off ("0" or "1") and the value of
  595. # LF_TRIGGER is the total cumulative number of failures that will trigger lfd
  596. # to block the IP address
  597. #
  598. # Setting the application trigger to "0" disables it
  599. LF_TRIGGER = "0"
  600.  
  601. # If LF_TRIGGER is > "0" then LF_TRIGGER_PERM can be set to "1" to permanently
  602. # block the IP address, or LF_TRIGGER_PERM can be set to a value greater than
  603. # "1" and the IP address will be blocked temporarily for that value in seconds.
  604. # For example:
  605. # LF_TRIGGER_PERM = "1" => the IP is blocked permanently
  606. # LF_TRIGGER_PERM = "3600" => the IP is blocked temporarily for 1 hour
  607. #
  608. # If LF_TRIGGER is "0", then the application LF_[application]_PERM value works
  609. # in the same way as above and LF_TRIGGER_PERM serves no function
  610. LF_TRIGGER_PERM = "1"
  611.  
  612. # To only block access to the failed application instead of a complete block
  613. # for an ip address, you can set the following to "1", but LF_TRIGGER must be
  614. # set to "0" with specific application[*] trigger levels also set appropriately
  615. LF_SELECT = "0"
  616.  
  617. # Send an email alert if an IP address is blocked by one of the [*] triggers
  618. LF_EMAIL_ALERT = "1"
  619.  
  620. # [*]Enable login failure detection of sshd connections
  621. LF_SSHD = "5"
  622. LF_SSHD_PERM = "1"
  623.  
  624. # [*]Enable login failure detection of ftp connections
  625. LF_FTPD = "10"
  626. LF_FTPD_PERM = "1"
  627.  
  628. # [*]Enable login failure detection of SMTP AUTH connections
  629. LF_SMTPAUTH = "5"
  630. LF_SMTPAUTH_PERM = "1"
  631.  
  632. # [*]Enable login failure detection of pop3 connections
  633. LF_POP3D = "10"
  634. LF_POP3D_PERM = "1"
  635.  
  636. # [*]Enable login failure detection of imap connections
  637. LF_IMAPD = "10"
  638. LF_IMAPD_PERM = "1"
  639.  
  640. # [*]Enable login failure detection of Apache .htpasswd connections
  641. # Due to the often high logging rate in the Apache error log, you might want to
  642. # enable this option only if you know you are suffering from attacks against
  643. # password protected directories
  644. LF_HTACCESS = "5"
  645. LF_HTACCESS_PERM = "1"
  646.  
  647. # [*]Enable failure detection of repeated Apache mod_security rule triggers
  648. # Due to the often high logging rate in the Apache error log, you might want to
  649. # enable this option only if you know you are suffering from attacks against
  650. # web scripts
  651. LF_MODSEC = "5"
  652. LF_MODSEC_PERM = "1"
  653.  
  654. # [*]Enable detection of repeated BIND denied requests
  655. # This option should be enabled with care as it will prevent blocked IPs from
  656. # resolving any domains on the server. You might want to set the trigger value
  657. # reasonably high to avoid this
  658. # Example: LF_BIND = "100"
  659. LF_BIND = "0"
  660. LF_BIND_PERM = "1"
  661.  
  662. # [*]Enable detection of repeated suhosin ALERTs
  663. # Example: LF_SUHOSIN = "5"
  664. LF_SUHOSIN = "0"
  665. LF_SUHOSIN_PERM = "1"
  666.  
  667. # Send an email alert if anyone logs in successfully using SSH
  668. LF_SSH_EMAIL_ALERT = "1"
  669.  
  670. # Send an email alert if anyone uses su to access another account. This will
  671. # send an email alert whether the attempt to use su was successful or not
  672. LF_SU_EMAIL_ALERT = "1"
  673.  
  674. # Send an email alert if anyone logs in successfully to root on the console
  675. LF_CONSOLE_EMAIL_ALERT = "1"
  676.  
  677. # This option will keep track of the number of "File does not exist" errors in
  678. # HTACCESS_LOG. If the number of hits is more than LF_APACHE_404 in LF_INTERVAL
  679. # seconds then the IP address will be blocked
  680. #
  681. # Care should be used with this option as it could generate many
  682. # false-positives, especially Search Bots (use csf.rignore to ignore such bots)
  683. # so only use this option if you know you are under this type of attack
  684. #
  685. # A sensible setting for this would be quite high, perhaps 200
  686. #
  687. # To disable set to "0"
  688. LF_APACHE_404 = "0"
  689.  
  690. # If this option is set to 1 the blocks will be permanent
  691. # If this option is > 1, the blocks will be temporary for the specified number
  692. # of seconds
  693. LF_APACHE_404_PERM = "3600"
  694.  
  695. # This option will keep track of the number of "client denied by server
  696. # configuration" errors in HTACCESS_LOG. If the number of hits is more than
  697. # LF_APACHE_403 in LF_INTERVAL seconds then the IP address will be blocked
  698. #
  699. # Care should be used with this option as it could generate many
  700. # false-positives, especially Search Bots (use csf.rignore to ignore such bots)
  701. # so only use this option if you know you are under this type of attack
  702. #
  703. # A sensible setting for this would be quite high, perhaps 200
  704. #
  705. # To disable set to "0"
  706. LF_APACHE_403 = "0"
  707.  
  708. # If this option is set to 1 the blocks will be permanent
  709. # If this option is > 1, the blocks will be temporary for the specified number
  710. # of seconds
  711. LF_APACHE_403_PERM = "3600"
  712.  
  713. # System Exploit Checking. This option is designed to perform a series of tests
  714. # to send an alert in case a possible server compromise is detected
  715. #
  716. # To enable this feature set the following to the checking interval in seconds
  717. # (a value of 300 would seem sensible).
  718. #
  719. # To disable set to "0"
  720. LF_EXPLOIT = "300"
  721.  
  722. # This comma separated list allows you to (de)select which tests LF_EXPLOIT
  723. # performs
  724. #
  725. # For the SUPERUSER check, you can list usernames in csf.suignore to have them
  726. # ignored for that test
  727. #
  728. # Valid tests are:
  729. # SUPERUSER
  730. LF_EXPLOIT_CHECK = "SUPERUSER"
  731.  
  732. # Set the time interval to track login and other LF_ failures within (seconds),
  733. # i.e. LF_TRIGGER failures within the last LF_INTERVAL seconds
  734. LF_INTERVAL = "300"
  735.  
  736. # This is how long the lfd process sleeps (in seconds) before processing the
  737. # log file entries and checking whether other events need to be triggered
  738. LF_PARSE = "5"
  739.  
  740. # This is the interval that is used to flush reports of usernames, files and
  741. # pids so that persistent problems continue to be reported, in seconds.
  742. # A value of 3600 seems sensible
  743. LF_FLUSH = "3600"
  744.  
  745. ###############################################################################
  746. # SECTION:Directory Watching & Integrity
  747. ###############################################################################
  748. # Enable Directory Watching. This enables lfd to check /tmp and /dev/shm
  749. # directories for suspicious files, i.e. script exploits. If a suspicious
  750. # file is found an email alert is sent. One alert per file per LF_FLUSH
  751. # interval is sent
  752. #
  753. # To enable this feature set the following to the checking interval in seconds.
  754. # To disable set to "0"
  755. LF_DIRWATCH = "300"
  756.  
  757. # To remove any suspicious files found during directory watching, enable the
  758. # following. These files will be appended to a tarball in
  759. # /etc/csf/suspicious.tar
  760. LF_DIRWATCH_DISABLE = "0"
  761.  
  762. # This option allows you to have lfd watch a particular file or directory for
  763. # changes and should they change and email alert using watchalert.txt is sent
  764. #
  765. # To enable this feature set the following to the checking interval in seconds
  766. # (a value of 60 would seem sensible) and add your entries to csf.dirwatch
  767. #
  768. # Set to disable set to "0"
  769. LF_DIRWATCH_FILE = "0"
  770.  
  771. # System Integrity Checking. This enables lfd to compare md5sums of the
  772. # servers OS binary application files from the time when lfd starts. If the
  773. # md5sum of a monitored file changes an alert is sent. This option is intended
  774. # as an IDS (Intrusion Detection System) and is the last line of detection for
  775. # a possible root compromise.
  776. #
  777. # There will be constant false-positives as the servers OS is updated or
  778. # monitored application binaries are updated. However, unexpected changes
  779. # should be carefully inspected.
  780. #
  781. # Modified files will only be reported via email once.
  782. #
  783. # To enable this feature set the following to the checking interval in seconds
  784. # (a value of 3600 would seem sensible). This option may increase server I/O
  785. # load onto the server as it checks system binaries.
  786. #
  787. # To disable set to "0"
  788. LF_INTEGRITY = "3600"
  789.  
  790. ###############################################################################
  791. # SECTION:Distributed Attacks
  792. ###############################################################################
  793. # Distributed Account Attack. This option will keep track of login failures
  794. # from distributed IP addresses to a specific application account. If the
  795. # number of failures matches the trigger value above, ALL of the IP addresses
  796. # involved in the attack will be blocked according to the temp/perm rules above
  797. #
  798. # Tracking applies to LF_SSHD, LF_FTPD, LF_SMTPAUTH, LF_POP3D, LF_IMAPD,
  799. # LF_HTACCESS
  800. LF_DISTATTACK = "0"
  801.  
  802. # Set the following to the minimum number of unique IP addresses that trigger
  803. # LF_DISTATTACK
  804. LF_DISTATTACK_UNIQ = "2"
  805.  
  806. # Distributed FTP Logins. This option will keep track of successful FTP logins.
  807. # If the number of successful logins to an individual account is at least
  808. # LF_DISTFTP in LF_INTERVAL from at least LF_DISTFTP_UNIQ IP addresses, then
  809. # all of the IP addresses will be blocked
  810. #
  811. # This option can help mitigate the common FTP account compromise attacks that
  812. # use a distributed network of zombies to deface websites
  813. #
  814. # A sensible setting for this might be 5, depending on how many different
  815. # IP addresses you expect to an individual FTP account within LF_INTERVAL
  816. #
  817. # To disable set to "0"
  818. LF_DISTFTP = "0"
  819.  
  820. # Set the following to the minimum number of unique IP addresses that trigger
  821. # LF_DISTATTACK. LF_DISTFTP_UNIQ must be <= LF_DISTFTP for this to work
  822. LF_DISTFTP_UNIQ = "3"
  823.  
  824. # If this option is set to 1 the blocks will be permanent
  825. # If this option is > 1, the blocks will be temporary for the specified number
  826. # of seconds
  827. LF_DISTFTP_PERM = "3600"
  828.  
  829. ###############################################################################
  830. # SECTION:Login Tracking
  831. ###############################################################################
  832. # Block POP3 logins if greater than LT_POP3D times per hour per account per IP
  833. # address (0=disabled)
  834. #
  835. # This is a temporary block for the rest of the hour, afterwhich the IP is
  836. # unblocked
  837. LT_POP3D = "0"
  838.  
  839. # Block IMAP logins if greater than LT_IMAPD times per hour per account per IP
  840. # address (0=disabled) - not recommended for IMAP logins due to the ethos
  841. # within which IMAP works. If you want to use this, setting it quite high is
  842. # probably a good idea
  843. #
  844. # This is a temporary block for the rest of the hour, afterwhich the IP is
  845. # unblocked
  846. LT_IMAPD = "0"
  847.  
  848. # Send an email alert if an account exceeds LT_POP3D/LT_IMAPD logins per hour
  849. # per IP
  850. LT_EMAIL_ALERT = "1"
  851.  
  852. # If LF_PERMBLOCK is enabled but you do not want this to apply to
  853. # LT_POP3D/LT_IMAPD, then enable this option
  854. LT_SKIPPERMBLOCK = "0"
  855.  
  856. ###############################################################################
  857. # SECTION:Connection Tracking
  858. ###############################################################################
  859. # Connection Tracking. This option enables tracking of all connections from IP
  860. # addresses to the server. If the total number of connections is greater than
  861. # this value then the offending IP address is blocked. This can be used to help
  862. # prevent some types of DOS attack.
  863. #
  864. # Care should be taken with this option. It's entirely possible that you will
  865. # see false-positives. Some protocols can be connection hungry, e.g. FTP, IMAPD
  866. # and HTTP so it could be quite easy to trigger, especially with a lot of
  867. # closed connections in TIME_WAIT. However, for a server that is prone to DOS
  868. # attacks this may be very useful. A reasonable setting for this option might
  869. # be around 300.
  870. #
  871. # To disable this feature, set this to 0
  872. CT_LIMIT = "0"
  873.  
  874. # Connection Tracking interval. Set this to the the number of seconds between
  875. # connection tracking scans
  876. CT_INTERVAL = "30"
  877.  
  878. # Send an email alert if an IP address is blocked due to connection tracking
  879. CT_EMAIL_ALERT = "1"
  880.  
  881. # If you want to make IP blocks permanent then set this to 1, otherwise blocks
  882. # will be temporary and will be cleared after CT_BLOCK_TIME seconds
  883. CT_PERMANENT = "0"
  884.  
  885. # If you opt for temporary IP blocks for CT, then the following is the interval
  886. # in seconds that the IP will remained blocked for (e.g. 1800 = 30 mins)
  887. CT_BLOCK_TIME = "1800"
  888.  
  889. # If you don't want to count the TIME_WAIT state against the connection count
  890. # then set the following to "1"
  891. CT_SKIP_TIME_WAIT = "0"
  892.  
  893. # If you only want to count specific states (e.g. SYN_RECV) then add the states
  894. # to the following as a comma separated list. E.g. "SYN_RECV,TIME_WAIT"
  895. #
  896. # Leave this option empty to count all states against CT_LIMIT
  897. CT_STATES = ""
  898.  
  899. # If you only want to count specific ports (e.g. 80,443) then add the ports
  900. # to the following as a comma separated list. E.g. "80,443"
  901. #
  902. # Leave this option empty to count all ports against CT_LIMIT
  903. CT_PORTS = ""
  904.  
  905. ###############################################################################
  906. # SECTION:Process Tracking
  907. ###############################################################################
  908. # Process Tracking. This option enables tracking of user and nobody processes
  909. # and examines them for suspicious executables or open network ports. Its
  910. # purpose is to identify potential exploit processes that are running on the
  911. # server, even if they are obfuscated to appear as system services. If a
  912. # suspicious process is found an alert email is sent with relevant information.
  913. # It is then the responsibility of the recipient to investigate the process
  914. # further as the script takes no further action
  915. #
  916. # The following is the number of seconds a process has to be active before it
  917. # is inspected. If you set this time too low, then you will likely trigger
  918. # false-positives with CGI or PHP scripts.
  919. # Set the value to 0 to disable this feature
  920. PT_LIMIT = "60"
  921.  
  922. # How frequently processes are checked in seconds
  923. PT_INTERVAL = "60"
  924.  
  925. # If you want process tracking to highlight php or perl scripts that are run
  926. # through apache then disable the following,
  927. # i.e. set it to 0
  928. #
  929. # While enabling this setting will reduce false-positives, having it set to 0
  930. # does provide better checking for exploits running on the server
  931. PT_SKIP_HTTP = "0"
  932.  
  933. # lfd will report processes, even if they're listed in csf.pignore, if they're
  934. # tagged as (deleted) by Linux. This information is provided in Linux under
  935. # /proc/PID/exe. A (deleted) process is one that is running a binary that has
  936. # the inode for the file removed from the file system directory. This usually
  937. # happens when the binary has been replaced due to an upgrade for it by the OS
  938. # vendor or another third party (e.g. cPanel). You need to investigate whether
  939. # this is indeed the case to be sure that the original binary has not been
  940. # replaced by a rootkit or is running an exploit.
  941. #
  942. # To stop lfd reporting such process you need to restart the daemon to which it
  943. # belongs and therefore run the process using the replacement binary (presuming
  944. # one exists). This will normally mean running the associated startup script in
  945. # /etc/init.d/
  946. #
  947. # If you do want lfd to report deleted binary processes, set to 1
  948. PT_DELETED = "0"
  949.  
  950. # If a PT_DELETED event is triggered, then if the following contains the path to
  951. # a script, it will be run in a child process and passed the executable, pid
  952. # and account for the process
  953. #
  954. # The action script must have the execute bit and interpreter (shebang) set. An
  955. # example is provided in /etc/csf/pt_deleted_action.pl
  956. #
  957. # WARNING: Make sure you read and understand the potential security
  958. # implications of such processes in PT_DELETED above before simply restarting
  959. # such processes with a script
  960. PT_DELETED_ACTION = ""
  961.  
  962. # User Process Tracking. This option enables the tracking of the number of
  963. # process any given account is running at one time. If the number of processes
  964. # exceeds the value of the following setting an email alert is sent with
  965. # details of those processes. If you specify a user in csf.pignore it will be
  966. # ignored
  967. #
  968. # Set to 0 to disable this feature
  969. PT_USERPROC = "10"
  970.  
  971. # This User Process Tracking option sends an alert if any linux user process
  972. # exceeds the memory usage set (MB). To ignore specific processes or users use
  973. # csf.pignore
  974. #
  975. # Set to 0 to disable this feature
  976. PT_USERMEM = "200"
  977.  
  978. # This User Process Tracking option sends an alert if any linux user process
  979. # exceeds the time usage set (seconds). To ignore specific processes or users
  980. # use csf.pignore
  981. #
  982. # Set to 0 to disable this feature
  983. PT_USERTIME = "1800"
  984.  
  985. # If this option is set then processes detected by PT_USERMEM, PT_USERTIME or
  986. # PT_USERPROC are killed
  987. #
  988. # Warning: We don't recommend enabling this option unless absolutely necessary
  989. # as it can cause unexpected problems when processes are suddenly terminated.
  990. # It can also lead to system processes being terminated which could cause
  991. # stability issues. It is much better to leave this option disabled and to
  992. # investigate each case as it is reported when the triggers above are breached
  993. #
  994. # Note: Processes that are running deleted excecutables (see PT_DELETED) will
  995. # not be killed by lfd
  996. PT_USERKILL = "0"
  997.  
  998. # If you want to disable email alerts if PT_USERKILL is triggered, then set
  999. # this option to 0
  1000. PT_USERKILL_ALERT = "1"
  1001.  
  1002. # If a PT_* event is triggered, then if the following contains the path to
  1003. # a script, it will be run in a child process and passed the PID(s) of the
  1004. # process(es) in a comma separated list.
  1005. #
  1006. # The action script must have the execute bit and interpreter (shebang) set
  1007. PT_USER_ACTION = ""
  1008.  
  1009. # Check the PT_LOAD_AVG minute Load Average (can be set to 1 5 or 15 and
  1010. # defaults to 5 if set otherwise) on the server every PT_LOAD seconds. If the
  1011. # load average is greater than or equal to PT_LOAD_LEVEL then an email alert is
  1012. # sent. lfd then does not report subsequent high load until PT_LOAD_SKIP
  1013. # seconds has passed to prevent email floods.
  1014. #
  1015. # Set PT_LOAD to "0" to disable this feature
  1016. PT_LOAD = "30"
  1017. PT_LOAD_AVG = "5"
  1018. PT_LOAD_LEVEL = "6"
  1019. PT_LOAD_SKIP = "3600"
  1020.  
  1021. # If a PT_LOAD event is triggered, then if the following contains the path to
  1022. # a script, it will be run in a child process. For example, the script could
  1023. # contain commands to terminate and restart httpd, php, exim, etc incase of
  1024. # looping processes. The action script must have the execute bit an
  1025. # interpreter (shebang) set
  1026. PT_LOAD_ACTION = ""
  1027.  
  1028. ###############################################################################
  1029. # SECTION:Port Scan Tracking
  1030. ###############################################################################
  1031. # Port Scan Tracking. This feature tracks port blocks logged by iptables to
  1032. # syslog. If an IP address generates a port block that is logged more than
  1033. # PS_LIMIT within PS_INTERVAL seconds, the IP address will be blocked.
  1034. #
  1035. # This feature could, for example, be useful for blocking hackers attempting
  1036. # to access the standard SSH port if you have moved it to a port other than 22
  1037. # and have removed 22 from the TCP_IN list so that connection attempts to the
  1038. # old port are being logged
  1039. #
  1040. # This feature blocks all iptables blocks from the iptables logs, including
  1041. # repeated attempts to one port or SYN flood blocks, etc
  1042. #
  1043. # Note: This feature will only track iptables blocks from the log file set in
  1044. # IPTABLES_LOG below and if you have DROP_LOGGING enabled. However, it will
  1045. # cause redundant blocking with DROP_IP_LOGGING enabled
  1046. #
  1047. # Warning: It's possible that an elaborate DDOS (i.e. from multiple IP's)
  1048. # could very quickly fill the iptables rule chains and cause a DOS in itself.
  1049. # The DENY_IP_LIMIT should help to mitigate such problems with permanent blocks
  1050. # and the DENY_TEMP_IP_LIMIT with temporary blocks
  1051. #
  1052. # Set PS_INTERVAL to "0" to disable this feature. A value of between 60 and 300
  1053. # would be sensible to enable this feature
  1054. PS_INTERVAL = "300"
  1055. PS_LIMIT = "10"
  1056.  
  1057. # You can specify the ports and/or port ranges that should be tracked by the
  1058. # Port Scan Tracking feature. The following setting is a comma separated list
  1059. # of those ports and uses the same format as TCP_IN. The default setting of
  1060. # 0:65535,ICMP covers all ports
  1061. PS_PORTS = "0:65535,ICMP"
  1062.  
  1063. # You can select whether IP blocks for Port Scan Tracking should be temporary
  1064. # or permanent. Set PS_PERMANENT to "0" for temporary and "1" for permanent
  1065. # blocking. If set to "0" PS_BLOCK_TIME is the amount of time in seconds to
  1066. # temporarily block the IP address for
  1067. PS_PERMANENT = "0"
  1068. PS_BLOCK_TIME = "3600"
  1069.  
  1070. # Set the following to "1" to enable Port Scan Tracking email alerts, set to
  1071. # "0" to disable them
  1072. PS_EMAIL_ALERT = "1"
  1073.  
  1074. ###############################################################################
  1075. # SECTION:Account Tracking
  1076. ###############################################################################
  1077. # Account Tracking. The following options enable the tracking of modifications
  1078. # to the accounts on a server. If any of the enabled options are triggered by
  1079. # a modifications to an account, an alert email is sent. Only the modification
  1080. # is reported. The cause of the modification will have to be investigated
  1081. # manually
  1082. #
  1083. # You can set AT_ALERT to the following:
  1084. # 0 = disable this feature
  1085. # 1 = enable this feature for all accounts
  1086. # 2 = enable this feature only for superuser accounts (UID = 0, e.g. root, etc)
  1087. # 3 = enable this feature only for the root account
  1088. AT_ALERT = "2"
  1089.  
  1090. # This options is the interval between checks in seconds
  1091. AT_INTERVAL = "60"
  1092.  
  1093. # Send alert if a new account is created
  1094. AT_NEW = "1"
  1095.  
  1096. # Send alert if an existing account is deleted
  1097. AT_OLD = "1"
  1098.  
  1099. # Send alert if an account password has changed
  1100. AT_PASSWD = "1"
  1101.  
  1102. # Send alert if an account uid has changed
  1103. AT_UID = "1"
  1104.  
  1105. # Send alert if an account gid has changed
  1106. AT_GID = "1"
  1107.  
  1108. # Send alert if an account login directory has changed
  1109. AT_DIR = "1"
  1110.  
  1111. # Send alert if an account login shell has changed
  1112. AT_SHELL = "1"
  1113.  
  1114. ###############################################################################
  1115. # SECTION:Integrated User Interface
  1116. ###############################################################################
  1117. # Integrated User Interface. This feature provides a HTML UI to csf and lfd,
  1118. # without requiring a control panel or web server. The UI runs as a sub process
  1119. # to the lfd daemon
  1120. #
  1121. # As it runs under the root account and successful login provides root access
  1122. # to the server, great care should be taken when configuring and using this
  1123. # feature. There are additional restrictions to enhance secure access to the UI
  1124. #
  1125. # See readme.txt for more information about using this feature BEFORE enabling
  1126. # it for security and access reasons
  1127. #
  1128. # 1 to enable, 0 to disable
  1129. UI = "0"
  1130.  
  1131. # Set this to the port that want to bind this service to. You should configure
  1132. # this port to be >1023 and different from any other port already being used
  1133. #
  1134. # Do NOT enable access to this port in TCP_IN, instead only allow trusted IP's
  1135. # to the port using Advanced Allow Filters (see readme.txt)
  1136. UI_PORT = "6666"
  1137.  
  1138. # This should be a secure, hard to guess username
  1139. #
  1140. # This must be changed from the default
  1141. UI_USER = "username"
  1142.  
  1143. # This should be a secure, hard to guess password. That is, at least 8
  1144. # characters long with a mixture of upper and lowercase characters plus
  1145. # numbers and non-alphanumeric characters
  1146. #
  1147. # This must be changed from the default
  1148. UI_PASS = "password"
  1149.  
  1150. # This is the login session timeout. If there is no activity for a logged in
  1151. # session within this number of seconds, the session will timeout and a new
  1152. # login will be required
  1153. #
  1154. # For security reasons, you should always keep this option low (i.e 60-300)
  1155. UI_TIMEOUT = "300"
  1156.  
  1157. # This is the maximum concurrent connections allowed to the server. The default
  1158. # value should be sufficient
  1159. UI_CHILDREN = "5"
  1160.  
  1161. # The number of login retries allowed within a 24 hour period. A successful
  1162. # login from the IP address will clear the failures
  1163. #
  1164. # For security reasons, you should always keep this option low (i.e 0-10)
  1165. UI_RETRY = "5"
  1166.  
  1167. # If enabled, this option will add the connecting IP address to the file
  1168. # /etc/csf/ui/ui.ban after UI_RETRY login failures. The IP address will not be
  1169. # able to login to the UI while it is listed in this file. The UI_BAN setting
  1170. # does not refer to any of the csf/lfd allow or ignore files, e.g. csf.allow,
  1171. # csf.ignore, etc.
  1172. #
  1173. # For security reasons, you should always enable this option
  1174. UI_BAN = "1"
  1175.  
  1176. # If enabled, only IPs (or CIDR's) listed in the file /etc/csf/ui/ui.allow will
  1177. # be allowed to login to the UI. The UI_ALLOW setting does not refer to any of
  1178. # the csf/lfd allow or ignore files, e.g. csf.allow, csf.ignore, etc.
  1179. #
  1180. # For security reasons, you should always enable this option and use ui.allow
  1181. UI_ALLOW = "1"
  1182.  
  1183. # If enabled, this option will trigger an iptables block through csf after
  1184. # UI_RETRY login failures
  1185. #
  1186. # 0 = no block;1 = perm block;nn=temp block for nn secs
  1187. UI_BLOCK = "1"
  1188.  
  1189. # This controls what email alerts are sent with regards to logins to the UI. It
  1190. # uses the uialert.txt template
  1191. #
  1192. # 4 = login success + login failure/ban/block + login attempts
  1193. # 3 = login success + login failure/ban/block
  1194. # 2 = login failure/ban/block
  1195. # 1 = login ban/block
  1196. # 0 = disabled
  1197. UI_ALERT = "4"
  1198.  
  1199. # This is the SSL cipher list that the Integrated UI will negotiate from
  1200. UI_CIPHER = "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP:!kEDH"
  1201.  
  1202. # If cxs is installed then enabling this option will provide a dropdown box to
  1203. # switch between applications
  1204. UI_CXS = "0"
  1205.  
  1206. # There is a modified installation of ConfigServer Explorer (cse) provided with
  1207. # the csf distribution. If this option is enabled it will provide a dropdown
  1208. # box to switch between applications
  1209. UI_CSE = "0"
  1210.  
  1211. ###############################################################################
  1212. # SECTION:Messenger service
  1213. ###############################################################################
  1214. # Messenger service. This feature allows the display of a message to a blocked
  1215. # connecting IP address to inform the user that they are blocked in the
  1216. # firewall. This can help when users get themselves blocked, e.g. due to
  1217. # multiple login failures. The service is provided by two daemons running on
  1218. # ports providing either an HTML or TEXT message.
  1219. #
  1220. # This feature does not work on servers that do not have the iptables module
  1221. # ipt_REDIRECT loaded. Typically, this will be with MONOLITHIC kernels. VPS
  1222. # server admins should check with their VPS host provider that the iptables
  1223. # module is included.
  1224. #
  1225. # For further information on features and limitations refer to the csf
  1226. # readme.txt
  1227. #
  1228. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  1229. # this server
  1230. #
  1231. # 1 to enable, 0 to disable
  1232. MESSENGER = "0"
  1233.  
  1234. # Provide this service to temporary IP address blocks
  1235. MESSENGER_TEMP = "1"
  1236.  
  1237. # Provide this service to permanent IP address blocks
  1238. MESSENGER_PERM = "1"
  1239.  
  1240. # User account to run the service servers under. We recommend creating a
  1241. # specific non-priv, non-shell account for this purpose
  1242. MESSENGER_USER = "csf"
  1243.  
  1244. # This is the maximum concurrent connections allowed to each service server
  1245. MESSENGER_CHILDREN = "10"
  1246.  
  1247. # Set this to the port that will receive the HTML message. You should configure
  1248. # this port to be >1023 and different from the TEXT port. Do NOT enable access
  1249. # to this port in TCP_IN
  1250. MESSENGER_HTML = "8888"
  1251.  
  1252. # This comma separated list are the HTML ports that will be redirected for the
  1253. # blocked IP address. If you are using per application blocking (LF_TRIGGER)
  1254. # then only the relevant block port will be redirected to the messenger port
  1255. MESSENGER_HTML_IN = "80,2082,2095"
  1256.  
  1257. # Set this to the port that will receive the TEXT message. You should configure
  1258. # this port to be >1023 and different from the HTML port. Do NOT enable access
  1259. # to this port in TCP_IN
  1260. MESSENGER_TEXT = "8889"
  1261.  
  1262. # This comma separated list are the TEXT ports that will be redirected for the
  1263. # blocked IP address. If you are using per application blocking (LF_TRIGGER)
  1264. # then only the relevant block port will be redirected to the messenger port
  1265. MESSENGER_TEXT_IN = "21"
  1266.  
  1267. # These settings limit the rate at which connections can be made to the
  1268. # messenger service servers. Its intention is to provide protection from
  1269. # attacks or excessive connections to the servers. If the rate is exceeded then
  1270. # iptables will revert for the duration to the normal blocking actiity
  1271. #
  1272. # See the iptables man page for the correct --limit rate syntax
  1273. MESSENGER_RATE = "30/m"
  1274. MESSENGER_BURST = "5"
  1275.  
  1276. ###############################################################################
  1277. # SECTION:lfd Clustering
  1278. ###############################################################################
  1279. # lfd Clustering. This allows the configuration of an lfd cluster environment
  1280. # where a group of servers can share blocks and configuration option changes.
  1281. # Included are CLI and UI options to send requests to the cluster.
  1282. #
  1283. # See the readme.txt file for more information and details on setup and
  1284. # security risks.
  1285. #
  1286. # Comma separated list of cluster member IP addresses to send requests to
  1287. CLUSTER_SENDTO = ""
  1288.  
  1289. # Comma separated list of cluster member IP addresses to receive requests from
  1290. CLUSTER_RECVFROM = ""
  1291.  
  1292. # IP address of the master node in the cluster allowed to send CLUSTER_CONFIG
  1293. # changes
  1294. CLUSTER_MASTER = ""
  1295.  
  1296. # If this is a NAT server, set this to the public IP address of this server
  1297. CLUSTER_NAT = ""
  1298.  
  1299. # If a cluster member should send requests on an IP other than the default IP,
  1300. # set it here
  1301. CLUSTER_LOCALADDR = ""
  1302.  
  1303. # Cluster communication port (must be the same on all member servers). There
  1304. # is no need to open this port in the firewall as csf will automatically add
  1305. # in and out bound rules to allow communication between cluster members
  1306. CLUSTER_PORT = "7777"
  1307.  
  1308. # This is a secret key used to encrypt cluster communications using the
  1309. # Blowfish algorithm. It should be between 8 and 56 characters long,
  1310. # preferably > 20 random characters
  1311. # 56 chars: 012345678901234567890123456789012345678901234567890123456
  1312. CLUSTER_KEY = ""
  1313.  
  1314. # Automatically send lfd blocks to all members of CLUSTER_SENDTO. Those
  1315. # servers must have this servers IP address listed in their CLUSTER_RECVFROM
  1316. #
  1317. # Set to 0 to disable this feature
  1318. CLUSTER_BLOCK = "1"
  1319.  
  1320. # This option allows the enabling and disabling of the Cluster configuration
  1321. # changing options --cconfig, --cconfigr, --cfile, --ccfile sent from the
  1322. # CLUSTER_MASTER server
  1323. #
  1324. # Set this option to 1 to allow Cluster configurations to be received
  1325. CLUSTER_CONFIG = "0"
  1326.  
  1327. # Maximum number of child processes to listen on. High blocking rates or large
  1328. # clusters may need to increase this
  1329. CLUSTER_CHILDREN = "10"
  1330.  
  1331. ###############################################################################
  1332. # SECTION:Port Knocking
  1333. ###############################################################################
  1334. # Port Knocking. This feature allows port knocking to be enabled on multiple
  1335. # ports with a variable number of knocked ports and a timeout. There must be a
  1336. # minimum of 3 ports to knock for an entry to be valid
  1337. #
  1338. # See the following for information regarding Port Knocking:
  1339. # http://www.portknocking.org/
  1340. #
  1341. # This feature does not work on servers that do not have the iptables module
  1342. # ipt_recent loaded. Typically, this will be with MONOLITHIC kernels. VPS
  1343. # server admins should check with their VPS host provider that the iptables
  1344. # module is included
  1345. #
  1346. # For further information and syntax refer to the Port Knocking section of the
  1347. # csf readme.txt
  1348. #
  1349. # Note: Run /etc/csf/csftest.pl to check whether this option will function on
  1350. # this server
  1351. #
  1352. # openport;protocol;timeout;kport1;kport2;kport3[...;kportN],...
  1353. # e.g.: 22;TCP;20;100;200;300;400
  1354. PORTKNOCKING = ""
  1355.  
  1356. # Enable PORTKNOCKING logging by iptables
  1357. PORTKNOCKING_LOG = "1"
  1358.  
  1359. # Send an email alert if the PORTKNOCKING port is opened. PORTKNOCKING_LOG must
  1360. # also be enabled to use this option
  1361. PORTKNOCKING_ALERT = "1"
  1362.  
  1363. ###############################################################################
  1364. # SECTION:Log Scanner
  1365. ###############################################################################
  1366. # Log Scanner. This feature will send out an email summary of the log lines of
  1367. # each log listed in /etc/csf/csf.logfiles. All lines will be reported unless
  1368. # they match a regular expression in /etc/csf/csf.logignore
  1369. #
  1370. # Note: lfd builds the report continuously from lines logged after lfd has
  1371. # started, so any lines logged when lfd is not running will not be reported
  1372. # (e.g. during reboot). If lfd is restarted, then the report will include any
  1373. # lines logged during the previous lfd logging period that weren't reported
  1374. #
  1375. # 1 to enable, 0 to disable
  1376. LOGSCANNER = "0"
  1377.  
  1378. # This is the interval each report will be sent based on the logalert.txt
  1379. # template
  1380. #
  1381. # The interval can be set to:
  1382. # "hourly" - sent on the hour
  1383. # "daily" - sent at midnight (00:00)
  1384. # "manual" - sent whenever "csf --logrun" is run. This allows for scheduling
  1385. # via cron job
  1386. LOGSCANNER_INTERVAL = "hourly"
  1387.  
  1388. # Report Style
  1389. # 1 = Separate chronological log lines per log file
  1390. # 2 = Simply chronological log of all lines
  1391. LOGSCANNER_STYLE = "1"
  1392.  
  1393. # Send the report email even if no log lines reported
  1394. # 1 to enable, 0 to disable
  1395. LOGSCANNER_EMPTY = "1"
  1396.  
  1397. # Maximum number of lines in the report before it is truncated. This is to
  1398. # prevent log lines flooding resulting in an excessively large report. This
  1399. # might need to be increased if you choose a daily report
  1400. LOGSCANNER_LINES = "5000"
  1401.  
  1402. ###############################################################################
  1403. # SECTION:Statistics Settings
  1404. ###############################################################################
  1405. # Statistics
  1406. #
  1407. # Some of the Statistics output requires the gd graphics library and the
  1408. # GD::Graph perl module with all dependent modules to be installed for the UI
  1409. # for them to be displayed
  1410. #
  1411. # This option enabled statistical data gathering
  1412. ST_ENABLE = "1"
  1413.  
  1414. # This option determines how many iptables log lines to store for reports
  1415. ST_IPTABLES = "100"
  1416.  
  1417. # This option indicates whether rDNS and CC lookups are performed at the time
  1418. # the log line is recorded (this is not performed when viewing the reports)
  1419. #
  1420. # Warning: If DROP_IP_LOGGING is enabled and there are frequent iptables hits,
  1421. # then enabling this setting could cause serious performance problems
  1422. ST_LOOKUP = "0"
  1423.  
  1424. ###############################################################################
  1425. # SECTION:OS Specific Settings
  1426. ###############################################################################
  1427. # Binary locations
  1428. IPTABLES = "/sbin/iptables"
  1429. IP6TABLES = "/sbin/ip6tables"
  1430. MODPROBE = "/sbin/modprobe"
  1431. IFCONFIG = "/sbin/ifconfig"
  1432. SENDMAIL = "/usr/sbin/sendmail"
  1433. PS = "/bin/ps"
  1434. VMSTAT = "/usr/bin/vmstat"
  1435. LS = "/bin/ls"
  1436. MD5SUM = "/usr/bin/md5sum"
  1437. TAR = "/bin/tar"
  1438. CHATTR = "/usr/bin/chattr"
  1439. UNZIP = "/usr/bin/unzip"
  1440. GUNZIP = "/bin/gunzip"
  1441.  
  1442. # Log file locations
  1443. HTACCESS_LOG = "/var/log/httpd/error_log"
  1444. MODSEC_LOG = "/var/log/httpd/error_log"
  1445. SSHD_LOG = "/var/log/secure"
  1446. SU_LOG = "/var/log/secure"
  1447. FTPD_LOG = "/var/log/messages"
  1448. SMTPAUTH_LOG = "/var/log/secure"
  1449. POP3D_LOG = "/var/log/maillog"
  1450. IMAPD_LOG = "/var/log/maillog"
  1451. IPTABLES_LOG = "/var/log/messages"
  1452. SUHOSIN_LOG = "/var/log/messages"
  1453. BIND_LOG = "/var/log/messages"
  1454.  
  1455. CUSTOM1_LOG = "/var/log/messages"
  1456. CUSTOM2_LOG = "/var/log/messages"
  1457. CUSTOM3_LOG = "/var/log/messages"
  1458. CUSTOM4_LOG = "/var/log/messages"
  1459. CUSTOM5_LOG = "/var/log/messages"
  1460. CUSTOM6_LOG = "/var/log/messages"
  1461. CUSTOM7_LOG = "/var/log/messages"
  1462. CUSTOM8_LOG = "/var/log/messages"
  1463. CUSTOM9_LOG = "/var/log/messages"
  1464.  
  1465. # This configuration is for use with generic Linux servers, do not change the
  1466. # following setting:
  1467. GENERIC = "1"
  1468.  
  1469. # If you find ever increasing numbers of zombie lfd processes you may need to
  1470. # revert to the old child reaper code by enabling this option
  1471. OLD_REAPER = "0"
  1472.  
  1473. # For internal use only. You should not enable this option as it could cause
  1474. # instability in csf and lfd
  1475. DEBUG = "0"
  1476. ###############################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement