-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins version: 2.442
Audit Trail plugin version: 361.v82cde86c784e
We allow anonymous users in our Jenkins instance. The problem is, however, is that we would like to see the IP address of the one who triggered a job. Ironically, the IP address is only logged for authenticated users (where it is in fact unnecessary, since the user has already been identified), while for anonymous users it is not. Here's what I see when an unauthenticated user starts a job:
Aug 24, 2023 3:27:03,083 PMSandbox » auto-tests #171 Started by user anonymous, Parameters:[] on node #unknown# started at 2023-08-24T15:00:38Z completed in 1584852ms completed: FAILURE
The issue was also discussed in JENKINS-53430, but I was asked to create a dedicated bug ticket.
- relates to
-
JENKINS-53430 Capture logged in username and IP Address Audit Trail Plugin
-
- Closed
-
myx_ostankin I had a look to your use case and I'm pretty sure there is nothing more that we can do.
What you are looking at (Started by user...) is managed by a RunListener. The RunListener doesn't have access to the IP of the user who triggered the build.
This leads me to a question about your statement:
> the IP address is only logged for authenticated users
AFAICT, this is not possible, at least if you use the RunListener, as explained above. There is no way to retrieve the IP this way.
That being said, you can achieve what you wish by adjusting the `URL Patterns to Log` and adding `build` (and/or `buildWithParameters` if you use parametrised builds).
This way you are logging at the request level and you'll get the IP dumped, eg:
Hope that helps.