Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Disable the visualization of Injected Environment variables in Jenkins

Tags:

Jenkins SECURITY-248 states that I should "Disable the visualization of Injected Environment variables in the global configuration." I cannot find this setting in the Configuration. Any help will be appreciated.

like image 381
Matthias Danetzky Avatar asked Mar 15 '18 09:03

Matthias Danetzky


People also ask

What is inject environment variable in Jenkins?

EnvInject Plugin aka (Environment Injector Plugin) gives you several options to set environment variables from Jenkins configuration. By selecting Inject environment variables to the build process you will get: Properties File Path. Properties Content. Script File Path.

How can I see environment variables in Jenkins?

Goto to the /job/<project>/configure screen. In "Build Environment" section check "Inject environment variables to the build process"

How do I change environment variables in Jenkins?

We can install and use the EnvInject plugin to inject environment variables during the build startup. In the build configuration window, we select the “Inject environment variables” option in the “Add build step” combo box. We can then add the required environment variables in the properties content text box.


2 Answers

You can do the following to make sure to address this security issue correctly:

  1. Check to see if you have any files affected by this security issue by executing this command: sudo find . -name "injectedEnvVars.txt"
  2. Delete all the files recursively by executing the following command: sudo find . -name "injectedEnvVars.txt" -delete
  3. Re-execute step #1 to make sure there are no files left.
  4. Go to the Jenkins instance, from Configure Global Security under Environment Injector Plugin check Do not show injected variables. Prevent the plugin from leaking secrets again
  5. From Configure Global Security under Hidden security warnings, click on Security Warnings and then uncheck Environment Injector Plugin: Exposure of sensitive build variables stored by EnvInject 1.90 and earlier. This will make sure to hide that error message so it doesn’t appear again. Prevent the warning message from showing #1 Prevent the warning message from showing #2

Reference: https://jenkins.io/security/advisory/2018-02-26/#SECURITY-248

like image 200
Hassan Radi Avatar answered Sep 19 '22 17:09

Hassan Radi


Configure Global Security {buildhost}/configureSecurity/

at the bottom is "Do not show injected variables"

like image 44
Mickster04 Avatar answered Sep 21 '22 17:09

Mickster04