Generalisation of new SSH regex
This commit is contained in:
parent
ed809f4f98
commit
e1ff702cd1
@ -55,7 +55,7 @@ streams:
|
|||||||
# ip's regex is inserted in the following regex
|
# ip's regex is inserted in the following regex
|
||||||
- 'authentication failure;.*rhost=<ip>'
|
- 'authentication failure;.*rhost=<ip>'
|
||||||
- 'Failed password for .* from <ip>'
|
- 'Failed password for .* from <ip>'
|
||||||
- 'Connection reset by authenticating user .* <ip>'
|
- 'Connection (reset|closed) by (authenticating|invalid) user .* <ip>'
|
||||||
# if retry and retryperiod are defined,
|
# if retry and retryperiod are defined,
|
||||||
# the actions will only take place if a same pattern is
|
# the actions will only take place if a same pattern is
|
||||||
# found `retry` times in a `retryperiod` interval
|
# found `retry` times in a `retryperiod` interval
|
||||||
|
@ -64,7 +64,7 @@ local iptables(args) = ['ip46tables', '-w'] + args;
|
|||||||
// ip's regex is inserted in the following regex
|
// ip's regex is inserted in the following regex
|
||||||
@'authentication failure;.*rhost=<ip>',
|
@'authentication failure;.*rhost=<ip>',
|
||||||
@'Failed password for .* from <ip>',
|
@'Failed password for .* from <ip>',
|
||||||
@'Connection reset by authenticating user .* <ip>',
|
@'Connection (reset|closed) by (authenticating|invalid) user .* <ip>',
|
||||||
],
|
],
|
||||||
// if retry and retryperiod are defined,
|
// if retry and retryperiod are defined,
|
||||||
// the actions will only take place if a same pattern is
|
// the actions will only take place if a same pattern is
|
||||||
|
@ -16,7 +16,8 @@ local banFor(time) = {
|
|||||||
// ip46tables (C program also in this repo) handles running the good commands
|
// ip46tables (C program also in this repo) handles running the good commands
|
||||||
ip: {
|
ip: {
|
||||||
regex: @'(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|(?:(?:[0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,7}:|(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}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a-fA-F]{1,4}){1,7}|:)|fe80:(?::[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(?:ffff(?::0{1,4}){0,1}:){0,1}(?:(?:25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(?:25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9])|(?:[0-9a-fA-F]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(?:25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9]))',
|
||||||
ignore: std.makeArray(255, function(i) "192.168.1."+i),
|
// Ignore all from 192.168.1.1 to 192.168.1.255
|
||||||
|
ignore: std.makeArray(255, function(i) '192.168.1.' + (i + 1)),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user