Cache for ignore-facilities (for ignoreip
, ignoreself
and ignorecommand
)
#2176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ignorecache
to improve performance of ignore failure check (using caching of results fromignoreip
,ignoreself
andignorecommand
);closes RFE Enhancements on the ignorecommand execution #1229, because if cache enabled it does not matter how often failure occurred (command is executed once by the first occurrence)
ignorecommand
to use actions-similar replacement (ticket-based now, so capable to interpolate all possible tags)The cache can be used to speedup ignore verification (so fail2ban would not call
ignorecommand
or execute DNS lookup repeatedly for already verified IPs (o whatever else is specified askey
inignorecache
) for defined time.Syntax:
key
- expression for key of cached entry (that relates to stored result of ignore-facilities) specified as an action tag or substitution expression as string, interpolating combination of standard action tags like<ip>
or<F-USER>
from ticket generated by failure;max-count
- maximal number of entries in cache (cache size);max-time
- maximal time the entries in cache remain valid (cache time);Set option
ignorecache
to empty value will disable the cache.Example 1:
This will cache the result of
ignorecommand
(file contains IP) andignoreip
(DNS lookup) for 1 hour for maximal 500 entries, using IP substituted like "192.0.2.1" as cache-keys.Example 2:
This will cache the result of
ignorecommand
for 5 minutes for maximal 100 entries, using values substituted like "user@host" as cache-keys.