Advertisement
Guest User

Untitled

a guest
Apr 17th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.36 KB | None | 0 0
  1. ############ THESE SETTINGS ARE REQUIRED ############
  2.  
  3. ########################################################################
  4. #
  5. # SECURE_LOG: the log file that contains sshd logging info
  6. # if you are not sure, grep "sshd:" /var/log/*
  7. #
  8. # The file to process can be overridden with the --file command line
  9. # argument
  10. #
  11. # Redhat or Fedora Core:
  12. #SECURE_LOG = /var/log/secure
  13. #
  14. # Mandrake, FreeBSD or OpenBSD:
  15. SECURE_LOG = /var/log/auth.log
  16. #
  17. # SuSE:
  18. #SECURE_LOG = /var/log/messages
  19. #
  20. # Mac OS X (v10.4 or greater -
  21. # also refer to: http://www.denyhosts.net/faq.html#macos
  22. #SECURE_LOG = /private/var/log/asl.log
  23. #
  24. # Mac OS X (v10.3 or earlier):
  25. #SECURE_LOG=/private/var/log/system.log
  26. #
  27. ########################################################################
  28.  
  29. ########################################################################
  30. #
  31. # HOSTS_DENY: the file which contains restricted host access information
  32. #
  33. # Most operating systems:
  34. HOSTS_DENY = /etc/hosts.deniedssh
  35. #
  36. # Some BSD (FreeBSD) Unixes:
  37. #HOSTS_DENY = /etc/hosts.allow
  38. #
  39. # Another possibility (also see the next option):
  40. #HOSTS_DENY = /etc/hosts.evil
  41. #######################################################################
  42.  
  43.  
  44. ########################################################################
  45. #
  46. # PURGE_DENY: removed HOSTS_DENY entries that are older than this time
  47. # when DenyHosts is invoked with the --purge flag
  48. #
  49. # format is: i[dhwmy]
  50. # Where 'i' is an integer (eg. 7)
  51. # 'm' = minutes
  52. # 'h' = hours
  53. # 'd' = days
  54. # 'w' = weeks
  55. # 'y' = years
  56. #
  57. # never purge:
  58. PURGE_DENY =
  59. #
  60. # purge entries older than 1 week
  61. #PURGE_DENY = 1w
  62. #
  63. # purge entries older than 5 days
  64. #PURGE_DENY = 5d
  65. #######################################################################
  66.  
  67. #######################################################################
  68. #
  69. # PURGE_THRESHOLD: defines the maximum times a host will be purged.
  70. # Once this value has been exceeded then this host will not be purged.
  71. # Setting this parameter to 0 (the default) disables this feature.
  72. #
  73. # default: a denied host can be purged/re-added indefinitely
  74. #PURGE_THRESHOLD = 0
  75. #
  76. # a denied host will be purged at most 2 times.
  77. #PURGE_THRESHOLD = 2
  78. #
  79. #######################################################################
  80.  
  81.  
  82. #######################################################################
  83. #
  84. # BLOCK_SERVICE: the service name that should be blocked in HOSTS_DENY
  85. #
  86. # man 5 hosts_access for details
  87. #
  88. # eg. sshd: 127.0.0.1 # will block sshd logins from 127.0.0.1
  89. #
  90. # To block all services for the offending host:
  91. #BLOCK_SERVICE = ALL
  92. # To block only sshd:
  93. BLOCK_SERVICE = sshd
  94. # To only record the offending host and nothing else (if using
  95. # an auxilary file to list the hosts). Refer to:
  96. # http://denyhosts.sourceforge.net/faq.html#aux
  97. #BLOCK_SERVICE =
  98. #
  99. #######################################################################
  100.  
  101.  
  102. #######################################################################
  103. #
  104. # DENY_THRESHOLD_INVALID: block each host after the number of failed login
  105. # attempts has exceeded this value. This value applies to invalid
  106. # user login attempts (eg. non-existent user accounts)
  107. #
  108. DENY_THRESHOLD_INVALID = 5
  109. #
  110. #######################################################################
  111.  
  112. #######################################################################
  113. #
  114. # DENY_THRESHOLD_VALID: block each host after the number of failed
  115. # login attempts has exceeded this value. This value applies to valid
  116. # user login attempts (eg. user accounts that exist in /etc/passwd) except
  117. # for the "root" user
  118. #
  119. DENY_THRESHOLD_VALID = 10
  120. #
  121. #######################################################################
  122.  
  123. #######################################################################
  124. #
  125. # DENY_THRESHOLD_ROOT: block each host after the number of failed
  126. # login attempts has exceeded this value. This value applies to
  127. # "root" user login attempts only.
  128. #
  129. DENY_THRESHOLD_ROOT = 1
  130. #
  131. #######################################################################
  132.  
  133.  
  134. #######################################################################
  135. #
  136. # DENY_THRESHOLD_RESTRICTED: block each host after the number of failed
  137. # login attempts has exceeded this value. This value applies to
  138. # usernames that appear in the WORK_DIR/restricted-usernames file only.
  139. #
  140. DENY_THRESHOLD_RESTRICTED = 1
  141. #
  142. #######################################################################
  143.  
  144.  
  145. #######################################################################
  146. #
  147. # WORK_DIR: the path that DenyHosts will use for writing data to
  148. # (it will be created if it does not already exist).
  149. #
  150. # Note: it is recommended that you use an absolute pathname
  151. # for this value (eg. /home/foo/denyhosts/data)
  152. #
  153. WORK_DIR = /usr/local/share/denyhosts/data
  154. #
  155. #######################################################################
  156.  
  157. #######################################################################
  158. #
  159. # SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS
  160. #
  161. # SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS=YES|NO
  162. # If set to YES, if a suspicious login attempt results from an allowed-host
  163. # then it is considered suspicious. If this is NO, then suspicious logins
  164. # from allowed-hosts will not be reported. All suspicious logins from
  165. # ip addresses that are not in allowed-hosts will always be reported.
  166. #
  167. SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS=YES
  168. ######################################################################
  169.  
  170. ######################################################################
  171. #
  172. # HOSTNAME_LOOKUP
  173. #
  174. # HOSTNAME_LOOKUP=YES|NO
  175. # If set to YES, for each IP address that is reported by Denyhosts,
  176. # the corresponding hostname will be looked up and reported as well
  177. # (if available).
  178. #
  179. HOSTNAME_LOOKUP=NO
  180. #
  181. ######################################################################
  182.  
  183.  
  184. ######################################################################
  185. #
  186. # LOCK_FILE
  187. #
  188. # LOCK_FILE=/path/denyhosts
  189. # If this file exists when DenyHosts is run, then DenyHosts will exit
  190. # immediately. Otherwise, this file will be created upon invocation
  191. # and deleted upon exit. This ensures that only one instance is
  192. # running at a time.
  193. #
  194. # Redhat/Fedora:
  195. #LOCK_FILE = /var/lock/subsys/denyhosts
  196. #
  197. # Debian (and FreeBSD)
  198. LOCK_FILE = /var/run/denyhosts.pid
  199. #
  200. # Misc
  201. #LOCK_FILE = /tmp/denyhosts.lock
  202. #
  203. ######################################################################
  204.  
  205.  
  206. ############ THESE SETTINGS ARE OPTIONAL ############
  207.  
  208.  
  209. #######################################################################
  210. #
  211. # ADMIN_EMAIL: if you would like to receive emails regarding newly
  212. # restricted hosts and suspicious logins, set this address to
  213. # match your email address. If you do not want to receive these reports
  214. # leave this field blank (or run with the --noemail option)
  215. #
  216. # Multiple email addresses can be delimited by a comma, eg:
  217. # ADMIN_EMAIL = foo@bar.com, bar@foo.com, etc@foobar.com
  218. #
  219. #ADMIN_EMAIL =
  220. #
  221. #######################################################################
  222.  
  223. #######################################################################
  224. #
  225. # SMTP_HOST and SMTP_PORT: if DenyHosts is configured to email
  226. # reports (see ADMIN_EMAIL) then these settings specify the
  227. # email server address (SMTP_HOST) and the server port (SMTP_PORT)
  228. #
  229. #
  230. SMTP_HOST = localhost
  231. SMTP_PORT = 25
  232. #
  233. #######################################################################
  234.  
  235. #######################################################################
  236. #
  237. # SMTP_USERNAME and SMTP_PASSWORD: set these parameters if your
  238. # smtp email server requires authentication
  239. #
  240. #SMTP_USERNAME=foo
  241. #SMTP_PASSWORD=bar
  242. #
  243. ######################################################################
  244.  
  245. #######################################################################
  246. #
  247. # SMTP_FROM: you can specify the "From:" address in messages sent
  248. # from DenyHosts when it reports thwarted abuse attempts
  249. #
  250. SMTP_FROM = DenyHosts <nobody@localhost>
  251. #
  252. #######################################################################
  253.  
  254. #######################################################################
  255. #
  256. # SMTP_SUBJECT: you can specify the "Subject:" of messages sent
  257. # by DenyHosts when it reports thwarted abuse attempts
  258. SMTP_SUBJECT = DenyHosts Report
  259. #
  260. ######################################################################
  261.  
  262. ######################################################################
  263. #
  264. # SMTP_DATE_FORMAT: specifies the format used for the "Date:" header
  265. # when sending email messages.
  266. #
  267. # for possible values for this parameter refer to: man strftime
  268. #
  269. # the default:
  270. #
  271. #SMTP_DATE_FORMAT = %a, %d %b %Y %H:%M:%S %z
  272. #
  273. ######################################################################
  274.  
  275. ######################################################################
  276. #
  277. # SYSLOG_REPORT
  278. #
  279. # SYSLOG_REPORT=YES|NO
  280. # If set to yes, when denied hosts are recorded the report data
  281. # will be sent to syslog (syslog must be present on your system).
  282. # The default is: NO
  283. #
  284. #SYSLOG_REPORT=NO
  285. #
  286. #SYSLOG_REPORT=YES
  287. #
  288. ######################################################################
  289.  
  290. ######################################################################
  291. #
  292. # ALLOWED_HOSTS_HOSTNAME_LOOKUP
  293. #
  294. # ALLOWED_HOSTS_HOSTNAME_LOOKUP=YES|NO
  295. # If set to YES, for each entry in the WORK_DIR/allowed-hosts file,
  296. # the hostname will be looked up. If your versions of tcp_wrappers
  297. # and sshd sometimes log hostnames in addition to ip addresses
  298. # then you may wish to specify this option.
  299. #
  300. #ALLOWED_HOSTS_HOSTNAME_LOOKUP=NO
  301. #
  302. ######################################################################
  303.  
  304. ######################################################################
  305. #
  306. # AGE_RESET_VALID: Specifies the period of time between failed login
  307. # attempts that, when exceeded will result in the failed count for
  308. # this host to be reset to 0. This value applies to login attempts
  309. # to all valid users (those within /etc/passwd) with the
  310. # exception of root. If not defined, this count will never
  311. # be reset.
  312. #
  313. # See the comments in the PURGE_DENY section (above)
  314. # for details on specifying this value or for complete details
  315. # refer to: http://denyhosts.sourceforge.net/faq.html#timespec
  316. #
  317. AGE_RESET_VALID=5d
  318. #
  319. ######################################################################
  320.  
  321. ######################################################################
  322. #
  323. # AGE_RESET_ROOT: Specifies the period of time between failed login
  324. # attempts that, when exceeded will result in the failed count for
  325. # this host to be reset to 0. This value applies to all login
  326. # attempts to the "root" user account. If not defined,
  327. # this count will never be reset.
  328. #
  329. # See the comments in the PURGE_DENY section (above)
  330. # for details on specifying this value or for complete details
  331. # refer to: http://denyhosts.sourceforge.net/faq.html#timespec
  332. #
  333. AGE_RESET_ROOT=25d
  334. #
  335. ######################################################################
  336.  
  337. ######################################################################
  338. #
  339. # AGE_RESET_RESTRICTED: Specifies the period of time between failed login
  340. # attempts that, when exceeded will result in the failed count for
  341. # this host to be reset to 0. This value applies to all login
  342. # attempts to entries found in the WORK_DIR/restricted-usernames file.
  343. # If not defined, the count will never be reset.
  344. #
  345. # See the comments in the PURGE_DENY section (above)
  346. # for details on specifying this value or for complete details
  347. # refer to: http://denyhosts.sourceforge.net/faq.html#timespec
  348. #
  349. AGE_RESET_RESTRICTED=25d
  350. #
  351. ######################################################################
  352.  
  353.  
  354. ######################################################################
  355. #
  356. # AGE_RESET_INVALID: Specifies the period of time between failed login
  357. # attempts that, when exceeded will result in the failed count for
  358. # this host to be reset to 0. This value applies to login attempts
  359. # made to any invalid username (those that do not appear
  360. # in /etc/passwd). If not defined, count will never be reset.
  361. #
  362. # See the comments in the PURGE_DENY section (above)
  363. # for details on specifying this value or for complete details
  364. # refer to: http://denyhosts.sourceforge.net/faq.html#timespec
  365. #
  366. AGE_RESET_INVALID=10d
  367. #
  368. ######################################################################
  369.  
  370.  
  371. ######################################################################
  372. #
  373. # RESET_ON_SUCCESS: If this parameter is set to "yes" then the
  374. # failed count for the respective ip address will be reset to 0
  375. # if the login is successful.
  376. #
  377. # The default is RESET_ON_SUCCESS = no
  378. #
  379. #RESET_ON_SUCCESS = yes
  380. #
  381. #####################################################################
  382.  
  383.  
  384. ######################################################################
  385. #
  386. # PLUGIN_DENY: If set, this value should point to an executable
  387. # program that will be invoked when a host is added to the
  388. # HOSTS_DENY file. This executable will be passed the host
  389. # that will be added as it's only argument.
  390. #
  391. #PLUGIN_DENY=/usr/bin/true
  392. #
  393. ######################################################################
  394.  
  395.  
  396. ######################################################################
  397. #
  398. # PLUGIN_PURGE: If set, this value should point to an executable
  399. # program that will be invoked when a host is removed from the
  400. # HOSTS_DENY file. This executable will be passed the host
  401. # that is to be purged as it's only argument.
  402. #
  403. #PLUGIN_PURGE=/usr/bin/true
  404. #
  405. ######################################################################
  406.  
  407. ######################################################################
  408. #
  409. # USERDEF_FAILED_ENTRY_REGEX: if set, this value should contain
  410. # a regular expression that can be used to identify additional
  411. # hackers for your particular ssh configuration. This functionality
  412. # extends the built-in regular expressions that DenyHosts uses.
  413. # This parameter can be specified multiple times.
  414. # See this faq entry for more details:
  415. # http://denyhosts.sf.net/faq.html#userdef_regex
  416. #
  417. USERDEF_FAILED_ENTRY_REGEX=[a|A]uthentication error for (?P<invalid>invalid user |illegal user )?(?P<user>.*?) from (::ffff:)?(?P<host>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
  418. USERDEF_FAILED_ENTRY_REGEX=[a|A]uthentication error for (?P<invalid>invalid user |illegal user )?(?P<user>.*?) from (?P<host>.*)
  419. # sorry no entries for IPv6 address yet :(
  420. #
  421. #
  422. ######################################################################
  423.  
  424.  
  425.  
  426.  
  427. ######### THESE SETTINGS ARE SPECIFIC TO DAEMON MODE ##########
  428.  
  429.  
  430.  
  431. #######################################################################
  432. #
  433. # DAEMON_LOG: when DenyHosts is run in daemon mode (--daemon flag)
  434. # this is the logfile that DenyHosts uses to report it's status.
  435. # To disable logging, leave blank. (default is: /var/log/denyhosts)
  436. #
  437. DAEMON_LOG = /var/log/denyhosts
  438. #
  439. # disable logging:
  440. #DAEMON_LOG =
  441. #
  442. ######################################################################
  443.  
  444. #######################################################################
  445. #
  446. # DAEMON_LOG_TIME_FORMAT: when DenyHosts is run in daemon mode
  447. # (--daemon flag) this specifies the timestamp format of
  448. # the DAEMON_LOG messages (default is the ISO8061 format:
  449. # ie. 2005-07-22 10:38:01,745)
  450. #
  451. # for possible values for this parameter refer to: man strftime
  452. #
  453. # Jan 1 13:05:59
  454. #DAEMON_LOG_TIME_FORMAT = %b %d %H:%M:%S
  455. #
  456. # Jan 1 01:05:59
  457. #DAEMON_LOG_TIME_FORMAT = %b %d %I:%M:%S
  458. #
  459. ######################################################################
  460.  
  461. #######################################################################
  462. #
  463. # DAEMON_LOG_MESSAGE_FORMAT: when DenyHosts is run in daemon mode
  464. # (--daemon flag) this specifies the message format of each logged
  465. # entry. By default the following format is used:
  466. #
  467. # %(asctime)s - %(name)-12s: %(levelname)-8s %(message)s
  468. #
  469. # Where the "%(asctime)s" portion is expanded to the format
  470. # defined by DAEMON_LOG_TIME_FORMAT
  471. #
  472. # This string is passed to python's logging.Formatter contstuctor.
  473. # For details on the possible format types please refer to:
  474. # http://docs.python.org/lib/node357.html
  475. #
  476. # This is the default:
  477. #DAEMON_LOG_MESSAGE_FORMAT = %(asctime)s - %(name)-12s: %(levelname)-8s %(message)s
  478. #
  479. #
  480. ######################################################################
  481.  
  482.  
  483. #######################################################################
  484. #
  485. # DAEMON_SLEEP: when DenyHosts is run in daemon mode (--daemon flag)
  486. # this is the amount of time DenyHosts will sleep between polling
  487. # the SECURE_LOG. See the comments in the PURGE_DENY section (above)
  488. # for details on specifying this value or for complete details
  489. # refer to: http://denyhosts.sourceforge.net/faq.html#timespec
  490. #
  491. #
  492. DAEMON_SLEEP = 30s
  493. #
  494. #######################################################################
  495.  
  496. #######################################################################
  497. #
  498. # DAEMON_PURGE: How often should DenyHosts, when run in daemon mode,
  499. # run the purge mechanism to expire old entries in HOSTS_DENY
  500. # This has no effect if PURGE_DENY is blank.
  501. #
  502. DAEMON_PURGE = 1h
  503. #
  504. #######################################################################
  505.  
  506.  
  507. ######### THESE SETTINGS ARE SPECIFIC TO ##########
  508. ######### DAEMON SYNCHRONIZATION ##########
  509.  
  510.  
  511. #######################################################################
  512. #
  513. # Synchronization mode allows the DenyHosts daemon the ability
  514. # to periodically send and receive denied host data such that
  515. # DenyHosts daemons worldwide can automatically inform one
  516. # another regarding banned hosts. This mode is disabled by
  517. # default, you must uncomment SYNC_SERVER to enable this mode.
  518. #
  519. # for more information, please refer to:
  520. # http:/denyhosts.sourceforge.net/faq.html#sync
  521. #
  522. #######################################################################
  523.  
  524.  
  525. #######################################################################
  526. #
  527. # SYNC_SERVER: The central server that communicates with DenyHost
  528. # daemons. Currently, denyhosts.net is the only available server
  529. # however, in the future, it may be possible for organizations to
  530. # install their own server for internal network synchronization
  531. #
  532. # To disable synchronization (the default), do nothing.
  533. #
  534. # To enable synchronization, you must uncomment the following line:
  535. #SYNC_SERVER = http://xmlrpc.denyhosts.net:9911
  536. #
  537. #######################################################################
  538.  
  539. #######################################################################
  540. #
  541. # SYNC_INTERVAL: the interval of time to perform synchronizations if
  542. # SYNC_SERVER has been uncommented. The default is 1 hour.
  543. #
  544. #SYNC_INTERVAL = 1h
  545. #
  546. #######################################################################
  547.  
  548.  
  549. #######################################################################
  550. #
  551. # SYNC_UPLOAD: allow your DenyHosts daemon to transmit hosts that have
  552. # been denied? This option only applies if SYNC_SERVER has
  553. # been uncommented.
  554. # The default is SYNC_UPLOAD = yes
  555. #
  556. #SYNC_UPLOAD = no
  557. #SYNC_UPLOAD = yes
  558. #
  559. #######################################################################
  560.  
  561.  
  562. #######################################################################
  563. #
  564. # SYNC_DOWNLOAD: allow your DenyHosts daemon to receive hosts that have
  565. # been denied by others? This option only applies if SYNC_SERVER has
  566. # been uncommented.
  567. # The default is SYNC_DOWNLOAD = yes
  568. #
  569. #SYNC_DOWNLOAD = no
  570. #SYNC_DOWNLOAD = yes
  571. #
  572. #
  573. #
  574. #######################################################################
  575.  
  576. #######################################################################
  577. #
  578. # SYNC_DOWNLOAD_THRESHOLD: If SYNC_DOWNLOAD is enabled this parameter
  579. # filters the returned hosts to those that have been blocked this many
  580. # times by others. That is, if set to 1, then if a single DenyHosts
  581. # server has denied an ip address then you will receive the denied host.
  582. #
  583. # See also SYNC_DOWNLOAD_RESILIENCY
  584. #
  585. #SYNC_DOWNLOAD_THRESHOLD = 10
  586. #
  587. # The default is SYNC_DOWNLOAD_THRESHOLD = 3
  588. #
  589. #SYNC_DOWNLOAD_THRESHOLD = 3
  590. #
  591. #######################################################################
  592.  
  593. #######################################################################
  594. #
  595. # SYNC_DOWNLOAD_RESILIENCY: If SYNC_DOWNLOAD is enabled then the
  596. # value specified for this option limits the downloaded data
  597. # to this resiliency period or greater.
  598. #
  599. # Resiliency is defined as the timespan between a hackers first known
  600. # attack and it's most recent attack. Example:
  601. #
  602. # If the centralized denyhosts.net server records an attack at 2 PM
  603. # and then again at 5 PM, specifying a SYNC_DOWNLOAD_RESILIENCY = 4h
  604. # will not download this ip address.
  605. #
  606. # However, if the attacker is recorded again at 6:15 PM then the
  607. # ip address will be downloaded by your DenyHosts instance.
  608. #
  609. # This value is used in conjunction with the SYNC_DOWNLOAD_THRESHOLD
  610. # and only hosts that satisfy both values will be downloaded.
  611. # This value has no effect if SYNC_DOWNLOAD_THRESHOLD = 1
  612. #
  613. # The default is SYNC_DOWNLOAD_RESILIENCY = 5h (5 hours)
  614. #
  615. # Only obtain hackers that have been at it for 2 days or more:
  616. #SYNC_DOWNLOAD_RESILIENCY = 2d
  617. #
  618. # Only obtain hackers that have been at it for 5 hours or more:
  619. #SYNC_DOWNLOAD_RESILIENCY = 5h
  620. #
  621. #######################################################################
  622. # путь к логу авторизации
  623. SECURE_LOG = /var/log/auth.log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement