Skip to content

[ISSUE #10810] Redact authentication signatures in audit logs - #10811

Open
Aias00 wants to merge 1 commit into
apache:developfrom
Aias00:fix/auth-signature-log-redaction-10810
Open

[ISSUE #10810] Redact authentication signatures in audit logs#10811
Aias00 wants to merge 1 commit into
apache:developfrom
Aias00:fix/auth-signature-log-redaction-10810

Conversation

@Aias00

@Aias00 Aias00 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

  • Mask authentication request signatures before writing audit logs.
  • Keep only a short prefix/suffix for long signatures and fully redact short or blank signatures.
  • Add tests for short and long signature masking.

Why

Authentication signatures are security-sensitive request material. Audit logs should preserve useful diagnostics without emitting the raw signature value.

Validation

  • JAVA_HOME=$(/usr/libexec/java_home -v 1.8) mvn -pl auth -am -DskipITs -DskipCheckStyle -Dtest=DefaultAuthenticationProviderTest -DfailIfNoTests=false test
  • git diff --check

Closes #10810

Copilot AI review requested due to automatic review settings August 4, 2026 00:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov-commenter

codecov-commenter commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.22%. Comparing base (eddb235) to head (b93cf20).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10811      +/-   ##
=============================================
- Coverage      48.34%   48.22%   -0.13%     
+ Complexity     13527    13491      -36     
=============================================
  Files           1380     1380              
  Lines         101104   101111       +7     
  Branches       13107    13108       +1     
=============================================
- Hits           48882    48763     -119     
- Misses         46267    46359      +92     
- Partials        5955     5989      +34     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-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.

Summary

Redacts authentication signatures in audit logs by showing only the first and last 4 characters with a **** mask in the middle. Good security practice to prevent credential leakage in logs. Clean implementation with proper edge-case handling (blank/short signatures) and comprehensive tests.

LGTM.


Automated review by github-manager-bot

@RockteMQ-AI

Copy link
Copy Markdown
Contributor

🤖 Automated Review by RockteMQ-AI

Review of the diff for PR #10811.

Summary: The change consistently masks authentication signatures before they reach the audit logger and adds focused unit tests. The log format string itself is preserved, so parsing tools that key on the [AUTHENTICATION] ... Signature = {} structure remain compatible.

Findings:

🟢 SuggestionDefaultAuthenticationProvider.java:33
The boundary signature.length() <= SIGNATURE_VISIBLE_CHARS * 2 means a 9-character signature reveals 8 of 9 characters (only the 5th is hidden). Consider raising the minimum hidden length or making the threshold clearer so "long" signatures actually obscure a meaningful portion.

🟢 SuggestionDefaultAuthenticationProviderTest.java:73
Add explicit boundary tests for exactly 8 and 9 character inputs to document and lock in the masking behavior at the threshold.

🟢 SuggestionDefaultAuthenticationProviderTest.java:65-66
Confirm the project test framework still uses JUnit 4 (org.junit.Test, org.junit.Assert) rather than JUnit 5; otherwise migrate to org.junit.jupiter.api.

🟡 WarningDefaultAuthenticationProvider.java:29-38
maskSignature is package-private static. That is fine for unit testing, but if other providers reuse this logic in the future it should be promoted to a shared utility rather than copied.

No critical correctness or security issues. The change effectively prevents raw signatures from being persisted in audit logs while retaining enough structure for troubleshooting.


This is an automated review. Please verify findings before acting on them.

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.

[Bug] Authentication audit logs expose request signatures

4 participants