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

feat: add authentication_failure throttled log #12746

Merged

Conversation

zmstone
Copy link
Member

@zmstone zmstone commented Mar 20, 2024

Fixes https://emqx.atlassian.net/browse/EMQX-12052

Release version: v/e5.6.0

Summary

  • add authentication_faulre throttled log
  • add 'username' to log metadata, meaning if username is provided, most of the logs will have it included
  • add 'tag' to authz warning logs

log examples:

2024-03-20T11:03:45.693577+01:00 [warning] msg: log_events_throttled_during_last_period, period: 1 minutes, 0 seconds, dropped: #{authentication_failure => 12}
2024-03-20T11:04:11.138524+01:00 [warning] tag: AUTHN, clientid: bbb, msg: authentication_failure, peername: 127.0.0.1:41538, username: a, reason: bad_username_or_password
2024-03-20T11:08:39.568980+01:00 [warning] tag: AUTHZ, clientid: bbb, msg: cannot_publish_to_topic_due_to_not_authorized, peername: 127.0.0.1:47860, username: aaa, topic: republish-event/1, reason: not_authorized
2024-03-20T12:04:45.519265+01:00 [warning] tag: AUTHZ, clientid: bbb, msg: authorization_permission_denied, peername: 127.0.0.1:32798, username: aaa, topic: republish-event/1, source: file, action: SUBSCRIBE(Q0)

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@zmstone zmstone requested review from lafirest and a team as code owners March 20, 2024 10:14
zmstone added a commit to zmstone/emqx that referenced this pull request Mar 20, 2024
also updated emqx#12520 to include newly added throttled log id
zmstone added a commit to zmstone/emqx that referenced this pull request Mar 20, 2024
also updated emqx#12520 to include newly added throttled log id
@zmstone zmstone force-pushed the 0320-add-throttle-log-for-auth-failure branch from efc126e to ef51adb Compare March 20, 2024 11:04
apps/emqx/src/emqx_logger_textfmt.erl Outdated Show resolved Hide resolved
changes/ce/feat-12746.en.md Outdated Show resolved Hide resolved
zmstone added 3 commits March 20, 2024 14:42
also included changes:

1. add 'username' to log metadata
2. add 'tag' to authz warning logs
also updated emqx#12520 to include newly added throttled log id
@zmstone zmstone force-pushed the 0320-add-throttle-log-for-auth-failure branch from ef51adb to 90fce21 Compare March 20, 2024 13:43
@zmstone zmstone requested a review from JimMoen as a code owner March 20, 2024 13:43
@zmstone zmstone merged commit bede5a5 into emqx:release-56 Mar 20, 2024
165 of 166 checks passed
@zmstone zmstone deleted the 0320-add-throttle-log-for-auth-failure branch March 20, 2024 16:06
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.

2 participants