Skip to content

authelia: set target_user meta and align bf user-enum distinct key#1796

Merged
buixor merged 4 commits into
masterfrom
copilot/fix-authelia-logs-parser
May 26, 2026
Merged

authelia: set target_user meta and align bf user-enum distinct key#1796
buixor merged 4 commits into
masterfrom
copilot/fix-authelia-logs-parser

Conversation

Copilot AI commented May 12, 2026

Copy link
Copy Markdown
Contributor
  • Inspect the referenced review comment and surrounding code
  • Make the smallest possible change to address only that comment
  • Run targeted validation for the affected files
  • Run final review/security validation

Copilot AI changed the title [WIP] Fix authelia-logs parser to include target_user meta authelia: set target_user meta and align bf user-enum distinct key May 12, 2026
Copilot finished work on behalf of buixor May 12, 2026 09:10
Copilot AI requested a review from buixor May 12, 2026 09:10
@github-actions

Copy link
Copy Markdown

Hello @Copilot and thank you for your contribution!

I'm a bot that helps maintainers to validate scenarios and ensure they include all the required information.
I've found some errors in your scenarios, please fix them and re-submit your PR, or ask for help if you need it.

The following items have errors:

crowdsecurity/crs-exclusion-plugin-cpanel:

  • labels not found

crowdsecurity/crs-exclusion-plugin-dokuwiki:

  • labels not found

crowdsecurity/crs-exclusion-plugin-drupal:

  • labels not found

crowdsecurity/crs-exclusion-plugin-nextcloud:

  • labels not found

crowdsecurity/crs-exclusion-plugin-phpbb:

  • labels not found

crowdsecurity/crs-exclusion-plugin-phpmyadmin:

  • labels not found

crowdsecurity/crs-exclusion-plugin-wordpress:

  • labels not found

crowdsecurity/crs-exclusion-plugin-xenforo:

  • labels not found

Mitre ATT&CK

Information about mitre attack can be found here.
As an example, some common mitre attack techniques:

  • T1110 for bruteforce attacks
  • T1595 and T1190 for exploitation of public vulnerabilities
  • T1595 for generic scanning of exposed applications

Expected format is (where XXXX is the technique ID):

labels:
  classification:
    - attack.TXXXX

CVEs

If your scenario covers a specific CVE (Common Vulnerabilities and Exposures), please add it.

Expected format is (where CVE-XXX-XXX is the CVE ID):

labels:
  classification:
    - cve.CVE-XXX-XXX

Behaviors

Please identify the behavior(s) your scenario is targeting. You can find the list of available behaviors here.

Expected format is (where <behavior> is the behavior you want to target):

labels:
  behavior: <behavior>

See the labels documentation for more information.

@buixor

buixor commented May 26, 2026

Copy link
Copy Markdown
Contributor

fix #1715

@buixor
buixor marked this pull request as ready for review May 26, 2026 08:47
Copilot AI review requested due to automatic review settings May 26, 2026 08:47
@github-actions

Copy link
Copy Markdown

Hello @buixor and thank you for your contribution!

❗ It seems that the following scenarios are not part of the 'crowdsecurity/appsec-virtual-patching' collection:

🔴 crowdsecurity/vpatch-CVE-2024-1061 🔴
🔴 crowdsecurity/vpatch-CVE-2023-23488 🔴
🔴 crowdsecurity/vpatch-CVE-2023-6567 🔴
🔴 crowdsecurity/vpatch-CVE-2024-1071 🔴
🔴 crowdsecurity/vpatch-CVE-2023-0600 🔴
🔴 crowdsecurity/vpatch-CVE-2023-3197 🔴
🔴 crowdsecurity/vpatch-CVE-2023-2009 🔴
🔴 crowdsecurity/vpatch-CVE-2023-6360 🔴
🔴 crowdsecurity/vpatch-CVE-2023-6623 🔴
🔴 crowdsecurity/vpatch-CVE-2022-3254 🔴
🔴 crowdsecurity/vpatch-CVE-2023-4634 🔴
🔴 crowdsecurity/vpatch-CVE-2023-23489 🔴
🔴 crowdsecurity/vpatch-CVE-2023-0900 🔴
🔴 crowdsecurity/vpatch-CVE-2025-40552 🔴

@github-actions

Copy link
Copy Markdown

Hello @buixor,

Scenarios/AppSec Rule are compliant with the taxonomy, thank you for your contribution!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns Authelia brute-force/user-enumeration detection with CrowdSec’s brute-force context expectations by emitting evt.Meta.target_user from the Authelia parser and deduplicating the user-enum scenario on that field.

Changes:

  • Add target_user metadata to LePresidente/authelia-logs (sourced from the parsed username).
  • Update LePresidente/authelia-bf_user-enum to use distinct: evt.Meta.target_user.
  • Extend existing hubtest assertions to validate target_user on parsed events and scenario alert events.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
scenarios/LePresidente/authelia-bf.yaml Switches user-enum scenario deduplication key from user to target_user.
parsers/s01-parse/LePresidente/authelia-logs.yaml Adds evt.Meta.target_user alongside evt.Meta.user.
.tests/authelia-logs/parser.assert Updates parser assertions to include target_user.
.tests/authelia-bf/scenario.assert Updates scenario assertions to include target_user in alert events.

Comment on lines 222 to +226
results["s01-parse"]["LePresidente/authelia-logs"][0].Evt.Meta["log_type"] == "auth_failed"
results["s01-parse"]["LePresidente/authelia-logs"][0].Evt.Meta["service"] == "authelia"
results["s01-parse"]["LePresidente/authelia-logs"][0].Evt.Meta["source_ip"] == "1.1.1.1"
results["s01-parse"]["LePresidente/authelia-logs"][0].Evt.Meta["user"] == "fakeuser"
results["s01-parse"]["LePresidente/authelia-logs"][0].Evt.Meta["target_user"] == "fakeuser"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1d2b846 by replacing the public IPs in .tests/authelia-logs/authelia-logs.log with an RFC 5737 example IP and updating .tests/authelia-logs/parser.assert accordingly. The targeted authelia-logs hubtest passes in the CrowdSec container.

Comment on lines 11 to +15
results[0].Overflow.Alert.Events[0].GetMeta("service") == "authelia"
results[0].Overflow.Alert.Events[0].GetMeta("source_ip") == "5.5.5.6"
results[0].Overflow.Alert.Events[0].GetMeta("timestamp") == "2022-02-16T12:31:49+02:00"
results[0].Overflow.Alert.Events[0].GetMeta("user") == "fakeuser1@example.com"
results[0].Overflow.Alert.Events[0].GetMeta("target_user") == "fakeuser1@example.com"
Copilot AI requested a review from buixor May 26, 2026 09:00
Copilot finished work on behalf of buixor May 26, 2026 09:00
@buixor
buixor merged commit 6a5c76a into master May 26, 2026
3 checks passed
@buixor
buixor deleted the copilot/fix-authelia-logs-parser branch May 26, 2026 09:23
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.

authelia-logs parser missing target_user meta — brute-force alerts lack user context

3 participants