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

$f2bV_matches on abuseipDB with APIV2 (not V1) #2310

Closed
Skyridr opened this issue Dec 20, 2018 · 3 comments
Closed

$f2bV_matches on abuseipDB with APIV2 (not V1) #2310

Skyridr opened this issue Dec 20, 2018 · 3 comments

Comments

@Skyridr
Copy link

Skyridr commented Dec 20, 2018

Using Fail2ban 0.11.0.3 and trying to set it up with AbuseIPDB using APIv2.

According to some issues, it was already resolved with:

actionban = lgm=$(printf '%%s\n...' "<matches>"); curl --fail --tlsv1.1 --data "key=<abuseipdb_apikey>" --data-urlencode "comment=$lgm" --data "ip=<ip>" --data "category=<abuseipdb_category>" "https://www.abuseipdb.com/report/json"

However, APIV2 is using a different setup:

actionban = curl --fail 'https://api.abuseipdb.com/api/v2/report' \
     -H 'Accept: application/json' \
     -H 'Key: <abuseipdb_apikey>' \
     --data-urlencode 'comment=<matches>' \
     --data-urlencode 'ip=<ip>' \
     --data 'categories=<abuseipdb_category>'

Which also results in $f2bV_matches showing up on the report comments on the abuseipDB website. API v1 is already deprecated, so I think the abuseipdb.conf file needs to be updated using the new api v2 code.

https://docs.abuseipdb.com/

@sebres
Copy link
Contributor

sebres commented Dec 20, 2018

This going to escape-issue (via variable) inside the fail2ban (since 0.10.x)...
Just use double quotation mark " instead:

- --data-urlencode 'comment=<matches>'
+ --data-urlencode "comment=<matches>"

@sebres sebres closed this as completed Dec 20, 2018
@Skyridr
Copy link
Author

Skyridr commented Dec 20, 2018

Assumed as much as I just found out about it by doing some digging, thanks!

Will the abuseipdb.conf be updated with the v2 API actionban version though? Seeing v1 is deprecated.

@sebres
Copy link
Contributor

sebres commented Dec 20, 2018

YW

Will the abuseipdb.conf be updated with the v2 API actionban version though?

There is a PR #2302 that covers this. So welcome with testing.

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

No branches or pull requests

2 participants