Skip to content

KAFKA-14605: Change audit log level in StandardAuthorizer - #23223

Open
hulincup wants to merge 2 commits into
apache:trunkfrom
hulincup:KAFKA-14605-fix-log-level
Open

KAFKA-14605: Change audit log level in StandardAuthorizer#23223
hulincup wants to merge 2 commits into
apache:trunkfrom
hulincup:KAFKA-14605-fix-log-level

Conversation

@hulincup

@hulincup hulincup commented Aug 21, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

Change the audit log level in StandardAuthorizerData:

  • ALLOWED operations: DEBUG → INFO (when logIfAllowed is set)
  • DENIED operations: INFO → WARN (when logIfDenied is set)

Why are the changes needed?

Audit logs are security-critical and should be visible at default log levels.

Currently:

  • ALLOWED operations are logged at DEBUG level - too verbose, requires DEBUG logging to see
  • DENIED operations are logged at INFO level - not prominent enough for security events

After this change:

  • ALLOWED operations logged at INFO level - visible in default configuration
  • DENIED operations logged at WARN level - stands out as security events

Did this PR include tests?

Yes. Updated StandardAuthorizerTest:

  • Stub isInfoEnabled() and isWarnEnabled() for the new log levels
  • Verify info() for ALLOWED (was debug())
  • Verify warn() for DENIED (was info())

Documentation

Updated docs/security/security-model.md to reflect the new log level contract:

  • INFO logs allowed requests (was DEBUG)
  • WARN logs denied requests (was INFO)

Performance Considerations

The default log4j2.yaml sets kafka.authorizer.logger to INFO. After this change, ALLOWED operations will be logged by default on brokers with ACLs enabled. This increases audit visibility but also increases log volume. Operators who want the previous behavior can set the logger level to WARN.

Fixes: KAFKA-14605

Change log level to INFO when logIfAllowed is set (was DEBUG),
and to WARN when logIfDenied is set (was INFO).

Audit logs are security-critical and should be visible at default
log levels. DEBUG is too verbose for INFO, and INFO is not
prominent enough for security denials.
@github-actions github-actions Bot added triage PRs from the community kraft small Small PRs labels Aug 21, 2026
- Update StandardAuthorizerTest to verify INFO for ALLOWED and WARN for DENIED
- Update security-model.md to reflect new log level contract:
  INFO logs allowed requests, WARN logs denied requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kraft small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant