authelia: Regulation policy does not consider time zone correctly

Version

v4.39.0

Deployment Method

Docker

Reverse Proxy

Caddy

Reverse Proxy Version

2.8.0

Description

It was mentioned that after the rework on regulation, basic auth would also trigger regulation policy ban. But after testing it does not seem to work.

Reproduction

Setup authelia with the following config for regulation policy, input wrong credentials on purpose and see if IP or user is temporarily banned.

Expectations

User and IP are temporarily banned after too many wrong inputs for basic auth endpoint.

Configuration (Authelia)

# yamllint disable rule:comments-indentation
---

regulation:
  modes:
    - 'user'
    - 'ip'
  max_retries: 3
  find_time: '1 minutes'
  ban_time: '2 minutes'

Logs (Proxy / Application)


Documentation

No response

Generative AI

No

Pre-Submission Checklist

  • I agree to follow the Code of Conduct

  • This is a bug report and not a support request

  • I have read the security policy and this bug report is not a security issue or security related issue

  • I have either included the complete configuration file or I am sure it’s unrelated to the configuration

  • I have either included the complete debug / trace logs or the output of the build-info command if the logs are not relevant

  • I have provided all of the required information in full with the only alteration being reasonable sanitization in accordance with the Troubleshooting Sanitization reference guide

  • I have checked for related proxy or application logs and included them if available

  • I have checked for related issues and checked the documentation

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

I technically found a similar issue with something else and accidentally solved it in 3ebed86c189abd30d9166ae9688bad82674ffd01 but cherry picked some of that out into another commit. If it’s the same issue the driver outputs a timestamp when using CURRENT_TIMESTAMP that is not comparable to the time.Time that is serialized by the driver, looks like it’s absent the timezone.