Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
095aeda840 | ||
|
|
3fb02527a4 | ||
|
|
25a61ce632 | ||
|
|
21d94ff178 | ||
|
|
196c55e931 | ||
|
|
0fa76ef75a | ||
|
|
a147a8b0e1 | ||
|
|
1bcb62e31c | ||
|
|
a57643404c | ||
|
|
80805cabfc | ||
|
|
4fe4ac8dde | ||
|
|
0b3ad780fe | ||
|
|
ebf5784b8c | ||
|
|
3b02098817 | ||
|
|
96661f25ab | ||
|
|
7678f59827 | ||
|
|
4b54a07d71 | ||
|
|
e74baae666 | ||
|
|
cb042dda7d | ||
|
|
3245b8018b | ||
|
|
1cd3118da3 | ||
|
|
98c7dd04a4 | ||
|
|
d91d949e95 | ||
|
|
1e8ce20b32 | ||
|
|
8e3a26bdeb | ||
|
|
ba839af8ad | ||
|
|
f8f59dd31a | ||
|
|
5ee482bc9a | ||
|
|
d086317cc8 | ||
|
|
17eed32e03 | ||
|
|
621d8cae17 | ||
|
|
ec043cd202 | ||
|
|
d7afcde2e1 | ||
|
|
1929e7a76b | ||
|
|
320a3dcdd5 | ||
|
|
a98cc08b31 | ||
|
|
5093ff8956 | ||
|
|
d6b884f3b7 | ||
|
|
5ac303df8a | ||
|
|
8d45deca86 | ||
|
|
974ba688d4 | ||
|
|
7f22c4873a | ||
|
|
1414a44b8e | ||
|
|
ad1f9dc4d0 | ||
|
|
64217fe018 | ||
|
|
c0f9348db5 | ||
|
|
d709ec8179 | ||
|
|
ba282b794c | ||
|
|
e323c148e1 | ||
|
|
1e4a14fb25 | ||
|
|
2f99d5accb | ||
|
|
cb667edf17 | ||
|
|
ade79635b2 | ||
|
|
39fe0bdce6 | ||
|
|
10cd815525 | ||
|
|
c03fe6682c | ||
|
|
e3f2fcfab4 | ||
|
|
2ed414ed09 | ||
|
|
410a6ce5c8 | ||
|
|
579c6a94af | ||
|
|
43f2923fbd | ||
|
|
bbfff18280 | ||
|
|
c7a86b4616 | ||
|
|
2a508da5a0 | ||
|
|
38535b0cca | ||
|
|
d2f5c7de09 | ||
|
|
92f90038fa | ||
|
|
8b984a0135 | ||
|
|
6be1a5a0b1 | ||
|
|
8afea37494 | ||
|
|
c5f1598a21 | ||
|
|
ae3e9b9149 | ||
|
|
87f717e0e0 | ||
|
|
3d52fe3e4e | ||
|
|
0a05dbdbfc | ||
|
|
3312b8cb95 | ||
|
|
1627d4f573 | ||
|
|
f07e0f7ade | ||
|
|
ec4e0dd65b | ||
|
|
2367ad115c | ||
|
|
5e3de882af | ||
|
|
3f9cf27853 | ||
|
|
4f8427178a | ||
|
|
6ac2156907 | ||
|
|
3e1aa03037 | ||
|
|
ef5c826c74 | ||
|
|
2918849f9e | ||
|
|
88f779ed24 | ||
|
|
5a8f1bceb8 | ||
|
|
2958ad8636 | ||
|
|
8f6a8df3a4 | ||
|
|
5debaa4cac | ||
|
|
e4e7a83cff | ||
|
|
71ce548117 | ||
|
|
b5b615731e | ||
|
|
319cfefac2 | ||
|
|
d3f5d2d52b | ||
|
|
f0214b3d36 | ||
|
|
ab0847e2d5 | ||
|
|
b6fac90b5a | ||
|
|
63b3f39adc | ||
|
|
8b741129a5 | ||
|
|
7d173b7ce0 | ||
|
|
6893d5a8b7 | ||
|
|
d74dd9321b | ||
|
|
b2f6a3a658 | ||
|
|
ff09c52927 | ||
|
|
dda70d60c0 | ||
|
|
c5d43d7573 | ||
|
|
7579072e3b | ||
|
|
4eba9f2a4b | ||
|
|
2d51240b3e | ||
|
|
977dfe4bd7 | ||
|
|
14edeed310 | ||
|
|
0c4d356d11 | ||
|
|
080dd12288 | ||
|
|
a838deba7f | ||
|
|
1215cb28ac | ||
|
|
d445b5671d | ||
|
|
7f38b80d35 | ||
|
|
9eaa2322b0 | ||
|
|
5aa20c30d8 | ||
|
|
5d8f500471 | ||
|
|
2686811593 | ||
|
|
80a33b1dee | ||
|
|
b259e81911 | ||
|
|
d8e450cf12 | ||
|
|
4b17dddc23 | ||
|
|
ccf4f3a07d | ||
|
|
9659033523 | ||
|
|
cbac7c176a | ||
|
|
6cf4669dee | ||
|
|
d135aeea16 | ||
|
|
8757563be1 | ||
|
|
996920cdaa | ||
|
|
061fab898a | ||
|
|
e587526ede | ||
|
|
343ccd7e8a | ||
|
|
9bdc4be6cc | ||
|
|
725354c793 | ||
|
|
529866b2bb | ||
|
|
f15ed35619 | ||
|
|
08393f9d82 | ||
|
|
df5e024fb8 | ||
|
|
fb08534ed7 | ||
|
|
3eaefe8da0 | ||
|
|
04aba6168c | ||
|
|
a45b1c974c | ||
|
|
63acc862b1 | ||
|
|
fb6315ea5e | ||
|
|
6f4b6ec8cc | ||
|
|
e3d43d1241 | ||
|
|
92a2242174 | ||
|
|
e353fb8024 | ||
|
|
55d7d9e214 | ||
|
|
884cbbd6e1 | ||
|
|
abc5a4e062 | ||
|
|
a0352182e8 | ||
|
|
294ec73f62 | ||
|
|
9f1d1f4fbd | ||
|
|
42dee38ad2 | ||
|
|
2b6bb2c1be | ||
|
|
8ae9208454 | ||
|
|
a2f0dbad87 | ||
|
|
f4f92aa72d | ||
|
|
d678440658 | ||
|
|
ea26509594 | ||
|
|
6198b4566c | ||
|
|
366c64cb9d | ||
|
|
409348394e | ||
|
|
7f185a828e | ||
|
|
69c96c00c0 | ||
|
|
dc4ee5aa47 | ||
|
|
c75748c5d3 | ||
|
|
3700a9e523 | ||
|
|
21dd317870 | ||
|
|
dbc77c47c3 | ||
|
|
913c37db80 | ||
|
|
0f44a3408a | ||
|
|
164105fab1 | ||
|
|
5f3f4d1e2f | ||
|
|
9df332fdef | ||
|
|
2781e7b9d1 | ||
|
|
2d4c3edeb6 | ||
|
|
c9907bef0d | ||
|
|
097d9ea7fe | ||
|
|
3c8aa0e6ba | ||
|
|
0a7f5b7b5c | ||
|
|
e60b10392d | ||
|
|
f259dac747 | ||
|
|
747d468322 | ||
|
|
2c60d08b28 | ||
|
|
fe334590cd | ||
|
|
73b39e0894 | ||
|
|
6b5cc2dee8 | ||
|
|
ba7daef86c | ||
|
|
3bb19ecc9d | ||
|
|
7d256681a4 | ||
|
|
567039f261 | ||
|
|
27e435a7f5 | ||
|
|
cecc3d62ff | ||
|
|
d0ba27cf46 | ||
|
|
d959f6d199 | ||
|
|
c0256724a7 | ||
|
|
27c40a77a3 | ||
|
|
b8e8a87ee9 | ||
|
|
0f27a8add8 | ||
|
|
a03109d096 | ||
|
|
eea1881b73 | ||
|
|
b78d1e439a | ||
|
|
e768f8637a | ||
|
|
79b61e009a | ||
|
|
753fff9c15 | ||
|
|
071048b8f2 | ||
|
|
7965d652a1 | ||
|
|
a6de9459fc | ||
|
|
bba8844af8 | ||
|
|
31a4a27ee3 | ||
|
|
fe716743ed | ||
|
|
8672950c15 | ||
|
|
595ee7ed74 | ||
|
|
0c12cb7970 | ||
|
|
cc64ef25f6 | ||
|
|
5d0e74d2ab | ||
|
|
d04c6c13ed | ||
|
|
a107a8e7d2 | ||
|
|
1cefb7fdc6 | ||
|
|
f5ea40c7da | ||
|
|
adbfdc222d | ||
|
|
ca4da9d1d3 | ||
|
|
9c8dcbd6eb | ||
|
|
1c1a9b868c | ||
|
|
840f0ff10a | ||
|
|
267cbf5861 | ||
|
|
25e006e137 | ||
|
|
2a18b82f5f | ||
|
|
df659a0cbc | ||
|
|
472bdc437b | ||
|
|
010e76406f | ||
|
|
9f635c66fb | ||
|
|
66ff90408f | ||
|
|
d4adec7797 | ||
|
|
5430091acb | ||
|
|
ec873e2dc3 | ||
|
|
e700ccc667 | ||
|
|
690ad20958 | ||
|
|
6ef69b48ca | ||
|
|
55d6408b13 | ||
|
|
7f0010be68 | ||
|
|
7cb6412f68 | ||
|
|
9d77fb2b4c | ||
|
|
a07e6fe1a2 | ||
|
|
02525d7b6f | ||
|
|
c8059bf9b3 | ||
|
|
2817a8144c | ||
|
|
1418bcdf5b | ||
|
|
960e30cfcd | ||
|
|
d253e60a8b | ||
|
|
24093de32d | ||
|
|
f518d42c59 | ||
|
|
4c2539856c | ||
|
|
d977d81ef7 | ||
|
|
f381b98246 | ||
|
|
e8ee3ba544 | ||
|
|
5abc4ba4ae | ||
|
|
f555ff45e9 | ||
|
|
74b73bce8a | ||
|
|
a038fd5dfe | ||
|
|
70c601e9e5 | ||
|
|
4d2734dd86 | ||
|
|
ed20d457b2 | ||
|
|
f09ba1b399 | ||
|
|
a3a148078e | ||
|
|
17a6ba44b3 | ||
|
|
db1f3477cc | ||
|
|
3f04cba9f9 | ||
|
|
07fa9f2912 | ||
|
|
d0d1f8c362 | ||
|
|
8bc7623388 | ||
|
|
be3115cda0 | ||
|
|
b2036c1d62 | ||
|
|
e569281d6b | ||
|
|
5a2cc4e1c5 | ||
|
|
e9071b642a | ||
|
|
81fb28e146 | ||
|
|
2945fe8cbd | ||
|
|
d9b8796792 | ||
|
|
7b05c1ce7a | ||
|
|
1707560df8 | ||
|
|
41b88b4f4f | ||
|
|
1e3da21c68 | ||
|
|
ad51fb7e1e | ||
|
|
57caf8ec90 | ||
|
|
7327fee2c8 | ||
|
|
4bc8bc9d5f | ||
|
|
8da663a67e | ||
|
|
295630cccf | ||
|
|
76e5d2b199 | ||
|
|
f21c58dc72 | ||
|
|
b82f584a96 | ||
|
|
d2cef96f33 | ||
|
|
7e8d98c4ed | ||
|
|
3ca69c8c0a | ||
|
|
7d172faa50 | ||
|
|
39d4bb3c35 | ||
|
|
a7ad3e00dd | ||
|
|
2216fd8da4 | ||
|
|
1ea36c3045 | ||
|
|
9d076af9a2 | ||
|
|
98983adf76 | ||
|
|
067b76fc9e | ||
|
|
253d47d33c | ||
|
|
9510346507 | ||
|
|
0ef8f6675d | ||
|
|
9100d07c03 | ||
|
|
62a6771b33 | ||
|
|
73a8175bb0 | ||
|
|
ea35f2ad75 | ||
|
|
08dbe4abd5 | ||
|
|
fd25c4cbb8 | ||
|
|
309c8dddd7 | ||
|
|
56fefe9240 | ||
|
|
a5ab4406d8 | ||
|
|
ec3000798d | ||
|
|
dd8081ade5 | ||
|
|
d7ef5d166d | ||
|
|
78fc99ec7e | ||
|
|
1da9ab78be | ||
|
|
5a0edf61c9 | ||
|
|
3c83c19070 | ||
|
|
412120ac3c | ||
|
|
9b6da03c90 | ||
|
|
6cff2bb007 | ||
|
|
1588200274 | ||
|
|
b8e2b77265 | ||
|
|
fa1ff4c5d8 | ||
|
|
54b2208690 | ||
|
|
0ae2ef68be | ||
|
|
afb7a93163 | ||
|
|
43f699b872 | ||
|
|
368aa9e775 | ||
|
|
f2aec43d8a | ||
|
|
42aef09d69 | ||
|
|
01e92ce4a6 | ||
|
|
1c1b671c74 | ||
|
|
5b8fc3b51a | ||
|
|
852670bc99 | ||
|
|
8b3b9addd1 | ||
|
|
5da2422f61 | ||
|
|
fe84b158a5 | ||
|
|
da1652d0d7 | ||
|
|
12be3ed77d | ||
|
|
87a1a2f1a1 | ||
|
|
6b90ca820f | ||
|
|
affd9cef5f | ||
|
|
06b46e92eb | ||
|
|
7e3061e7ac | ||
|
|
78651de7e5 | ||
|
|
2912bc640b | ||
|
|
136781d627 | ||
|
|
d21a24de8e | ||
|
|
fc175fa78a | ||
|
|
ede2009708 | ||
|
|
343ec1cdd2 | ||
|
|
38b32a9a72 | ||
|
|
22a04dae05 | ||
|
|
b1e1cab4b7 | ||
|
|
606bf110c9 | ||
|
|
6e570b8644 | ||
|
|
5b16973f08 | ||
|
|
8547ea7ea0 | ||
|
|
9905904bba | ||
|
|
00c5d33e45 | ||
|
|
b64a435b0e | ||
|
|
b43dc147b5 | ||
|
|
bc2b81133c | ||
|
|
68f827e1f3 | ||
|
|
4c22d4a801 | ||
|
|
d42ec210cc | ||
|
|
9f1c6f1617 | ||
|
|
ab363a2c0e | ||
|
|
e3737bb7c0 | ||
|
|
428c75d1cd | ||
|
|
d4da9afd7f | ||
|
|
9d7388e684 | ||
|
|
55e76c0b80 | ||
|
|
781a25512b | ||
|
|
8b43d54878 | ||
|
|
32f02ef3b3 | ||
|
|
42714d0849 | ||
|
|
2ddf687c31 | ||
|
|
15158e4474 | ||
|
|
f088e7bf76 | ||
|
|
6281dc3633 | ||
|
|
4766547e1f | ||
|
|
ef1eaf9b37 | ||
|
|
c15c300d2a | ||
|
|
e6ca04ca9d | ||
|
|
2e42b98cd3 | ||
|
|
6c6cf2a956 | ||
|
|
df885586d4 | ||
|
|
e57e950ef5 | ||
|
|
ab3a7fc6d2 | ||
|
|
35591db3e8 | ||
|
|
7282cf91b0 | ||
|
|
b3644ad413 | ||
|
|
91eca4fdeb | ||
|
|
14e68eed72 | ||
|
|
9137c7bb23 | ||
|
|
1492ab2247 | ||
|
|
ac8e8db814 | ||
|
|
d7643fe538 | ||
|
|
88cf5bcd93 | ||
|
|
774dda6105 | ||
|
|
34d63fccfe | ||
|
|
65ce64ba6d | ||
|
|
01333fc3e2 | ||
|
|
7a28861fc7 | ||
|
|
3f48907064 | ||
|
|
9c7bd80807 | ||
|
|
303861d7c7 | ||
|
|
ccbc0c7405 | ||
|
|
a7c68ea19f | ||
|
|
12b3ac684a | ||
|
|
cd42cb26d6 | ||
|
|
569dea2b19 | ||
|
|
9e6d07d928 | ||
|
|
3befbb1770 | ||
|
|
7f1b578af4 | ||
|
|
8cbc1e0ebb | ||
|
|
546fff8dc0 | ||
|
|
d2d3762ba9 | ||
|
|
5fa1f69264 | ||
|
|
3965d690b1 | ||
|
|
50fbcda8b6 | ||
|
|
8dc6f30cdd | ||
|
|
ed4b5b8bdc | ||
|
|
94b64055e1 | ||
|
|
9f701bb611 | ||
|
|
05f9e53660 | ||
|
|
d4c921c22a | ||
|
|
3f5c382a98 | ||
|
|
bb0f732ae6 | ||
|
|
8694c54728 | ||
|
|
70e47c9621 | ||
|
|
ec37b1942c | ||
|
|
31a6c8cf5d | ||
|
|
b158f83aa3 | ||
|
|
8614ca8c41 |
@@ -0,0 +1 @@
|
||||
ChangeLog linguist-language=Markdown
|
||||
@@ -1,49 +0,0 @@
|
||||
_We will be very grateful, if your problem was described as completely as possible,
|
||||
enclosing excerpts from logs (if possible within DEBUG mode, if no errors evident
|
||||
within INFO mode), and configuration in particular of effected relevant settings
|
||||
(e.g., with ` fail2ban-client -d | grep 'affected-jail-name' ` for a particular
|
||||
jail troubleshooting).
|
||||
Thank you in advance for the details, because such issues like "It does not work"
|
||||
alone could not help to resolve anything!
|
||||
Thanks! (remove this paragraph and other comments upon reading)_
|
||||
|
||||
### Environment:
|
||||
|
||||
_Fill out and check (`[x]`) the boxes which apply. If your Fail2Ban version is outdated,
|
||||
and you can't verify that the issue persists in the recent release, better seek support
|
||||
from the distribution you obtained Fail2Ban from_
|
||||
|
||||
- Fail2Ban version (including any possible distribution suffixes):
|
||||
- OS, including release name/version:
|
||||
- [ ] Fail2Ban installed via OS/distribution mechanisms
|
||||
- [ ] You have not applied any additional foreign patches to the codebase
|
||||
- [ ] Some customizations were done to the configuration (provide details below is so)
|
||||
|
||||
### The issue:
|
||||
|
||||
_Summary here_
|
||||
|
||||
#### Steps to reproduce
|
||||
|
||||
#### Expected behavior
|
||||
|
||||
#### Observed behavior
|
||||
|
||||
#### Any additional information
|
||||
|
||||
### Configuration, dump and another helpful excerpts
|
||||
|
||||
#### Any customizations done to /etc/fail2ban/ configuration
|
||||
```
|
||||
```
|
||||
|
||||
#### Relevant parts of /var/log/fail2ban.log file:
|
||||
_preferably obtained while running fail2ban with `loglevel = 4`_
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
#### Relevant lines from monitored log files in question:
|
||||
|
||||
```
|
||||
```
|
||||
@@ -0,0 +1,70 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a bug within the fail2ban engines (not filters or jails)
|
||||
title: '[BR]: '
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
- Before reporting, please make sure to search the open and closed issues for any reports in the past.
|
||||
- Use this issue template to report a bug in the fail2ban engine (not in a filter or jail).
|
||||
- If you want to request a feature or a new filter, please use "Feature request" or "Filter request" instead.
|
||||
- If you have rather some question, please open or join to some discussion.
|
||||
|
||||
We will be very grateful, if your problem was described as completely as possible,
|
||||
enclosing excerpts from logs (if possible within DEBUG mode, if no errors evident
|
||||
within INFO mode), and configuration in particular of effected relevant settings
|
||||
(e.g., with ` fail2ban-client -d | grep 'affected-jail-name' ` for a particular
|
||||
jail troubleshooting).
|
||||
Thank you in advance for the details, because such issues like "It does not work"
|
||||
alone could not help to resolve anything!
|
||||
Thanks!
|
||||
(you can remove this paragraph and other comments upon reading)
|
||||
-->
|
||||
|
||||
### Environment:
|
||||
|
||||
<!--
|
||||
Fill out and check (`[x]`) the boxes which apply. If your Fail2Ban version is outdated,
|
||||
and you can't verify that the issue persists in the recent release, better seek support
|
||||
from the distribution you obtained Fail2Ban from
|
||||
-->
|
||||
|
||||
- Fail2Ban version <!-- including any possible distribution suffixes --> :
|
||||
- OS, including release name/version :
|
||||
- [ ] Fail2Ban installed via OS/distribution mechanisms
|
||||
- [ ] You have not applied any additional foreign patches to the codebase
|
||||
- [ ] Some customizations were done to the configuration (provide details below is so)
|
||||
|
||||
### The issue:
|
||||
|
||||
<!-- summary here -->
|
||||
|
||||
#### Steps to reproduce
|
||||
|
||||
#### Expected behavior
|
||||
|
||||
#### Observed behavior
|
||||
|
||||
#### Any additional information
|
||||
|
||||
|
||||
### Configuration, dump and another helpful excerpts
|
||||
|
||||
#### Any customizations done to /etc/fail2ban/ configuration
|
||||
<!-- put your configuration excerpts between next 2 lines -->
|
||||
```
|
||||
```
|
||||
|
||||
#### Relevant parts of /var/log/fail2ban.log file:
|
||||
<!-- preferably obtained while running fail2ban with `loglevel = 4` -->
|
||||
<!-- put your log excerpt between next 2 lines -->
|
||||
```
|
||||
```
|
||||
|
||||
#### Relevant lines from monitored log files:
|
||||
<!-- put your log excerpt between next 2 lines -->
|
||||
```
|
||||
```
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea or an enhancement for this project
|
||||
title: '[RFE]: '
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
- Before requesting, please make sure to search the open and closed issues for any requests in the past.
|
||||
- Use this issue template to request a feature in the fail2ban engine (not a new filter or jail).
|
||||
- If you want to request a new filter or failregex, please use "Filter request" instead.
|
||||
- If you have rather some question, please open or join to some discussion.
|
||||
-->
|
||||
|
||||
#### Feature request type
|
||||
<!--
|
||||
Please provide a summary description of the feature request.
|
||||
-->
|
||||
|
||||
#### Description
|
||||
<!--
|
||||
Please describe the feature in more detail.
|
||||
-->
|
||||
|
||||
#### Considered alternatives
|
||||
<!--
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
-->
|
||||
|
||||
#### Any additional information
|
||||
<!--
|
||||
Add any other context or screenshots about the feature request here.
|
||||
-->
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
name: Filter request
|
||||
about: Request a new jail or filter to be supported or existing filter extended with new failregex
|
||||
title: '[FR]: '
|
||||
labels: filter-request
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
- Before requesting, please make sure to search the open and closed issues for any requests in the past.
|
||||
- Sometimes failregex have been already requested before but are not implemented yet due to various reasons.
|
||||
- If there are no hits for your concerns, please proceed otherwise add a comment to the related issue (also if it is closed).
|
||||
- If you want to request a new feature, please use "Feature request" instead.
|
||||
- If you have rather some question, please open or join to some discussion.
|
||||
-->
|
||||
|
||||
### Environment:
|
||||
|
||||
<!--
|
||||
Fill out and check (`[x]`) the boxes which apply.
|
||||
-->
|
||||
|
||||
- Fail2Ban version <!-- including any possible distribution suffixes --> :
|
||||
- OS, including release name/version :
|
||||
|
||||
#### Service, project or product which log or journal should be monitored
|
||||
|
||||
- Name of filter or jail in Fail2Ban (if already exists) :
|
||||
- Service, project or product name, including release name/version :
|
||||
- Repository or URL (if known) :
|
||||
- Service type :
|
||||
- Ports and protocols the service is listening :
|
||||
|
||||
#### Log or journal information
|
||||
<!-- Delete unrelated group -->
|
||||
|
||||
<!-- Log file -->
|
||||
|
||||
- Log file name(s) :
|
||||
|
||||
<!-- Systemd journal -->
|
||||
|
||||
- Journal identifier or unit name :
|
||||
|
||||
#### Any additional information
|
||||
|
||||
|
||||
### Relevant lines from monitored log files:
|
||||
|
||||
#### failures in sense of fail2ban filter (fail2ban must match):
|
||||
<!-- put your log excerpt between next 2 lines -->
|
||||
```
|
||||
```
|
||||
|
||||
#### legitimate messages (fail2ban should not consider as failures):
|
||||
<!-- put your log excerpt between next 2 lines -->
|
||||
```
|
||||
```
|
||||
@@ -1,7 +1,8 @@
|
||||
Before submitting your PR, please review the following checklist:
|
||||
|
||||
- [ ] **CHOOSE CORRECT BRANCH**: if filing a bugfix/enhancement
|
||||
against 0.9.x series, choose `master` branch
|
||||
against certain release version, choose `0.9`, `0.10` or `0.11` branch,
|
||||
for dev-edition use `master` branch
|
||||
- [ ] **CONSIDER adding a unit test** if your PR resolves an issue
|
||||
- [ ] **LIST ISSUES** this PR resolves
|
||||
- [ ] **MAKE SURE** this PR doesn't break existing tests
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
name: CI
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
# events but only for the master branch
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'doc/**'
|
||||
- 'files/**'
|
||||
- 'man/**'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'doc/**'
|
||||
- 'files/**'
|
||||
- 'man/**'
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11.0-alpha.1', pypy2, pypy3]
|
||||
fail-fast: false
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Grant systemd-journal access
|
||||
run: sudo usermod -a -G systemd-journal "$USER" || echo 'no systemd-journal access'
|
||||
|
||||
- name: Python version
|
||||
run: |
|
||||
F2B_PY=$(python -c "import sys; print(sys.version)")
|
||||
echo "Python: ${{ matrix.python-version }} -- ${F2B_PY/$'\n'/ }"
|
||||
F2B_PYV=$(echo "${F2B_PY}" | grep -oP '^\d+(?:\.\d+)')
|
||||
F2B_PY=${F2B_PY:0:1}
|
||||
echo "Set F2B_PY=$F2B_PY, F2B_PYV=$F2B_PYV"
|
||||
echo "F2B_PY=$F2B_PY" >> $GITHUB_ENV
|
||||
echo "F2B_PYV=$F2B_PYV" >> $GITHUB_ENV
|
||||
# for GHA we need to monitor all journals, since it cannot be found using SYSTEM_ONLY(4):
|
||||
echo "F2B_SYSTEMD_DEFAULT_FLAGS=0" >> $GITHUB_ENV
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
if [[ "$F2B_PY" = 3 ]]; then python -m pip install --upgrade pip || echo "can't upgrade pip"; fi
|
||||
if [[ "$F2B_PY" = 3 ]] && ! command -v 2to3x -v 2to3 > /dev/null; then
|
||||
#pip install 2to3
|
||||
sudo apt-get -y install 2to3
|
||||
fi
|
||||
#sudo apt-get -y install python${F2B_PY/2/}-pyinotify || echo 'inotify not available'
|
||||
python -m pip install pyinotify || echo 'inotify not available'
|
||||
#sudo apt-get -y install python${F2B_PY/2/}-systemd || echo 'systemd not available'
|
||||
sudo apt-get -y install libsystemd-dev || echo 'systemd dependencies seems to be unavailable'
|
||||
python -m pip install systemd-python || echo 'systemd not available'
|
||||
|
||||
- name: Before scripts
|
||||
run: |
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
# Manually execute 2to3 for now
|
||||
if [[ "$F2B_PY" = 3 ]]; then echo "2to3 ..." && ./fail2ban-2to3; fi
|
||||
_debug() { echo -n "$1 "; err=$("${@:2}" 2>&1) && echo 'OK' || echo -e "FAIL\n$err"; }
|
||||
# (debug) output current preferred encoding:
|
||||
_debug 'Encodings:' python -c 'import locale, sys; from fail2ban.helpers import PREFER_ENC; print(PREFER_ENC, locale.getpreferredencoding(), (sys.stdout and sys.stdout.encoding))'
|
||||
# (debug) backend availabilities:
|
||||
echo 'Backends:'
|
||||
_debug '- systemd:' python -c 'from fail2ban.server.filtersystemd import FilterSystemd'
|
||||
#_debug '- systemd (root): ' sudo python -c 'from fail2ban.server.filtersystemd import FilterSystemd'
|
||||
_debug '- pyinotify:' python -c 'from fail2ban.server.filterpyinotify import FilterPyinotify'
|
||||
|
||||
- name: Test suite
|
||||
run: |
|
||||
if [[ "$F2B_PY" = 2 ]]; then
|
||||
python setup.py test
|
||||
elif dpkg --compare-versions "$F2B_PYV" lt 3.10; then
|
||||
python bin/fail2ban-testcases --verbosity=2
|
||||
else
|
||||
echo "Skip systemd backend since systemd-python module must be fixed for python >= v.3.10 in GHA ..."
|
||||
python bin/fail2ban-testcases --verbosity=2 -i "[sS]ystemd|[jJ]ournal"
|
||||
fi
|
||||
|
||||
#- name: Test suite (debug some systemd tests only)
|
||||
#run: python bin/fail2ban-testcases --verbosity=2 "[sS]ystemd|[jJ]ournal"
|
||||
#run: python bin/fail2ban-testcases --verbosity=2 -l 5 "test_WrongChar"
|
||||
|
||||
- name: Build
|
||||
run: python setup.py build
|
||||
|
||||
#- name: Test initd scripts
|
||||
# run: shellcheck -s bash -e SC1090,SC1091 files/debian-initd
|
||||
+5
-13
@@ -10,22 +10,14 @@ dist: xenial
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- python: 2.6
|
||||
dist: trusty # required for Python 2.6
|
||||
- python: 2.7
|
||||
dist: trusty # required for packages like gamin
|
||||
name: 2.7 (trusty)
|
||||
- python: 2.7
|
||||
name: 2.7 (xenial)
|
||||
- python: pypy
|
||||
dist: trusty
|
||||
- python: 3.3
|
||||
dist: trusty
|
||||
#- python: pypy
|
||||
- python: 3.4
|
||||
- python: 3.5
|
||||
- python: 3.6
|
||||
- python: 3.7
|
||||
- python: 3.8-dev
|
||||
- python: 3.8
|
||||
- python: 3.9-dev
|
||||
- python: pypy3.5
|
||||
before_install:
|
||||
- echo "running under $TRAVIS_PYTHON_VERSION"
|
||||
@@ -69,8 +61,8 @@ script:
|
||||
- if [[ "$F2B_PY" = 3 ]]; then coverage run bin/fail2ban-testcases --verbosity=2; fi
|
||||
# Use $VENV_BIN (not python) or else sudo will always run the system's python (2.7)
|
||||
- sudo $VENV_BIN/pip install .
|
||||
# Doc files should get installed on Travis under Linux (python >= 3.8 seem to use another path segment)
|
||||
- if [[ $TRAVIS_PYTHON_VERSION < 3.8 ]]; then test -e /usr/share/doc/fail2ban/FILTERS; fi
|
||||
# Doc files should get installed on Travis under Linux (some builds/python's seem to use another path segment)
|
||||
- test -e /usr/share/doc/fail2ban/FILTERS && echo 'found' || echo 'not found'
|
||||
# Test initd script
|
||||
- shellcheck -s bash -e SC1090,SC1091 files/debian-initd
|
||||
after_success:
|
||||
|
||||
@@ -6,7 +6,40 @@
|
||||
Fail2Ban: Changelog
|
||||
===================
|
||||
|
||||
ver. 0.11.1 (2020/01/11) - this-is-the-way
|
||||
ver. 1.0.1-dev-1 (20??/??/??) - development nightly edition
|
||||
-----------
|
||||
|
||||
### Compatibility:
|
||||
* potential incompatibility by parsing of options of `backend`, `filter` and `action` parameters (if they
|
||||
are partially incorrect), because fail2ban could throw an error now (doesn't silently bypass it anymore).
|
||||
* to v.0.11:
|
||||
- due to change of `actioncheck` behavior (gh-488), some actions can be incompatible as regards
|
||||
the invariant check, if `actionban` or `actionunban` would not throw an error (exit code
|
||||
different from 0) in case of unsane environment.
|
||||
|
||||
### Fixes
|
||||
* readline fixed to consider interim new-line character as part of code point in multi-byte logs
|
||||
(e. g. unicode encoding like utf-16be, utf-16le);
|
||||
* `action.d/ufw.conf`:
|
||||
- fixed handling on IPv6 (using prepend, gh-2331, gh-3018)
|
||||
- application names containing spaces can be used now (gh-656, gh-1532, gh-3018)
|
||||
* `filter.d/drupal-auth.conf` more strict regex, extended to match "Login attempt failed from" (gh-2742)
|
||||
|
||||
### New Features and Enhancements
|
||||
* `actioncheck` behavior is changed now (gh-488), so invariant check as well as restore or repair
|
||||
of sane environment (in case of recognized unsane state) would only occur on action errors (e. g.
|
||||
if ban or unban operations are exiting with other code as 0)
|
||||
* better recognition of log rotation, better performance by reopen: avoid unnecessary seek to begin of file
|
||||
(and hash calculation)
|
||||
* file filter reads only complete lines (ended with new-line) now, so waits for end of line (for its completion)
|
||||
* `action.d/ufw.conf` (gh-3018):
|
||||
- new option `add` (default `prepend`), can be supplied as `insert 1` for ufw versions before v.0.36 (gh-2331, gh-3018)
|
||||
- new options `kill-mode` and `kill` to drop established connections of intruder (see action for details, gh-3018)
|
||||
* `filter.d/nginx-http-auth.conf` - extended with parameter mode, so additionally to `auth` (or `normal`)
|
||||
mode `fallback` (or combined as `aggressive`) can find SSL errors while SSL handshaking, gh-2881
|
||||
|
||||
|
||||
ver. 0.11.2 (2020/11/23) - heal-the-world-with-security-tools
|
||||
-----------
|
||||
|
||||
### Compatibility:
|
||||
@@ -37,6 +70,73 @@ ver. 0.11.1 (2020/01/11) - this-is-the-way
|
||||
- Since v0.10 fail2ban supports the matching of IPv6 addresses, but not all ban actions are
|
||||
IPv6-capable now.
|
||||
|
||||
### Fixes
|
||||
* [stability] prevent race condition - no ban if filter (backend) is continuously busy if
|
||||
too many messages will be found in log, e. g. initial scan of large log-file or journal (gh-2660)
|
||||
* pyinotify-backend sporadically avoided initial scanning of log-file by start
|
||||
* python 3.9 compatibility (and Travis CI support)
|
||||
* restoring a large number (500+ depending on files ulimit) of current bans when using PyPy fixed
|
||||
* manual ban is written to database, so can be restored by restart (gh-2647)
|
||||
* `jail.conf`: don't specify `action` directly in jails (use `action_` or `banaction` instead)
|
||||
* no mails-action added per default anymore (e. g. to allow that `action = %(action_mw)s` should be specified
|
||||
per jail or in default section in jail.local), closes gh-2357
|
||||
* ensure we've unique action name per jail (also if parameter `actname` is not set but name deviates from standard name, gh-2686)
|
||||
* don't use `%(banaction)s` interpolation because it can be complex value (containing `[...]` and/or quotes),
|
||||
so would bother the action interpolation
|
||||
* fixed type conversion in config readers (take place after all interpolations get ready), that allows to
|
||||
specify typed parameters variable (as substitutions) as well as to supply it in other sections or as init parameters.
|
||||
* `action.d/*-ipset*.conf`: several ipset actions fixed (no timeout per default anymore), so no discrepancy
|
||||
between ipset and fail2ban (removal from ipset will be managed by fail2ban only, gh-2703)
|
||||
* `action.d/cloudflare.conf`: fixed `actionunban` (considering new-line chars and optionally real json-parsing
|
||||
with `jq`, gh-2140, gh-2656)
|
||||
* `action.d/nftables.conf` (type=multiport only): fixed port range selector, replacing `:` with `-` (gh-2763)
|
||||
* `action.d/firewallcmd-*.conf` (multiport only): fixed port range selector, replacing `:` with `-` (gh-2821)
|
||||
* `action.d/bsd-ipfw.conf`: fixed selection of rule-no by large list or initial `lowest_rule_num` (gh-2836)
|
||||
* `filter.d/common.conf`: avoid substitute of default values in related `lt_*` section, `__prefix_line`
|
||||
should be interpolated in definition section (inside the filter-config, gh-2650)
|
||||
* `filter.d/dovecot.conf`:
|
||||
- add managesieve and submission support (gh-2795);
|
||||
- accept messages with more verbose logging (gh-2573);
|
||||
* `filter.d/courier-smtp.conf`: prefregex extended to consider port in log-message (gh-2697)
|
||||
* `filter.d/traefik-auth.conf`: filter extended with parameter mode (`normal`, `ddos`, `aggressive`) to handle
|
||||
the match of username differently (gh-2693):
|
||||
- `normal`: matches 401 with supplied username only
|
||||
- `ddos`: matches 401 without supplied username only
|
||||
- `aggressive`: matches 401 and any variant (with and without username)
|
||||
* `filter.d/sshd.conf`: normalizing of user pattern in all RE's, allowing empty user (gh-2749)
|
||||
|
||||
### New Features and Enhancements
|
||||
* fail2ban-regex:
|
||||
- speedup formatted output (bypass unneeded stats creation)
|
||||
- extended with prefregex statistic
|
||||
- more informative output for `datepattern` (e. g. set from filter) - pattern : description
|
||||
* parsing of action in jail-configs considers space between action-names as separator also
|
||||
(previously only new-line was allowed), for example `action = a b` would specify 2 actions `a` and `b`
|
||||
* new filter and jail for GitLab recognizing failed application logins (gh-2689)
|
||||
* new filter and jail for Grafana recognizing failed application logins (gh-2855)
|
||||
* new filter and jail for SoftEtherVPN recognizing failed application logins (gh-2723)
|
||||
* `filter.d/guacamole.conf` extended with `logging` parameter to follow webapp-logging if it's configured (gh-2631)
|
||||
* `filter.d/bitwarden.conf` enhanced to support syslog (gh-2778)
|
||||
* introduced new prefix `{UNB}` for `datepattern` to disable word boundaries in regex;
|
||||
* datetemplate: improved anchor detection for capturing groups `(^...)`;
|
||||
* datepattern: improved handling with wrong recognized timestamps (timezones, no datepattern, etc)
|
||||
as well as some warnings signaling user about invalid pattern or zone (gh-2814):
|
||||
- filter gets mode in-operation, which gets activated if filter starts processing of new messages;
|
||||
in this mode a timestamp read from log-line that appeared recently (not an old line), deviating too much
|
||||
from now (up too 24h), will be considered as now (assuming a timezone issue), so could avoid unexpected
|
||||
bypass of failure (previously exceeding `findtime`);
|
||||
- better interaction with non-matching optional datepattern or invalid timestamps;
|
||||
- implements special datepattern `{NONE}` - allow to find failures totally without date-time in log messages,
|
||||
whereas filter will use now as timestamp (gh-2802)
|
||||
* performance optimization of `datepattern` (better search algorithm in datedetector, especially for single template);
|
||||
* fail2ban-client: extended to unban IP range(s) by subnet (CIDR/mask) or hostname (DNS), gh-2791;
|
||||
* extended capturing of alternate tags in filter, allowing combine of multiple groups to single tuple token with new tag
|
||||
prefix `<F-TUPLE_`, that would combine value of `<F-V>` with all value of `<F-TUPLE_V?_n?>` tags (gh-2755)
|
||||
|
||||
|
||||
ver. 0.11.1 (2020/01/11) - this-is-the-way
|
||||
-----------
|
||||
|
||||
### Fixes
|
||||
* purge database will be executed now (within observer).
|
||||
* restoring currently banned ip after service restart fixed
|
||||
@@ -122,7 +222,7 @@ Yes, Hrrrm...
|
||||
### New Features
|
||||
* new replacement tags for failregex to match subnets in form of IP-addresses with CIDR mask (gh-2559):
|
||||
- `<CIDR>` - helper regex to match CIDR (simple integer form of net-mask);
|
||||
- `<SUBNET>` - regex to match sub-net adresses (in form of IP/CIDR, also single IP is matched, so part /CIDR is optional);
|
||||
- `<SUBNET>` - regex to match sub-net addresses (in form of IP/CIDR, also single IP is matched, so part /CIDR is optional);
|
||||
* grouped tags (`<ADDR>`, `<HOST>`, `<SUBNET>`) recognize IP addresses enclosed in square brackets
|
||||
* new failregex-flag tag `<F-MLFGAINED>` for failregex, signaled that the access to service was gained
|
||||
(ATM used similar to tag `<F-NOFAIL>`, but it does not add the log-line to matches, gh-2279)
|
||||
|
||||
@@ -278,6 +278,7 @@ to tune it. fail2ban-regex -D ... will present Debuggex URLs for the regexs
|
||||
and sample log files that you pass into it.
|
||||
|
||||
In general use when using regex debuggers for generating fail2ban filters:
|
||||
|
||||
* use regex from the ./fail2ban-regex output (to ensure all substitutions are
|
||||
done)
|
||||
* replace <HOST> with (?&.ipv4)
|
||||
|
||||
@@ -3,10 +3,9 @@ bin/fail2ban-regex
|
||||
bin/fail2ban-server
|
||||
bin/fail2ban-testcases
|
||||
ChangeLog
|
||||
config/action.d/apprise.conf
|
||||
config/action.d/abuseipdb.conf
|
||||
config/action.d/apf.conf
|
||||
config/action.d/badips.conf
|
||||
config/action.d/badips.py
|
||||
config/action.d/blocklist_de.conf
|
||||
config/action.d/bsd-ipfw.conf
|
||||
config/action.d/cloudflare.conf
|
||||
@@ -100,6 +99,8 @@ config/filter.d/exim.conf
|
||||
config/filter.d/exim-spam.conf
|
||||
config/filter.d/freeswitch.conf
|
||||
config/filter.d/froxlor-auth.conf
|
||||
config/filter.d/gitlab.conf
|
||||
config/filter.d/grafana.conf
|
||||
config/filter.d/groupoffice.conf
|
||||
config/filter.d/gssftpd.conf
|
||||
config/filter.d/guacamole.conf
|
||||
@@ -139,6 +140,7 @@ config/filter.d/sendmail-auth.conf
|
||||
config/filter.d/sendmail-reject.conf
|
||||
config/filter.d/sieve.conf
|
||||
config/filter.d/slapd.conf
|
||||
config/filter.d/softethervpn.conf
|
||||
config/filter.d/sogo-auth.conf
|
||||
config/filter.d/solid-pop3d.conf
|
||||
config/filter.d/squid.conf
|
||||
@@ -217,7 +219,6 @@ fail2ban/setup.py
|
||||
fail2ban-testcases-all
|
||||
fail2ban-testcases-all-python3
|
||||
fail2ban/tests/action_d/__init__.py
|
||||
fail2ban/tests/action_d/test_badips.py
|
||||
fail2ban/tests/action_d/test_smtp.py
|
||||
fail2ban/tests/actionstestcase.py
|
||||
fail2ban/tests/actiontestcase.py
|
||||
@@ -227,6 +228,8 @@ fail2ban/tests/clientreadertestcase.py
|
||||
fail2ban/tests/config/action.d/action.conf
|
||||
fail2ban/tests/config/action.d/brokenaction.conf
|
||||
fail2ban/tests/config/fail2ban.conf
|
||||
fail2ban/tests/config/filter.d/checklogtype.conf
|
||||
fail2ban/tests/config/filter.d/checklogtype_test.conf
|
||||
fail2ban/tests/config/filter.d/simple.conf
|
||||
fail2ban/tests/config/filter.d/test.conf
|
||||
fail2ban/tests/config/filter.d/test.local
|
||||
@@ -265,6 +268,8 @@ fail2ban/tests/files/database_v1.db
|
||||
fail2ban/tests/files/database_v2.db
|
||||
fail2ban/tests/files/filter.d/substition.conf
|
||||
fail2ban/tests/files/filter.d/testcase01.conf
|
||||
fail2ban/tests/files/filter.d/testcase02.conf
|
||||
fail2ban/tests/files/filter.d/testcase02.local
|
||||
fail2ban/tests/files/filter.d/testcase-common.conf
|
||||
fail2ban/tests/files/ignorecommand.py
|
||||
fail2ban/tests/files/logs/3proxy
|
||||
@@ -299,6 +304,8 @@ fail2ban/tests/files/logs/exim
|
||||
fail2ban/tests/files/logs/exim-spam
|
||||
fail2ban/tests/files/logs/freeswitch
|
||||
fail2ban/tests/files/logs/froxlor-auth
|
||||
fail2ban/tests/files/logs/gitlab
|
||||
fail2ban/tests/files/logs/grafana
|
||||
fail2ban/tests/files/logs/groupoffice
|
||||
fail2ban/tests/files/logs/gssftpd
|
||||
fail2ban/tests/files/logs/guacamole
|
||||
@@ -336,6 +343,7 @@ fail2ban/tests/files/logs/sendmail-auth
|
||||
fail2ban/tests/files/logs/sendmail-reject
|
||||
fail2ban/tests/files/logs/sieve
|
||||
fail2ban/tests/files/logs/slapd
|
||||
fail2ban/tests/files/logs/softethervpn
|
||||
fail2ban/tests/files/logs/sogo-auth
|
||||
fail2ban/tests/files/logs/solid-pop3d
|
||||
fail2ban/tests/files/logs/squid
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/ _|__ _(_) |_ ) |__ __ _ _ _
|
||||
| _/ _` | | |/ /| '_ \/ _` | ' \
|
||||
|_| \__,_|_|_/___|_.__/\__,_|_||_|
|
||||
v0.11.0.dev1 20??/??/??
|
||||
v1.0.1.dev1 20??/??/??
|
||||
|
||||
## Fail2Ban: ban hosts that cause multiple authentication errors
|
||||
|
||||
@@ -34,6 +34,7 @@ this case, you should use that instead.**
|
||||
|
||||
Required:
|
||||
- [Python2 >= 2.6 or Python >= 3.2](https://www.python.org) or [PyPy](https://pypy.org)
|
||||
- python-setuptools, python-distutils or python3-setuptools for installation from source
|
||||
|
||||
Optional:
|
||||
- [pyinotify >= 0.8.3](https://github.com/seb-m/pyinotify), may require:
|
||||
@@ -46,11 +47,11 @@ Optional:
|
||||
|
||||
To install:
|
||||
|
||||
tar xvfj fail2ban-0.11.0.tar.bz2
|
||||
cd fail2ban-0.11.0
|
||||
tar xvfj fail2ban-1.0.1.tar.bz2
|
||||
cd fail2ban-1.0.1
|
||||
sudo python setup.py install
|
||||
|
||||
Alternatively, you can clone the source from GitHub to a directory of Your choice, and do the install from there. Pick the correct branch, for example, 0.11
|
||||
Alternatively, you can clone the source from GitHub to a directory of Your choice, and do the install from there. Pick the correct branch, for example, master or 0.11
|
||||
|
||||
git clone https://github.com/fail2ban/fail2ban.git
|
||||
cd fail2ban
|
||||
@@ -89,11 +90,11 @@ fail2ban(1) and jail.conf(5) manpages for further references.
|
||||
Code status:
|
||||
------------
|
||||
|
||||
* travis-ci.org: [](https://travis-ci.org/fail2ban/fail2ban?branch=0.11) (0.11 branch) / [](https://travis-ci.org/fail2ban/fail2ban?branch=0.10) (0.10 branch)
|
||||
* travis-ci.org: [](https://travis-ci.org/fail2ban/fail2ban?branch=master) / [](https://travis-ci.org/fail2ban/fail2ban?branch=0.11) (0.11 branch) / [](https://travis-ci.org/fail2ban/fail2ban?branch=0.10) (0.10 branch)
|
||||
|
||||
* coveralls.io: [](https://coveralls.io/github/fail2ban/fail2ban?branch=0.11) (0.11 branch) / [](https://coveralls.io/github/fail2ban/fail2ban?branch=0.10) / (0.10 branch)
|
||||
* coveralls.io: [](https://coveralls.io/github/fail2ban/fail2ban?branch=master) / [](https://coveralls.io/github/fail2ban/fail2ban?branch=0.11) (0.11 branch) / [](https://coveralls.io/github/fail2ban/fail2ban?branch=0.10) / (0.10 branch)
|
||||
|
||||
* codecov.io: [](https://codecov.io/gh/fail2ban/fail2ban/branch/0.11) (0.11 branch) / [](https://codecov.io/gh/fail2ban/fail2ban/branch/0.10) (0.10 branch)
|
||||
* codecov.io: [](https://codecov.io/gh/fail2ban/fail2ban/branch/master) / [](https://codecov.io/gh/fail2ban/fail2ban/branch/0.11) (0.11 branch) / [](https://codecov.io/gh/fail2ban/fail2ban/branch/0.10) (0.10 branch)
|
||||
|
||||
Contact:
|
||||
--------
|
||||
|
||||
@@ -21,14 +21,13 @@
|
||||
#
|
||||
# Example, for ssh bruteforce (in section [sshd] of `jail.local`):
|
||||
# action = %(known/action)s
|
||||
# %(action_abuseipdb)s[abuseipdb_apikey="my-api-key", abuseipdb_category="18,22"]
|
||||
# abuseipdb[abuseipdb_apikey="my-api-key", abuseipdb_category="18,22"]
|
||||
#
|
||||
# See below for catagories.
|
||||
# See below for categories.
|
||||
#
|
||||
# Original Ref: https://wiki.shaunc.com/wikka.php?wakka=ReportingToAbuseIPDBWithFail2Ban
|
||||
# Added to fail2ban by Andrew James Collett (ajcollett)
|
||||
|
||||
## abuseIPDB Catagories, `the abuseipdb_category` MUST be set in the jail.conf action call.
|
||||
## abuseIPDB Categories, `the abuseipdb_category` MUST be set in the jail.conf action call.
|
||||
# Example, for ssh bruteforce: action = %(action_abuseipdb)s[abuseipdb_category="18,22"]
|
||||
# ID Title Description
|
||||
# 3 Fraud Orders
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# Fail2Ban configuration file
|
||||
#
|
||||
# Author: Chris Caron <lead2gold@gmail.com>
|
||||
#
|
||||
#
|
||||
|
||||
[Definition]
|
||||
|
||||
# Option: actionstart
|
||||
# Notes.: command executed once at the start of Fail2Ban.
|
||||
# Values: CMD
|
||||
#
|
||||
actionstart = printf %%b "The jail <name> as been started successfully." | <apprise> -t "[Fail2Ban] <name>: started on `uname -n`"
|
||||
|
||||
# Option: actionstop
|
||||
# Notes.: command executed once at the end of Fail2Ban
|
||||
# Values: CMD
|
||||
#
|
||||
actionstop = printf %%b "The jail <name> has been stopped." | <apprise> -t "[Fail2Ban] <name>: stopped on `uname -n`"
|
||||
|
||||
# Option: actioncheck
|
||||
# Notes.: command executed once before each actionban command
|
||||
# Values: CMD
|
||||
#
|
||||
actioncheck =
|
||||
|
||||
# Option: actionban
|
||||
# Notes.: command executed when banning an IP. Take care that the
|
||||
# command is executed with Fail2Ban user rights.
|
||||
# Tags: See jail.conf(5) man page
|
||||
# Values: CMD
|
||||
#
|
||||
actionban = printf %%b "The IP <ip> has just been banned by Fail2Ban after <failures> attempts against <name>" | <apprise> -n "warning" -t "[Fail2Ban] <name>: banned <ip> from `uname -n`"
|
||||
|
||||
# Option: actionunban
|
||||
# Notes.: command executed when unbanning an IP. Take care that the
|
||||
# command is executed with Fail2Ban user rights.
|
||||
# Tags: See jail.conf(5) man page
|
||||
# Values: CMD
|
||||
#
|
||||
actionunban =
|
||||
|
||||
[Init]
|
||||
|
||||
# Define location of the default apprise configuration file to use
|
||||
#
|
||||
config = /etc/fail2ban/apprise.conf
|
||||
#
|
||||
apprise = apprise -c "<config>"
|
||||
@@ -1,19 +0,0 @@
|
||||
# Fail2ban reporting to badips.com
|
||||
#
|
||||
# Note: This reports an IP only and does not actually ban traffic. Use
|
||||
# another action in the same jail if you want bans to occur.
|
||||
#
|
||||
# Set the category to the appropriate value before use.
|
||||
#
|
||||
# To get see register and optional key to get personalised graphs see:
|
||||
# http://www.badips.com/blog/personalized-statistics-track-the-attackers-of-all-your-servers-with-one-key
|
||||
|
||||
[Definition]
|
||||
|
||||
actionban = curl --fail --user-agent "<agent>" http://www.badips.com/add/<category>/<ip>
|
||||
|
||||
[Init]
|
||||
|
||||
# Option: category
|
||||
# Notes.: Values are from the list here: http://www.badips.com/get/categories
|
||||
category =
|
||||
@@ -1,391 +0,0 @@
|
||||
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
|
||||
# vi: set ft=python sts=4 ts=4 sw=4 noet :
|
||||
|
||||
# This file is part of Fail2Ban.
|
||||
#
|
||||
# Fail2Ban is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Fail2Ban is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Fail2Ban; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
import sys
|
||||
if sys.version_info < (2, 7): # pragma: no cover
|
||||
raise ImportError("badips.py action requires Python >= 2.7")
|
||||
import json
|
||||
import threading
|
||||
import logging
|
||||
if sys.version_info >= (3, ): # pragma: 2.x no cover
|
||||
from urllib.request import Request, urlopen
|
||||
from urllib.parse import urlencode
|
||||
from urllib.error import HTTPError
|
||||
else: # pragma: 3.x no cover
|
||||
from urllib2 import Request, urlopen, HTTPError
|
||||
from urllib import urlencode
|
||||
|
||||
from fail2ban.server.actions import Actions, ActionBase, BanTicket
|
||||
from fail2ban.helpers import splitwords, str2LogLevel
|
||||
|
||||
|
||||
|
||||
class BadIPsAction(ActionBase): # pragma: no cover - may be unavailable
|
||||
"""Fail2Ban action which reports bans to badips.com, and also
|
||||
blacklist bad IPs listed on badips.com by using another action's
|
||||
ban method.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
jail : Jail
|
||||
The jail which the action belongs to.
|
||||
name : str
|
||||
Name assigned to the action.
|
||||
category : str
|
||||
Valid badips.com category for reporting failures.
|
||||
score : int, optional
|
||||
Minimum score for bad IPs. Default 3.
|
||||
age : str, optional
|
||||
Age of last report for bad IPs, per badips.com syntax.
|
||||
Default "24h" (24 hours)
|
||||
banaction : str, optional
|
||||
Name of banaction to use for blacklisting bad IPs. If `None`,
|
||||
no blacklist of IPs will take place.
|
||||
Default `None`.
|
||||
bancategory : str, optional
|
||||
Name of category to use for blacklisting, which can differ
|
||||
from category used for reporting. e.g. may want to report
|
||||
"postfix", but want to use whole "mail" category for blacklist.
|
||||
Default `category`.
|
||||
bankey : str, optional
|
||||
Key issued by badips.com to retrieve personal list
|
||||
of blacklist IPs.
|
||||
updateperiod : int, optional
|
||||
Time in seconds between updating bad IPs blacklist.
|
||||
Default 900 (15 minutes)
|
||||
loglevel : int/str, optional
|
||||
Log level of the message when an IP is (un)banned.
|
||||
Default `DEBUG`.
|
||||
Can be also supplied as two-value list (comma- or space separated) to
|
||||
provide level of the summary message when a group of IPs is (un)banned.
|
||||
Example `DEBUG,INFO`.
|
||||
agent : str, optional
|
||||
User agent transmitted to server.
|
||||
Default `Fail2Ban/ver.`
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError
|
||||
If invalid `category`, `score`, `banaction` or `updateperiod`.
|
||||
"""
|
||||
|
||||
TIMEOUT = 10
|
||||
_badips = "https://www.badips.com"
|
||||
def _Request(self, url, **argv):
|
||||
return Request(url, headers={'User-Agent': self.agent}, **argv)
|
||||
|
||||
def __init__(self, jail, name, category, score=3, age="24h",
|
||||
banaction=None, bancategory=None, bankey=None, updateperiod=900,
|
||||
loglevel='DEBUG', agent="Fail2Ban", timeout=TIMEOUT):
|
||||
super(BadIPsAction, self).__init__(jail, name)
|
||||
|
||||
self.timeout = timeout
|
||||
self.agent = agent
|
||||
self.category = category
|
||||
self.score = score
|
||||
self.age = age
|
||||
self.banaction = banaction
|
||||
self.bancategory = bancategory or category
|
||||
self.bankey = bankey
|
||||
loglevel = splitwords(loglevel)
|
||||
self.sumloglevel = str2LogLevel(loglevel[-1])
|
||||
self.loglevel = str2LogLevel(loglevel[0])
|
||||
self.updateperiod = updateperiod
|
||||
|
||||
self._bannedips = set()
|
||||
# Used later for threading.Timer for updating badips
|
||||
self._timer = None
|
||||
|
||||
@staticmethod
|
||||
def isAvailable(timeout=1):
|
||||
try:
|
||||
response = urlopen(Request("/".join([BadIPsAction._badips]),
|
||||
headers={'User-Agent': "Fail2Ban"}), timeout=timeout)
|
||||
return True, ''
|
||||
except Exception as e: # pragma: no cover
|
||||
return False, e
|
||||
|
||||
def logError(self, response, what=''): # pragma: no cover - sporadical (502: Bad Gateway, etc)
|
||||
messages = {}
|
||||
try:
|
||||
messages = json.loads(response.read().decode('utf-8'))
|
||||
except:
|
||||
pass
|
||||
self._logSys.error(
|
||||
"%s. badips.com response: '%s'", what,
|
||||
messages.get('err', 'Unknown'))
|
||||
|
||||
def getCategories(self, incParents=False):
|
||||
"""Get badips.com categories.
|
||||
|
||||
Returns
|
||||
-------
|
||||
set
|
||||
Set of categories.
|
||||
|
||||
Raises
|
||||
------
|
||||
HTTPError
|
||||
Any issues with badips.com request.
|
||||
ValueError
|
||||
If badips.com response didn't contain necessary information
|
||||
"""
|
||||
try:
|
||||
response = urlopen(
|
||||
self._Request("/".join([self._badips, "get", "categories"])), timeout=self.timeout)
|
||||
except HTTPError as response: # pragma: no cover
|
||||
self.logError(response, "Failed to fetch categories")
|
||||
raise
|
||||
else:
|
||||
response_json = json.loads(response.read().decode('utf-8'))
|
||||
if not 'categories' in response_json:
|
||||
err = "badips.com response lacked categories specification. Response was: %s" \
|
||||
% (response_json,)
|
||||
self._logSys.error(err)
|
||||
raise ValueError(err)
|
||||
categories = response_json['categories']
|
||||
categories_names = set(
|
||||
value['Name'] for value in categories)
|
||||
if incParents:
|
||||
categories_names.update(set(
|
||||
value['Parent'] for value in categories
|
||||
if "Parent" in value))
|
||||
return categories_names
|
||||
|
||||
def getList(self, category, score, age, key=None):
|
||||
"""Get badips.com list of bad IPs.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
category : str
|
||||
Valid badips.com category.
|
||||
score : int
|
||||
Minimum score for bad IPs.
|
||||
age : str
|
||||
Age of last report for bad IPs, per badips.com syntax.
|
||||
key : str, optional
|
||||
Key issued by badips.com to fetch IPs reported with the
|
||||
associated key.
|
||||
|
||||
Returns
|
||||
-------
|
||||
set
|
||||
Set of bad IPs.
|
||||
|
||||
Raises
|
||||
------
|
||||
HTTPError
|
||||
Any issues with badips.com request.
|
||||
"""
|
||||
try:
|
||||
url = "?".join([
|
||||
"/".join([self._badips, "get", "list", category, str(score)]),
|
||||
urlencode({'age': age})])
|
||||
if key:
|
||||
url = "&".join([url, urlencode({'key': key})])
|
||||
self._logSys.debug('badips.com: get list, url: %r', url)
|
||||
response = urlopen(self._Request(url), timeout=self.timeout)
|
||||
except HTTPError as response: # pragma: no cover
|
||||
self.logError(response, "Failed to fetch bad IP list")
|
||||
raise
|
||||
else:
|
||||
return set(response.read().decode('utf-8').split())
|
||||
|
||||
@property
|
||||
def category(self):
|
||||
"""badips.com category for reporting IPs.
|
||||
"""
|
||||
return self._category
|
||||
|
||||
@category.setter
|
||||
def category(self, category):
|
||||
if category not in self.getCategories():
|
||||
self._logSys.error("Category name '%s' not valid. "
|
||||
"see badips.com for list of valid categories",
|
||||
category)
|
||||
raise ValueError("Invalid category: %s" % category)
|
||||
self._category = category
|
||||
|
||||
@property
|
||||
def bancategory(self):
|
||||
"""badips.com bancategory for fetching IPs.
|
||||
"""
|
||||
return self._bancategory
|
||||
|
||||
@bancategory.setter
|
||||
def bancategory(self, bancategory):
|
||||
if bancategory != "any" and bancategory not in self.getCategories(incParents=True):
|
||||
self._logSys.error("Category name '%s' not valid. "
|
||||
"see badips.com for list of valid categories",
|
||||
bancategory)
|
||||
raise ValueError("Invalid bancategory: %s" % bancategory)
|
||||
self._bancategory = bancategory
|
||||
|
||||
@property
|
||||
def score(self):
|
||||
"""badips.com minimum score for fetching IPs.
|
||||
"""
|
||||
return self._score
|
||||
|
||||
@score.setter
|
||||
def score(self, score):
|
||||
score = int(score)
|
||||
if 0 <= score <= 5:
|
||||
self._score = score
|
||||
else:
|
||||
raise ValueError("Score must be 0-5")
|
||||
|
||||
@property
|
||||
def banaction(self):
|
||||
"""Jail action to use for banning/unbanning.
|
||||
"""
|
||||
return self._banaction
|
||||
|
||||
@banaction.setter
|
||||
def banaction(self, banaction):
|
||||
if banaction is not None and banaction not in self._jail.actions:
|
||||
self._logSys.error("Action name '%s' not in jail '%s'",
|
||||
banaction, self._jail.name)
|
||||
raise ValueError("Invalid banaction")
|
||||
self._banaction = banaction
|
||||
|
||||
@property
|
||||
def updateperiod(self):
|
||||
"""Period in seconds between banned bad IPs will be updated.
|
||||
"""
|
||||
return self._updateperiod
|
||||
|
||||
@updateperiod.setter
|
||||
def updateperiod(self, updateperiod):
|
||||
updateperiod = int(updateperiod)
|
||||
if updateperiod > 0:
|
||||
self._updateperiod = updateperiod
|
||||
else:
|
||||
raise ValueError("Update period must be integer greater than 0")
|
||||
|
||||
def _banIPs(self, ips):
|
||||
for ip in ips:
|
||||
try:
|
||||
ai = Actions.ActionInfo(BanTicket(ip), self._jail)
|
||||
self._jail.actions[self.banaction].ban(ai)
|
||||
except Exception as e:
|
||||
self._logSys.error(
|
||||
"Error banning IP %s for jail '%s' with action '%s': %s",
|
||||
ip, self._jail.name, self.banaction, e,
|
||||
exc_info=self._logSys.getEffectiveLevel()<=logging.DEBUG)
|
||||
else:
|
||||
self._bannedips.add(ip)
|
||||
self._logSys.log(self.loglevel,
|
||||
"Banned IP %s for jail '%s' with action '%s'",
|
||||
ip, self._jail.name, self.banaction)
|
||||
|
||||
def _unbanIPs(self, ips):
|
||||
for ip in ips:
|
||||
try:
|
||||
ai = Actions.ActionInfo(BanTicket(ip), self._jail)
|
||||
self._jail.actions[self.banaction].unban(ai)
|
||||
except Exception as e:
|
||||
self._logSys.error(
|
||||
"Error unbanning IP %s for jail '%s' with action '%s': %s",
|
||||
ip, self._jail.name, self.banaction, e,
|
||||
exc_info=self._logSys.getEffectiveLevel()<=logging.DEBUG)
|
||||
else:
|
||||
self._logSys.log(self.loglevel,
|
||||
"Unbanned IP %s for jail '%s' with action '%s'",
|
||||
ip, self._jail.name, self.banaction)
|
||||
finally:
|
||||
self._bannedips.remove(ip)
|
||||
|
||||
def start(self):
|
||||
"""If `banaction` set, blacklists bad IPs.
|
||||
"""
|
||||
if self.banaction is not None:
|
||||
self.update()
|
||||
|
||||
def update(self):
|
||||
"""If `banaction` set, updates blacklisted IPs.
|
||||
|
||||
Queries badips.com for list of bad IPs, removing IPs from the
|
||||
blacklist if no longer present, and adds new bad IPs to the
|
||||
blacklist.
|
||||
"""
|
||||
if self.banaction is not None:
|
||||
if self._timer:
|
||||
self._timer.cancel()
|
||||
self._timer = None
|
||||
|
||||
try:
|
||||
ips = self.getList(
|
||||
self.bancategory, self.score, self.age, self.bankey)
|
||||
# Remove old IPs no longer listed
|
||||
s = self._bannedips - ips
|
||||
m = len(s)
|
||||
self._unbanIPs(s)
|
||||
# Add new IPs which are now listed
|
||||
s = ips - self._bannedips
|
||||
p = len(s)
|
||||
self._banIPs(s)
|
||||
if m != 0 or p != 0:
|
||||
self._logSys.log(self.sumloglevel,
|
||||
"Updated IPs for jail '%s' (-%d/+%d)",
|
||||
self._jail.name, m, p)
|
||||
self._logSys.debug(
|
||||
"Next update for jail '%' in %i seconds",
|
||||
self._jail.name, self.updateperiod)
|
||||
finally:
|
||||
self._timer = threading.Timer(self.updateperiod, self.update)
|
||||
self._timer.start()
|
||||
|
||||
def stop(self):
|
||||
"""If `banaction` set, clears blacklisted IPs.
|
||||
"""
|
||||
if self.banaction is not None:
|
||||
if self._timer:
|
||||
self._timer.cancel()
|
||||
self._timer = None
|
||||
self._unbanIPs(self._bannedips.copy())
|
||||
|
||||
def ban(self, aInfo):
|
||||
"""Reports banned IP to badips.com.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
aInfo : dict
|
||||
Dictionary which includes information in relation to
|
||||
the ban.
|
||||
|
||||
Raises
|
||||
------
|
||||
HTTPError
|
||||
Any issues with badips.com request.
|
||||
"""
|
||||
try:
|
||||
url = "/".join([self._badips, "add", self.category, str(aInfo['ip'])])
|
||||
self._logSys.debug('badips.com: ban, url: %r', url)
|
||||
response = urlopen(self._Request(url), timeout=self.timeout)
|
||||
except HTTPError as response: # pragma: no cover
|
||||
self.logError(response, "Failed to ban")
|
||||
raise
|
||||
else:
|
||||
messages = json.loads(response.read().decode('utf-8'))
|
||||
self._logSys.debug(
|
||||
"Response from badips.com report: '%s'",
|
||||
messages['suc'])
|
||||
|
||||
Action = BadIPsAction
|
||||
@@ -14,7 +14,10 @@
|
||||
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
|
||||
# Values: CMD
|
||||
#
|
||||
actionstart = ipfw show | fgrep -c -m 1 -s 'table(<table>)' > /dev/null 2>&1 || ( ipfw show | awk 'BEGIN { b = <lowest_rule_num> } { if ($1 < b) {} else if ($1 == b) { b = $1 + 1 } else { e = b } } END { if (e) exit e <br> else exit b }'; num=$?; ipfw -q add $num <blocktype> <block> from table\(<table>\) to me <port>; echo $num > "<startstatefile>" )
|
||||
actionstart = ipfw show | fgrep -c -m 1 -s 'table(<table>)' > /dev/null 2>&1 || (
|
||||
num=$(ipfw show | awk 'BEGIN { b = <lowest_rule_num> } { if ($1 == b) { b = $1 + 1 } } END { print b }');
|
||||
ipfw -q add "$num" <blocktype> <block> from table\(<table>\) to me <port>; echo "$num" > "<startstatefile>"
|
||||
)
|
||||
|
||||
|
||||
# Option: actionstop
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# Please set jail.local's permission to 640 because it contains your CF API key.
|
||||
#
|
||||
# This action depends on curl.
|
||||
# This action depends on curl (and optionally jq).
|
||||
# Referenced from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE
|
||||
#
|
||||
# To get your CloudFlare API Key: https://www.cloudflare.com/a/account/my-account
|
||||
@@ -43,9 +43,9 @@ actioncheck =
|
||||
# API v1
|
||||
#actionban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
|
||||
# API v4
|
||||
actionban = curl -s -o /dev/null -X POST -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' \
|
||||
-H 'Content-Type: application/json' -d '{ "mode": "block", "configuration": { "target": "ip", "value": "<ip>" } }' \
|
||||
https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules
|
||||
actionban = curl -s -o /dev/null -X POST <_cf_api_prms> \
|
||||
-d '{"mode":"block","configuration":{"target":"<cftarget>","value":"<ip>"},"notes":"Fail2Ban <name>"}' \
|
||||
<_cf_api_url>
|
||||
|
||||
# Option: actionunban
|
||||
# Notes.: command executed when unbanning an IP. Take care that the
|
||||
@@ -58,9 +58,14 @@ actionban = curl -s -o /dev/null -X POST -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-
|
||||
# API v1
|
||||
#actionunban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
|
||||
# API v4
|
||||
actionunban = curl -s -o /dev/null -X DELETE -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' \
|
||||
https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules/$(curl -s -X GET -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' \
|
||||
'https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules?mode=block&configuration_target=ip&configuration_value=<ip>&page=1&per_page=1' | cut -d'"' -f6)
|
||||
actionunban = id=$(curl -s -X GET <_cf_api_prms> \
|
||||
"<_cf_api_url>?mode=block&configuration_target=<cftarget>&configuration_value=<ip>&page=1&per_page=1¬es=Fail2Ban%%20<name>" \
|
||||
| { jq -r '.result[0].id' 2>/dev/null || tr -d '\n' | sed -nE 's/^.*"result"\s*:\s*\[\s*\{\s*"id"\s*:\s*"([^"]+)".*$/\1/p'; })
|
||||
if [ -z "$id" ]; then echo "<name>: id for <ip> cannot be found"; exit 0; fi;
|
||||
curl -s -o /dev/null -X DELETE <_cf_api_prms> "<_cf_api_url>/$id"
|
||||
|
||||
_cf_api_url = https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules
|
||||
_cf_api_prms = -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' -H 'Content-Type: application/json'
|
||||
|
||||
[Init]
|
||||
|
||||
@@ -76,3 +81,8 @@ actionunban = curl -s -o /dev/null -X DELETE -H 'X-Auth-Email: <cfuser>' -H 'X-A
|
||||
cftoken =
|
||||
|
||||
cfuser =
|
||||
|
||||
cftarget = ip
|
||||
|
||||
[Init?family=inet6]
|
||||
cftarget = ip6
|
||||
|
||||
@@ -102,7 +102,7 @@ logpath = /dev/null
|
||||
# Notes.: Your system mail command. Is passed 2 args: subject and recipient
|
||||
# Values: CMD
|
||||
#
|
||||
mailcmd = mail -s
|
||||
mailcmd = mail -E 'set escape' -s
|
||||
|
||||
# Option: mailargs
|
||||
# Notes.: Additional arguments to mail command. e.g. for standard Unix mail:
|
||||
|
||||
@@ -179,7 +179,7 @@ tcpflags =
|
||||
# Notes.: Your system mail command. Is passed 2 args: subject and recipient
|
||||
# Values: CMD
|
||||
#
|
||||
mailcmd = mail -s
|
||||
mailcmd = mail -E 'set escape' -s
|
||||
|
||||
# Option: mailargs
|
||||
# Notes.: Additional arguments to mail command. e.g. for standard Unix mail:
|
||||
|
||||
@@ -18,21 +18,46 @@ before = firewallcmd-common.conf
|
||||
|
||||
[Definition]
|
||||
|
||||
actionstart = ipset create <ipmset> hash:ip timeout <default-timeout><familyopt>
|
||||
actionstart = <ipstype_<ipsettype>/actionstart>
|
||||
firewall-cmd --direct --add-rule <family> filter <chain> 0 <actiontype> -m set --match-set <ipmset> src -j <blocktype>
|
||||
|
||||
actionflush = ipset flush <ipmset>
|
||||
actionflush = <ipstype_<ipsettype>/actionflush>
|
||||
|
||||
actionstop = firewall-cmd --direct --remove-rule <family> filter <chain> 0 <actiontype> -m set --match-set <ipmset> src -j <blocktype>
|
||||
<actionflush>
|
||||
ipset destroy <ipmset>
|
||||
<ipstype_<ipsettype>/actionstop>
|
||||
|
||||
actionban = ipset add <ipmset> <ip> timeout <bantime> -exist
|
||||
actionban = <ipstype_<ipsettype>/actionban>
|
||||
|
||||
actionprolong = %(actionban)s
|
||||
# actionprolong = %(actionban)s
|
||||
|
||||
actionunban = <ipstype_<ipsettype>/actionunban>
|
||||
|
||||
[ipstype_ipset]
|
||||
|
||||
actionstart = ipset create <ipmset> hash:ip timeout <default-ipsettime> <familyopt>
|
||||
|
||||
actionflush = ipset flush <ipmset>
|
||||
|
||||
actionstop = ipset destroy <ipmset>
|
||||
|
||||
actionban = ipset add <ipmset> <ip> timeout <ipsettime> -exist
|
||||
|
||||
actionunban = ipset del <ipmset> <ip> -exist
|
||||
|
||||
[ipstype_firewalld]
|
||||
|
||||
actionstart = firewall-cmd --direct --new-ipset=<ipmset> --type=hash:ip --option=timeout=<default-ipsettime> <firewalld_familyopt>
|
||||
|
||||
# TODO: there doesn't seem to be an explicit way to invoke the ipset flush function using firewall-cmd
|
||||
actionflush =
|
||||
|
||||
actionstop = firewall-cmd --direct --delete-ipset=<ipmset>
|
||||
|
||||
actionban = firewall-cmd --ipset=<ipmset> --add-entry=<ip>
|
||||
|
||||
actionunban = firewall-cmd --ipset=<ipmset> --remove-entry=<ip>
|
||||
|
||||
[Init]
|
||||
|
||||
# Option: chain
|
||||
@@ -42,11 +67,25 @@ actionunban = ipset del <ipmset> <ip> -exist
|
||||
#
|
||||
chain = INPUT_direct
|
||||
|
||||
# Option: default-timeout
|
||||
# Option: default-ipsettime
|
||||
# Notes: specifies default timeout in seconds (handled default ipset timeout only)
|
||||
# Values: [ NUM ] Default: 600
|
||||
# Values: [ NUM ] Default: 0 (no timeout, managed by fail2ban by unban)
|
||||
default-ipsettime = 0
|
||||
|
||||
default-timeout = 600
|
||||
# Option: ipsettime
|
||||
# Notes: specifies ticket timeout (handled ipset timeout only)
|
||||
# Values: [ NUM ] Default: 0 (managed by fail2ban by unban)
|
||||
ipsettime = 0
|
||||
|
||||
# expresion to caclulate timeout from bantime, example:
|
||||
# banaction = %(known/banaction)s[ipsettime='<timeout-bantime>']
|
||||
timeout-bantime = $([ "<bantime>" -le 2147483 ] && echo "<bantime>" || echo 0)
|
||||
|
||||
# Option: ipsettype
|
||||
# Notes.: defines type of ipset used for match-set (firewalld or ipset)
|
||||
# Values: firewalld or ipset
|
||||
# Default: ipset
|
||||
ipsettype = ipset
|
||||
|
||||
# Option: actiontype
|
||||
# Notes.: defines additions to the blocking rule
|
||||
@@ -67,14 +106,16 @@ multiport = -p <protocol> -m multiport --dports <port>
|
||||
|
||||
ipmset = f2b-<name>
|
||||
familyopt =
|
||||
firewalld_familyopt =
|
||||
|
||||
[Init?family=inet6]
|
||||
|
||||
ipmset = f2b-<name>6
|
||||
familyopt = <sp>family inet6
|
||||
familyopt = family inet6
|
||||
firewalld_familyopt = --option=family=inet6
|
||||
|
||||
|
||||
# DEV NOTES:
|
||||
#
|
||||
# Author: Edgar Hoch and Daniel Black
|
||||
# Author: Edgar Hoch, Daniel Black, Sergey Brester and Mihail Politaev
|
||||
# firewallcmd-new / iptables-ipset-proto6 combined for maximium goodness
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Fail2Ban configuration file
|
||||
#
|
||||
# Author: Donald Yandt
|
||||
# Authors: Donald Yandt, Sergey G. Brester
|
||||
#
|
||||
# Because of the rich rule commands requires firewalld-0.3.1+
|
||||
# This action uses firewalld rich-rules which gives you a cleaner iptables since it stores rules according to zones and not
|
||||
@@ -10,36 +10,15 @@
|
||||
#
|
||||
# If you use the --permanent rule you get a xml file in /etc/firewalld/zones/<zone>.xml that can be shared and parsed easliy
|
||||
#
|
||||
# Example commands to view rules:
|
||||
# firewall-cmd [--zone=<zone>] --list-rich-rules
|
||||
# firewall-cmd [--zone=<zone>] --list-all
|
||||
# firewall-cmd [--zone=zone] --query-rich-rule='rule'
|
||||
# This is an derivative of firewallcmd-rich-rules.conf, see there for details and other parameters.
|
||||
|
||||
[INCLUDES]
|
||||
|
||||
before = firewallcmd-common.conf
|
||||
before = firewallcmd-rich-rules.conf
|
||||
|
||||
[Definition]
|
||||
|
||||
actionstart =
|
||||
|
||||
actionstop =
|
||||
|
||||
actioncheck =
|
||||
|
||||
# you can also use zones and/or service names.
|
||||
#
|
||||
# zone example:
|
||||
# firewall-cmd --zone=<zone> --add-rich-rule="rule family='<family>' source address='<ip>' port port='<port>' protocol='<protocol>' log prefix='f2b-<name>' level='<level>' limit value='<rate>/m' <rich-blocktype>"
|
||||
#
|
||||
# service name example:
|
||||
# firewall-cmd --zone=<zone> --add-rich-rule="rule family='<family>' source address='<ip>' service name='<service>' log prefix='f2b-<name>' level='<level>' limit value='<rate>/m' <rich-blocktype>"
|
||||
#
|
||||
# Because rich rules can only handle single or a range of ports we must split ports and execute the command for each port. Ports can be single and ranges separated by a comma or space for an example: http, https, 22-60, 18 smtp
|
||||
|
||||
actionban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --add-rich-rule="rule family='<family>' source address='<ip>' port port='$p' protocol='<protocol>' log prefix='f2b-<name>' level='<level>' limit value='<rate>/m' <rich-blocktype>"; done
|
||||
|
||||
actionunban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --remove-rich-rule="rule family='<family>' source address='<ip>' port port='$p' protocol='<protocol>' log prefix='f2b-<name>' level='<level>' limit value='<rate>/m' <rich-blocktype>"; done
|
||||
rich-suffix = log prefix='f2b-<name>' level='<level>' limit value='<rate>/m' <rich-blocktype>
|
||||
|
||||
[Init]
|
||||
|
||||
@@ -48,4 +27,3 @@ level = info
|
||||
|
||||
# log rate per minute
|
||||
rate = 1
|
||||
|
||||
|
||||
@@ -35,8 +35,10 @@ actioncheck =
|
||||
#
|
||||
# Because rich rules can only handle single or a range of ports we must split ports and execute the command for each port. Ports can be single and ranges separated by a comma or space for an example: http, https, 22-60, 18 smtp
|
||||
|
||||
actionban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --add-rich-rule="rule family='<family>' source address='<ip>' port port='$p' protocol='<protocol>' <rich-blocktype>"; done
|
||||
fwcmd_rich_rule = rule family='<family>' source address='<ip>' port port='$p' protocol='<protocol>' %(rich-suffix)s
|
||||
|
||||
actionban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --add-rich-rule="%(fwcmd_rich_rule)s"; done
|
||||
|
||||
actionunban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --remove-rich-rule="rule family='<family>' source address='<ip>' port port='$p' protocol='<protocol>' <rich-blocktype>"; done
|
||||
|
||||
actionunban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --remove-rich-rule="%(fwcmd_rich_rule)s"; done
|
||||
|
||||
rich-suffix = <rich-blocktype>
|
||||
@@ -26,7 +26,7 @@ before = iptables-common.conf
|
||||
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
|
||||
# Values: CMD
|
||||
#
|
||||
actionstart = ipset create <ipmset> hash:ip timeout <default-timeout><familyopt>
|
||||
actionstart = ipset create <ipmset> hash:ip timeout <default-ipsettime> <familyopt>
|
||||
<iptables> -I <chain> -m set --match-set <ipmset> src -j <blocktype>
|
||||
|
||||
# Option: actionflush
|
||||
@@ -49,9 +49,9 @@ actionstop = <iptables> -D <chain> -m set --match-set <ipmset> src -j <blocktype
|
||||
# Tags: See jail.conf(5) man page
|
||||
# Values: CMD
|
||||
#
|
||||
actionban = ipset add <ipmset> <ip> timeout <bantime> -exist
|
||||
actionban = ipset add <ipmset> <ip> timeout <ipsettime> -exist
|
||||
|
||||
actionprolong = %(actionban)s
|
||||
# actionprolong = %(actionban)s
|
||||
|
||||
# Option: actionunban
|
||||
# Notes.: command executed when unbanning an IP. Take care that the
|
||||
@@ -63,11 +63,19 @@ actionunban = ipset del <ipmset> <ip> -exist
|
||||
|
||||
[Init]
|
||||
|
||||
# Option: default-timeout
|
||||
# Option: default-ipsettime
|
||||
# Notes: specifies default timeout in seconds (handled default ipset timeout only)
|
||||
# Values: [ NUM ] Default: 600
|
||||
# Values: [ NUM ] Default: 0 (no timeout, managed by fail2ban by unban)
|
||||
default-ipsettime = 0
|
||||
|
||||
default-timeout = 600
|
||||
# Option: ipsettime
|
||||
# Notes: specifies ticket timeout (handled ipset timeout only)
|
||||
# Values: [ NUM ] Default: 0 (managed by fail2ban by unban)
|
||||
ipsettime = 0
|
||||
|
||||
# expresion to caclulate timeout from bantime, example:
|
||||
# banaction = %(known/banaction)s[ipsettime='<timeout-bantime>']
|
||||
timeout-bantime = $([ "<bantime>" -le 2147483 ] && echo "<bantime>" || echo 0)
|
||||
|
||||
ipmset = f2b-<name>
|
||||
familyopt =
|
||||
@@ -76,4 +84,4 @@ familyopt =
|
||||
[Init?family=inet6]
|
||||
|
||||
ipmset = f2b-<name>6
|
||||
familyopt = <sp>family inet6
|
||||
familyopt = family inet6
|
||||
|
||||
@@ -26,7 +26,7 @@ before = iptables-common.conf
|
||||
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
|
||||
# Values: CMD
|
||||
#
|
||||
actionstart = ipset create <ipmset> hash:ip timeout <default-timeout><familyopt>
|
||||
actionstart = ipset create <ipmset> hash:ip timeout <default-ipsettime> <familyopt>
|
||||
<iptables> -I <chain> -p <protocol> -m multiport --dports <port> -m set --match-set <ipmset> src -j <blocktype>
|
||||
|
||||
# Option: actionflush
|
||||
@@ -49,9 +49,9 @@ actionstop = <iptables> -D <chain> -p <protocol> -m multiport --dports <port> -m
|
||||
# Tags: See jail.conf(5) man page
|
||||
# Values: CMD
|
||||
#
|
||||
actionban = ipset add <ipmset> <ip> timeout <bantime> -exist
|
||||
actionban = ipset add <ipmset> <ip> timeout <ipsettime> -exist
|
||||
|
||||
actionprolong = %(actionban)s
|
||||
# actionprolong = %(actionban)s
|
||||
|
||||
# Option: actionunban
|
||||
# Notes.: command executed when unbanning an IP. Take care that the
|
||||
@@ -63,11 +63,19 @@ actionunban = ipset del <ipmset> <ip> -exist
|
||||
|
||||
[Init]
|
||||
|
||||
# Option: default-timeout
|
||||
# Option: default-ipsettime
|
||||
# Notes: specifies default timeout in seconds (handled default ipset timeout only)
|
||||
# Values: [ NUM ] Default: 600
|
||||
# Values: [ NUM ] Default: 0 (no timeout, managed by fail2ban by unban)
|
||||
default-ipsettime = 0
|
||||
|
||||
default-timeout = 600
|
||||
# Option: ipsettime
|
||||
# Notes: specifies ticket timeout (handled ipset timeout only)
|
||||
# Values: [ NUM ] Default: 0 (managed by fail2ban by unban)
|
||||
ipsettime = 0
|
||||
|
||||
# expresion to caclulate timeout from bantime, example:
|
||||
# banaction = %(known/banaction)s[ipsettime='<timeout-bantime>']
|
||||
timeout-bantime = $([ "<bantime>" -le 2147483 ] && echo "<bantime>" || echo 0)
|
||||
|
||||
ipmset = f2b-<name>
|
||||
familyopt =
|
||||
@@ -76,4 +84,4 @@ familyopt =
|
||||
[Init?family=inet6]
|
||||
|
||||
ipmset = f2b-<name>6
|
||||
familyopt = <sp>family inet6
|
||||
familyopt = family inet6
|
||||
|
||||
@@ -17,7 +17,7 @@ actionstart = printf %%b "Hi,\n
|
||||
The jail <name> has been started successfully.\n
|
||||
Output will be buffered until <lines> lines are available.\n
|
||||
Regards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
|
||||
|
||||
# Option: actionstop
|
||||
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
|
||||
@@ -28,13 +28,13 @@ actionstop = if [ -f <tmpfile> ]; then
|
||||
These hosts have been banned by Fail2Ban.\n
|
||||
`cat <tmpfile>`
|
||||
Regards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: Summary from <fq-hostname>" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: Summary from <fq-hostname>" <dest>
|
||||
rm <tmpfile>
|
||||
fi
|
||||
printf %%b "Hi,\n
|
||||
The jail <name> has been stopped.\n
|
||||
Regards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
|
||||
|
||||
# Option: actioncheck
|
||||
# Notes.: command executed once before each actionban command
|
||||
@@ -55,7 +55,7 @@ actionban = printf %%b "`date`: <ip> (<failures> failures)\n" >> <tmpfile>
|
||||
These hosts have been banned by Fail2Ban.\n
|
||||
`cat <tmpfile>`
|
||||
\nRegards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: Summary" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: Summary" <dest>
|
||||
rm <tmpfile>
|
||||
fi
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ actionunban =
|
||||
# Notes.: Your system mail command. Is passed 2 args: subject and recipient
|
||||
# Values: CMD
|
||||
#
|
||||
mailcmd = mail -s
|
||||
mailcmd = mail -E 'set escape' -s
|
||||
|
||||
# Default name of the chain
|
||||
#
|
||||
|
||||
@@ -20,7 +20,7 @@ norestored = 1
|
||||
actionstart = printf %%b "Hi,\n
|
||||
The jail <name> has been started successfully.\n
|
||||
Regards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
|
||||
|
||||
# Option: actionstop
|
||||
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
|
||||
@@ -29,7 +29,7 @@ actionstart = printf %%b "Hi,\n
|
||||
actionstop = printf %%b "Hi,\n
|
||||
The jail <name> has been stopped.\n
|
||||
Regards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
|
||||
|
||||
# Option: actioncheck
|
||||
# Notes.: command executed once before each actionban command
|
||||
@@ -49,7 +49,7 @@ actionban = printf %%b "Hi,\n
|
||||
Here is more information about <ip> :\n
|
||||
`%(_whois_command)s`\n
|
||||
Regards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
|
||||
|
||||
# Option: actionunban
|
||||
# Notes.: command executed when unbanning an IP. Take care that the
|
||||
|
||||
@@ -16,7 +16,7 @@ norestored = 1
|
||||
actionstart = printf %%b "Hi,\n
|
||||
The jail <name> has been started successfully.\n
|
||||
Regards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
|
||||
|
||||
# Option: actionstop
|
||||
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
|
||||
@@ -25,7 +25,7 @@ actionstart = printf %%b "Hi,\n
|
||||
actionstop = printf %%b "Hi,\n
|
||||
The jail <name> has been stopped.\n
|
||||
Regards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
|
||||
|
||||
# Option: actioncheck
|
||||
# Notes.: command executed once before each actionban command
|
||||
@@ -43,7 +43,7 @@ actionban = printf %%b "Hi,\n
|
||||
The IP <ip> has just been banned by Fail2Ban after
|
||||
<failures> attempts against <name>.\n
|
||||
Regards,\n
|
||||
Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
|
||||
Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
|
||||
|
||||
# Option: actionunban
|
||||
# Notes.: command executed when unbanning an IP. Take care that the
|
||||
|
||||
@@ -34,7 +34,7 @@ type = multiport
|
||||
|
||||
rule_match-custom =
|
||||
rule_match-allports = meta l4proto \{ <protocol> \}
|
||||
rule_match-multiport = $proto dport \{ <port> \}
|
||||
rule_match-multiport = $proto dport \{ $(echo '<port>' | sed s/:/-/g) \}
|
||||
match = <rule_match-<type>>
|
||||
|
||||
# Option: rule_stat
|
||||
|
||||
@@ -84,8 +84,15 @@ srv_cfg_path = /etc/nginx/
|
||||
#srv_cmd = nginx -c %(srv_cfg_path)s/nginx.conf
|
||||
srv_cmd = nginx
|
||||
|
||||
# first test configuration is correct, hereafter send reload signal:
|
||||
blck_lst_reload = %(srv_cmd)s -qt; if [ $? -eq 0 ]; then
|
||||
# pid file (used to check nginx is running):
|
||||
srv_pid = /run/nginx.pid
|
||||
|
||||
# command used to check whether nginx is running and configuration is valid:
|
||||
srv_is_running = [ -f "%(srv_pid)s" ]
|
||||
srv_check_cmd = %(srv_is_running)s && %(srv_cmd)s -qt
|
||||
|
||||
# first test nginx is running and configuration is correct, hereafter send reload signal:
|
||||
blck_lst_reload = %(srv_check_cmd)s; if [ $? -eq 0 ]; then
|
||||
%(srv_cmd)s -s reload; if [ $? -ne 0 ]; then echo 'reload failed.'; fi;
|
||||
fi;
|
||||
|
||||
@@ -103,6 +110,8 @@ actionstop = %(actionflush)s
|
||||
|
||||
actioncheck =
|
||||
|
||||
actionban = echo "\\\\<fid> 1;" >> '%(blck_lst_file)s'; %(blck_lst_reload)s
|
||||
_echo_blck_row = printf '\%%s 1;\n' "<fid>"
|
||||
|
||||
actionunban = id=$(echo "<fid>" | sed -e 's/[]\/$*.^|[]/\\&/g'); sed -i "/^\\\\$id 1;$/d" %(blck_lst_file)s; %(blck_lst_reload)s
|
||||
actionban = %(_echo_blck_row)s >> '%(blck_lst_file)s'; %(blck_lst_reload)s
|
||||
|
||||
actionunban = id=$(%(_echo_blck_row)s | sed -e 's/[]\/$*.^|[]/\\&/g'); sed -i "/^$id$/d" %(blck_lst_file)s; %(blck_lst_reload)s
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
# Values: CMD
|
||||
#
|
||||
actionstart = if ! ipset -quiet -name list f2b-<name> >/dev/null;
|
||||
then ipset -quiet -exist create f2b-<name> hash:ip timeout <default-timeout>;
|
||||
then ipset -quiet -exist create f2b-<name> hash:ip timeout <default-ipsettime>;
|
||||
fi
|
||||
|
||||
# Option: actionstop
|
||||
@@ -66,9 +66,9 @@ actionstop = ipset flush f2b-<name>
|
||||
# Tags: See jail.conf(5) man page
|
||||
# Values: CMD
|
||||
#
|
||||
actionban = ipset add f2b-<name> <ip> timeout <bantime> -exist
|
||||
actionban = ipset add f2b-<name> <ip> timeout <ipsettime> -exist
|
||||
|
||||
actionprolong = %(actionban)s
|
||||
# actionprolong = %(actionban)s
|
||||
|
||||
# Option: actionunban
|
||||
# Notes.: command executed when unbanning an IP. Take care that the
|
||||
@@ -78,8 +78,16 @@ actionprolong = %(actionban)s
|
||||
#
|
||||
actionunban = ipset del f2b-<name> <ip> -exist
|
||||
|
||||
# Option: default-timeout
|
||||
# Option: default-ipsettime
|
||||
# Notes: specifies default timeout in seconds (handled default ipset timeout only)
|
||||
# Values: [ NUM ] Default: 600
|
||||
# Values: [ NUM ] Default: 0 (no timeout, managed by fail2ban by unban)
|
||||
default-ipsettime = 0
|
||||
|
||||
default-timeout = 600
|
||||
# Option: ipsettime
|
||||
# Notes: specifies ticket timeout (handled ipset timeout only)
|
||||
# Values: [ NUM ] Default: 0 (managed by fail2ban by unban)
|
||||
ipsettime = 0
|
||||
|
||||
# expresion to caclulate timeout from bantime, example:
|
||||
# banaction = %(known/banaction)s[ipsettime='<timeout-bantime>']
|
||||
timeout-bantime = $([ "<bantime>" -le 2147483 ] && echo "<bantime>" || echo 0)
|
||||
|
||||
@@ -13,16 +13,45 @@ actionstop =
|
||||
|
||||
actioncheck =
|
||||
|
||||
actionban = [ -n "<application>" ] && app="app <application>"
|
||||
ufw insert <insertpos> <blocktype> from <ip> to <destination> $app
|
||||
# ufw does "quickly process packets for which we already have a connection" in before.rules,
|
||||
# therefore all related sockets should be closed
|
||||
# actionban is using `ss` to do so, this only handles IPv4 and IPv6.
|
||||
|
||||
actionunban = [ -n "<application>" ] && app="app <application>"
|
||||
ufw delete <blocktype> from <ip> to <destination> $app
|
||||
actionban = if [ -n "<application>" ] && ufw app info "<application>"
|
||||
then
|
||||
ufw <add> <blocktype> from <ip> to <destination> app "<application>" comment "<comment>"
|
||||
else
|
||||
ufw <add> <blocktype> from <ip> to <destination> comment "<comment>"
|
||||
fi
|
||||
<kill>
|
||||
|
||||
actionunban = if [ -n "<application>" ] && ufw app info "<application>"
|
||||
then
|
||||
ufw delete <blocktype> from <ip> to <destination> app "<application>"
|
||||
else
|
||||
ufw delete <blocktype> from <ip> to <destination>
|
||||
fi
|
||||
|
||||
# Option: kill-mode
|
||||
# Notes.: can be set to ss or conntrack (may be extended later with other modes) to immediately drop all connections from banned IP, default empty (no kill)
|
||||
# Example: banaction = ufw[kill-mode=ss]
|
||||
kill-mode =
|
||||
|
||||
# intern conditional parameter used to provide killing mode after ban:
|
||||
_kill_ =
|
||||
_kill_ss = ss -K dst "[<ip>]"
|
||||
_kill_conntrack = conntrack -D -s "<ip>"
|
||||
|
||||
# Option: kill
|
||||
# Notes.: can be used to specify custom killing feature, by default depending on option kill-mode
|
||||
# Examples: banaction = ufw[kill='ss -K "( sport = :http || sport = :https )" dst "[<ip>]"']
|
||||
# banaction = ufw[kill='cutter "<ip>"']
|
||||
kill = <_kill_<kill-mode>>
|
||||
|
||||
[Init]
|
||||
# Option: insertpos
|
||||
# Notes.: The position number in the firewall list to insert the block rule
|
||||
insertpos = 1
|
||||
# Option: add
|
||||
# Notes.: can be set to "insert 1" to insert a rule at certain position (here 1):
|
||||
add = prepend
|
||||
|
||||
# Option: blocktype
|
||||
# Notes.: reject or deny
|
||||
@@ -36,6 +65,10 @@ destination = any
|
||||
# Notes.: application from sudo ufw app list
|
||||
application =
|
||||
|
||||
# Option: comment
|
||||
# Notes.: comment for rule added by fail2ban
|
||||
comment = by Fail2Ban after <failures> attempts against <name>
|
||||
|
||||
# DEV NOTES:
|
||||
#
|
||||
# Author: Guilhem Lettron
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# NOTICE
|
||||
# INFO
|
||||
# DEBUG
|
||||
# Values: [ LEVEL ] Default: ERROR
|
||||
# Values: [ LEVEL ] Default: INFO
|
||||
#
|
||||
loglevel = INFO
|
||||
|
||||
@@ -55,6 +55,12 @@ socket = /var/run/fail2ban/fail2ban.sock
|
||||
#
|
||||
pidfile = /var/run/fail2ban/fail2ban.pid
|
||||
|
||||
# Option: allowipv6
|
||||
# Notes.: Allows IPv6 interface:
|
||||
# Default: auto
|
||||
# Values: [ auto yes (on, true, 1) no (off, false, 0) ] Default: auto
|
||||
#allowipv6 = auto
|
||||
|
||||
# Options: dbfile
|
||||
# Notes.: Set the file for the fail2ban persistent data to be stored.
|
||||
# A value of ":memory:" means database is only stored in memory
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
[Definition]
|
||||
|
||||
failregex = ^<HOST> .*Googlebot.*$
|
||||
failregex = ^\s*<HOST> \S+ \S+(?: \S+)?\s+\S+ "[A-Z]+ /\S* [^"]*" \d+ \d+ \"[^"]*\" "[^"]*\bGooglebot/[^"]*"
|
||||
|
||||
ignoreregex =
|
||||
|
||||
datepattern = ^[^\[]*\[({DATE})
|
||||
datepattern = ^[^\[]*(\[{DATE}\s*\])
|
||||
{^LN-BEG}
|
||||
|
||||
# DEV Notes:
|
||||
|
||||
@@ -17,9 +17,9 @@ before = apache-common.conf
|
||||
|
||||
[Definition]
|
||||
|
||||
script = /\S*(?:php(?:[45]|[.-]cgi)?|\.asp|\.exe|\.pl)
|
||||
script = /\S*(?:php(?:[45]|[.-]cgi)?|\.asp|\.exe|\.pl|\bcgi-bin/)
|
||||
|
||||
prefregex = ^%(_apache_error_client)s (?:AH0(?:01(?:28|30)|1(?:264|071)): )?(?:(?:[Ff]ile|script|[Gg]ot) )<F-CONTENT>.+</F-CONTENT>$
|
||||
prefregex = ^%(_apache_error_client)s (?:AH0(?:01(?:28|30)|1(?:264|071)|2811): )?(?:(?:[Ff]ile|script|[Gg]ot) )<F-CONTENT>.+</F-CONTENT>$
|
||||
|
||||
failregex = ^(?:does not exist|not found or unable to stat): <script>\b
|
||||
^'<script>\S*' not found or unable to stat
|
||||
|
||||
@@ -8,7 +8,7 @@ before = apache-common.conf
|
||||
|
||||
[Definition]
|
||||
|
||||
failregex = ^%(_apache_error_client)s (?:(?:AH0013[456]: )?Invalid (method|URI) in request\b|(?:AH00565: )?request failed: URI too long \(longer than \d+\)|request failed: erroneous characters after protocol string:|(?:AH00566: )?request failed: invalid characters in URI\b)
|
||||
failregex = ^%(_apache_error_client)s (?:(?:AH001[23][456]: )?Invalid (method|URI) in request\b|(?:AH00565: )?request failed: URI too long \(longer than \d+\)|request failed: erroneous characters after protocol string:|(?:AH00566: )?request failed: invalid characters in URI\b)
|
||||
|
||||
ignoreregex =
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ log_prefix= (?:NOTICE|SECURITY|WARNING)%(__pid_re)s:?(?:\[C-[\da-f]*\])?:? [^:]+
|
||||
prefregex = ^%(__prefix_line)s%(log_prefix)s <F-CONTENT>.+</F-CONTENT>$
|
||||
|
||||
failregex = ^Registration from '[^']*' failed for '<HOST>(:\d+)?' - (?:Wrong password|Username/auth name mismatch|No matching peer found|Not a local domain|Device does not match ACL|Peer is not supposed to register|ACL error \(permit/deny\)|Not a local domain)$
|
||||
^Call from '[^']*' \(<HOST>:\d+\) to extension '[^']*' rejected because extension not found in context
|
||||
^Call from '[^']*' \((?:(?:TCP|UDP):)?<HOST>:\d+\) to extension '[^']*' rejected because extension not found in context
|
||||
^(?:Host )?<HOST> (?:failed (?:to authenticate\b|MD5 authentication\b)|tried to authenticate with nonexistent user\b)
|
||||
^No registration for peer '[^']*' \(from <HOST>\)$
|
||||
^hacking attempt detected '<HOST>'$
|
||||
|
||||
@@ -2,5 +2,12 @@
|
||||
# Detecting failed login attempts
|
||||
# Logged in bwdata/logs/identity/Identity/log.txt
|
||||
|
||||
[INCLUDES]
|
||||
before = common.conf
|
||||
|
||||
[Definition]
|
||||
failregex = ^\s*\[WRN\]\s+Failed login attempt(?:, 2FA invalid)?\. <HOST>$
|
||||
_daemon = Bitwarden-Identity
|
||||
failregex = ^%(__prefix_line)s\s*\[(?:W(?:RN|arning)|Bit\.Core\.[^\]]+)\]\s+Failed login attempt(?:, 2FA invalid)?\. <ADDR>$
|
||||
|
||||
# DEV Notes:
|
||||
# __prefix_line can result to an empty string, so it can support syslog and non-syslog at once.
|
||||
|
||||
@@ -25,7 +25,7 @@ __pid_re = (?:\[\d+\])
|
||||
|
||||
# Daemon name (with optional source_file:line or whatever)
|
||||
# EXAMPLES: pam_rhosts_auth, [sshd], pop(pam_unix)
|
||||
__daemon_re = [\[\(]?%(_daemon)s(?:\(\S+\))?[\]\)]?:?
|
||||
__daemon_re = [\[\(]?<_daemon>(?:\(\S+\))?[\]\)]?:?
|
||||
|
||||
# extra daemon info
|
||||
# EXAMPLE: [ID 800047 auth.info]
|
||||
@@ -33,7 +33,7 @@ __daemon_extra_re = \[ID \d+ \S+\]
|
||||
|
||||
# Combinations of daemon name and PID
|
||||
# EXAMPLES: sshd[31607], pop(pam_unix)[4920]
|
||||
__daemon_combs_re = (?:%(__pid_re)s?:\s+%(__daemon_re)s|%(__daemon_re)s%(__pid_re)s?:?)
|
||||
__daemon_combs_re = (?:<__pid_re>?:\s+<__daemon_re>|<__daemon_re><__pid_re>?:?)
|
||||
|
||||
# Some messages have a kernel prefix with a timestamp
|
||||
# EXAMPLES: kernel: [769570.846956]
|
||||
@@ -69,12 +69,12 @@ datepattern = <lt_<logtype>/datepattern>
|
||||
|
||||
[lt_file]
|
||||
# Common line prefixes for logtype "file":
|
||||
__prefix_line = %(__date_ambit)s?\s*(?:%(__bsd_syslog_verbose)s\s+)?(?:%(__hostname)s\s+)?(?:%(__kernel_prefix)s\s+)?(?:%(__vserver)s\s+)?(?:%(__daemon_combs_re)s\s+)?(?:%(__daemon_extra_re)s\s+)?
|
||||
__prefix_line = <__date_ambit>?\s*(?:<__bsd_syslog_verbose>\s+)?(?:<__hostname>\s+)?(?:<__kernel_prefix>\s+)?(?:<__vserver>\s+)?(?:<__daemon_combs_re>\s+)?(?:<__daemon_extra_re>\s+)?
|
||||
datepattern = {^LN-BEG}
|
||||
|
||||
[lt_short]
|
||||
# Common (short) line prefix for logtype "journal" (corresponds output of formatJournalEntry):
|
||||
__prefix_line = \s*(?:%(__hostname)s\s+)?(?:%(_daemon)s%(__pid_re)s?:?\s+)?(?:%(__kernel_prefix)s\s+)?
|
||||
__prefix_line = \s*(?:<__hostname>\s+)?(?:<_daemon><__pid_re>?:?\s+)?(?:<__kernel_prefix>\s+)?
|
||||
datepattern = %(lt_file/datepattern)s
|
||||
[lt_journal]
|
||||
__prefix_line = %(lt_short/__prefix_line)s
|
||||
|
||||
@@ -12,7 +12,7 @@ before = common.conf
|
||||
|
||||
_daemon = courieresmtpd
|
||||
|
||||
prefregex = ^%(__prefix_line)serror,relay=<HOST>,<F-CONTENT>.+</F-CONTENT>$
|
||||
prefregex = ^%(__prefix_line)serror,relay=<HOST>,(?:port=\d+,)?<F-CONTENT>.+</F-CONTENT>$
|
||||
|
||||
failregex = ^[^:]*: 550 User (<.*> )?unknown\.?$
|
||||
^msg="535 Authentication failed\.",cmd:( AUTH \S+)?( [0-9a-zA-Z\+/=]+)?(?: \S+)$
|
||||
|
||||
@@ -8,17 +8,18 @@ before = common.conf
|
||||
[Definition]
|
||||
|
||||
_auth_worker = (?:dovecot: )?auth(?:-worker)?
|
||||
_auth_worker_info = (?:conn \w+:auth(?:-worker)? \(uid=\w+\): auth(?:-worker)?<\d+>: )?
|
||||
_daemon = (?:dovecot(?:-auth)?|auth)
|
||||
|
||||
prefregex = ^%(__prefix_line)s(?:%(_auth_worker)s(?:\([^\)]+\))?: )?(?:%(__pam_auth)s(?:\(dovecot:auth\))?: |(?:pop3|imap)-login: )?(?:Info: )?<F-CONTENT>.+</F-CONTENT>$
|
||||
prefregex = ^%(__prefix_line)s(?:%(_auth_worker)s(?:\([^\)]+\))?: )?(?:%(__pam_auth)s(?:\(dovecot:auth\))?: |(?:pop3|imap|managesieve|submission)-login: )?(?:Info: )?%(_auth_worker_info)s<F-CONTENT>.+</F-CONTENT>$
|
||||
|
||||
failregex = ^authentication failure; logname=<F-ALT_USER1>\S*</F-ALT_USER1> uid=\S* euid=\S* tty=dovecot ruser=<F-USER>\S*</F-USER> rhost=<HOST>(?:\s+user=<F-ALT_USER>\S*</F-ALT_USER>)?\s*$
|
||||
^(?:Aborted login|Disconnected)(?::(?: [^ \(]+)+)? \((?:auth failed, \d+ attempts(?: in \d+ secs)?|tried to use (?:disabled|disallowed) \S+ auth|proxy dest auth failed)\):(?: user=<<F-USER>[^>]*</F-USER>>,)?(?: method=\S+,)? rip=<HOST>(?:[^>]*(?:, session=<\S+>)?)\s*$
|
||||
^pam\(\S+,<HOST>(?:,\S*)?\): pam_authenticate\(\) failed: (?:User not known to the underlying authentication module: \d+ Time\(s\)|Authentication failure \(password mismatch\?\)|Permission denied)\s*$
|
||||
^[a-z\-]{3,15}\(\S*,<HOST>(?:,\S*)?\): (?:unknown user|invalid credentials|Password mismatch)\s*$
|
||||
^(?:Aborted login|Disconnected|Remote closed connection|Client has quit the connection)(?::(?: [^ \(]+)+)? \((?:auth failed, \d+ attempts(?: in \d+ secs)?|tried to use (?:disabled|disallowed) \S+ auth|proxy dest auth failed)\):(?: user=<<F-USER>[^>]*</F-USER>>,)?(?: method=\S+,)? rip=<HOST>(?:[^>]*(?:, session=<\S+>)?)\s*$
|
||||
^pam\(\S+,<HOST>(?:,\S*)?\): pam_authenticate\(\) failed: (?:User not known to the underlying authentication module: \d+ Time\(s\)|Authentication failure \([Pp]assword mismatch\?\)|Permission denied)\s*$
|
||||
^[a-z\-]{3,15}\(\S*,<HOST>(?:,\S*)?\): (?:[Uu]nknown user|[Ii]nvalid credentials|[Pp]assword mismatch)
|
||||
<mdre-<mode>>
|
||||
|
||||
mdre-aggressive = ^(?:Aborted login|Disconnected)(?::(?: [^ \(]+)+)? \((?:no auth attempts|disconnected before auth was ready,|client didn't finish \S+ auth,)(?: (?:in|waited) \d+ secs)?\):(?: user=<[^>]*>,)?(?: method=\S+,)? rip=<HOST>(?:[^>]*(?:, session=<\S+>)?)\s*$
|
||||
mdre-aggressive = ^(?:Aborted login|Disconnected|Remote closed connection|Client has quit the connection)(?::(?: [^ \(]+)+)? \((?:no auth attempts|disconnected before auth was ready,|client didn't finish \S+ auth,)(?: (?:in|waited) \d+ secs)?\):(?: user=<[^>]*>,)?(?: method=\S+,)? rip=<HOST>(?:[^>]*(?:, session=<\S+>)?)\s*$
|
||||
|
||||
mdre-normal =
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ before = common.conf
|
||||
|
||||
[Definition]
|
||||
|
||||
failregex = ^%(__prefix_line)s(https?:\/\/)([\da-z\.-]+)\.([a-z\.]{2,6})(\/[\w\.-]+)*\|\d{10}\|user\|<HOST>\|.+\|.+\|\d\|.*\|Login attempt failed for .+\.$
|
||||
failregex = ^%(__prefix_line)s(?:https?:\/\/)[^|]+\|[^|]+\|[^|]+\|<ADDR>\|(?:[^|]*\|)*Login attempt failed (?:for|from) <F-USER>[^|]+</F-USER>\.$
|
||||
|
||||
ignoreregex =
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ after = exim-common.local
|
||||
host_info_pre = (?:H=([\w.-]+ )?(?:\(\S+\) )?)?
|
||||
host_info_suf = (?::\d+)?(?: I=\[\S+\](:\d+)?)?(?: U=\S+)?(?: P=e?smtp)?(?: F=(?:<>|[^@]+@\S+))?\s
|
||||
host_info = %(host_info_pre)s\[<HOST>\]%(host_info_suf)s
|
||||
pid = (?: \[\d+\])?
|
||||
pid = (?: \[\d+\]| \w+ exim\[\d+\]:)?
|
||||
|
||||
# DEV Notes:
|
||||
# From exim source code: ./src/receive.c:add_host_info_for_log
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Fail2Ban filter for Gitlab
|
||||
# Detecting unauthorized access to the Gitlab Web portal
|
||||
# typically logged in /var/log/gitlab/gitlab-rails/application.log
|
||||
|
||||
[Definition]
|
||||
failregex = ^: Failed Login: username=<F-USER>.+</F-USER> ip=<HOST>$
|
||||
@@ -0,0 +1,9 @@
|
||||
# Fail2Ban filter for Grafana
|
||||
# Detecting unauthorized access
|
||||
# Typically logged in /var/log/grafana/grafana.log
|
||||
|
||||
[Init]
|
||||
datepattern = ^t=%%Y-%%m-%%dT%%H:%%M:%%S%%z
|
||||
|
||||
[Definition]
|
||||
failregex = ^(?: lvl=err?or)? msg="Invalid username or password"(?: uname=(?:"<F-ALT_USER>[^"]+</F-ALT_USER>"|<F-USER>\S+</F-USER>)| error="<F-ERROR>[^"]+</F-ERROR>"| \S+=(?:\S*|"[^"]+"))* remote_addr=<ADDR>$
|
||||
@@ -5,21 +5,47 @@
|
||||
|
||||
[Definition]
|
||||
|
||||
# Option: failregex
|
||||
# Notes.: regex to match the password failures messages in the logfile.
|
||||
# Values: TEXT
|
||||
#
|
||||
logging = catalina
|
||||
failregex = <L_<logging>/failregex>
|
||||
maxlines = <L_<logging>/maxlines>
|
||||
datepattern = <L_<logging>/datepattern>
|
||||
|
||||
[L_catalina]
|
||||
|
||||
failregex = ^.*\nWARNING: Authentication attempt from <HOST> for user "[^"]*" failed\.$
|
||||
|
||||
# Option: ignoreregex
|
||||
# Notes.: regex to ignore. If this regex matches, the line is ignored.
|
||||
# Values: TEXT
|
||||
#
|
||||
ignoreregex =
|
||||
|
||||
# "maxlines" is number of log lines to buffer for multi-line regex searches
|
||||
maxlines = 2
|
||||
|
||||
datepattern = ^%%b %%d, %%ExY %%I:%%M:%%S %%p
|
||||
^WARNING:()**
|
||||
{^LN-BEG}
|
||||
{^LN-BEG}
|
||||
|
||||
[L_webapp]
|
||||
|
||||
failregex = ^ \[\S+\] WARN \S+ - Authentication attempt from <HOST> for user "<F-USER>[^"]+</F-USER>" failed.
|
||||
|
||||
maxlines = 1
|
||||
|
||||
datepattern = ^%%H:%%M:%%S.%%f
|
||||
|
||||
# DEV Notes:
|
||||
#
|
||||
# failregex is based on the default pattern given in Guacamole documentation :
|
||||
# https://guacamole.apache.org/doc/gug/configuring-guacamole.html#webapp-logging
|
||||
#
|
||||
# The following logback.xml Guacamole configuration file can then be used accordingly :
|
||||
# <configuration>
|
||||
# <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
# <file>/var/log/guacamole.log</file>
|
||||
# <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
# <fileNamePattern>/var/log/guacamole.%d.log.gz</fileNamePattern>
|
||||
# <maxHistory>32</maxHistory>
|
||||
# </rollingPolicy>
|
||||
# <encoder>
|
||||
# <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
# </encoder>
|
||||
# </appender>
|
||||
# <root level="info">
|
||||
# <appender-ref ref="FILE" />
|
||||
# </root>
|
||||
# </configuration>
|
||||
|
||||
@@ -6,24 +6,35 @@
|
||||
#
|
||||
import sys
|
||||
from fail2ban.server.ipdns import DNSUtils, IPAddr
|
||||
from threading import Thread
|
||||
|
||||
def process_args(argv):
|
||||
if len(argv) != 2:
|
||||
raise ValueError("Please provide a single IP as an argument. Got: %s\n"
|
||||
% (argv[1:]))
|
||||
if len(argv) - 1 not in (1, 2):
|
||||
raise ValueError("Usage %s ip ?timeout?. Got: %s\n"
|
||||
% (argv[0], argv[1:]))
|
||||
ip = argv[1]
|
||||
|
||||
if not IPAddr(ip).isValid:
|
||||
raise ValueError("Argument must be a single valid IP. Got: %s\n"
|
||||
% ip)
|
||||
return ip
|
||||
return argv[1:]
|
||||
|
||||
google_ips = None
|
||||
|
||||
def is_googlebot(ip):
|
||||
def is_googlebot(ip, timeout=55):
|
||||
import re
|
||||
|
||||
host = DNSUtils.ipToName(ip)
|
||||
timeout = float(timeout or 0)
|
||||
if timeout:
|
||||
def ipToNameTO(host, ip, timeout):
|
||||
host[0] = DNSUtils.ipToName(ip)
|
||||
host = [None]
|
||||
th = Thread(target=ipToNameTO, args=(host, ip, timeout)); th.daemon=True; th.start()
|
||||
th.join(timeout)
|
||||
host = host[0]
|
||||
else:
|
||||
host = DNSUtils.ipToName(ip)
|
||||
|
||||
if not host or not re.match(r'.*\.google(bot)?\.com$', host):
|
||||
return False
|
||||
host_ips = DNSUtils.dnsToIp(host)
|
||||
@@ -31,7 +42,7 @@ def is_googlebot(ip):
|
||||
|
||||
if __name__ == '__main__': # pragma: no cover
|
||||
try:
|
||||
ret = is_googlebot(process_args(sys.argv))
|
||||
ret = is_googlebot(*process_args(sys.argv))
|
||||
except ValueError as e:
|
||||
sys.stderr.write(str(e))
|
||||
sys.exit(2)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
[Definition]
|
||||
|
||||
failregex = ^: \((?:http|mod)_auth\.c\.\d+\) (?:password doesn\'t match .* username: .*|digest: auth failed for .*: wrong password|get_password failed), IP: <HOST>\s*$
|
||||
failregex = ^\s*(?:: )?\(?(?:http|mod)_auth\.c\.\d+\) (?:password doesn\'t match for (?:\S+|.*?) username:\s+<F-USER>(?:\S+|.*?)</F-USER>\s*|digest: auth failed(?: for\s+<F-ALT_USER>(?:\S+|.*?)</F-ALT_USER>\s*)?: (?:wrong password|uri mismatch \([^\)]*\))|get_password failed),? IP: <HOST>\s*$
|
||||
|
||||
ignoreregex =
|
||||
|
||||
|
||||
@@ -8,13 +8,17 @@
|
||||
# common.local
|
||||
before = common.conf
|
||||
|
||||
# [DEFAULT]
|
||||
# logtype = short
|
||||
|
||||
[Definition]
|
||||
|
||||
_daemon = monit
|
||||
|
||||
_prefix = Warning|HttpRequest
|
||||
|
||||
# Regexp for previous (accessing monit httpd) and new (access denied) versions
|
||||
failregex = ^\[\s*\]\s*error\s*:\s*Warning:\s+Client '<HOST>' supplied (?:unknown user '[^']+'|wrong password for user '[^']*') accessing monit httpd$
|
||||
^%(__prefix_line)s\w+: access denied -- client <HOST>: (?:unknown user '[^']+'|wrong password for user '[^']*'|empty password)$
|
||||
failregex = ^%(__prefix_line)s(?:error\s*:\s+)?(?:%(_prefix)s):\s+(?:access denied\s+--\s+)?[Cc]lient '?<HOST>'?(?:\s+supplied|\s*:)\s+(?:unknown user '<F-ALT_USER>[^']+</F-ALT_USER>'|wrong password for user '<F-USER>[^']*</F-USER>'|empty password)
|
||||
|
||||
# Ignore login with empty user (first connect, no user specified)
|
||||
# ignoreregex = %(__prefix_line)s\w+: access denied -- client <HOST>: (?:unknown user '')
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# Fail2Ban filter for Monitorix (HTTP built-in server)
|
||||
#
|
||||
|
||||
[INCLUDES]
|
||||
|
||||
before = common.conf
|
||||
|
||||
[Definition]
|
||||
|
||||
_daemon = monitorix-httpd
|
||||
|
||||
# Option: failregex
|
||||
# Notes.: regex to match the password failures messages in the logfile. The
|
||||
# host must be matched by a group named "host". The tag "<HOST>" can
|
||||
# be used for standard IP/hostname matching and is only an alias for
|
||||
# (?:::f{4,6}:)?(?P<host>\S+)
|
||||
# Values: TEXT
|
||||
#
|
||||
failregex = ^(?:\s+-)?\s*(?:NOTEXIST|AUTHERR|NOTALLOWED) - <ADDR>\b
|
||||
|
||||
# Option: ignoreregex
|
||||
# Notes.: regex to ignore. If this regex matches, the line is ignored.
|
||||
# Values: TEXT
|
||||
#
|
||||
ignoreregex =
|
||||
@@ -0,0 +1,15 @@
|
||||
# Fail2Ban filter for failed MSSQL Server authentication attempts
|
||||
|
||||
[Definition]
|
||||
|
||||
failregex = ^\s*Logon\s+Login failed for user '<F-USER>(?:[^']*|.*)</F-USER>'\. [^'\[]+\[CLIENT: <ADDR>\]$
|
||||
|
||||
|
||||
# DEV Notes:
|
||||
# Tested with SQL Server 2019 on Ubuntu 18.04
|
||||
#
|
||||
# Example:
|
||||
# 2020-02-24 14:48:55.12 Logon Login failed for user 'root'. Reason: Could not find a login matching the name provided. [CLIENT: 127.0.0.1]
|
||||
#
|
||||
# Author: Rüdiger Olschewsky
|
||||
#
|
||||
@@ -17,7 +17,7 @@ before = common.conf
|
||||
|
||||
_daemon = mysqld
|
||||
|
||||
failregex = ^%(__prefix_line)s(?:(?:\d{6}|\d{4}-\d{2}-\d{2})[ T]\s?\d{1,2}:\d{2}:\d{2} )?(?:\d+ )?\[\w+\] (?:\[[^\]]+\] )*Access denied for user '[^']+'@'<HOST>' (to database '[^']*'|\(using password: (YES|NO)\))*\s*$
|
||||
failregex = ^%(__prefix_line)s(?:(?:\d{6}|\d{4}-\d{2}-\d{2})[ T]\s?\d{1,2}:\d{2}:\d{2} )?(?:\d+ )?\[\w+\] (?:\[[^\]]+\] )*Access denied for user '<F-USER>[^']+</F-USER>'@'<HOST>' (to database '[^']*'|\(using password: (YES|NO)\))*\s*$
|
||||
|
||||
ignoreregex =
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ __daemon_combs_re=(?:%(__pid_re)s?:\s+%(__daemon_re)s|%(__daemon_re)s%(__pid_re)
|
||||
|
||||
# hostname daemon_id spaces
|
||||
# this can be optional (for instance if we match named native log files)
|
||||
__line_prefix=(?:\s\S+ %(__daemon_combs_re)s\s+)?
|
||||
__line_prefix=(?:\s*\S+ %(__daemon_combs_re)s\s+)?
|
||||
|
||||
prefregex = ^%(__line_prefix)s(?: error:)?\s*client(?: @\S*)? <HOST>#\S+(?: \([\S.]+\))?: <F-CONTENT>.+</F-CONTENT>\s(?:denied|\(NOTAUTH\))\s*$
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Fail2Ban filter to match bad requests to nginx
|
||||
#
|
||||
|
||||
[Definition]
|
||||
|
||||
# The request often doesn't contain a method, only some encoded garbage
|
||||
# This will also match requests that are entirely empty
|
||||
failregex = ^<HOST> - \S+ \[\] "[^"]*" 400
|
||||
|
||||
datepattern = {^LN-BEG}%%ExY(?P<_sep>[-/.])%%m(?P=_sep)%%d[T ]%%H:%%M:%%S(?:[.,]%%f)?(?:\s*%%z)?
|
||||
^[^\[]*\[({DATE})
|
||||
{^LN-BEG}
|
||||
|
||||
journalmatch = _SYSTEMD_UNIT=nginx.service + _COMM=nginx
|
||||
|
||||
# Author: Jan Przybylak
|
||||
@@ -17,7 +17,9 @@ datepattern = {^LN-BEG}%%ExY(?P<_sep>[-/.])%%m(?P=_sep)%%d[T ]%%H:%%M:%%S(?:[.,]
|
||||
^[^\[]*\[({DATE})
|
||||
{^LN-BEG}
|
||||
|
||||
journalmatch = _SYSTEMD_UNIT=nginx.service + _COMM=nginx
|
||||
|
||||
# DEV Notes:
|
||||
# Based on apache-botsearch filter
|
||||
#
|
||||
# Author: Frantisek Sumsal
|
||||
# Author: Frantisek Sumsal
|
||||
|
||||
@@ -3,15 +3,32 @@
|
||||
|
||||
[Definition]
|
||||
|
||||
mode = normal
|
||||
|
||||
failregex = ^ \[error\] \d+#\d+: \*\d+ user "(?:[^"]+|.*?)":? (?:password mismatch|was not found in "[^\"]*"), client: <HOST>, server: \S*, request: "\S+ \S+ HTTP/\d+\.\d+", host: "\S+"(?:, referrer: "\S+")?\s*$
|
||||
mdre-auth = ^\s*\[error\] \d+#\d+: \*\d+ user "(?:[^"]+|.*?)":? (?:password mismatch|was not found in "[^\"]*"), client: <HOST>, server: \S*, request: "\S+ \S+ HTTP/\d+\.\d+", host: "\S+"(?:, referrer: "\S+")?\s*$
|
||||
mdre-fallback = ^\s*\[crit\] \d+#\d+: \*\d+ SSL_do_handshake\(\) failed \(SSL: error:\S+(?: \S+){1,3} too (?:long|short)\)[^,]*, client: <HOST>
|
||||
|
||||
mdre-normal = %(mdre-auth)s
|
||||
mdre-aggressive = %(mdre-auth)s
|
||||
%(mdre-fallback)s
|
||||
|
||||
failregex = <mdre-<mode>>
|
||||
|
||||
ignoreregex =
|
||||
|
||||
datepattern = {^LN-BEG}
|
||||
|
||||
journalmatch = _SYSTEMD_UNIT=nginx.service + _COMM=nginx
|
||||
|
||||
# DEV NOTES:
|
||||
# mdre-auth:
|
||||
# Based on samples in https://github.com/fail2ban/fail2ban/pull/43/files
|
||||
# Extensive search of all nginx auth failures not done yet.
|
||||
#
|
||||
# Author: Daniel Black
|
||||
|
||||
# mdre-fallback:
|
||||
# Ban people checking for TLS_FALLBACK_SCSV repeatedly
|
||||
# https://stackoverflow.com/questions/28010492/nginx-critical-error-with-ssl-handshaking/28010608#28010608
|
||||
# Author: Stephan Orlowsky
|
||||
|
||||
|
||||
@@ -44,3 +44,6 @@ failregex = ^\s*\[[a-z]+\] \d+#\d+: \*\d+ limiting requests, excess: [\d\.]+ by
|
||||
ignoreregex =
|
||||
|
||||
datepattern = {^LN-BEG}
|
||||
|
||||
journalmatch = _SYSTEMD_UNIT=nginx.service + _COMM=nginx
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ _daemon = nsd
|
||||
# (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
|
||||
# Values: TEXT
|
||||
|
||||
failregex = ^%(__prefix_line)sinfo: ratelimit block .* query <HOST> TYPE255$
|
||||
^%(__prefix_line)sinfo: .* <HOST> refused, no acl matches\.$
|
||||
failregex = ^%(__prefix_line)sinfo: ratelimit block .* query <ADDR> TYPE255$
|
||||
^%(__prefix_line)sinfo: .* from(?: client)? <ADDR> refused, no acl matches\.?$
|
||||
|
||||
ignoreregex =
|
||||
|
||||
datepattern = {^LN-BEG}Epoch
|
||||
{^LN-BEG}
|
||||
{^LN-BEG}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Fail2Ban fitler for the phpMyAdmin-syslog
|
||||
# Fail2Ban filter for the phpMyAdmin-syslog
|
||||
#
|
||||
|
||||
[INCLUDES]
|
||||
|
||||
@@ -12,16 +12,15 @@ before = common.conf
|
||||
|
||||
_daemon = postfix(-\w+)?/\w+(?:/smtp[ds])?
|
||||
_port = (?::\d+)?
|
||||
_pref = [A-Z]{4}
|
||||
|
||||
prefregex = ^%(__prefix_line)s<mdpr-<mode>> <F-CONTENT>.+</F-CONTENT>$
|
||||
|
||||
mdpr-normal = (?:\w+: reject:|(?:improper command pipelining|too many errors) after \S+)
|
||||
mdre-normal=^RCPT from [^[]*\[<HOST>\]%(_port)s: 55[04] 5\.7\.1\s
|
||||
^RCPT from [^[]*\[<HOST>\]%(_port)s: 45[04] 4\.7\.\d+ (?:Service unavailable\b|Client host rejected: cannot find your (reverse )?hostname\b)
|
||||
^RCPT from [^[]*\[<HOST>\]%(_port)s: 450 4\.7\.\d+ (<[^>]*>)?: Helo command rejected: Host not found\b
|
||||
^EHLO from [^[]*\[<HOST>\]%(_port)s: 504 5\.5\.\d+ (<[^>]*>)?: Helo command rejected: need fully-qualified hostname\b
|
||||
^(RCPT|VRFY) from [^[]*\[<HOST>\]%(_port)s: 550 5\.1\.1\s
|
||||
^RCPT from [^[]*\[<HOST>\]%(_port)s: 450 4\.1\.\d+ (<[^>]*>)?: Sender address rejected: Domain not found\b
|
||||
# Extended RE for normal mode to match reject by unknown users or undeliverable address, can be set to empty to avoid this:
|
||||
exre-user = |[Uu](?:ser unknown|ndeliverable address)
|
||||
|
||||
mdpr-normal = (?:\w+: (?:milter-)?reject:|(?:improper command pipelining|too many errors) after \S+)
|
||||
mdre-normal=^%(_pref)s from [^[]*\[<HOST>\]%(_port)s: [45][50][04] [45]\.\d\.\d+ (?:(?:<[^>]*>)?: )?(?:(?:Helo command|(?:Sender|Recipient) address) rejected: )?(?:Service unavailable|(?:Client host|Command|Data command) rejected|Relay access denied|(?:Host|Domain) not found|need fully-qualified hostname|match%(exre-user)s)\b
|
||||
^from [^[]*\[<HOST>\]%(_port)s:?
|
||||
|
||||
mdpr-auth = warning:
|
||||
@@ -31,13 +30,15 @@ mdre-auth2= ^[^[]*\[<HOST>\]%(_port)s: SASL ((?i)LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5
|
||||
|
||||
# Mode "rbl" currently included in mode "normal", but if needed for jail "postfix-rbl" only:
|
||||
mdpr-rbl = %(mdpr-normal)s
|
||||
mdre-rbl = ^RCPT from [^[]*\[<HOST>\]%(_port)s: [45]54 [45]\.7\.1 Service unavailable; Client host \[\S+\] blocked\b
|
||||
mdre-rbl = ^%(_pref)s from [^[]*\[<HOST>\]%(_port)s: [45]54 [45]\.7\.1 Service unavailable; Client host \[\S+\] blocked\b
|
||||
|
||||
# Mode "rbl" currently included in mode "normal" (within 1st rule)
|
||||
mdpr-more = %(mdpr-normal)s
|
||||
mdre-more = %(mdre-normal)s
|
||||
|
||||
mdpr-ddos = lost connection after(?! DATA) [A-Z]+
|
||||
# Includes some of the log messages described in
|
||||
# <http://www.postfix.org/POSTSCREEN_README.html>.
|
||||
mdpr-ddos = (?:lost connection after(?! DATA) [A-Z]+|disconnect(?= from \S+(?: \S+=\d+)* auth=0/(?:[1-9]|\d\d+))|(?:PREGREET \d+|HANGUP) after \S+|COMMAND (?:TIME|COUNT|LENGTH) LIMIT)
|
||||
mdre-ddos = ^from [^[]*\[<HOST>\]%(_port)s:?
|
||||
|
||||
mdpr-extra = (?:%(mdpr-auth)s|%(mdpr-normal)s)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Fail2Ban fitler for the Proftpd FTP daemon
|
||||
# Fail2Ban filter for the Proftpd FTP daemon
|
||||
#
|
||||
# Set "UseReverseDNS off" in proftpd.conf to avoid the need for DNS.
|
||||
# See: http://www.proftpd.org/docs/howto/DNS.html
|
||||
@@ -14,16 +14,15 @@ before = common.conf
|
||||
|
||||
_daemon = proftpd
|
||||
|
||||
__suffix_failed_login = (User not authorized for login|No such user found|Incorrect password|Password expired|Account disabled|Invalid shell: '\S+'|User in \S+|Limit (access|configuration) denies login|Not a UserAlias|maximum login length exceeded).?
|
||||
__suffix_failed_login = ([uU]ser not authorized for login|[nN]o such user found|[iI]ncorrect password|[pP]assword expired|[aA]ccount disabled|[iI]nvalid shell: '\S+'|[uU]ser in \S+|[lL]imit (access|configuration) denies login|[nN]ot a UserAlias|[mM]aximum login length exceeded)
|
||||
|
||||
|
||||
prefregex = ^%(__prefix_line)s%(__hostname)s \(\S+\[<HOST>\]\)[: -]+ <F-CONTENT>(?:USER|SECURITY|Maximum).+</F-CONTENT>$
|
||||
prefregex = ^%(__prefix_line)s%(__hostname)s \(\S+\[<HOST>\]\)[: -]+ <F-CONTENT>(?:USER|SECURITY|Maximum) .+</F-CONTENT>$
|
||||
|
||||
|
||||
failregex = ^USER .*: no such user found from \S+ \[\S+\] to \S+:\S+ *$
|
||||
^USER .* \(Login failed\): %(__suffix_failed_login)s\s*$
|
||||
^SECURITY VIOLATION: .* login attempted\. *$
|
||||
^Maximum login attempts \(\d+\) exceeded *$
|
||||
failregex = ^USER <F-USER>\S+|.*?</F-USER>(?: \(Login failed\))?: %(__suffix_failed_login)s
|
||||
^SECURITY VIOLATION: <F-USER>\S+|.*?</F-USER> login attempted
|
||||
^Maximum login attempts \(\d+\) exceeded
|
||||
|
||||
ignoreregex =
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ prefregex = ^\s*(\[\])?(%(__hostname)s\s*(?:roundcube(?:\[(\d*)\])?:)?\s*(<[\w]+
|
||||
failregex = ^(?:FAILED login|Login failed) for <F-USER>.*</F-USER> from <HOST>(?:(?:\([^\)]*\))?\. (?:(?! from ).)*(?: user=(?P=user))? in \S+\.php on line \d+ \(\S+ \S+\))?$
|
||||
^(?:<[\w]+> )?Failed login for <F-USER>.*</F-USER> from <HOST> in session \w+( \(error: \d\))?$
|
||||
|
||||
ignoreregex = Could not connect to .* Connection refused
|
||||
ignoreregex =
|
||||
|
||||
journalmatch = SYSLOG_IDENTIFIER=roundcube
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Fail2Ban filter for port scans detected by scanlogd
|
||||
|
||||
[INCLUDES]
|
||||
|
||||
# Read common prefixes. If any customizations available -- read them from
|
||||
# common.local
|
||||
before = common.conf
|
||||
|
||||
[Definition]
|
||||
|
||||
_daemon = scanlogd
|
||||
|
||||
failregex = ^%(__prefix_line)s<ADDR>(?::<F-PORT/>)? to \S+ ports\b
|
||||
|
||||
ignoreregex =
|
||||
|
||||
# Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
|
||||
@@ -8,11 +8,14 @@ before = common.conf
|
||||
[Definition]
|
||||
|
||||
_daemon = (?:sendmail|sm-(?:mta|acceptingconnections))
|
||||
# "\w{14,20}" will give support for IDs from 14 up to 20 characters long
|
||||
__prefix_line = %(known/__prefix_line)s(?:\w{14,20}: )?
|
||||
addr = (?:IPv6:<IP6>|<IP4>)
|
||||
|
||||
# "w{14,20}" will give support for IDs from 14 up to 20 characters long
|
||||
failregex = ^%(__prefix_line)s(\S+ )?\[(?:IPv6:<IP6>|<IP4>)\]( \(may be forged\))?: possible SMTP attack: command=AUTH, count=\d+$
|
||||
prefregex = ^<F-MLFID>%(__prefix_line)s</F-MLFID><F-CONTENT>.+</F-CONTENT>$
|
||||
|
||||
failregex = ^(\S+ )?\[%(addr)s\]( \(may be forged\))?: possible SMTP attack: command=AUTH, count=\d+$
|
||||
^AUTH failure \([^\)]+\):(?: [^:]+:)? (?:authentication failure|user not found): [^,]*, user=<F-USER>(?:\S+|.*?)</F-USER>, relay=(?:\S+ )?\[%(addr)s\](?: \(may be forged\))?$
|
||||
ignoreregex =
|
||||
|
||||
journalmatch = _SYSTEMD_UNIT=sendmail.service
|
||||
|
||||
@@ -21,19 +21,20 @@ before = common.conf
|
||||
|
||||
_daemon = (?:(sm-(mta|acceptingconnections)|sendmail))
|
||||
__prefix_line = %(known/__prefix_line)s(?:\w{14,20}: )?
|
||||
addr = (?:(?:IPv6:)?<IP6>|<IP4>)
|
||||
|
||||
prefregex = ^<F-MLFID>%(__prefix_line)s</F-MLFID><F-CONTENT>.+</F-CONTENT>$
|
||||
|
||||
cmnfailre = ^ruleset=check_rcpt, arg1=(?P<email><\S+@\S+>), relay=(\S+ )?\[(?:IPv6:<IP6>|<IP4>)\](?: \(may be forged\))?, reject=(550 5\.7\.1 (?P=email)\.\.\. Relaying denied\. (IP name possibly forged \[(\d+\.){3}\d+\]|Proper authentication required\.|IP name lookup failed \[(\d+\.){3}\d+\])|553 5\.1\.8 (?P=email)\.\.\. Domain of sender address \S+ does not exist|550 5\.[71]\.1 (?P=email)\.\.\. (Rejected: .*|User unknown))$
|
||||
^ruleset=check_relay, arg1=(?P<dom>\S+), arg2=(?:IPv6:<IP6>|<IP4>), relay=((?P=dom) )?\[(\d+\.){3}\d+\](?: \(may be forged\))?, reject=421 4\.3\.2 (Connection rate limit exceeded\.|Too many open connections\.)$
|
||||
^rejecting commands from (\S* )?\[(?:IPv6:<IP6>|<IP4>)\] due to pre-greeting traffic after \d+ seconds$
|
||||
^(?:\S+ )?\[(?:IPv6:<IP6>|<IP4>)\]: (?:(?i)expn|vrfy) \S+ \[rejected\]$
|
||||
cmnfailre = ^ruleset=check_rcpt, arg1=(?P<email><\S+@\S+>), relay=(\S+ )?\[%(addr)s\](?: \(may be forged\))?, reject=(?:550 5\.7\.1(?: (?P=email)\.\.\.)?(?: Relaying denied\.)? (?:IP name possibly forged \[(\d+\.){3}\d+\]|Proper authentication required\.|IP name lookup failed \[(\d+\.){3}\d+\]|Fix reverse DNS for \S+)|553 5\.1\.8(?: (?P=email)\.\.\.)? Domain of sender address \S+ does not exist|550 5\.[71]\.1 (?P=email)\.\.\. (Rejected: .*|User unknown))$
|
||||
^ruleset=check_relay(?:, arg\d+=\S*)*, relay=(\S+ )?\[%(addr)s\](?: \(may be forged\))?, reject=421 4\.3\.2 (Connection rate limit exceeded\.|Too many open connections\.)$
|
||||
^rejecting commands from (\S* )?\[%(addr)s\] due to pre-greeting traffic after \d+ seconds$
|
||||
^(?:\S+ )?\[%(addr)s\]: (?:(?i)expn|vrfy) \S+ \[rejected\]$
|
||||
^<[^@]+@[^>]+>\.\.\. No such user here$
|
||||
^<F-NOFAIL>from=<[^@]+@[^>]+></F-NOFAIL>, size=\d+, class=\d+, nrcpts=\d+, bodytype=\w+, proto=E?SMTP, daemon=MTA, relay=\S+ \[(?:IPv6:<IP6>|<IP4>)\]$
|
||||
^<F-NOFAIL>from=<[^@]+@[^>]+></F-NOFAIL>, size=\d+, class=\d+, nrcpts=\d+, bodytype=\w+, proto=E?SMTP, daemon=MTA, relay=\S+ \[%(addr)s\]$
|
||||
|
||||
mdre-normal =
|
||||
|
||||
mdre-extra = ^(?:\S+ )?\[(?:IPv6:<IP6>|<IP4>)\](?: \(may be forged\))? did not issue (?:[A-Z]{4}[/ ]?)+during connection to (?:TLS)?M(?:TA|S[PA])(?:-\w+)?$
|
||||
mdre-extra = ^(?:\S+ )?\[%(addr)s\](?: \(may be forged\))? did not issue \S+ during connection
|
||||
|
||||
mdre-aggressive = %(mdre-extra)s
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Fail2Ban filter for SoftEtherVPN
|
||||
# Detecting unauthorized access to SoftEtherVPN
|
||||
# typically logged in /usr/local/vpnserver/security_log/*/sec.log, or in syslog, depending on configuration
|
||||
|
||||
[INCLUDES]
|
||||
before = common.conf
|
||||
|
||||
[Definition]
|
||||
failregex = ^%(__prefix_line)s(?:(?:\([\d\-]+ [\d:.]+\) )?<SECURITY_LOG>: )?Connection "[^"]+": User authentication failed. The user name that has been provided was "<F-USER>(?:[^"]+|.+)</F-USER>", from <ADDR>\.$
|
||||
+31
-14
@@ -25,7 +25,7 @@ __pref = (?:(?:error|fatal): (?:PAM: )?)?
|
||||
__suff = (?: (?:port \d+|on \S+|\[preauth\])){0,3}\s*
|
||||
__on_port_opt = (?: (?:port \d+|on \S+)){0,2}
|
||||
# close by authenticating user:
|
||||
__authng_user = (?: (?:invalid|authenticating) user <F-USER>\S+|.+?</F-USER>)?
|
||||
__authng_user = (?: (?:invalid|authenticating) user <F-USER>\S+|.*?</F-USER>)?
|
||||
|
||||
# for all possible (also future) forms of "no matching (cipher|mac|MAC|compression method|key exchange method|host key type) found",
|
||||
# see ssherr.c for all possible SSH_ERR_..._ALG_MATCH errors.
|
||||
@@ -40,39 +40,45 @@ prefregex = ^<F-MLFID>%(__prefix_line)s</F-MLFID>%(__pref)s<F-CONTENT>.+</F-CONT
|
||||
|
||||
cmnfailre = ^[aA]uthentication (?:failure|error|failed) for <F-USER>.*</F-USER> from <HOST>( via \S+)?%(__suff)s$
|
||||
^User not known to the underlying authentication module for <F-USER>.*</F-USER> from <HOST>%(__suff)s$
|
||||
^Failed publickey for invalid user <F-USER>(?P<cond_user>\S+)|(?:(?! from ).)*?</F-USER> from <HOST>%(__on_port_opt)s(?: ssh\d*)?(?(cond_user): |(?:(?:(?! from ).)*)$)
|
||||
^Failed \b(?!publickey)\S+ for (?P<cond_inv>invalid user )?<F-USER>(?P<cond_user>\S+)|(?(cond_inv)(?:(?! from ).)*?|[^:]+)</F-USER> from <HOST>%(__on_port_opt)s(?: ssh\d*)?(?(cond_user): |(?:(?:(?! from ).)*)$)
|
||||
<cmnfailre-failed-pub-<publickey>>
|
||||
^Failed <cmnfailed> for (?P<cond_inv>invalid user )?<F-USER>(?P<cond_user>\S+)|(?(cond_inv)(?:(?! from ).)*?|[^:]+)</F-USER> from <HOST>%(__on_port_opt)s(?: ssh\d*)?(?(cond_user): |(?:(?:(?! from ).)*)$)
|
||||
^<F-USER>ROOT</F-USER> LOGIN REFUSED FROM <HOST>
|
||||
^[iI](?:llegal|nvalid) user <F-USER>.*?</F-USER> from <HOST>%(__suff)s$
|
||||
^User <F-USER>.+</F-USER> from <HOST> not allowed because not listed in AllowUsers%(__suff)s$
|
||||
^User <F-USER>.+</F-USER> from <HOST> not allowed because listed in DenyUsers%(__suff)s$
|
||||
^User <F-USER>.+</F-USER> from <HOST> not allowed because not in any group%(__suff)s$
|
||||
^User <F-USER>\S+|.*?</F-USER> from <HOST> not allowed because not listed in AllowUsers%(__suff)s$
|
||||
^User <F-USER>\S+|.*?</F-USER> from <HOST> not allowed because listed in DenyUsers%(__suff)s$
|
||||
^User <F-USER>\S+|.*?</F-USER> from <HOST> not allowed because not in any group%(__suff)s$
|
||||
^refused connect from \S+ \(<HOST>\)
|
||||
^Received <F-MLFFORGET>disconnect</F-MLFFORGET> from <HOST>%(__on_port_opt)s:\s*3: .*: Auth fail%(__suff)s$
|
||||
^User <F-USER>.+</F-USER> from <HOST> not allowed because a group is listed in DenyGroups%(__suff)s$
|
||||
^User <F-USER>.+</F-USER> from <HOST> not allowed because none of user's groups are listed in AllowGroups%(__suff)s$
|
||||
^User <F-USER>\S+|.*?</F-USER> from <HOST> not allowed because a group is listed in DenyGroups%(__suff)s$
|
||||
^User <F-USER>\S+|.*?</F-USER> from <HOST> not allowed because none of user's groups are listed in AllowGroups%(__suff)s$
|
||||
^<F-NOFAIL>%(__pam_auth)s\(sshd:auth\):\s+authentication failure;</F-NOFAIL>(?:\s+(?:(?:logname|e?uid|tty)=\S*)){0,4}\s+ruser=<F-ALT_USER>\S*</F-ALT_USER>\s+rhost=<HOST>(?:\s+user=<F-USER>\S*</F-USER>)?%(__suff)s$
|
||||
^(error: )?maximum authentication attempts exceeded for <F-USER>.*</F-USER> from <HOST>%(__on_port_opt)s(?: ssh\d*)?%(__suff)s$
|
||||
^User <F-USER>.+</F-USER> not allowed because account is locked%(__suff)s
|
||||
^maximum authentication attempts exceeded for <F-USER>.*</F-USER> from <HOST>%(__on_port_opt)s(?: ssh\d*)?%(__suff)s$
|
||||
^User <F-USER>\S+|.*?</F-USER> not allowed because account is locked%(__suff)s
|
||||
^<F-MLFFORGET>Disconnecting</F-MLFFORGET>(?: from)?(?: (?:invalid|authenticating)) user <F-USER>\S+</F-USER> <HOST>%(__on_port_opt)s:\s*Change of username or service not allowed:\s*.*\[preauth\]\s*$
|
||||
^<F-MLFFORGET>Disconnecting</F-MLFFORGET>: Too many authentication failures(?: for <F-USER>.+?</F-USER>)?%(__suff)s$
|
||||
^Disconnecting: Too many authentication failures(?: for <F-USER>\S+|.*?</F-USER>)?%(__suff)s$
|
||||
^<F-NOFAIL>Received <F-MLFFORGET>disconnect</F-MLFFORGET></F-NOFAIL> from <HOST>%(__on_port_opt)s:\s*11:
|
||||
<mdre-<mode>-other>
|
||||
^<F-MLFFORGET><F-MLFGAINED>Accepted \w+</F-MLFGAINED></F-MLFFORGET> for <F-USER>\S+</F-USER> from <HOST>(?:\s|$)
|
||||
|
||||
cmnfailed-any = \S+
|
||||
cmnfailed-ignore = \b(?!publickey)\S+
|
||||
cmnfailed-invalid = <cmnfailed-ignore>
|
||||
cmnfailed-nofail = (?:<F-NOFAIL>publickey</F-NOFAIL>|\S+)
|
||||
cmnfailed = <cmnfailed-<publickey>>
|
||||
|
||||
mdre-normal =
|
||||
# used to differentiate "connection closed" with and without `[preauth]` (fail/nofail cases in ddos mode)
|
||||
mdre-normal-other = ^<F-NOFAIL><F-MLFFORGET>(Connection closed|Disconnected)</F-MLFFORGET></F-NOFAIL> (?:by|from)%(__authng_user)s <HOST>(?:%(__suff)s|\s*)$
|
||||
|
||||
mdre-ddos = ^Did not receive identification string from <HOST>
|
||||
^kex_exchange_identification: (?:[Cc]lient sent invalid protocol identifier|[Cc]onnection closed by remote host)
|
||||
^Bad protocol version identification '.*' from <HOST>
|
||||
^Connection <F-MLFFORGET>reset</F-MLFFORGET> by <HOST>
|
||||
^<F-NOFAIL>SSH: Server;Ltype:</F-NOFAIL> (?:Authname|Version|Kex);Remote: <HOST>-\d+;[A-Z]\w+:
|
||||
^Read from socket failed: Connection <F-MLFFORGET>reset</F-MLFFORGET> by peer
|
||||
# same as mdre-normal-other, but as failure (without <F-NOFAIL>) and [preauth] only:
|
||||
mdre-ddos-other = ^<F-MLFFORGET>(Connection closed|Disconnected)</F-MLFFORGET> (?:by|from)%(__authng_user)s <HOST>%(__on_port_opt)s\s+\[preauth\]\s*$
|
||||
mdre-ddos-other = ^<F-MLFFORGET>(Connection (?:closed|reset)|Disconnected)</F-MLFFORGET> (?:by|from)%(__authng_user)s <HOST>%(__on_port_opt)s\s+\[preauth\]\s*$
|
||||
|
||||
mdre-extra = ^Received <F-MLFFORGET>disconnect</F-MLFFORGET> from <HOST>%(__on_port_opt)s:\s*14: No supported authentication methods available
|
||||
mdre-extra = ^Received <F-MLFFORGET>disconnect</F-MLFFORGET> from <HOST>%(__on_port_opt)s:\s*14: No(?: supported)? authentication methods available
|
||||
^Unable to negotiate with <HOST>%(__on_port_opt)s: no matching <__alg_match> found.
|
||||
^Unable to negotiate a <__alg_match>
|
||||
^no matching <__alg_match> found:
|
||||
@@ -84,6 +90,17 @@ mdre-aggressive = %(mdre-ddos)s
|
||||
# mdre-extra-other is fully included within mdre-ddos-other:
|
||||
mdre-aggressive-other = %(mdre-ddos-other)s
|
||||
|
||||
# Parameter "publickey": nofail (default), invalid, any, ignore
|
||||
publickey = nofail
|
||||
# consider failed publickey for invalid users only:
|
||||
cmnfailre-failed-pub-invalid = ^Failed publickey for invalid user <F-USER>(?P<cond_user>\S+)|(?:(?! from ).)*?</F-USER> from <HOST>%(__on_port_opt)s(?: ssh\d*)?(?(cond_user): |(?:(?:(?! from ).)*)$)
|
||||
# consider failed publickey for valid users too (don't need RE, see cmnfailed):
|
||||
cmnfailre-failed-pub-any =
|
||||
# same as invalid, but consider failed publickey for valid users too, just as no failure (helper to get IP and user-name only, see cmnfailed):
|
||||
cmnfailre-failed-pub-nofail = <cmnfailre-failed-pub-invalid>
|
||||
# don't consider failed publickey as failures (don't need RE, see cmnfailed):
|
||||
cmnfailre-failed-pub-ignore =
|
||||
|
||||
cfooterre = ^<F-NOFAIL>Connection from</F-NOFAIL> <HOST>
|
||||
|
||||
failregex = %(cmnfailre)s
|
||||
|
||||
@@ -51,6 +51,26 @@
|
||||
|
||||
[Definition]
|
||||
|
||||
failregex = ^<HOST> \- (?!- )\S+ \[\] \"(GET|POST|HEAD) [^\"]+\" 401\b
|
||||
# Parameter "method" can be used to specifiy request method
|
||||
req-method = \S+
|
||||
# Usage example (for jail.local):
|
||||
# filter = traefik-auth[req-method="GET|POST|HEAD"]
|
||||
|
||||
failregex = ^<HOST> \- <usrre-<mode>> \[\] \"(?:<req-method>) [^\"]+\" 401\b
|
||||
|
||||
ignoreregex =
|
||||
|
||||
# Parameter "mode": normal (default), ddos or aggressive
|
||||
# Usage example (for jail.local):
|
||||
# [traefik-auth]
|
||||
# mode = aggressive
|
||||
# # or another jail (rewrite filter parameters of jail):
|
||||
# [traefik-auth-ddos]
|
||||
# filter = traefik-auth[mode=ddos]
|
||||
#
|
||||
mode = normal
|
||||
|
||||
# part of failregex matches user name (must be available in normal mode, must be empty in ddos mode, and both for aggressive mode):
|
||||
usrre-normal = (?!- )<F-USER>\S+</F-USER>
|
||||
usrre-ddos = -
|
||||
usrre-aggressive = <F-USER>\S+</F-USER>
|
||||
@@ -5,17 +5,23 @@ before = apache-common.conf
|
||||
|
||||
[Definition]
|
||||
|
||||
# pattern: [Wed Apr 27 23:12:07.736196 2016] [:error] [pid 2460] [client 10.1.1.1:47296] WAR [Login denied for user "test"], referer: https://zoneminderurl/index.php
|
||||
#
|
||||
# patterns: [Mon Mar 28 16:50:49.522240 2016] [:error] [pid 1795] [client 10.1.1.1:50700] WAR [Login denied for user "username1"], referer: https://zoneminder/
|
||||
# [Sun Mar 28 16:53:00.472693 2021] [php7:notice] [pid 11328] [client 10.1.1.1:39568] ERR [Could not retrieve user test details], referer: https://zm/
|
||||
# [Sun Mar 28 16:59:14.150625 2021] [php7:notice] [pid 11336] [client 10.1.1.1:39654] ERR [Login denied for user "john"], referer: https://zm/
|
||||
#
|
||||
# Option: failregex
|
||||
# Notes.: regex to match the password failure messages in the logfile.
|
||||
# Notes.: regex to match the login failure and non-existent user error messages in the logfile.
|
||||
|
||||
failregex = ^%(_apache_error_client)s WAR \[Login denied for user "[^"]*"\]
|
||||
prefregex = ^%(_apache_error_client)s (?:ERR|WAR) <F-CONTENT>\[(?:Login denied|Could not retrieve).*</F-CONTENT>$
|
||||
|
||||
failregex = ^\[Login denied for user "<F-USER>[^"]*</F-USER>"\]
|
||||
^\[Could not retrieve user <F-USER>\S*</F-USER>
|
||||
|
||||
ignoreregex =
|
||||
|
||||
# Notes:
|
||||
# Tested on Zoneminder 1.29.0
|
||||
# Tested on Zoneminder 1.29 and 1.35.21
|
||||
#
|
||||
# Zoneminder versions > 1.3x use "ERR" and < 1.3x use "WAR" level logs, so i've kept both for compatibility reasons
|
||||
#
|
||||
# Author: John Marzella
|
||||
|
||||
+69
-42
@@ -52,7 +52,7 @@ before = paths-debian.conf
|
||||
# to prevent "clever" botnets calculate exact time IP can be unbanned again:
|
||||
#bantime.rndtime =
|
||||
|
||||
# "bantime.maxtime" is the max number of seconds using the ban time can reach (don't grows further)
|
||||
# "bantime.maxtime" is the max number of seconds using the ban time can reach (doesn't grow further)
|
||||
#bantime.maxtime =
|
||||
|
||||
# "bantime.factor" is a coefficient to calculate exponent growing of the formula or common multiplier,
|
||||
@@ -60,14 +60,14 @@ before = paths-debian.conf
|
||||
# grows by 1, 2, 4, 8, 16 ...
|
||||
#bantime.factor = 1
|
||||
|
||||
# "bantime.formula" used by default to calculate next value of ban time, default value bellow,
|
||||
# "bantime.formula" used by default to calculate next value of ban time, default value below,
|
||||
# the same ban time growing will be reached by multipliers 1, 2, 4, 8, 16, 32...
|
||||
#bantime.formula = ban.Time * (1<<(ban.Count if ban.Count<20 else 20)) * banFactor
|
||||
#
|
||||
# more aggressive example of formula has the same values only for factor "2.0 / 2.885385" :
|
||||
#bantime.formula = ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)
|
||||
|
||||
# "bantime.multipliers" used to calculate next value of ban time instead of formula, coresponding
|
||||
# "bantime.multipliers" used to calculate next value of ban time instead of formula, corresponding
|
||||
# previously ban count and given "bantime.factor" (for multipliers default is 1);
|
||||
# following example grows ban time by 1, 2, 4, 8, 16 ... and if last ban count greater as multipliers count,
|
||||
# always used last multiplier (64 in example), for factor '1' and original ban time 600 - 10.6 hours
|
||||
@@ -77,7 +77,7 @@ before = paths-debian.conf
|
||||
#bantime.multipliers = 1 5 30 60 300 720 1440 2880
|
||||
|
||||
# "bantime.overalljails" (if true) specifies the search of IP in the database will be executed
|
||||
# cross over all jails, if false (dafault), only current jail of the ban IP will be searched
|
||||
# cross over all jails, if false (default), only current jail of the ban IP will be searched
|
||||
#bantime.overalljails = false
|
||||
|
||||
# --------------------
|
||||
@@ -209,28 +209,37 @@ banaction = iptables-multiport
|
||||
banaction_allports = iptables-allports
|
||||
|
||||
# The simplest action to take: ban only
|
||||
action_ = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
action_ = %(banaction)s[port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
|
||||
# ban & send an e-mail with whois report to the destemail.
|
||||
action_mw = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
%(mta)s-whois[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
action_mw = %(action_)s
|
||||
%(mta)s-whois[sender="%(sender)s", dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
|
||||
# ban & send an e-mail with whois report and relevant log lines
|
||||
# to the destemail.
|
||||
action_mwl = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
%(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath="%(logpath)s", chain="%(chain)s"]
|
||||
action_mwl = %(action_)s
|
||||
%(mta)s-whois-lines[sender="%(sender)s", dest="%(destemail)s", logpath="%(logpath)s", chain="%(chain)s"]
|
||||
|
||||
# See the IMPORTANT note in action.d/xarf-login-attack for when to use this action
|
||||
#
|
||||
# ban & send a xarf e-mail to abuse contact of IP address and include relevant log lines
|
||||
# to the destemail.
|
||||
action_xarf = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
action_xarf = %(action_)s
|
||||
xarf-login-attack[service=%(__name__)s, sender="%(sender)s", logpath="%(logpath)s", port="%(port)s"]
|
||||
|
||||
# ban & send a notification to one or more of the 50+ services supported by Apprise.
|
||||
# See https://github.com/caronc/apprise/wiki for details on what is supported.
|
||||
#
|
||||
# You may optionally over-ride the default configuration line (containing the Apprise URLs)
|
||||
# by using 'apprise[config="/alternate/path/to/apprise.cfg"]' otherwise
|
||||
# /etc/fail2ban/apprise.conf is sourced for your supported notification configuration.
|
||||
# action = %(action_)s
|
||||
# apprise
|
||||
|
||||
# ban IP on CloudFlare & send an e-mail with whois report and relevant log lines
|
||||
# to the destemail.
|
||||
action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"]
|
||||
%(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath="%(logpath)s", chain="%(chain)s"]
|
||||
%(mta)s-whois-lines[sender="%(sender)s", dest="%(destemail)s", logpath="%(logpath)s", chain="%(chain)s"]
|
||||
|
||||
# Report block via blocklist.de fail2ban reporting service API
|
||||
#
|
||||
@@ -240,21 +249,7 @@ action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"]
|
||||
# in your `jail.local` globally (section [DEFAULT]) or per specific jail section (resp. in
|
||||
# corresponding jail.d/my-jail.local file).
|
||||
#
|
||||
action_blocklist_de = blocklist_de[email="%(sender)s", service=%(filter)s, apikey="%(blocklist_de_apikey)s", agent="%(fail2ban_agent)s"]
|
||||
|
||||
# Report ban via badips.com, and use as blacklist
|
||||
#
|
||||
# See BadIPsAction docstring in config/action.d/badips.py for
|
||||
# documentation for this action.
|
||||
#
|
||||
# NOTE: This action relies on banaction being present on start and therefore
|
||||
# should be last action defined for a jail.
|
||||
#
|
||||
action_badips = badips.py[category="%(__name__)s", banaction="%(banaction)s", agent="%(fail2ban_agent)s"]
|
||||
#
|
||||
# Report ban via badips.com (uses action.d/badips.conf for reporting only)
|
||||
#
|
||||
action_badips_report = badips[category="%(__name__)s", agent="%(fail2ban_agent)s"]
|
||||
action_blocklist_de = blocklist_de[email="%(sender)s", service="%(__name__)s", apikey="%(blocklist_de_apikey)s", agent="%(fail2ban_agent)s"]
|
||||
|
||||
# Report ban via abuseipdb.com.
|
||||
#
|
||||
@@ -371,12 +366,15 @@ maxretry = 1
|
||||
[openhab-auth]
|
||||
|
||||
filter = openhab
|
||||
action = iptables-allports[name=NoAuthFailures]
|
||||
banaction = %(banaction_allports)s
|
||||
logpath = /opt/openhab/logs/request.log
|
||||
|
||||
|
||||
# To use more aggressive http-auth modes set filter parameter "mode" in jail.local:
|
||||
# normal (default), aggressive (combines all), auth or fallback
|
||||
# See "tests/files/logs/nginx-http-auth" or "filter.d/nginx-http-auth.conf" for usage example and details.
|
||||
[nginx-http-auth]
|
||||
|
||||
# mode = normal
|
||||
port = http,https
|
||||
logpath = %(nginx_error_log)s
|
||||
|
||||
@@ -392,8 +390,10 @@ logpath = %(nginx_error_log)s
|
||||
|
||||
port = http,https
|
||||
logpath = %(nginx_error_log)s
|
||||
maxretry = 2
|
||||
|
||||
[nginx-bad-request]
|
||||
port = http,https
|
||||
logpath = %(nginx_access_log)s
|
||||
|
||||
# Ban attackers that try to use PHP's URL-fopen() functionality
|
||||
# through GET/POST variables. - Experimental, with more than a year
|
||||
@@ -478,6 +478,7 @@ backend = %(syslog_backend)s
|
||||
|
||||
port = http,https
|
||||
logpath = /var/log/tomcat*/catalina.out
|
||||
#logpath = /var/log/guacamole.log
|
||||
|
||||
[monit]
|
||||
#Ban clients brute-forcing the monit gui login
|
||||
@@ -744,8 +745,8 @@ logpath = /var/log/named/security.log
|
||||
[nsd]
|
||||
|
||||
port = 53
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
action_ = %(default/action_)s[name=%(__name__)s-tcp, protocol="tcp"]
|
||||
%(default/action_)s[name=%(__name__)s-udp, protocol="udp"]
|
||||
logpath = /var/log/nsd.log
|
||||
|
||||
|
||||
@@ -756,9 +757,8 @@ logpath = /var/log/nsd.log
|
||||
[asterisk]
|
||||
|
||||
port = 5060,5061
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
|
||||
action_ = %(default/action_)s[name=%(__name__)s-tcp, protocol="tcp"]
|
||||
%(default/action_)s[name=%(__name__)s-udp, protocol="udp"]
|
||||
logpath = /var/log/asterisk/messages
|
||||
maxretry = 10
|
||||
|
||||
@@ -766,9 +766,8 @@ maxretry = 10
|
||||
[freeswitch]
|
||||
|
||||
port = 5060,5061
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
|
||||
action_ = %(default/action_)s[name=%(__name__)s-tcp, protocol="tcp"]
|
||||
%(default/action_)s[name=%(__name__)s-udp, protocol="udp"]
|
||||
logpath = /var/log/freeswitch.log
|
||||
maxretry = 10
|
||||
|
||||
@@ -798,6 +797,14 @@ logpath = %(mysql_log)s
|
||||
backend = %(mysql_backend)s
|
||||
|
||||
|
||||
[mssql-auth]
|
||||
# Default configuration for Microsoft SQL Server for Linux
|
||||
# See the 'mssql-conf' manpage how to change logpath or port
|
||||
logpath = /var/opt/mssql/log/errorlog
|
||||
port = 1433
|
||||
filter = mssql-auth
|
||||
|
||||
|
||||
# Log wrong MongoDB auth (for details see filter 'filter.d/mongodb-auth.conf')
|
||||
[mongodb-auth]
|
||||
# change port when running with "--shardsvr" or "--configsvr" runtime operation
|
||||
@@ -853,11 +860,23 @@ logpath = /var/log/ejabberd/ejabberd.log
|
||||
[counter-strike]
|
||||
|
||||
logpath = /opt/cstrike/logs/L[0-9]*.log
|
||||
# Firewall: http://www.cstrike-planet.com/faq/6
|
||||
tcpport = 27030,27031,27032,27033,27034,27035,27036,27037,27038,27039
|
||||
udpport = 1200,27000,27001,27002,27003,27004,27005,27006,27007,27008,27009,27010,27011,27012,27013,27014,27015
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(tcpport)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(udpport)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
action_ = %(default/action_)s[name=%(__name__)s-tcp, port="%(tcpport)s", protocol="tcp"]
|
||||
%(default/action_)s[name=%(__name__)s-udp, port="%(udpport)s", protocol="udp"]
|
||||
|
||||
[softethervpn]
|
||||
port = 500,4500
|
||||
protocol = udp
|
||||
logpath = /usr/local/vpnserver/security_log/*/sec.log
|
||||
|
||||
[gitlab]
|
||||
port = http,https
|
||||
logpath = /var/log/gitlab/gitlab-rails/application.log
|
||||
|
||||
[grafana]
|
||||
port = http,https
|
||||
logpath = /var/log/grafana/grafana.log
|
||||
|
||||
[bitwarden]
|
||||
port = http,https
|
||||
@@ -909,8 +928,8 @@ findtime = 1
|
||||
[murmur]
|
||||
# AKA mumble-server
|
||||
port = 64738
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol=tcp, chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol=udp, chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
action_ = %(default/action_)s[name=%(__name__)s-tcp, protocol="tcp"]
|
||||
%(default/action_)s[name=%(__name__)s-udp, protocol="udp"]
|
||||
logpath = /var/log/mumble-server/mumble-server.log
|
||||
|
||||
|
||||
@@ -951,3 +970,11 @@ logpath = %(apache_error_log)s
|
||||
# see `filter.d/traefik-auth.conf` for details and service example.
|
||||
port = http,https
|
||||
logpath = /var/log/traefik/access.log
|
||||
|
||||
[scanlogd]
|
||||
logpath = %(syslog_local0)s
|
||||
banaction = %(banaction_allports)s
|
||||
|
||||
[monitorix]
|
||||
port = 8080
|
||||
logpath = /var/log/monitorix-httpd
|
||||
|
||||
@@ -26,3 +26,5 @@ exim_main_log = /var/log/exim4/mainlog
|
||||
# was in debian squeezy but not in wheezy
|
||||
# /etc/proftpd/proftpd.conf (SystemLog)
|
||||
proftpd_log = /var/log/proftpd/proftpd.log
|
||||
|
||||
roundcube_errors_log = /var/log/roundcube/errors.log
|
||||
|
||||
Vendored
-91
@@ -1,91 +0,0 @@
|
||||
fail2ban (0.10.2-1) unstable; urgency=medium
|
||||
|
||||
This version is a major development leap forward to provide
|
||||
IPv6 support, which also required extensions to the configuration
|
||||
system. That is why it is not unlikely that configuration left from the
|
||||
previous version(s) would either not work or would not work as intended.
|
||||
|
||||
You are advised to accept new configuration and adjust it for your
|
||||
customizations (if any). See changelog.Debian.gz for more information.
|
||||
|
||||
-- Yaroslav Halchenko <debian@onerussian.com> Sun, 21 Jan 2018 22:25:26 -0500
|
||||
|
||||
fail2ban (0.9.0+git48-gabcab00-1) experimental; urgency=low
|
||||
|
||||
[ Yaroslav Halchenko ]
|
||||
* This version went through big refactoring which allowed to gain new
|
||||
features such as multiline matching (see upstream's changelog for more
|
||||
information).
|
||||
* Although .local files are still supported, customizations are advised
|
||||
to be provided under corresponding .d/ directories. E.g. see
|
||||
/etc/fail2ban/jail.d/defaults-debian.conf which is where now sshd
|
||||
jail is enabled by default to match previous behavior of Fail2Ban in
|
||||
Debian.
|
||||
|
||||
[ Daniel Schaal ]
|
||||
* All jails definitions were rewritten to become more concise and uniform.
|
||||
From this version on log paths are defined in distro specific files,
|
||||
for Debian this is in /etc/fail2ban/paths-debian.conf.
|
||||
|
||||
-- Yaroslav Halchenko <debian@onerussian.com> Tue, 25 Mar 2014 08:38:31 -0400
|
||||
|
||||
fail2ban (0.8.11-1) unstable; urgency=low
|
||||
|
||||
* retroactive for 0.8.9: by default iptables-* actions do not simply
|
||||
DROP packets from offending IP but rather reject with
|
||||
icmp-port-unreachable. If DROP behaviour is preferable, provide
|
||||
config/action.d/iptables-blocktype.local with [Init] section defining
|
||||
blocktype = DROP or override action definition to provide
|
||||
blocktype=DROP option in jail.local
|
||||
* Many failregex's were tight-up in this release which could
|
||||
theoretically effect operation in comparison to previous release(s).
|
||||
|
||||
-- Yaroslav Halchenko <debian@onerussian.com> Sat, 16 Nov 2013 22:27:50 -0500
|
||||
|
||||
fail2ban (0.8.4-3) unstable; urgency=low
|
||||
|
||||
* Jail named-refused-udp is unsafe and opens possibility for easy DoS,
|
||||
thus discouraged to be used, and commented out (see #583364 for more
|
||||
information).
|
||||
|
||||
-- Yaroslav Halchenko <debian@onerussian.com> Mon, 28 Jun 2010 22:12:22 -0400
|
||||
|
||||
fail2ban (0.7.1-0.2) unstable; urgency=low
|
||||
|
||||
fail2ban 0.7 is a complete rewrite of the 0.6 version, and if you
|
||||
customized any of provided configuration or startup files
|
||||
(/etc/default/fail2ban, /etc/fail2ban.conf, /etc/init.d/fail2ban),
|
||||
please read further. The configuration scheme has changed upstream:
|
||||
0.7 ignores /etc/fail2ban.conf and instead uses a split configuration
|
||||
under /etc/fail2ban/. To retain your customizations, for example to
|
||||
monitor anything other than sshd, you will need to set them under that
|
||||
new directory; use *.local files for customizations. Please see
|
||||
/usr/share/doc/fail2ban/README.Debian.gz and
|
||||
http://fail2ban.sourceforge.net for further description of new
|
||||
configuration scheme. Detailed documentation is under development (see
|
||||
#400416). When you are satisfied with the new settings, please delete
|
||||
/etc/fail2ban.conf to avoid confusion.
|
||||
|
||||
Fail2ban 0.7 uses client/server architecture and fail2ban-client is to
|
||||
substitute fail2ban command to provide an interface between the user and
|
||||
fail2ban-server. That is why some command line parameters present in
|
||||
fail2ban 0.6 are invalid in fail2ban-client. Such change affects
|
||||
/etc/default/fail2ban; you should review that file if you customized it.
|
||||
Please enable sections as directed in README.Debian.gz mentioned above.
|
||||
You must use newly shipped init.d/fail2ban, or otherwise fail2ban will
|
||||
not start.
|
||||
|
||||
This note was rewritten in release 0.7.5-2 to clarify its meaning.
|
||||
|
||||
-- Yaroslav Halchenko <debian@onerussian.com> Sat, 9 Dec 2006 18:24:36 -0500
|
||||
|
||||
fail2ban (0.6.0-4) unstable; urgency=low
|
||||
|
||||
In this version the new section ApacheAttacks was introduced to ban IPs
|
||||
which are found to run some known attack on the host. For now it captures
|
||||
just awstats and mambo related attacks. To make this feature work, the bug of
|
||||
wrongly specified timeregexp for Apache's access.log file was fixed.
|
||||
Besides that group of log files has changed to be adm, and now they are
|
||||
readable by the group.
|
||||
|
||||
-- Yaroslav Halchenko <debian@onerussian.com> Fri, 10 Feb 2006 13:05:07 -0500
|
||||
Vendored
-251
@@ -1,251 +0,0 @@
|
||||
fail2ban (>=0.7.0) for Debian
|
||||
-----------------------------
|
||||
|
||||
This package is ~99% identical to the upstream version. Few features
|
||||
could have been added but not yet propagated into upstream version and
|
||||
some modifications might be Debian-specific. Debian specific jail.conf
|
||||
file is shipped. Original upstream file is available from
|
||||
/usr/share/doc/fail2ban/examples/jail.conf
|
||||
|
||||
Currently, the major difference with upstream: python libraries are
|
||||
placed under /usr/share/fail2ban instead of /usr/lib/fail2ban to
|
||||
comply with policy regarding architecture independent resources.
|
||||
|
||||
fail2ban supports both nftables and iptables.
|
||||
|
||||
Shorewall and startup sequence (#847728)
|
||||
----------------------------------------
|
||||
|
||||
If you are using systemd, create a
|
||||
/etc/systemd/system/fail2ban.service.d/override.conf with contents:
|
||||
|
||||
[Unit]
|
||||
Requires=shorewall.service
|
||||
After=shorewall.service
|
||||
|
||||
go guarantee a proper sequence of startup/shutdown (shorewall should
|
||||
be started before fail2ban, and stopped after). Similar settings
|
||||
could be adopted for other firewall solutions.
|
||||
|
||||
|
||||
Upgrade from 0.6 versions:
|
||||
-------------------------
|
||||
|
||||
* New Config Files Format:
|
||||
|
||||
If you had introduced your own sections in /etc/fail2ban.conf, you
|
||||
would need manually to convert them into a new format. At minimum you
|
||||
need to create /etc/fail2ban/filter.d/NAME.local (leave .conf files
|
||||
for me and upstream please to avoid any conflicts -- introduce your
|
||||
changes in .local) with failregex in [Definition] section. And provide
|
||||
appropriate jail definition in /etc/fail2ban/jail.local
|
||||
|
||||
|
||||
* Enabled Sections:
|
||||
|
||||
Only handling of ssh files is enabled by default. If you want to use
|
||||
fail2ban with apache, please enable apache section manually in
|
||||
/etc/fail2ban/jail.local by including next lines:
|
||||
|
||||
[apache]
|
||||
enabled = true
|
||||
|
||||
NOTE: -e command line parameter is non existent in 0.7.x
|
||||
|
||||
|
||||
* Interpolations vs actions/filters parameters:
|
||||
|
||||
For details see #398739 or wait for a closure of #400416
|
||||
|
||||
Every pair of .conf and then .local (if exists) files is read
|
||||
separately from any other configuration file, so interpolations cannot
|
||||
penetrate from jail.* into actions.d/*. To overcome this, it is
|
||||
necessary to create a PARAMETER which can be substituted in actions
|
||||
[Definition] section, if it is also defined in the [Init] section of
|
||||
that file and is used in place of necessary allocation as <PARAMETER>
|
||||
tag. Parameters can be specified in the definitions within
|
||||
jail.{conf,local}. For instance, 1 lengthy example, where the same
|
||||
name "fwchain" is used both as interpolation (in jail.local) and as a
|
||||
parameter (in iptables-flex.local) (from #398739)
|
||||
|
||||
==> /etc/fail2ban/jail.local <==
|
||||
[DEFAULT]
|
||||
action = iptables-flex[name=%(__name__)s, port=%(port)s, fwchain=%(fwchain)s, post_start_commands=%(post_start_commands)s, pre_end_commands=%(pre_end_commands)s]
|
||||
fwchain = INPUT
|
||||
[ssh]
|
||||
fwchain = ssh-tarpit
|
||||
==> /etc/fail2ban/action.d/iptables-flex.local <==
|
||||
[Definition]
|
||||
actionstart = iptables -N fail2ban-<name>
|
||||
iptables -I <fwchain> -m state --state NEW -p <protocol> --dport <port> -j fail2ban-<name>
|
||||
iptables -I <fwchain> -j <whitelist>
|
||||
actionstop = iptables -D <fwchain> -j <whitelist>
|
||||
iptables -D <fwchain> -m state --state NEW -p <protocol> --dport <port> -j fail2ban-<name>
|
||||
iptables -F fail2ban-<name>
|
||||
iptables -X fail2ban-<name>
|
||||
actioncheck = iptables -n -L <fwchain> | grep -q fail2ban-<name>
|
||||
actionban = iptables -I fail2ban-<name> 1 -s <ip> -j DROP
|
||||
actionunban = iptables -D fail2ban-<name> -s <ip> -j DROP
|
||||
[Init]
|
||||
whitelist = ssh-whitelist
|
||||
fwchain = INPUT
|
||||
name = default
|
||||
port = ssh
|
||||
protocol = tcp
|
||||
|
||||
|
||||
* Multiport banning: Comment for #373592, #545971
|
||||
|
||||
iptables-multiport action is now default banaction (file jail.conf, to
|
||||
be customized within jail.local). Therefore assure that you have built
|
||||
multiport module if you use custom kernel.
|
||||
|
||||
If you would like to ban all ports for that host, just redefine
|
||||
fwban/fwunban commands to don't have --dport %(port)s statement at
|
||||
all, or use shorewall, where actionban bans whole IP.
|
||||
|
||||
* Blocking of NEW connections only
|
||||
Comment for the wishlist #350746.
|
||||
|
||||
It might be benefitial in some cases to ban only new connections. For
|
||||
that just use iptables-new action instead of default banaction
|
||||
|
||||
/etc/fail2ban/jail.local:
|
||||
|
||||
[DEFAULT]
|
||||
banaction=iptables-new
|
||||
|
||||
(you can override banaction within interesting for you section).
|
||||
Also you can redefine the whole action parameter if you like.
|
||||
|
||||
|
||||
* Interaction with ipmasq
|
||||
Comment to #461417
|
||||
|
||||
Although fail2ban should detect and recreate missing chains if the external
|
||||
command wipes out iptables, it is better to explicitly to force-reload
|
||||
fail2ban. For this reason there is examples/ipmasq-ZZZzzz|fail2ban.rul file is
|
||||
shipped along to be installed under name ZZZzzz|fail2ban.rul within
|
||||
/etc/ipmasq.
|
||||
|
||||
* Interaction with logrotate with custom logtarget
|
||||
Comment to #631917
|
||||
|
||||
if you use an alternative logtarget (e.g. SYSLOG) thus not using
|
||||
/var/log/fail2ban.log you should divert logrotate configuration into
|
||||
a disabled state, e.g.
|
||||
|
||||
sudo dpkg-divert --rename --divert \
|
||||
/etc/logrotate.d/fail2ban.disabled /etc/logrotate.d/fail2ban
|
||||
|
||||
|
||||
Troubleshooting:
|
||||
---------------
|
||||
|
||||
* Updated failregex:
|
||||
|
||||
To resolve the security bug #330827 [1] failregex expressions must
|
||||
provide a named group (?P<host>...) as a placeholder of the abuser's
|
||||
host. Alternative tag (since 0.7.5) can be "<HOST>". The naming of the
|
||||
group was introduced to capture possible future generalizations of
|
||||
failregex to provide even more information.
|
||||
|
||||
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=330827
|
||||
|
||||
You might benefit from using fail2ban-regex command shipped along to
|
||||
construct and debug your failregex statements.
|
||||
|
||||
* "Interpolations" in the config file:
|
||||
|
||||
Since version 0.6.0-3 to reduce duplication, thus to improve
|
||||
readability of the config file, interpolations provided by the module
|
||||
ConfigParser are used. If you had custom sections defined before, you
|
||||
might benefit from updating config file and adding appropriate
|
||||
information for the new sections.
|
||||
|
||||
N.B. If you have some nice additional sections defined, I would really
|
||||
appreciate if you share them with me or upstream author, so they could
|
||||
be eventually included in the fail2ban package for general use by the
|
||||
rest of the community.
|
||||
|
||||
|
||||
* Mailing:
|
||||
|
||||
Since actions.d/mail*.conf commands rely on presence of "mail"
|
||||
command, mailx package (or another package providing mailx
|
||||
functionality such as mailutils) is required if those actions are
|
||||
activated in jail.{conf,local}.
|
||||
|
||||
|
||||
* Dirty exit:
|
||||
|
||||
If firewall rules gets cleaned out before fail2ban exits (like was
|
||||
happening with firestarter), errors get reported during the exit of
|
||||
fail2ban, but they are "safe" and can be ignored.
|
||||
|
||||
|
||||
** SSHD Configuration Specific Problems
|
||||
|
||||
* Ban "Not allowed" attempts:
|
||||
|
||||
Make sure that you have
|
||||
ChallengeResponseAuthentication no
|
||||
PasswordAuthentication yes
|
||||
|
||||
Details from the bug report #350980 [2]
|
||||
|
||||
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=350980
|
||||
|
||||
|
||||
* Not caught attempts to login as root
|
||||
|
||||
On the boxes running older versions of openssh (e.g. sarge
|
||||
distribution) in the case when PermitRootLogin is set to something
|
||||
else than "yes" and iff AllowUsers is active, failed root logins do
|
||||
not confirm to the standard logging message -- they omit the source
|
||||
IP, thus allowing attack to persist since such messages are not caught
|
||||
by fail2ban.
|
||||
|
||||
|
||||
* Bantime:
|
||||
|
||||
An IP is banned for "bantime" not since the last failed login attempt
|
||||
from the IP, but rather since the moment when failed login was
|
||||
detected by fail2ban. Thus, if fail2ban gets [re]started, any IP which
|
||||
had enough of failed logins with durations less than "findtime" between
|
||||
them prior to the [re]start moment, will be banned for
|
||||
"bantime" since [re]start moment, not since the last failed login
|
||||
time.
|
||||
|
||||
* Findtime:
|
||||
|
||||
"Findtime" option of a jail actually defines a duration to reset the
|
||||
counter of failed login attempts, if no new attempt was detected within
|
||||
that time frame (i.e. within "findtime").
|
||||
|
||||
See
|
||||
http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Jail_Options
|
||||
for more information on jail options.
|
||||
|
||||
|
||||
* Syslog entries can be 'forged' by a regular user
|
||||
|
||||
From
|
||||
http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Possibility_of_DOS_attack_by_a_local_user
|
||||
|
||||
Especially on systems which provide ssh/CGI/PHP services to unknown
|
||||
users it is possible to block other users from ssh and probably other
|
||||
access as a unprivileged user may issue:
|
||||
|
||||
logger -p auth.warning -t 'sshd[123]' 'Illegal user user1 from 1.2.3.4'
|
||||
|
||||
N.B. chmod o-x /usr/bin/logger should provide at least obfuscation
|
||||
solution
|
||||
|
||||
Or the malicious user may write via PHP's openlog()/syslog() to syslog.
|
||||
|
||||
P.S. Anyone is welcome to recommend proper security solution to this
|
||||
issue, such as an alternative to sysklogd which allows better control
|
||||
over users logging to specific facilities (such as AUTH)
|
||||
|
||||
-- Yaroslav Halchenko <debian@onerussian.com>, Mon, 22 Jan 2018 10:37:00 -0500
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
* completions installation
|
||||
|
||||
W: fail2ban: package-installs-into-obsolete-dir etc/bash_completion.d/ : ^etc/bash_completion.d/ -> usr/share/bash-completion/completions (see also https://bugs.debian.org/776954)
|
||||
W: fail2ban: package-installs-into-obsolete-dir etc/bash_completion.d/fail2ban : ^etc/bash_completion.d/ -> usr/share/bash-completion/completions (see also https://bugs.debian.org/776954)
|
||||
|
||||
* Find proper answer to "Syslog entries can be 'forged' by a regular
|
||||
user" mentioned in README.Debian
|
||||
|
||||
-- Yaroslav O. Halchenko <debian@onerussian.com> Wed, 6 Dec 2006 22:14:26 -0500
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
nopycentral.patch
|
||||
Vendored
-40
@@ -1,40 +0,0 @@
|
||||
diff -x '*~' -x .svn -Naur trunk/debian/control trunk.backports/debian/control
|
||||
--- trunk/debian/control 2006-10-23 00:57:02.000000000 -0400
|
||||
+++ trunk.backports/debian/control 2006-12-04 08:45:25.000000000 -0500
|
||||
@@ -4,13 +4,13 @@
|
||||
Maintainer: Yaroslav Halchenko <debian@onerussian.com>
|
||||
Uploaders: Barak Pearlmutter <bap@debian.org>
|
||||
Build-Depends: debhelper (>= 5.0.37.2), dpatch
|
||||
-Build-Depends-Indep: python, python-dev, help2man, python-central (>= 0.5.6)
|
||||
+Build-Depends-Indep: python, python2.4, python2.4-dev, help2man
|
||||
XS-Python-Version: current, >= 2.4
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
Package: fail2ban
|
||||
Architecture: all
|
||||
-Depends: ${python:Depends}, iptables, lsb-base (>=2.0-7)
|
||||
+Depends: python2.4, iptables, lsb-base (>=2.0-7)
|
||||
Suggests: python-gamin
|
||||
XB-Python-Version: ${python:Versions}
|
||||
Description: bans IPs that cause multiple authentication errors
|
||||
diff -x '*~' -x .svn -Naur trunk/debian/rules trunk.backports/debian/rules
|
||||
--- trunk/debian/rules 2006-11-11 21:19:14.000000000 -0500
|
||||
+++ trunk.backports/debian/rules 2006-12-04 08:45:45.000000000 -0500
|
||||
@@ -39,7 +39,7 @@
|
||||
dh_installdirs
|
||||
|
||||
# Add here commands to install the package into debian/fail2ban.
|
||||
- python setup.py install --root=$(DESTDIR) --no-compile
|
||||
+ python2.4 setup.py install --root=$(DESTDIR) --no-compile
|
||||
#X Evil - must be removed after Debian switches over to 2.4, now
|
||||
# distutils.setup will override the enterpreter line to /usr/bin/python
|
||||
install fail2ban-server fail2ban-client $(DESTDIR)/usr/bin
|
||||
@@ -62,7 +62,7 @@
|
||||
dh_installlogrotate
|
||||
dh_installinit -- defaults 99
|
||||
dh_installman man/*.1
|
||||
- dh_pycentral
|
||||
+ dh_python
|
||||
dh_link
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
Vendored
-1395
File diff suppressed because it is too large
Load Diff
Vendored
-48
@@ -1,48 +0,0 @@
|
||||
Source: fail2ban
|
||||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: Debian Python Team <team+python@tracker.debian.org>
|
||||
Uploaders: Yaroslav Halchenko <debian@onerussian.com>,
|
||||
Sylvestre Ledru <sylvestre@debian.org>
|
||||
Build-Depends:
|
||||
debhelper-compat (= 9)
|
||||
, debhelper (>= 9.20160709)
|
||||
, dh-python
|
||||
, python3
|
||||
, python3-setuptools
|
||||
, python3-pyinotify
|
||||
, sqlite3
|
||||
, 2to3
|
||||
Homepage: http://www.fail2ban.org
|
||||
Vcs-Git: https://salsa.debian.org/python-team/packages/fail2ban.git
|
||||
Vcs-Browser: https://salsa.debian.org/python-team/packages/fail2ban
|
||||
Standards-Version: 4.4.1
|
||||
|
||||
|
||||
Package: fail2ban
|
||||
Architecture: all
|
||||
Depends: ${python3:Depends}, ${misc:Depends}, lsb-base (>=2.0-7)
|
||||
Recommends: nftables | iptables, whois, python3-pyinotify, python3-systemd
|
||||
Suggests: mailx, system-log-daemon, monit, sqlite3
|
||||
Description: ban hosts that cause multiple authentication errors
|
||||
Fail2ban monitors log files (e.g. /var/log/auth.log,
|
||||
/var/log/apache/access.log) and temporarily or persistently bans
|
||||
failure-prone addresses by updating existing firewall rules. Fail2ban
|
||||
allows easy specification of different actions to be taken such as to ban
|
||||
an IP using iptables or hostsdeny rules, or simply to send a notification
|
||||
email.
|
||||
.
|
||||
By default, it comes with filter expressions for various services
|
||||
(sshd, apache, proftpd, sasl, etc.) but configuration can be
|
||||
easily extended for monitoring any other text file. All filters and
|
||||
actions are given in the config files, thus fail2ban can be adopted
|
||||
to be used with a variety of files and firewalls. Following recommends
|
||||
are listed:
|
||||
.
|
||||
- iptables/nftables -- default installation uses iptables for banning.
|
||||
nftables is also supported. You most probably need it
|
||||
- whois -- used by a number of *mail-whois* actions to send notification
|
||||
emails with whois information about attacker hosts. Unless you will use
|
||||
those you don't need whois
|
||||
- python3-pyinotify -- unless you monitor services logs via systemd, you
|
||||
need pyinotify for efficient monitoring for log files changes
|
||||
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
This package was originally debianized by Yaroslav Halchenko
|
||||
<debian@onerussian.com> on Mon Jul 4 14:41:34 HST 2005
|
||||
|
||||
It was downloaded from http://www.sourceforge.net/projects/fail2ban
|
||||
|
||||
Author: Cyril Jaquier: <cyril.jaquier@fail2ban.org>
|
||||
http://fail2ban.sourceforge.net
|
||||
|
||||
Copyright: 2004-2009 Cyril Jaquier
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License, version 2, can be found in /usr/share/common-licenses/GPL-2.
|
||||
|
||||
The Debian packaging is (C) 2006-2011, Yaroslav Halchenko <debian@onerussian.com>
|
||||
and is licensed under the GPL, see above.
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
[sshd]
|
||||
enabled = true
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
README.md
|
||||
TODO
|
||||
doc/run-rootless.txt
|
||||
Vendored
-39
@@ -1,39 +0,0 @@
|
||||
# This file is part of Fail2Ban.
|
||||
#
|
||||
# Fail2Ban is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Fail2Ban is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Fail2Ban; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Author: Cyril Jaquier
|
||||
#
|
||||
# $Revision$
|
||||
|
||||
# Command line options for Fail2Ban. Refer to "fail2ban-client -h" for
|
||||
# valid options.
|
||||
FAIL2BAN_OPTS=""
|
||||
|
||||
# Run fail2ban as a different user. If not set, fail2ban
|
||||
# will run as root.
|
||||
#
|
||||
# The user is not created automatically.
|
||||
# The user can be created e.g. with
|
||||
# useradd --system --no-create-home --home-dir / --groups adm fail2ban
|
||||
# Log files are readable by group adm by default. Adding the fail2ban
|
||||
# user to this group allows it to read the logfiles.
|
||||
#
|
||||
# Another manual step that needs to be taken is to allow write access
|
||||
# for fail2ban user to fail2ban log files. The /etc/init.d/fail2ban
|
||||
# script will change the ownership when starting fail2ban. Logrotate
|
||||
# needs to be configured separately, see /etc/logrotate.d/fail2ban.
|
||||
#
|
||||
# FAIL2BAN_USER="fail2ban"
|
||||
Vendored
-19
@@ -1,19 +0,0 @@
|
||||
/var/log/fail2ban.log {
|
||||
|
||||
weekly
|
||||
rotate 4
|
||||
compress
|
||||
# Do not rotate if empty
|
||||
notifempty
|
||||
|
||||
delaycompress
|
||||
missingok
|
||||
postrotate
|
||||
fail2ban-client flushlogs 1>/dev/null
|
||||
endscript
|
||||
|
||||
# If fail2ban runs as non-root it still needs to have write access
|
||||
# to logfiles.
|
||||
# create 640 fail2ban adm
|
||||
create 640 root adm
|
||||
}
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
[DEFAULT]
|
||||
# the default branch for upstream sources:
|
||||
upstream-branch = upstream
|
||||
# the default branch for the debian patch:
|
||||
debian-branch = debian-releases/experimental
|
||||
# use pristine-tar
|
||||
# pristine-tar = True
|
||||
# the default tag formats used:
|
||||
upstream-tag = %(version)s
|
||||
debian-tag = debian/%(version)s
|
||||
|
||||
|
||||
# Options only affecting git-buildpackage
|
||||
[git-buildpackage]
|
||||
# use this for more svn-buildpackage like behaviour:
|
||||
export-dir = ../build-area/
|
||||
tarball-dir = ../tarballs/
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
From d1afbb566f0304487b5d578b4aacef8e647ee74b Mon Sep 17 00:00:00 2001
|
||||
From: Yaroslav Halchenko <debian@onerussian.com>
|
||||
Date: Sun, 21 Jan 2018 20:16:43 -0500
|
||||
Subject: [PATCH 2/4] ENH: verify that use_stock_cfg was not provided while
|
||||
overriding it
|
||||
|
||||
Just found this possibly confusing to outside programmer aspect
|
||||
so decided to make it more explicit
|
||||
---
|
||||
fail2ban/tests/fail2banclienttestcase.py | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
Index: fail2ban/fail2ban/tests/fail2banclienttestcase.py
|
||||
===================================================================
|
||||
--- fail2ban.orig/fail2ban/tests/fail2banclienttestcase.py
|
||||
+++ fail2ban/fail2ban/tests/fail2banclienttestcase.py
|
||||
@@ -173,6 +173,8 @@ def _start_params(tmp, use_stock=False,
|
||||
"""Filters list of 'files' to contain only directories (under dir)"""
|
||||
return [f for f in files if isdir(pjoin(dir, f))]
|
||||
shutil.copytree(STOCK_CONF_DIR, cfg, ignore=ig_dirs)
|
||||
+ assert use_stock_cfg is None, \
|
||||
+ "We are about to overload use_stock_cfg from the one provided %s" % repr(use_stock_cfg)
|
||||
if use_stock_cfg is None: use_stock_cfg = ('action.d', 'filter.d')
|
||||
# replace fail2ban params (database with memory):
|
||||
r = re.compile(r'^dbfile\s*=')
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
Index: fail2ban/files/debian-initd
|
||||
===================================================================
|
||||
--- fail2ban.orig/files/debian-initd
|
||||
+++ fail2ban/files/debian-initd
|
||||
@@ -28,7 +28,7 @@ NAME="fail2ban"
|
||||
|
||||
# fail2ban-client is not a daemon itself but starts a daemon and
|
||||
# loads its with configuration
|
||||
-DAEMON="/usr/local/bin/$NAME-client"
|
||||
+DAEMON="/usr/bin/$NAME-client"
|
||||
SCRIPTNAME="/etc/init.d/$NAME"
|
||||
|
||||
# Ad-hoc way to parse out socket file name
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
From: Yaroslav Halchenko <debian@onerussian.com>
|
||||
Date: Fri, 8 Feb 2008 00:40:57 -0500
|
||||
Subject: tune ups in upstream manpages to direct users to use reportbug
|
||||
|
||||
Index: fail2ban/man/fail2ban-client.1
|
||||
===================================================================
|
||||
--- fail2ban.orig/man/fail2ban-client.1
|
||||
+++ fail2ban/man/fail2ban-client.1
|
||||
@@ -470,7 +470,7 @@ the action <ACT> for <JAIL>
|
||||
.SH FILES
|
||||
\fI/etc/fail2ban/*\fR
|
||||
.SH "REPORTING BUGS"
|
||||
-Report bugs to https://github.com/fail2ban/fail2ban/issues
|
||||
+Report bugs via Debian bug tracking system \fIhttp://www.debian.org/Bugs/\fR .
|
||||
.SH "SEE ALSO"
|
||||
.br
|
||||
fail2ban-server(1)
|
||||
Index: fail2ban/man/fail2ban-server.1
|
||||
===================================================================
|
||||
--- fail2ban.orig/man/fail2ban-server.1
|
||||
+++ fail2ban/man/fail2ban-server.1
|
||||
@@ -69,7 +69,7 @@ display this help message
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
print the version (\fB\-V\fR returns machine\-readable short format)
|
||||
.SH "REPORTING BUGS"
|
||||
-Report bugs to https://github.com/fail2ban/fail2ban/issues
|
||||
+Report bugs via Debian bug tracking system \fIhttp://www.debian.org/Bugs/\fR .
|
||||
.SH "SEE ALSO"
|
||||
.br
|
||||
fail2ban-client(1)
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
From: Yaroslav Halchenko <debian@onerussian.com>
|
||||
Subject: Remove all non-provided .service's within PartOf of fail2ban.service
|
||||
|
||||
As reported and corroborated in the bug report, this causes inability
|
||||
of firewalld to restart.
|
||||
Correct solution would involve making systemd smarter and tune up
|
||||
of involved .service files.
|
||||
Since Debian ATM doesn't provide any of those ({ip{,6}tables,ipset}.service)
|
||||
files, it should be safe and generic enough to just prune them from PartOf
|
||||
|
||||
Thanks Joe Cooper <swelljoe@gmail.com> and Sunil Mohan Adapa <sunil@medhas.org>
|
||||
for the reports and nagging ;)
|
||||
|
||||
Origin: Fedora, Debian
|
||||
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871993
|
||||
Last-Update: 2018-04-04
|
||||
|
||||
Index: fail2ban/files/fail2ban.service.in
|
||||
===================================================================
|
||||
--- fail2ban.orig/files/fail2ban.service.in
|
||||
+++ fail2ban/files/fail2ban.service.in
|
||||
@@ -2,7 +2,7 @@
|
||||
Description=Fail2Ban Service
|
||||
Documentation=man:fail2ban(1)
|
||||
After=network.target iptables.service firewalld.service ip6tables.service ipset.service nftables.service
|
||||
-PartOf=iptables.service firewalld.service ip6tables.service ipset.service nftables.service
|
||||
+PartOf=firewalld.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
--- a/fail2ban/tests/config/filter.d/zzz-generic-example.conf
|
||||
+++ b/fail2ban/tests/config/filter.d/zzz-generic-example.conf
|
||||
@@ -8,7 +8,7 @@
|
||||
# Read common prefixes. If any customizations available -- read them from
|
||||
# common.local. common.conf is a symlink to the original common.conf and
|
||||
# should be copied (dereferenced) during installation
|
||||
-before = ../../../../config/filter.d/common.conf
|
||||
+before = ../../../../../../../config/filter.d/common.conf
|
||||
|
||||
[Definition]
|
||||
|
||||
--- a/fail2ban/tests/config/filter.d/zzz-sshd-obsolete-multiline.conf
|
||||
+++ b/fail2ban/tests/config/filter.d/zzz-sshd-obsolete-multiline.conf
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
# Read common prefixes. If any customizations available -- read them from
|
||||
# common.local
|
||||
-before = ../../../../config/filter.d/common.conf
|
||||
+before = ../../../../../../../config/filter.d/common.conf
|
||||
|
||||
[DEFAULT]
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
Index: fail2ban/files/fail2ban.service.in
|
||||
===================================================================
|
||||
--- fail2ban.orig/files/fail2ban.service.in
|
||||
+++ fail2ban/files/fail2ban.service.in
|
||||
@@ -15,6 +15,7 @@ ExecReload=@BINDIR@/fail2ban-client relo
|
||||
PIDFile=/run/fail2ban/fail2ban.pid
|
||||
Restart=on-failure
|
||||
RestartPreventExitStatus=0 255
|
||||
+Environment="PYTHONNOUSERSITE=yes"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
Index: fail2ban/bin/fail2ban-testcases
|
||||
===================================================================
|
||||
--- fail2ban.orig/bin/fail2ban-testcases
|
||||
+++ fail2ban/bin/fail2ban-testcases
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/env python
|
||||
+#!/usr/bin/env python3
|
||||
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
|
||||
# vi: set ft=python sts=4 ts=4 sw=4 noet :
|
||||
"""Script to run Fail2Ban tests battery
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
--- fail2ban-0.11.1.orig/config/filter.d/roundcube-auth.conf
|
||||
+++ fail2ban-0.11.1/config/filter.d/roundcube-auth.conf
|
||||
@@ -18,7 +18,7 @@ prefregex = ^\s*(\[\])?(%(__hostname)s\s
|
||||
failregex = ^(?:FAILED login|Login failed) for <F-USER>.*</F-USER> from <HOST>(?:(?:\([^\)]*\))?\. (?:(?! from ).)*(?: user=(?P=user))? in \S+\.php on line \d+ \(\S+ \S+\))?$
|
||||
^(?:<[\w]+> )?Failed login for <F-USER>.*</F-USER> from <HOST> in session \w+( \(error: \d\))?$
|
||||
|
||||
-ignoreregex =
|
||||
+ignoreregex = Could not connect to .* Connection refused
|
||||
|
||||
journalmatch = SYSLOG_IDENTIFIER=roundcube
|
||||
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
deb_path_to_common
|
||||
deb_init_paths
|
||||
deb_manpages_reportbug
|
||||
0002-ENH-verify-that-use_stock_cfg-was-not-provided-while.patch
|
||||
deb_no_iptables_service
|
||||
python3-test-suite.diff
|
||||
no-python-user.diff
|
||||
roundcude-update.diff
|
||||
Vendored
-98
@@ -1,98 +0,0 @@
|
||||
#! /bin/sh
|
||||
# postinst script for fail2ban
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postinst> `configure' <most-recently-configured-version>
|
||||
# * <old-postinst> `abort-upgrade' <new version>
|
||||
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
||||
# <new-version>
|
||||
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
||||
# <failed-install-package> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
#
|
||||
preversion=$2
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
# To fix the bug in generated by previous version files permissions
|
||||
# also closes #352053
|
||||
|
||||
LOG=/var/log/fail2ban.log
|
||||
touch $LOG
|
||||
chown root:adm ${LOG}*
|
||||
chmod 640 ${LOG}*
|
||||
|
||||
# Note regarding changed configuration file
|
||||
# Note regarding changed configuration file
|
||||
if [ ! -z $preversion ]; then
|
||||
if dpkg --compare-versions $preversion lt 0.7.1-1; then
|
||||
cat <<EOF
|
||||
WARNING!
|
||||
|
||||
Fail2ban 0.7 is a complete rewrite of the 0.6 version, and if you
|
||||
customized any of provided configuration or startup files
|
||||
(/etc/default/fail2ban, /etc/fail2ban.conf, /etc/init.d/fail2ban), please
|
||||
read relevant entry in /usr/share/doc/fail2ban/NEWS.Debian.gz.
|
||||
|
||||
EOF
|
||||
fi
|
||||
if dpkg --compare-versions $preversion lt 0.5.4-5.14; then
|
||||
cat <<EOF
|
||||
WARNING!
|
||||
|
||||
Configuration file /etc/fail2ban.conf, failregex configuration
|
||||
parameter specifically, were changed in 0.5.4-5 to close reported
|
||||
security breach, and in 0.5.4-5.14 to close few other bugs.
|
||||
|
||||
updating from <0.5.4-5
|
||||
Unless configuration file (or corresponding failregex'es) gets updated,
|
||||
security breach is not closed and corresponding warning will be reported
|
||||
by the fail2ban (in the log files).
|
||||
|
||||
updating from <0.5.4-5.14
|
||||
Bugs #329163, #331695 dealing with changed iptables rules
|
||||
outside of fail2ban were fixed in 0.5.4-5.14, and require upgrade of the
|
||||
configuration file (fwcheck option was introduced) to take full
|
||||
advantage of the problem solution (otherwise some problems might
|
||||
persist)
|
||||
|
||||
Please review the configuration file and make appropriate changes.
|
||||
ENJOY!
|
||||
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/action.d/firewall-cmd-direct-new.conf /etc/fail2ban/action.d/firewallcmd-new.conf 0.8.13-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/lighttpd-fastcgi.conf /etc/fail2ban/filter.d/suhosin.conf 0.8.13-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/sasl.conf /etc/fail2ban/filter.d/postfix-sasl.conf 0.8.13-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/couriersmtp.conf /etc/fail2ban/filter.d/courier-smtp.conf 0.9.0-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/courierlogin.conf /etc/fail2ban/filter.d/courier-auth.conf 0.9.0-1~ -- "$@"
|
||||
fi
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
Vendored
-52
@@ -1,52 +0,0 @@
|
||||
#! /bin/sh
|
||||
# postrm script for fail2ban
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postrm> `remove'
|
||||
# * <postrm> `purge'
|
||||
# * <old-postrm> `upgrade' <new-version>
|
||||
# * <new-postrm> `failed-upgrade' <old-version>
|
||||
# * <new-postrm> `abort-install'
|
||||
# * <new-postrm> `abort-install' <old-version>
|
||||
# * <new-postrm> `abort-upgrade' <old-version>
|
||||
# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
|
||||
# for details, see /usr/doc/packaging-manual/
|
||||
|
||||
|
||||
case "$1" in
|
||||
purge|disappear)
|
||||
|
||||
# Remove configuration
|
||||
rm -f /etc/fail2ban.conf
|
||||
|
||||
# Remove logs
|
||||
rm -f /var/log/fail2ban*
|
||||
|
||||
# Remove sqlite db
|
||||
rm -f /var/lib/fail2ban/fail2ban.sqlite3
|
||||
;;
|
||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade)
|
||||
# nothing
|
||||
# We may not delete the user fail2ban, as there may be
|
||||
# files owned by it in /var/log/ and /etc/.
|
||||
;;
|
||||
esac
|
||||
|
||||
if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/action.d/firewall-cmd-direct-new.conf /etc/fail2ban/action.d/firewallcmd-new.conf 0.8.13-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/lighttpd-fastcgi.conf /etc/fail2ban/filter.d/suhosin.conf 0.8.13-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/sasl.conf /etc/fail2ban/filter.d/postfix-sasl.conf 0.8.13-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/couriersmtp.conf /etc/fail2ban/filter.d/courier-smtp.conf 0.9.0-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/courierlogin.conf /etc/fail2ban/filter.d/courier-auth.conf 0.9.0-1~ -- "$@"
|
||||
fi
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
|
||||
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/action.d/firewall-cmd-direct-new.conf /etc/fail2ban/action.d/firewallcmd-new.conf 0.8.13-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/lighttpd-fastcgi.conf /etc/fail2ban/filter.d/suhosin.conf 0.8.13-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/sasl.conf /etc/fail2ban/filter.d/postfix-sasl.conf 0.8.13-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/couriersmtp.conf /etc/fail2ban/filter.d/courier-smtp.conf 0.9.0-1~ -- "$@"
|
||||
dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/courierlogin.conf /etc/fail2ban/filter.d/courier-auth.conf 0.9.0-1~ -- "$@"
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
Vendored
-69
@@ -1,69 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
export DH_VERBOSE=1
|
||||
|
||||
export PYBUILD_DISABLE_python2=1
|
||||
|
||||
%:
|
||||
dh $@ --with python3,systemd --buildsystem pybuild
|
||||
|
||||
DESTDIR=$(CURDIR)/debian/fail2ban
|
||||
PYVERSION=$(shell py3versions -dv)
|
||||
|
||||
override_dh_clean:
|
||||
-rm -rf fail2ban.egg-info
|
||||
-rm -f debian/fail2ban.init
|
||||
dh_clean
|
||||
: # auto generated
|
||||
-rm -f bin/fail2ban-python
|
||||
|
||||
override_dh_auto_configure:
|
||||
LANG=C ./fail2ban-2to3
|
||||
dh_auto_configure
|
||||
|
||||
override_dh_install:
|
||||
rm -f $(DESTDIR)/usr/share/doc/fail2ban/README.Solaris
|
||||
find "$(DESTDIR)/etc/fail2ban/" -type f -name 'paths-*.conf' -not -name 'paths-common.conf' -not -name 'paths-debian.conf' -delete
|
||||
: # Remove explicitly created /var/run/fail2ban
|
||||
: # just to please lintian since init file will
|
||||
: # take care about it anyways
|
||||
rm -rf $(DESTDIR)/var/run/ $(DESTDIR)/run/
|
||||
: # Install monit configuration
|
||||
install -d $(DESTDIR)/etc/monit/conf-available
|
||||
install -d $(DESTDIR)/etc/monit/monitrc.d
|
||||
install -m 644 files/monit/fail2ban $(DESTDIR)/etc/monit/monitrc.d/fail2ban
|
||||
: # Install bash completion
|
||||
install -d $(DESTDIR)/usr/share/bash-completion/completions
|
||||
install -m 644 files/bash-completion $(DESTDIR)/usr/share/bash-completion/completions/fail2ban
|
||||
: # Install systemd files
|
||||
install -d $(DESTDIR)/lib/systemd/system
|
||||
install -d $(DESTDIR)/usr/lib/tmpfiles.d
|
||||
install -m 644 build/fail2ban.service $(DESTDIR)/lib/systemd/system
|
||||
install -m 644 files/fail2ban-tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d
|
||||
install -d $(DESTDIR)/lib/systemd/system
|
||||
: # Install default jail enabler
|
||||
install -m 644 debian/debian-files/jail.d_defaults-debian.conf $(DESTDIR)/etc/fail2ban/jail.d/defaults-debian.conf
|
||||
dh_install
|
||||
|
||||
override_dh_auto_test:
|
||||
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
|
||||
# fails for now (4 tests), accept it for now
|
||||
FAIL2BAN_CONFIG_DIR="$(CURDIR)/config" LC_ALL=C.UTF-8 bin/fail2ban-testcases --verbosity=2 --no-network || true
|
||||
endif
|
||||
|
||||
override_dh_installexamples:
|
||||
dh_installexamples files/ipmasq-* files/nagios files/cacti
|
||||
|
||||
override_dh_installinit:
|
||||
cp -p files/debian-initd debian/fail2ban.init
|
||||
dh_installinit -- defaults 99
|
||||
|
||||
override_dh_installman:
|
||||
dh_installman man/*.[15]
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
3.0 (quilt)
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
Bug-Database: https://github.com/fail2ban/fail2ban/issues
|
||||
Bug-Submit: https://github.com/fail2ban/fail2ban/issues/new
|
||||
Repository: https://github.com/fail2ban/fail2ban.git
|
||||
Repository-Browse: https://github.com/fail2ban/fail2ban
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user