Add source IP address and hostname to authentication failure logs (JENKINS-76220)#265
Open
sgscheffler wants to merge 4 commits intojenkinsci:masterfrom
Open
Add source IP address and hostname to authentication failure logs (JENKINS-76220)#265sgscheffler wants to merge 4 commits intojenkinsci:masterfrom
sgscheffler wants to merge 4 commits intojenkinsci:masterfrom
Conversation
- Add getSourceInfo() helper method to capture request source information - Include remote address and hostname in credential exception warnings - Helps administrators identify which node/agent is using wrong credentials - Uses Jakarta servlet API - Gracefully handles cases where request context is unavailable Fixes JENKINS-76220
rsandell
reviewed
Nov 5, 2025
src/main/java/hudson/plugins/active_directory/ActiveDirectoryUnixAuthenticationProvider.java
Show resolved
Hide resolved
rsandell
reviewed
Nov 5, 2025
src/main/java/hudson/plugins/active_directory/ActiveDirectoryUnixAuthenticationProvider.java
Show resolved
Hide resolved
rsandell
reviewed
Nov 5, 2025
src/main/java/hudson/plugins/active_directory/ActiveDirectoryUnixAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
rsandell
reviewed
Nov 5, 2025
| (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); | ||
|
|
||
| if (attributes != null) { | ||
| HttpServletRequest request = attributes.getRequest(); |
Member
There was a problem hiding this comment.
I can't find any documentation or verify in the source if attributes.getRequest() could return null or not?
Have you verified that this doesn't break when performing authentication without a request?
e304827 to
a8f2517
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds source IP address and hostname to authentication failure log messages to help administrators identify which Jenkins node/agent is attempting to authenticate with incorrect credentials.
Changes
Example Output
Before:
After:
Fixes JENKINS-76220
Testing done
mvn clean compilemvn clean testmvn hpi:runto verify plugin loads correctlySubmitter checklist