Advertisement
Guest User

Untitled

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