Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subnet implementation (filter, parsing tags) #2560

Merged
merged 3 commits into from Nov 15, 2019

Conversation

sebres
Copy link
Contributor

@sebres sebres commented Nov 1, 2019

  • (part of Support to ban subnets #927) filter enhancement to parse IP sub-nets (IP/CIDR with correct recognition of IP-family),
    provides new replacement tags for failregex to match subnets in form of IP-addresses with CIDR mask (Allow filter to pass a network/subnet as HOST #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);
  • grouped tags (<ADDR>, <HOST>, <SUBNET>) recognize enclosed in square brackets IP addresses of both families (so all filters would accept square brackets around IPv4 addresses also).

…DR with correct recognition of IP-family),

provides new replacement tags for failregex to match subnets in form of IP-addresses with CIDR mask (fail2bangh-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);
@coveralls
Copy link

coveralls commented Nov 1, 2019

Coverage Status

Coverage decreased (-0.05%) to 97.741% when pulling e5d02bc on sebres:gh-927-subnet into 5e3fef1 on fail2ban:0.10.

@codecov-io
Copy link

codecov-io commented Nov 1, 2019

Codecov Report

Merging #2560 into 0.10 will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             0.10    #2560      +/-   ##
==========================================
+ Coverage   95.92%   96.01%   +0.08%     
==========================================
  Files          76       76              
  Lines       13729    13893     +164     
  Branches     2239     2260      +21     
==========================================
+ Hits        13170    13339     +169     
+ Misses        284      281       -3     
+ Partials      275      273       -2
Impacted Files Coverage Δ
fail2ban/tests/fail2banregextestcase.py 100% <100%> (ø) ⬆️
fail2ban/tests/servertestcase.py 96.54% <100%> (+0.12%) ⬆️
fail2ban/server/failregex.py 91.66% <100%> (+0.2%) ⬆️
fail2ban/server/filter.py 96.33% <100%> (+0.05%) ⬆️
fail2ban/client/csocket.py 100% <0%> (ø) ⬆️
fail2ban/tests/actionstestcase.py 100% <0%> (ø) ⬆️
fail2ban/tests/action_d/test_badips.py 100% <0%> (ø) ⬆️
fail2ban/client/jailsreader.py 100% <0%> (ø) ⬆️
fail2ban/tests/datedetectortestcase.py 99.59% <0%> (ø) ⬆️
fail2ban/tests/filtertestcase.py 98.89% <0%> (ø) ⬆️
... and 29 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d263ed...e86e9b2. Read the comment docs.

@sebres sebres changed the title subnet implementation subnet implementation (filter, parsing tags) Nov 15, 2019
@sebres sebres removed the WiP label Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants