Why does systeminfo need admin
why does systeminfo need admin (but the XML doesn't)
Imagine the following hypothetical situation:
There is one administrator who manages the software projects and jenkins instance, he can set secret information into environment-variables (like some specific SECRET_KEY
that can be used by the jenkins pipeline).
If now every ordinary user or service in the project could read all the environment variables, he could also get direct access to the SECRET_KEY
, without being in the controlled environment of jenkins-configurations that are only accessible on the server.
How to access environment variables outside the server
how can I get the JENKINS_HOME for a given Jenkins server using
regular user credentials?
I guess you need to make some kind of token
/ private-key
available to the service/user that can be used to make elevated-privilege requests to the server. For example explained in this stackoverflow question:
With this token you can then have elevated privileges for clients.
E.g. extracted from jenkins.io an example for authenticating scripted clients:
curl -X POST -L --user jenkins:apiToken \
https://jenkins.yourcompany.com/job/your_job/build
I hope this is also covering your desired api-access-point for xml.
Some more resources on jenkins authentication