#1079667 fail2ban: cloudflare-token action not using options specified in jail.local

#1079667#5
Date:
2024-08-26 03:23:26 UTC
From:
To:
Dear Maintainer,

If I put the following info in my jail.local file

[DEFAULT]
action = cloudflare-token
cfzone = MY_CF_ZONE_ID
cftoken = MY_CF_API_TOKEN

as instructed by comments of cloudflare-token.conf file, the jails don't work.

When I tried sudo fail2ban-client set botsearch banip x.x.x.x, the log says

fail2ban.actions        [1204999]: NOTICE  [nginx-botsearch] Ban x.x.x.x
fail2ban.observer       [1204999]: DEBUG   [nginx-botsearch] Observer: ban found x.x.x.x, 600
fail2ban.utils          [1204999]: DEBUG   7f78eafb9fd0 -- stdout: '{"success":false,"errors":[{"code":7003,"message":"Could not route to \\/zones\\/<cfzone>\\/firewall\\/access_rules\\/rules, perhaps your object identifier is invalid?"},{"code":7000,"message":"No route for that URI"}],"messages":[],"result":null}'
fail2ban.utils          [1204999]: DEBUG   7f78eafb9fd0 -- returned successfully 0

Manually issuing curl command works, so MY_CF_ZONE_ID and MY_CF_API_TOKEN are current.

Putting MY_CF_ZONE_ID and MY_CF_API_TOKEN in cloudflare-token.local makes it work, but ideally those info should be taken from jail.local.

Regards,
Joongul