This is one stop global knowledge base where you can learn about all the products, solutions and support features.
Jenkins, and a number of plugins, allow users to execute Groovy scripts in Jenkins. These scripting capabilities are provided by:
Script Console.
Jenkins Pipeline.
The Extended Email plugin.
The Groovy plugin - when using the "Execute system Groovy script" step.
The JobDSL plugin as of version 1.60 and later.
To protect Jenkins from execution of malicious scripts, these plugins execute user-provided scripts in a Groovy Sandbox that limits the internal APIs that are accessible. This protection is provided by the Script Security plugin. As soon as an unsafe method is used in any of the scripts, the administrator can use the "In-process Script Approval" action appears in Manage Jenkins to allow the unsafe method. Unsafe methods should not be enabled without careful consideration of the impact.
The Script Security plugin is installed automatically by the Post-install Setup Wizard, although initially no additional scripts or operations are approved for use.
Older versions of this plugin may not be safe to use. Please review the security warnings listed on the Script Security plugin page in order to ensure that the Script Security plugin is up to date. |
Security for in-process scripting is provided by two different mechanisms: the Groovy Sandbox and Script Approval. The first, the Groovy Sandbox, is enabled by default for Jenkins Pipeline allowing user-supplied Scripted and Declarative Pipeline to execute without prior Administrator intervention. The second, Script Approval, allows Administrators to approve or deny unsandboxed scripts, or allow sandboxed scripts to execute additional methods.
For most instances, the combination of the Groovy Sandbox and the Script Security’s built-in list of approved method signatures, will be sufficient. It is strongly recommended that Administrators only deviate from these defaults if absolutely necessary.
To reduce manual interventions by Administrators, most scripts will run in a Groovy Sandbox by default, including all Jenkins Pipelines. The sandbox only allows a subset of Groovy’s methods deemed sufficiently safe for "untrusted" access to be executed without prior approval. Scripts using the Groovy Sandbox are all subject to the same restrictions, therefore a Pipeline authored by an Administrator is subject to the restrictions as one authorized by a non-administrative user.
When a script attempts to use features or methods unauthorized by the sandbox, a script is halted immediately, as shown below with Jenkins Pipeline
The Pipeline above will not execute until an Administrator approves the method signature via the In-process Script Approval page.
In addition to adding approved method signatures, users may also disable the Groovy Sandbox entirely as shown below. Disabling the Groovy Sandbox requires that the entire script must be reviewed and manually approved by an administrator.
Manual approval of entire scripts, or method signatures, by an administrator provides Administrators with additional flexibility to support more advanced usages of in-process scripting. When the Groovy Sandbox is disabled, or a method outside of the built-in list is invoked, the Script Security plugin will check the Administrator-managed list of approved scripts and methods.
When a script is approved, it is approved for use in any Jenkins feature or plugin that integrates with script approval. Script approval is not tied to a specific job or to any other specific use of the script. Due to this, care must be taken when approving a script to ensure that any user supplied parameters can not be used to exploit the instance. |
For scripts which wish to execute outside of the Groovy Sandbox, the Administrator must approve the entire script in the In-process Script Approval page:
For scripts which use the Groovy Sandbox, but wish to execute an currently unapproved method signature will also be halted by Jenkins, and require an Administrator to approve the specific method signature before the script is allowed to execute:
Script approval provides three options: Approve, Deny, and "Approve assuming permissions check." While the purpose of the first two are self-evident, the third requires some additional understanding of what internal data scripts are able to access and how permissions checks inside of Jenkins function.
Consider a script which accesses the method
hudson.model.AbstractItem.getParent()
, which by itself is harmless and will
return an object containing either the folder or root item which contains the
currently executing Pipeline or Job. Following that method invocation,
executing
hudson.model.ItemGroup.getItems()
, which will list items in the
folder or root item, requires the
Job/Read
permission.
This could mean that approving the
hudson.model.ItemGroup.getItems()
method
signature would allow a script to bypass built-in permissions checks.
Instead, it is usually more desirable to click
Approve assuming permissions
check
which will cause the Script Approval engine to allow the method
signature assuming the user running the script has the permissions to execute
the method, such as the
Job/Read
permission in this example.
Was this page helpful?
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.
Jenkins features a Groovy script console which allows one to run arbitrary Groovy scripts within the Jenkins controller runtime or in the runtime on agents.
It is very important  to understand all of the following points because it affects the integrity of your Jenkins installation. The Jenkins Script Console:
Because of the power offered by the Jenkins Script Console, Jenkins and its
agents should never be run as theÂ
Be sure to secure your Jenkins instance |
The Jenkins Script Console can run either on the controller or any configured agents.
This feature can be accessed from
"Manage Jenkins" > "Script Console"
.Â
Or by visiting the sub-URLÂ
/script
 on your Jenkins instance.
Visit "Manage Jenkins" > "Manage Nodes" . Select any node to view the status page. In the menu on the left, a menu item is available to open a "Script Console" on that specific agent.
It’s also possible to run scripts from the controller Script Console on individual agents. The following script is an example running a script on agents from the controller Script Console.
Script executes code on agent from Master Script Console
import hudson.util.RemotingDiagnostics
import jenkins.model.Jenkins
String agentName = 'your agent name'
//groovy script you want executed on an agent
groovy_script = '''
println System.getenv("PATH")
println "uname -a".execute().text
'''.trim()
String result
Jenkins.instance.slaves.find { agent ->
agent.name == agentName
}.with { agent ->
result = RemotingDiagnostics.executeGroovy(groovy_script, agent.channel)
}
println result
Files can be read and written directly on the controller or agents via the controller Script Console.
Write a file to the Jenkins controller
new File('/tmp/file.txt').withWriter('UTF-8') { writer ->
try {
writer << 'hello world\n'
} finally {
writer.close()
}
}
Reading a file from the Jenkins controller
new File('/tmp/file.txt').text
Write file to agent through agent channel
import hudson.FilePath
import hudson.remoting.Channel
import jenkins.model.Jenkins
String agentName = 'some-agent'
String filePath = '/tmp/file.txt'
Channel agentChannel = Jenkins.instance.slaves.find { agent ->
agent.name == agentName
}.channel
new FilePath(agentChannel, filePath).write().with { os ->
try {
os << 'hello world\n'
} finally {
os.close()
}
}
Read file from agent through agent channel
import hudson.FilePath
import hudson.remoting.Channel
import jenkins.model.Jenkins
import java.io.BufferedReader
import java.io.InputStreamReader
import java.nio.charset.StandardCharsets
import java.util.stream.Collectors
String agentName = 'some-agent'
String filePath = '/tmp/file.txt'
Channel agentChannel = Jenkins.instance.slaves.find { agent ->
agent.name == agentName
}.channel
String fileContents = ''
new FilePath(agentChannel, filePath).read().with { is ->
try {
fileContents = new BufferedReader(
new InputStreamReader(is, StandardCharsets.UTF_8))
.lines()
.collect(Collectors.joining("\n"))
} finally {
is.close()
}
}
// print contents of the file from the agent
println '==='
println(fileContents)
println '==='
A Jenkins Admin can execute groovy scripts remotely by sending an HTTP POST
request to
/script/
url or
/scriptText/
.
curl example via bash
curl -d "script=<your_script_here>" https://jenkins/script
# or to get output as a plain text result (no HTML)
curl -d "script=<your_script_here>" https://jenkins/scriptText
Also, Jenkins CLI
offers the possibility to execute groovy scripts remotely using
groovy
command or execute groovy interactively via
groovysh
.
However, once again curl can be used to execute groovy scripts by making
use of bash command substitution. In the following example
somescript.groovy
is a groovy script in the current working
directory.
Curl submitting groovy file via bash
curl --data-urlencode "script=$(< ./somescript.groovy)" https://jenkins/scriptText
If security is configured in Jenkins, then curl can be provided options to
authenticate using theÂ
curl --user
 option.
Curl submitting groovy file providing username and api token via bash
curl --user 'username:api-token' --data-urlencode \
"script=$(< ./somescript.groovy)" https://jenkins/scriptText
Here is the equivalent command using python, not curl.
Python submitting groovy file providing username and api token
with open('somescript.groovy', 'r') as fd:
data = fd.read()
r = requests.post('https://jenkins/scriptText', auth=('username', 'api-token'), data={'script': data})
You can submit a script without mouse. Jenkins has a shortcut key which enables to submit with keyboard.
Windows / Linux: Ctrl + Enter
Mac: Command + Enter
Here are some recorded videos on the Jenkins Script Console:
Jenkins World 2017: Mastering the Jenkins Script Console - 44 minutes - sample usage and security discussion
LA Jenkins Area Meetup 2016 - Hacking on Jenkins Internals - Jenkins Script Console  - 39 minutes - sample usage
To expand your ability to write scripts in the script console, the following references are recommended:
Learn Groovy - Learning Groovy is useful for more than writing scripts for the Script Console. Groovy is also relevant for other features of Jenkins like Pipelines and shared pipeline libraries , the Groovy Plugin , the Job DSL plugin, and many other plugins which utilize Groovy (see section [Plugins-enabling-Groovy-usage]).
Write Groovy scripts for Jenkins with Code completion  - The gist of this is to create a Maven project within your IDE and to depend on org.jenkins-ci.main:jenkins-core (and any other plugins that you expect present). You can then write a Groovy script with code completion of Jenkins API objects and methods.
Due to the nature of Groovy scripts accessing Jenkins source code directly, Script Console scripts are easily out of date from the Jenkins source code. It is possible to run a script and get exceptions because public methods and interfaces in Jenkins core or Jenkins plugins have changed. Keep this in mind when trying out examples. Jenkins is easily started from a local development machine via the following command:
Starting a local copy of Jenkins
export JENKINS_HOME="./my_jenkins_home"
java -jar jenkins.war
Use CTRL+C to stop Jenkins. It is not recommended to try Script Console examples in a production Jenkins instance.
The following repositories offer solid examples of Groovy scripts for Jenkins.
Browse all Scriptler Plugin Groovy Scripts and please share your scripts with the Scriptler Plugin.
Activate Chuck Norris Plugin â This script activates Chuck Norris plugin for all jobs in your Jenkins server
Add a Maven Installation, Tool Installation, Modify System Config
Add a new label to agents meeting a condition â This script shows how to alter the agent nodes' label membership. In this case we create a new label if the existing label contains a string. It has been tested from the Jenkins command window.
Add notification plugin to every job â This script will add the Notification Plugin to every job.
Allow broken build claiming on every jobs â With the following simple script, you can activate the option on every jobs of your server in just one go.
Batch-Update Mercurial branch that is checked out â Updates for multiple jobs which branch will be checked out from Hg
Change JVM Options in all Maven tasks of Freestyle Jobs â This script find all Maven Tasks registered in freestyle jobs and replace JVM Options by a new value.
Change SCMTrigger for each project to disable during the night and the week-end â This script lets you easily change all jobs running every minutes so that it gets disabled between 21:00 and 07:00 and on Saturday and Sunday.
Clone all projects in a View â This script enumerates all projects belonging to a specific view and clones them.
Convert standard mail notifications to use the Mail-Ext Publisher plugin â This script replace mail notifications in all projects by Mail-Ext publisher plugin and re-uses existing recipients.
Delete tmp files left in workspace-files â This scripts deletes all the tmp files left in workspace-files directory after the build. On windows servers this seems pretty common.
Delete workspace for all disabled jobs â Deletes the workspace for all disabled jobs to save space
Disable all jobs â This script disables all jobs in your Jenkins server
Display Information About Nodes â This scripts displays a bunch of information about all the agent nodes.
Display job parameters â This scripts displays the parameters for all the jobs along with their default values (if applicable).
Display list of projects that were built more than 1 day ago. â This script to display list of projects that were built more than 1 day ago.
Display mail notifications recipients â This script displays for all jobs the list of mail recipients used for notifications.
Display monitors status â Jenkins uses monitors to validate various behaviors. If you dismiss one, Jenkins will never propose you to reactivate it. This script allows you to check the status of all monitors and to reactivate them.
Display the number of jobs using SCM Polling from Freestyle, Pipeline and Maven
Display timer triggers â This scripts displays the timer triggers for all the jobs in order to better arrange them.
Display Tools Location on All Nodes â This script can help to get Jenkins tools location on all your agents
Enable Timestamper plugin on all jobs â With the following simple script, you can activate the option on every jobs of your server in just one go.
Failed Jobs â This scripts displays a list of all failed jobs. Addon: restart them.
Find builds currently running that has been executing for more than N seconds
Grant Cancel Permission for user and group that have Build permission â This script will go through all groups and users in both Global security and per job security settings.
Invalidate Jenkins HTTP sessions â This script can monitor and invalidate HTTP sessions if there are many open ones on your server.
Manually run log rotation on all jobs â Runs log rotation on all jobs to free space
Monitor and Restart Offline Agents â This script can monitor and restart offline nodes if they are not disconnected manually.
Monitoring Scripts â Several scripts to display data about http sessions, threads, memory, JVM or MBeans, when using the Monitoring plugin.
My Test Grovvy
Parameterized System Groovy script â This script will demonstrate how to get parameters in a system groovy script.
Remove all disabled modules in Maven jobs â To remove all disabled modules in Maven jobs
Remove Deployed Artifacts Actions â This script is used to remove the Deployed Artifacts list that is uselessly stored for each build by the Artifact Deployer Plugin.
Remove Git Plugin BuildsByBranch BuildData â This script is used to remove the static list of BuildsByBranch that is uselessly stored for each build by the Git Plugin.
Set GitBlitRepositoryBrowser with custom settings on all repos â This scripts allows to update the repo browser. Can be adapted to any other browser, not only gitblit.
Update maven jobs to use the post build task to deploy artifacts â This script updates all maven jobs having a deploy goal by install and activate the post build step to deploy artifacts at the end of the build
Wipe out workspaces of all jobs â This script wipes out the workspaces of all jobs on your Jenkins server
Wipe workspaces for a set of jobs on all nodes â The script wipes workspaces of certain jobs on all nodes.
Config File Provider Plugin Adds the ability to provide configuration files (i.e., settings.xml for maven, XML, groovy, custom files, etc.) loaded through the Jenkins UI which will be copied to the job’s workspace.
Global Post Script Plugin â Execute a global configured groovy script after each build of each job managed by the Jenkins. This is typical for cases when you need to do something based on a shared set of parameters, such as triggering downstream jobs managed by the same Jenkins or remote ones based on the parameters been passed to the parameterized jobs.
Groovy plugin
Groovy Postbuild Plugin â This plugin executes a groovy script in the Jenkins JVM. Typically, the script checks some conditions and changes accordingly the build result, puts badges next to the build in the build history and/or displays information on the build summary page.
Groovy Remote Control Plugin â This plugin provides Groovy Remote Control's receiver, and allows to control external application from Jenkins.
Matrix Groovy Execution Strategy Plugin â A plugin to decide the execution order and valid combinations of matrix projects.
Pipeline Classpath Step Plugin Pipeline DSL step to add path to the groovy classpath
Scriptler Plugin â Scriptler allows you to store/edit groovy scripts and execute it on any of the nodes… no need to copy/paste groovy code anymore.
Was this page helpful?
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.
It is possible to spawn a process from a build and have that process live longer than the build itself. For example, perhaps the build launches a new application server with the result of the build. In older releases, the build often did not terminate. Instead, the specific step (such as the shell script, Ant, or Maven) terminates but the build itself does not terminate.
Jenkins detects this situation and, instead of blocking indefinitely, prints out a warning and terminates the build.
This happens because of how file descriptors are used between processes in a build.
Jenkins and the child process are connected by three pipes (
stdin
,
stdout
, and
stderr
.)
This allows Jenkins to capture the output from the child process.
The child process may write a lot of data to the pipe and quit immediately after that, so Jenkins waits for end-of-file (EOF) to be sure that it has drained the pipes before it terminates the build.
Whenever a process terminates, the operating system closes all the file descriptors it owned. So, even if the process did not close
stdout
and
stderr
, Jenkins gets end of file (EOF).
The complication happens when those file descriptors are inherited by other processes.
Let’s say the child process forks another process to the background.
The background process (which is actually a daemon) inherits all the file descriptors of the parent, including the writing side of the
stdout
ad
stderr
pipes that connect the child process and Jenkins.
If the daemon forgets to close them, Jenkins does not get EOF for pipes even when the child process exits, because the daemon still has those descriptors open.
This is how this problem happens.
A daemon should close all file descriptors to avoid such issues but some daemons do not follow the rule. You can mitigate this problem with various workarounds.
On Unix, you can use a wrapper like this to make the daemon behave. For example:
daemonize -E BUILD_ID=dontKillMe /path/to/your/command
In a Jenkins Pipeline, use
JENKINS_NODE_COOKIE
instead of
BUILD_ID
.
Note that this will set the BUILD_ID environment variable for the process being spawned to something other than the current BUILD_ID.
Or you can start jenkins with
-Dhudson.util.ProcessTree.disable=true
- see long running agent process for details.
On Windows, use the 'at' command to launch a process in the background. For example:
<scriptdef name="get-next-minute" language="beanshell"> <attribute name="property" /> date = new java.text.SimpleDateFormat("HH:mm") .format(new Date(System.currentTimeMillis() + 60000)); project.setProperty(attributes.get("property"), date); </scriptdef> <get-next-minute property="next-minute" /> <exec executable="at"> <arg value="${next-minute}" /> <arg value="/interactive" /> <arg value="${jboss.home}\bin\run.bat" /> </exec>
Another similar workaround on Windows is to use a wrapper script and launch your program through it:
// antRunAsync.js - Wrapper script to run an executable detached in the // background from Ant's <exec> task. This works by running the executable // using the Windows Scripting Host WshShell.Run method which doesn't copy // the standard filehandles stdin, stdout and stderr. Ant finds them closed // and doesn't wait for the program to exit. // // requirements: // Windows Scripting Host 1.0 or better. This is included with Windows // 98/Me/2000/XP. Users of Windows 95 or Windows NT 4.0 need to download // and install WSH support from // http://msdn.microsoft.com/scripting/. // // usage: // <exec executable="cscript.exe"> // <env key="ANTRUN_TITLE" value="Title for Window" /> <!-- optional --> // <env key="ANTRUN_OUTPUT" value="output.log" /> <!-- optional --> // <arg value="//NoLogo" /> // <arg value="antRunAsync.js" /> <!-- this script --> // <arg value="real executable" /> // </exec> var WshShell = WScript.CreateObject("WScript.Shell"); var exeStr = "%comspec% /c"; var arg = ""; var windowStyle = 1; var WshProcessEnv = WshShell.Environment("PROCESS"); var windowTitle = WshProcessEnv("ANTRUN_TITLE"); var outputFile = WshProcessEnv("ANTRUN_OUTPUT"); var OS = WshProcessEnv("OS"); var isWindowsNT = (OS == "Windows_NT"); // On Windows NT/2000/XP, specify a title for the window. If the environment // variable ANTRUN_TITLE is specified, that will be used instead of a default. if (isWindowsNT) { if (windowTitle == "") windowTitle = "Ant - " + WScript.Arguments(i); exeStr += "title " + windowTitle + " &&"; } // Loop through arguments quoting ones with spaces for (var i = 0; i < WScript.Arguments.count(); i++) { arg = WScript.Arguments(i); if (arg.indexOf(' ') > 0) exeStr += " \"" + arg + "\""; else exeStr += " " + arg; } // If the environment variable ANTRUN_OUTPUT was specified, redirect // output to that file. if (outputFile != "") { windowStyle = 7; // new window is minimized exeStr += " > \"" + outputFile + "\""; if (isWindowsNT) exeStr += " 2>&1"; } // WScript.Echo(exeStr); // WshShell.Run(exeStr); WshShell.Run(exeStr, windowStyle, false);
<exec executable="cscript.exe"> <env key="ANTRUN_TITLE" value="Title for Window" /> <!-- optional --> <env key="ANTRUN_OUTPUT" value="output.log" /> <!-- optional --> <arg value="//NoLogo" /> <arg value="antRunAsync.js" /> <!-- this script --> <arg value="real executable" /> </exec>
Another workaround for Windows is to schedule a permanent task and force running it from the Ant script. For example, run the command:
C:\>SCHTASKS /Create /RU SYSTEM /SC ONSTART /TN Tomcat /TR "C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\startup.bat"
Note, that
ONSTART
can be replaced with
ONCE
if you do not want to keep Tomcat running.
Add the following code to your Ant script:
<exec executable="SCHTASKS"> <arg value="/Run"/> <arg value="/TN"/> <arg value="Tomcat"/> </exec>
Was this page helpful?
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.
This section is a work in progress. Want to help? Check out the jenkinsci-docs mailing list. For other ways to contribute to the Jenkins project, see this page about participating and contributing. |
Was this page helpful?
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.
The Manage Jenkins >> System Information page provides detailed information about what is available on this Jenkins instance:
System Properties that can be used as arguments to the command line used to start Jenkins.
Environment Variables recognized on this system, with current values. This includes the environment variables defined by Jenkins and available on all systems as well as environment variables associated with plugins installed on this instance.
List of Plugins installed on the system.
Memory Usage gives a graph that shows the current memory usage for this instance.
Was this page helpful?
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.
Jenkins has several "hidden" features that can be enabled with system properties. This page documents many of them and explain how to configure them on your instance.
Some system properties related to the Remoting library used for communication between controller and agents are documented in that component’s repository.
System properties are defined by passing
-Dproperty=value
to the
java
command line to start Jenkins.
Make sure to pass all of these arguments
before
the
-jar
argument, otherwise they will be ignored.
Example:
java -Dhudson.footerURL=http://example.org -jar jenkins.war
The following lists the properties and the version of Jenkins they were introduced in.
Property
- Java property name
Default - Default value if not explicitly set
Since - The version of Jenkins the property was introduced in
Description - Other notes
We do NOT guarantee that system properties will remain unchanged and functional indefinitely. These switches are often experimental in nature, and subject to change without notice. If you find these useful, please file a ticket to promote it to an official feature.
Due to the very large number of system properties used, often just added as a "safety valve" or "escape hatch" in case a change causes problems, this list is not expected to be complete. |
debug.YUI
false
Whether to use the minified (
false
) or debug (
true
) JS files for the YUI library.
executable-war
Path to
jenkins.war
when invoked as
java -jar jenkins.war
, undefined otherwise.
This is the path to
jenkins.war
and set by the
executable-war
wrapper when invoked using
java -jar jenkins.war
.
This allows Jenkins to find its own
.war
file and e.g. replace it to apply an update.
If undefined, Jenkins will not e.g. offer to update itself.
historyWidget.descriptionLimit
100
Defines a limit for the characters shown in the description field for each build row in the Build History column.
A positive integer (e.g.
300
) will define the limit.
After the limit is reached (…) will be shown.
The value
-1
disables the limit and allows unlimited characters in the build description.
The value
0
shows no description.
hudson.bundled.plugins
undefined
Specify a location for additional bundled plugins during plugin development (
hpi:run
).
There is no reason this would be set by an administrator.
hudson.ClassicPluginStrategy.noBytecodeTransformer
false
Disable the bytecode transformer that retains compatibility at runtime after changing public Java APIs. Has no effect since 2.296, as the bytecode transformer has been removed.
hudson.ClassicPluginStrategy.useAntClassLoader
false
(until 2.309 and since 2.348),
true
(from 2.310 to 2.347)
Unused between 1.527 and 2.309.
Since 2.310, can be set to
false
to use
URLClassLoader
instead.
This is the default since 2.347.
hudson.cli.CLI.pingInterval
3000
Client-side HTTP CLI ping interval in milliseconds.
Set on the CLI client (
java -jar jenkins-cli.jar
), not Jenkins server process.
hudson.ConsoleNote.INSECURE
false
Whether to load unsigned console notes. See SECURITY-382 on Jenkins Security Advisory 2017-02-01.
hudson.consoleTailKB
150
How many KB of console log to show in default console view. This property had no effect from Jenkins 2.4 (inclusive) until 2.98/2.89.3 (exclusive), see JENKINS-48593.
hudson.diagnosis.HudsonHomeDiskUsageChecker.freeSpaceThreshold
1073741824
(1 GB, up to 2.39),
10737418240
(10 GB, from 2.40)
If there’s less than this amount of free disk space, in bytes, on the disk with the Jenkins home directory, and the disk is 90% or more full, a warning will be shown to administrators.
hudson.diyChunking
false
Set to
true
if the servlet container doesn’t support chunked encoding.
hudson.DNSMultiCast.disabled
false
until 2.218,
true
in 2.219
Set to
true
to disable DNS multicast.
Has no effect since 2.220 as the feature has been removed.
See SECURITY-1641
hudson.FilePath.VALIDATE_ANT_FILE_MASK_BOUND
10000
Max. number of operations to validate a file mask (e.g. pattern to archive artifacts).
hudson.footerURL
https://jenkins.io
Allows tweaking the URL displayed at the bottom of Jenkins' UI
hudson.Functions.autoRefreshSeconds
10
Number of seconds between reloads when Auto Refresh is enabled. Obsolete since the feature was removed in Jenkins 2.223.
hudson.Functions.hidingPasswordFields
true
Jenkins 2.205 and newer attempts to prevent browsers from offering to auto-fill password form fields by using a custom password control.
Setting this to
false
reverts to the legacy behavior of using mostly standard password form fields.
hudson.lifecycle
automatically determined based on environment, see
hudson.lifecycle.Lifecycle
Specify full class name for Lifecycle implementation to override default. See documentation for class names.
hudson.logging.LogRecorderManager.skipPermissionCheck
false
Disable security hardening for LogRecorderManager Stapler access. Possibly unsafe, see 2018-12-05 security advisory.
hudson.Main.development
false
in production,
true
in development
This is set to
true
by the development tooling to identify when Jenkins is running via
jetty:run
or
hpi:run
.
Can be used to distinguish between development and production use; most prominently used to bypass the setup wizard when running with an empty Jenkins home directory during development.
hudson.Main.timeout
15000
When using
jenkins-core.jar
from the CLI, this is the connection timeout connecting to Jenkins to report a build result.
hudson.markup.MarkupFormatter.previewsAllowGET
false
Controls whether URLs implementing markup formatter previews are accessible via GET. See 2021-01-13 security advisory.
hudson.markup.MarkupFormatter.previewsSetCSP
true
Controls whether to set restrictive Content-Security-Policy headers on URLs implementing markup formatter previews. See 2021-01-13 security advisory.
hudson.matrix.MatrixConfiguration.useShortWorkspaceName
false
Use shorter but cryptic names in matrix build workspace directories. Avoids problems with 256 character limit on paths in Cygwin, path depths problems on Windows, and shell metacharacter problems with label expressions on most platforms. See JENKINS-25783.
hudson.model.AbstractItem.skipPermissionCheck
false
Disable security hardening related to Stapler routing for AbstractItem. Possibly unsafe, see 2018-12-05 security advisory.
hudson.model.Api.INSECURE
false
Set to
true
to permit accessing the Jenkins remote API in an unsafe manner.
See SECURITY-47.
Deprecated, use e.g. Secure Requester Whitelist instead.
hudson.model.AsyncAperiodicWork.logRotateMinutes
1440
The number of minutes after which to try and rotate the log file used by any AsyncAperiodicWork extension.
For fine-grained control of a specific extension you can use the
FullyQualifiedClassName
.logRotateMinutes
system property to only affect a specific extension.
It is not anticipated that you will ever need to change these defaults.
hudson.model.AsyncAperiodicWork.logRotateSize
-1
When starting a new run of any AsyncAperiodicWork extension, if this value is non-negative and the existing log file is larger than the specified number of bytes then the log file will be rotated.
For fine-grained control of a specific extension you can use theÂ
FullyQualifiedClassName
.logRotateSize
system property to only affect a specific extension.
It is not anticipated that you will ever need to change these defaults.
hudson.model.AsyncPeriodicWork.logRotateMinutes
1440
The number of minutes after which to try and rotate the log file used by any AsyncPeriodicWork extension.
For fine-grained control of a specific extension you can use theÂ
FullyQualifiedClassName
.logRotateMinutes
system property to only affect a specific extension.
It is not anticipated that you will ever need to change these defaults.
Some implementations that can be individually configured (see FullyQualifiedClassName above):
hudson.model.WorkspaceCleanupThread
hudson.model.FingerprintCleanupThread
hudson.slaves.ConnectionActivityMonitor
jenkins.DailyCheck
jenkins.model.BackgroundGlobalBuildDiscarder
jenkins.telemetry.Telemetry$TelemetryReporter
hudson.model.AsyncPeriodicWork.logRotateSize
-1
When starting a new run of any AsyncPeriodicWork extension, if this value is non-negative and the existing log file is larger than the specified number of bytes then the log file will be rotated.
For fine-grained control of a specific extension you can use theÂ
FullyQualifiedClassName
.logRotateSize
system property to only affect a specific extension.
It is not anticipated that you will ever need to change these defaults
Some implementations that can be individually configured (see FullyQualifiedClassName above):
hudson.model.WorkspaceCleanupThread
hudson.model.FingerprintCleanupThread
hudson.slaves.ConnectionActivityMonitor
jenkins.DailyCheck
jenkins.model.BackgroundGlobalBuildDiscarder
jenkins.telemetry.Telemetry$TelemetryReporter
hudson.model.DirectoryBrowserSupport.allowAbsolutePath
false
Escape hatch for SECURITY-2481.
Set this to
true
to allow browsing to absolute paths.
hudson.model.DirectoryBrowserSupport.allowSymlinkEscape
false
Escape hatch for SECURITY-904 and SECURITY-1452.
hudson.model.DirectoryBrowserSupport.CSP
sandbox; default-src 'none'; image-src 'self'; style-src 'self';
Determines the Content Security Policy header sent for static files served by Jenkins. Only affects instances that don’t have a resource root URL set up. See Configuring Content Security Policy for more details.
hudson.model.DownloadService$Downloadable.defaultInterval
86400000
(1 day)
Interval between periodic downloads of Downloadables , typically tool installer metadata.
hudson.model.DownloadService.never
false
Suppress the periodic download of data files for plugins via browser-based download. Since Jenkins 2.200, this has no effect.
hudson.model.DownloadService.noSignatureCheck
false
Skip the update site signature check.
Setting this to
true
can be unsafe.
hudson.model.Hudson.flyweightSupport
false
before 1.337;
true
from 1.337; unused since 1.598
Matrix parent job and other flyweight tasks (e.g. Build Flow plugin) won’t consume an executor when
true
.
Unused since 1.598, flyweight support is now always enabled.
hudson.model.Hudson.initLogLevel
Deprecated: Backward-compatible fallback for
jenkins.model.Jenkins.initLogLevel
.
Removed since 2.272.
hudson.model.Hudson.killAfterLoad
Deprecated: Backward-compatible fallback for
jenkins.model.Jenkins.killAfterLoad
.
Removed since 2.272.
hudson.model.Hudson.logStartupPerformance
Deprecated: Backward-compatible fallback for
jenkins.model.Jenkins.logStartupPerformance
.
Removed since 2.272.
hudson.model.Hudson.parallelLoad
Deprecated: Backward-compatible fallback for
jenkins.model.Jenkins.parallelLoad
.
Removed since 2.272.
hudson.model.Hudson.workspaceDirName
Deprecated: Backward-compatible fallback for
jenkins.model.Jenkins.workspaceDirName
.
Removed since 2.272.
hudson.model.LabelAtom.allowFolderTraversal
false
Controls whether label names containing unsafe characters that lead to path traversal can be saved. See 2.263.2 upgrade guide.
hudson.model.LoadStatistics.clock
10000
(10 seconds)
Load statistics clock cycle in milliseconds.
hudson.model.LoadStatistics.decay
0.9
Decay ratio for every clock cycle in node utilization charts.
hudson.model.MultiStageTimeSeries.chartFont
SansSerif-10
Font used for load statistics. See Java documentation on how the value is decoded.
hudson.model.Node.SKIP_BUILD_CHECK_ON_FLYWEIGHTS
true
Whether to allow building flyweight tasks even if the necessary permission (Computer/Build) is missing. See JENKINS-46652.
hudson.model.ParametersAction.keepUndefinedParameters
undefined
If true, not discard parameters for builds that are not defined on the job. Enabling this can be unsafe. Since Jenkins 2.40, if set to false, will not log a warning message that parameters were defined but ignored.
hudson.model.ParametersAction.safeParameters
undefined
Comma-separated list of additional build parameter names that should not be discarded even when not defined on the job.
hudson.model.Queue.cacheRefreshPeriod
1000
Defines the refresh period for the internal queue cache (in milliseconds). The greater period workarounds web UI delays on large installations, which may be caused by locking of the build queue by build executors. Downside: Builds appear in the queue with a noticeable delay.
hudson.model.Queue.Saver.DELAY_SECONDS
60
Maximal delay of a save operation when content of Jenkins queue changes. This works as a balancing factor between queue consistency guarantee in case of Jenkins crash (short delay) and decreasing IO activity based on Jenkins load (long delay).
hudson.model.Run.ArtifactList.listCutoff
16
More artifacts than this will use tree view or simple link rather than listing out artifacts
hudson.model.Run.ArtifactList.treeCutoff
40
More artifacts than this will show a simple link to directory browser rather than showing artifacts in tree view
hudson.model.Slave.workspaceRoot
workspace
name of the folder within the agent root directory to contain workspaces
hudson.model.UpdateCenter.className
effectively
hudson.model.UpdateCenter
This allows overriding the implementation class for update center when customizing the
.war
packaging of Jenkins.
Cannot be used for plugins.
hudson.model.UpdateCenter.defaultUpdateSiteId
default
Configure a different ID for the default update site. Useful for custom war distributions or externally provided UC data files.
hudson.model.UpdateCenter.never
false
When true, don’t automatically check for new versions
hudson.model.UpdateCenter.pluginDownloadReadTimeoutSeconds
60
Read timeout in seconds for downloading plugins.
hudson.model.UpdateCenter.skipPermissionCheck
false
Disable security hardening related to Stapler routing for UpdateCenter. Possibly unsafe, see 2018-12-05 security advisory.
hudson.model.UpdateCenter.updateCenterUrl
https://updates.jenkins.io/
Deprecated: Override the default update site URL. May have no effect since Jenkins 1.333.
hudson.model.UsageStatistics.disabled
false
Set to
true
to opt out of usage statistics collection, independent of UI option.
hudson.model.User.allowNonExistentUserToLogin
false
When
true
, does not check auth realm for existence of user if there’s a record in Jenkins.
Unsafe, but may be used on some instances for service accounts
hudson.model.User.allowUserCreationViaUrl
false
Whether admins accessing
/user/example
creates a user record (see SECURITY-406 on Jenkins Security Advisory 2017-02-01)
hudson.model.User.SECURITY_243_FULL_DEFENSE
true
When false, skips part of the fix that tries to determine whether a given user ID exists, and if so, doesn’t consider users with the same full name during resolution.
hudson.model.User.skipPermissionCheck
false
Disable security hardening related to Stapler routing for User. Possibly unsafe, see 2018-12-05 security advisory.
hudson.model.WorkspaceCleanupThread.disabled
false
Don’t clean up old workspaces on agent nodes
hudson.model.WorkspaceCleanupThread.recurrencePeriodHours
24
How frequently workspace cleanup should run, in hours.
hudson.model.WorkspaceCleanupThread.retainForDays
30
Unused workspaces are retained for this many days before qualifying for deletion.
hudson.node_monitors.AbstractNodeMonitorDescriptor.periodMinutes
60
(1 hour)
How frequently to update node monitors by default, in minutes.
hudson.PluginManager.checkUpdateAttempts
1
Number of attempts to check the updates sites.
hudson.PluginManager.checkUpdateSleepTimeMillis
1000
Time (milliseconds) elapsed between retries to check the updates sites.
hudson.PluginManager.className
effectively
hudson.LocalPluginManager
Can be used to specify a different
PluginManager
implementation when customizing the
.war
packaging of Jenkins.
Cannot be used for plugins.
hudson.PluginManager.noFastLookup
false
Disable fast lookup using
ClassLoaderReflectionToolkit
which reflectively accesses internal methods of
ClassLoader
.
hudson.PluginManager.skipPermissionCheck
false
Disable security hardening related to Stapler routing for PluginManager. Possibly unsafe, see 2018-12-05 security advisory.
hudson.PluginManager.workDir
undefined
Location of the base directory for all exploded .hpi/.jpi plugins.
By default the plugins will be extracted under
$JENKINS_HOME/plugins/
.
hudson.PluginStrategy
effectively
hudson.ClassicPluginStrategy
Allow plugins to be loaded into a different environment, such as an existing DI container like Plexus.
Specify the full class name of a
hudson.PluginStrategy
implementation to override the default.
hudson.PluginWrapper.dependenciesVersionCheck.enabled
true
Set to
false
to skip the version check for plugin dependencies.
hudson.ProxyConfiguration.DEFAULT_CONNECT_TIMEOUT_MILLIS
20000
Connection timeout applied to connections e.g. to the update site.
hudson.remoting.ChannelBuilder.allCallablesCanIgnoreRoleChecker
false
Disable requirement for remoting callables to perform a role check. See the description in the upgrade guide.
hudson.remoting.ChannelBuilder.specificCallablesCanIgnoreRoleChecker
undefined
Comma-separated list of class names allowed to bypass role check requirement. See the description in the upgrade guide.
hudson.remoting.ClassFilter
undefined
Allow or disallow the deserialization of specified types.
Comma-separated class names, entries are whitelisted unless prefixed with
!
.
See JEP-200#backwards-compatibility: JEP-200 and JENKINS-47736.
hudson.scheduledRetention
false
Control a agent based on a schedule
hudson.scm.SCM.useAutoBrowserHolder
false
since Jenkins 2.9,
true
before
When set to
true
, Jenkins will guess the repository browser used to render links in the changelog.
hudson.script.noCache
false
in production,
true
during development
When set to true, Jenkins will not reference resource files through the
/static/…/
URL space, preventing their caching.
This is set to
true
during development by default, and
false
otherwise.
hudson.search.Search.skipPermissionCheck
false
Disable security hardening related to Stapler routing for Search. Possibly unsafe, see 2018-12-05 security advisory.
hudson.security.AccessDeniedException2.REPORT_GROUP_HEADERS
false
If set to true, restore pre-2.46 behavior of sending HTTP headers on "access denied" pages listing group memberships.
hudson.security.ArtifactsPermission
false
The Artifacts permission allows to control access to artifacts; When this property is unset or set to false, access to artifacts is not controlled
hudson.security.csrf.CrumbFilter.UNPROCESSED_PATHINFO
false
Escape hatch for SECURITY-1774.
hudson.security.csrf.DefaultCrumbIssuer.EXCLUDE_SESSION_ID
false
Escape hatch for SECURITY-626.
hudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION
false
Restore the ability to disable CSRF protection after the UI for doing so was removed from Jenkins 2.222.
hudson.security.csrf.requestfield
.crumb
(Jenkins 1.x),
Jenkins-Crumb
(Jenkins 2.0)
Parameter name that contains a crumb value on POST requests
hudson.security.ExtendedReadPermission
false
The ExtendedReadPermission allows read-only access to "Configure" pages; can also enable with extended-read-permission plugin
hudson.security.HudsonPrivateSecurityRealm.ID_REGEX
[a-zA-Z0-9_-]+
Regex for legal user names in Jenkins user database. See SECURITY-786.
hudson.security.HudsonPrivateSecurityRealm.maximumBCryptLogRound
18
Limits the number of rounds for pre-computed BCrypt hashes of user passwords for the Jenkins user database to prevent excessive computation.
hudson.security.LDAPSecurityRealm.groupSearch
LDAP filter to look for groups by their names
hudson.security.SecurityRealm.sessionFixationProtectionMode
1
Escape hatch for SECURITY-2371.
Set to
0
to disable the fix or to
2
to select an alternative implementation.
hudson.security.TokenBasedRememberMeServices2.skipTooFarExpirationDateCheck
false
Escape hatch for SECURITY-868
hudson.security.WipeOutPermission
false
The WipeOut permission allows to control access to the "Wipe Out Workspace" action, which is normally available as soon as the Build permission is granted
hudson.slaves.ChannelPinger.pingInterval
5
Frequency (in minutes) of pings between the controller and agents.
Deprecated since 2.37, use
hudson.slaves.ChannelPinger.pingIntervalSeconds
instead.
hudson.slaves.ChannelPinger.pingIntervalSeconds
300
Frequency of pings between the controller and agents, in seconds
hudson.slaves.ChannelPinger.pingTimeoutSeconds
240
Timeout for each ping between the controller and agents, in seconds
hudson.slaves.ConnectionActivityMonitor.enabled
false
Whether to enable this feature that checks whether agents are alive and cuts them off if not.
hudson.slaves.ConnectionActivityMonitor.frequency
10000
(10 seconds)
How frequently to check for channel activity, in milliseconds.
hudson.slaves.ConnectionActivityMonitor.timeToPing
180000
(3 minutes)
How long to wait after startup to start checking agent connections, in milliseconds.
hudson.slaves.NodeProvisioner.initialDelay
10 times
hudson.model.LoadStatistics.clock
, typically 100 seconds
How long to wait after startup before starting to provision nodes from clouds. This will allow static agents to start and handle the load first.
hudson.slaves.NodeProvisioner.MARGIN
hudson.slaves.NodeProvisioner.MARGIN0
hudson.slaves.NodeProvisioner.MARGIN_DECAY
hudson.slaves.NodeProvisioner.recurrencePeriod
Equal to
hudson.model.LoadStatistics.clock
, typically 10 seconds
How frequently to possibly provision nodes.
hudson.slaves.SlaveComputer.allowUnsupportedRemotingVersions
false
Allow connection by agents running unsupported remoting versions.
hudson.slaves.WorkspaceList
@
When concurrent builds is enabled, a unique workspace directory name is required for each concurrent build. To create this name, this token is placed between project name and a unique ID, e.g. "my-project@123".
hudson.tasks.ArtifactArchiver.warnOnEmpty
false
When true, builds don’t fail when there is nothing to archive
hudson.tasks.Fingerprinter.enableFingerprintsInDependencyGraph
false
When true, jobs associated through fingerprints are added to the dependency graph, even when there is no configured upstream/downstream relationship between them.
hudson.tasks.MailSender.maxLogLines
250
Number of lines of console output to include in emails
hudson.TcpSlaveAgentListener.hostName
Same as the configured Jenkins root URL
Host name that Jenkins advertises to inbound TCP agents. Especially useful when running Jenkins behind a reverse proxy.
hudson.TcpSlaveAgentListener.port
Same as the configured TCP agent port
Port that Jenkins advertises to inbound TCP agents. Especially useful when running Jenkins behind a reverse proxy.
hudson.TreeView
false
Enables the experimental nested views feature. Has no effect since 2.302, as the experimental nested views feature has been removed.
hudson.triggers.SafeTimerTask.logsTargetDir
$JENKINS_HOME/logs
Allows to move the logs usually found under
$JENKINS_HOME/logs
to another location.
Beware that no migration is handled if you change it on an existing instance.
hudson.triggers.SCMTrigger.starvationThreshold
3600000
(1 hour)
Milliseconds waiting for polling executor before trigger reports it is clogged.
hudson.udp
33848
until 2.218,
-1
in 2.219
Port for UDP multicast broadcast. Set to -1 to disable. Has no effect since 2.220 as the feature has been removed. See SECURITY-1641
hudson.upstreamCulprits
false
Pass blame information to downstream jobs.
hudson.util.AtomicFileWriter.DISABLE_FORCED_FLUSH
false
Disables the forced flushing when calling
#close()
.
Not expected to be used.
hudson.util.CharacterEncodingFilter.disableFilter
false
Set to
true
to disable the filter that sets request encoding to UTF-8 if it’s undefined and its content type is
text/xml
or
application/xml
(API submissions).
hudson.util.CharacterEncodingFilter.forceEncoding
false
Set to
true
to force the request encoding to UTF-8 even if a different character set is declared.
hudson.Util.deletionRetryWait
100
The time (in milliseconds) to wait between attempts to delete files when retrying. This has no effect unless hudson.Util.maxFileDeletionRetries is greater than 1. If zero, there will be no delay between attempts. If negative, the delay will be a (linearly) increasing multiple of this value between attempts.
hudson.util.Digester2.UNSAFE
false
Opts out of a change in default behavior that disables the processing of XML external entities (XXE) for the
Digester2
class in Jenkins if set to
true
.
This system property can be changed while Jenkins is running and the change is effective immediately.
See 2.263.2 upgrade guide.
Has no effect since 2.297, as the
Digester2
class has been removed.
hudson.util.FormValidation.applyContentSecurityPolicyHeaders
true
Controls whether to set restrictive Content-Security-Policy headers on URLs implementing form validation responses. This reduces the impact of cross-site scripting (XSS) vulnerabilities in form validation output. See 2.263.2 upgrade guide.
hudson.util.Graph.maxArea
10000000
(10 million)
Controls the maximum size (area) for requests to render graphs like load statistics. See 2021-01-13 security advisory.
hudson.Util.maxFileDeletionRetries
3
The number of times to attempt to delete files/directory trees before giving up and throwing an exception. Specifying a value less than 1 is invalid and will be treated as if a value of 1 (i.e. one attempt, no retries) was specified. See JENKINS-10113 and JENKINS-15331.
hudson.Util.noSymLink
false
True to disable creation of symbolic links in job/builds directories
hudson.Util.performGCOnFailedDelete
false
If this flag is set to
true
then we will request a garbage collection after a deletion failure before we next retry the delete.
It is ignored unless
hudson.Util.maxFileDeletionRetries
is greater than 1.
Setting this flag to
true
may
resolve some problems on Windows, and also for directory trees residing on an NFS share, but it can have a negative impact on performance and may have no effect at all (GC behavior is JVM-specific).
Warning
: This should only ever be used if you find that your builds are failing because Jenkins is unable to delete files, that this failure is because Jenkins itself has those files locked "open", and even then it should only be used on agents with relatively few executors (because the garbage collection can impact the performance of all job executors on that agent).
Setting this flag is a act of last resort - it is not recommended, and should not be used on your main Jenkins server unless you can tolerate the performance impact
.
hudson.util.ProcessTree.disable
false
True to disable cleanup of child processes.
hudson.util.RingBufferLogHandler.defaultSize
256
Number of log entries in loggers available on the UI at
/log/
hudson.util.RobustReflectionConverter.recordFailuresForAdmins
false
If set to
true
, Old Data Monitor will record some failures to load data submitted by users with Overall/Administer permission, partially disabling a security fix.
See 2021-01-13 security advisory and
hudson.util.RobustReflectionConverter.recordFailuresForAllAuthentications
.
hudson.util.RobustReflectionConverter.recordFailuresForAllAuthentications
false
If set to
true
, Old Data Monitor will record some failures to load data submitted by all authorized users, completely disabling a security fix.
See 2021-01-13 security advisory and
hudson.util.RobustReflectionConverter.recordFailuresForAdmins
.
hudson.util.Secret.AUTO_ENCRYPT_PASSWORD_CONTROL
true
Jenkins automatically round-trips
f:password
based form fields as encrypted
Secret
even if the field is not of type
Secret
.
Set this to
false
to disable this behavior, doing so is discouraged.
hudson.util.Secret.BLANK_NONSECRET_PASSWORD_FIELDS_WITHOUT_ITEM_CONFIGURE
true
If the user is missing
Item/Configure
permission, Jenkins 2.236 and newer will blank out the password value automatically even if the form field is not backed by a
Secret
.
Set this to
false
to disable this behavior, doing so is discouraged.
hudson.util.Secret.provider
system default
Force a particular crypto provider; with Glassfish Enterprise set value to
SunJCE
to workaround JENKINS-6459 and GLASSFISH-11862.
hudson.util.StreamTaskListener.AUTO_FLUSH
false
Jenkins no longer automatically flushes streams for code running remotely on agents for better performance. This may lead to loss of messages for plugins which print to a build log from the agent machine but do not flush their output. Use this flag to restore the previous behavior for freestyle builds.
hudson.Util.symlinkEscapeHatch
false
True to use exec of "ln" binary to create symbolic links instead of native code
hudson.Util.useNativeChmodAndMode
false
True to use native (JNA/JNR) implementation to set file permissions instead of NIO. Removed without replacement in 2.304.
hudson.util.XStream2.collectionUpdateLimit
5
The maximum number of seconds that adding elements to collections may cumulatively take when loading an XML document using XStream, or
-1
to disable.
See 2022-02-09 security advisory for context.
hudson.WebAppMain.forceSessionTrackingByCookie
true
Set to
false
to not force session tracking to be done via cookie.
Escape hatch for JENKINS-61738.
hudson.widgets.HistoryWidget.threshold
30
How many builds to show in the build history side panel widget.
HUDSON_HOME
n/a
Backward compatible fallback name for
JENKINS_HOME
.
See documentation there.
jekins.SoloFilePathFilter.redactErrors
true
Set to
false
to not redact error messages when the agent-to-controller file path filters reject a file access.
This can give attackers information about files and directories on the Jenkins controller file system.
jenkins.CLI.disabled
false
true
to disable Jenkins CLI via JNLP and HTTP (SSHD can still be enabled)
jenkins.InitReactorRunner.concurrency
2x of CPU
During start of Jenkins, loading of jobs in parallel have a fixed number of threads by default (twice the CPU).
To make Jenkins load time 8x faster (assuming sufficient IO), increase it to 8x.
For example, 24 CPU Jenkins controller host use this:
-Dhudson.InitReactorRunner.concurrency=192
jenkins.install.runSetupWizard
undefined
Set to
false
to skip install wizard.
Note that doing so leaves Jenkins unsecured.
Development-mode only: Set to
true
to not skip showing the setup wizard during Jenkins development.
This property is only effective the first time you run Jenkins in given
JENKINS_HOME
.
jenkins.install.SetupWizard.adminInitialApiToken
The default admin account will not have an API Token unless a value is provided for this system property
This property determines the behavior during the SetupWizard install phase concerning the API Token creation for the initial admin account. The behavior depends on the provided value:
true
A token is generated using random value at startup and the information is put in the file
$JENKINS_HOME/secrets/initialAdminApiToken
.
A fixed API Token will be created for the user with provided value as the token.
A fixed API Token will be created for the user with the value read from the file. Jenkins will not delete the file after read, so the script is responsible to remove it when no longer needed.
Token format is
[2-char hash version][32-hex-char of secret]
, where the hash version is currently only 11, e.g.,
110123456789abcdef0123456789abcdef
.
For example can be generated in following ways:
manually by prepending
11
to output of random generator website.
Ask for 32 hex digits or 16 bytes in hex, e.g. https://www.browserling.com/tools/random-hex, https://www.random.org/bytes/
in a shell:
echo "11$(openssl rand -hex 16)"
in JavaScript:
const genRanHex = size ⇒ […Array(size)].map) ⇒ Math.floor(Math.random() * 16).toString(16.join(''); console.log('11' + genRanHex(32));
When the API Token is generated using this system property, it should be revoked during the installation script using the other ways at your disposal so that you have a fresh (random) token with less traces for your script.
See ApiTokenProperty#generateNewToken(String) and ApiTokenProperty#revokeAllTokensExceptOne(String) for scripting methods or using the web API calls:
/user/[user-login]/descriptorByName/jenkins.security.ApiTokenProperty/generateNewToken
and
/user/[user-login]/descriptorByName/jenkins.security.ApiTokenProperty/revokeAllExcept
jenkins.model.Jenkins.additionalReadablePaths
undefined
A comma-separated list of additional top level path segments that should be accessible to users without Overall/Read permission. See 2021-01-13 security advisory.
jenkins.model.Jenkins.buildsDir
${ITEM_ROOTDIR}/builds
The configuration of a given job is located underÂ
$JENKINS_HOME/jobs/[JOB_NAME]/config.xml
 and its builds are underÂ
$JENKINS_HOME/jobs/[JOB_NAME]/builds
by default.
This option allows you to store builds elsewhere, which can be useful with finer-grained backup policies, or to store the build data on a faster disk such as an SSD.
The following placeholders are supported for this value:
${JENKINS_HOME}
 â Resolves to the Jenkins home directory.
${ITEM_ROOTDIR}
â The directory containing the job metadata within Jenkins home.
${ITEM_FULL_NAME}
â The full name of the item, with file system unsafe characters replaced by others.
${ITEM_FULLNAME}
â See above, but does not replace unsafe characters.
This is a legacy option and should not be used.
For instance, if you would like to store builds outside of Jenkins home, you can use a value like the following:Â
/some_other_root/builds/${ITEM_FULL_NAME}
This used to be a UI setting, but was removed in 2.119 as it did not support migration of existing build records and could lead to build-related errors until restart.
To manually migrate existing build records when starting to use this option (
TARGET_DIR
is the value supplied to
jenkins.model.Jenkins.buildsDir
):
For Pipeline and Freestyle job types, run this for each
JOB_NAME
:
mkdir -p [TARGET_DIR]
mv $JENKINS_HOME/jobs/[JOB_NAME]/builds [TARGET_DIR]/[JOB_NAME]
For Multibranch Pipeline jobs, run for each
BRANCH_NAME
:
mkdir -p [TARGET_DIR]/[JOB_NAME]/branches/
mv $JENKINS_HOME/jobs/[JOB_NAME]/branches/[BRANCH_NAME]/builds \
[TARGET_DIR]/[JOB_NAME]/branches/[BRANCH_NAME]
For Organization Folders, run this for each
REPO_NAME
and
BRANCH_NAME
:
mkdir -p [TARGET_DIR]/[ORG_NAME]/jobs/[REPO_NAME]/branches/
mv $JENKINS_HOME/jobs/[ORG_NAME]/jobs/[REPO_NAME]/branches/[BRANCH_NAME]/builds \
[TARGET_DIR]/[ORG_NAME]/jobs/[REPO_NAME]/branches/[BRANCH_NAME]
jenkins.model.Jenkins.crumbIssuerProxyCompatibility
false
true
to enable crumb proxy compatibility when running the Setup Wizard for the first time.
jenkins.model.Jenkins.disableExceptionOnNullInstance
false
true
to disable throwing an
IllegalStateException
when
Jenkins.getInstance()
returns
null
jenkins.model.Jenkins.enableExceptionOnNullInstance
false
true
to enable throwing an
IllegalStateException
when
Jenkins.getInstance()
returns
null
jenkins.model.Jenkins.exitCodeOnRestart
5
When using the
-Dhudson.lifecycle=hudson.lifecycle.ExitLifecycle
, exit using this exit code when Jenkins is restarted
jenkins.model.Jenkins.initLogLevel
FINE
Log level for verbose messages from the init reactor listener.
jenkins.model.Jenkins.killAfterLoad
false
Exit Jenkins right after loading. Intended as a development/testing aid only.
jenkins.model.Jenkins.logStartupPerformance
false
Log startup timing info. Note that some messages are not logged on levels visible by default (i.e. INFO and up).
jenkins.model.Jenkins.nameValidationRejectsTrailingDot
true
Set to
false
to allow names to end with a trailing
.
character, which can cause problems on Windows.
Escape hatch for SECURITY-2424.
jenkins.model.Jenkins.parallelLoad
true
Loads job configurations in parallel on startup.
jenkins.model.Jenkins.slaveAgentPort
-1
(disabled) since 2.0,
0
in Jenkins 1.x.
Specifies the default TCP agent port unless/until configured differently on the UI.
-1
to disable,
0
for random port, other values for fixed port.
jenkins.model.Jenkins.slaveAgentPortEnforce
false
If true, enforces the specified
jenkins.model.Jenkins.slaveAgentPort
on startup and will not allow changing it through the UI
jenkins.model.Jenkins.workspaceDirName
workspace
Obsolete: Was used as the default workspace directory name in the legacy workspace directory layout (workspace directories within job directories).
jenkins.model.Jenkins.workspacesDir
${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}
Allows to change the directory layout for the job workspaces on the controller node.
SeeÂ
jenkins.model.Jenkins.buildsDir
for supported placeholders.
jenkins.model.JenkinsLocationConfiguration.disableUrlValidation
false
Disable URL validation intended to prevent an XSS vulnerability. See SECURITY-1471 for details.
jenkins.model.lazy.BuildReference.MODE
soft
Configure the kind of reference Jenkins uses to hold builds in memory.
Choose from among
soft
,
weak
,
strong
, and
not
(do not hold builds in memory at all).
Intended mostly as a debugging aid.
See JENKINS-19400.
jenkins.model.Nodes.enforceNameRestrictions
true
Whether to enforce new name restrictions for agent names. See 2021-01-13 security advisory.
jenkins.model.StandardArtifactManager.disableTrafficCompression
false
true
to disable GZIP compression of artifacts when they’re transferred from agent nodes to controller. Uses less CPU at the cost of increased network traffic.
jenkins.monitor.JavaVersionRecommendationAdminMonitor.disable
false
true
to disable the monitor that recommends Java 11.
jenkins.security.ApiTokenProperty.adminCanGenerateNewTokensÂ
false
true
to allow users with Overall/Administer permission to create API tokens using the new system for any user.
Note that the user will not be able to use that token since it’s only displayed to the creator, once.
jenkins.security.ApiTokenProperty.showTokenToAdmins
false
True to show API tokens for users to administrators on the user configuration page.
This was set to
false
as part of SECURITY-200
jenkins.security.ClassFilterImpl.SUPPRESS_ALL
false
Do not perform any JEP-200 class filtering when deserializing data.
Setting this to
true
is unsafe.
See documentation.
jenkins.security.ClassFilterImpl.SUPPRESS_WHITELIST
false
Do not perform whitelist-based JEP-200 class filtering when deserializing data.
With this flag set, only explicitly blacklisted types will be rejected.
Setting this to
true
is unsafe.
See documentation.
jenkins.security.FrameOptionsPageDecorator.enabled
true
Whether to send
X-Frame-Options: sameorigin
header, set to
false
to disable and make Jenkins embeddable
jenkins.security.ignoreBasicAuth
false
When set to
true
, disable
Basic
authentication with username and password (rather than API token).
jenkins.security.ManagePermission
false
Enable the optional Overall/Manage permission that allows limited access to administrative features suitable for a hosted Jenkins environment. See JEP-223.
jenkins.security.ResourceDomainRootAction.validForMinutes
30
How long a resource URL served from the resource root URL will be valid for before users are required to reauthenticate to access it. See inline documentation in Jenkins for details.
jenkins.security.s2m.CallableDirectionChecker.allow
false
This flag can be set to
true
to disable the agent-to-controller security system entirely.
Since Jenkins 2.326, this is the only way to do that, as the UI option has been removed.
jenkins.security.s2m.CallableDirectionChecker.allowAnyRole
true
This flag can be set to
false
to explicitly reject
Callable
implementations that do not declare any required role.
It is unclear whether this can safely be set to
false
in Jenkins before 2.335, or whether that would cause problems with some remoting built-in callables.
This flag was removed in Jenkins 2.335.
jenkins.security.s2m.DefaultFilePathFilter.allow
false
Allow all file paths on the Jenkins controller to be accessed from agents. This disables a big part of SECURITY-144 protections.
jenkins.security.s2m.RunningBuildFilePathFilter.FAIL
true
Set to
false
to not reject attempts to access file paths in build directories of builds not currently being built on the accessing agent.
Instead, only a warning is logged.
Attempts to access file paths in build directories from other processes will still fail.
See the description of the SECURITY-2458 security fix for context.
jenkins.security.s2m.RunningBuildFilePathFilter.SKIP
false
Set to
true
to disable the additional protection to not reject attempts to access file paths in build directories.
This will restore access to any build directories both from agents and from other processes with a remoting channel, like Maven Integration Plugin.
See the description of the SECURITY-2458 security fix for context.
jenkins.security.seed.UserSeedProperty.disableUserSeed
false
Disables user seed . Escape hatch for SECURITY-901.
jenkins.security.seed.UserSeedProperty.hideUserSeedSection
false
Hide the UI for user seed introduced for SECURITY-901.
jenkins.security.stapler.StaplerDispatchValidator.disabled
false
Escape hatch for SECURITY-534.
jenkins.security.stapler.StaplerDispatchValidator.whitelist
stapler-views-whitelist.txt
in
JENKINS_HOME
Override the location of the user configurable whitelist for stapler view dispatches. This augments the built-in whitelist for SECURITY-534 that allows dispatches to views that would otherwise be prohibited.
jenkins.security.stapler.StaticRoutingDecisionProvider.whitelist
stapler-whitelist.txt
in
JENKINS_HOME
Override the location of the user configurable whitelist for stapler request routing. This augments the built-in whitelist for SECURITY-595 that allows routing requests through methods that would otherwise be prohibited.
jenkins.security.stapler.TypedFilter.prohibitStaticAccess
true
Prohibits access to
public static
fields when routing requests in Stapler.
Escape hatch for SECURITY-595.
jenkins.security.stapler.TypedFilter.skipTypeCheck
false
Skip (return) type check when determining whether a method or field should be routable with Stapler (i.e. allow any return type). Escape hatch for SECURITY-595.
jenkins.security.SuspiciousRequestFilter.allowSemicolonsInPath
false
Escape hatch for SECURITY-1774.
Allows requests to URLs with semicolon characters (
;
) in the request path.
jenkins.security.SystemReadPermission
false
Enable the optional Overall/SystemRead permission that allows read-only access to administrative features suitable for a managed Jenkins Configuration as Code environment. See JEP-224.
jenkins.security.UserDetailsCache.EXPIRE_AFTER_WRITE_SEC
120
(2 minutes)
How long a cache for
UserDetails
should be valid for before it is looked up again from the security realm.
See JENKINS-35493.
jenkins.slaves.DefaultJnlpSlaveReceiver.disableStrictVerification
false
jenkins.slaves.JnlpSlaveAgentProtocol3.enabled
undefined
false
to disable the JNLP3 agent protocol,
true
to enable it.
Otherwise it’s randomly enabled/disabled to A/B test it.
Obsolete since the protocol was removed in 2.214.
jenkins.slaves.NioChannelSelector.disabled
false
true
to disable Nio for JNLP agents
jenkins.slaves.StandardOutputSwapper.disabled
false
Some Unix-like agents (e.g. SSH Build Agents) can communicate via stdin/stdout, which is very convenient. Unfortunately, some JVM output (e.g. related to GC) also goes to standard out. This will swap output streams around to prevent stream corruption through unexpected writes to standard out.
jenkins.telemetry.Telemetry.endpoint
https://uplink.jenkins.io/events
Change the endpoint that JEP-214/Uplink telemetry sends data to. Expected to be used for testing only.
jenkins.ui.refresh
false
true
to enable the new experimental UX on Jenkins.
See JENKINS-60920.
Also see Jenkins UX SIG.
Has no effect since 2.344 as the feature has been removed.
jenkins.util.groovy.GroovyHookScript.ROOT_PATH
$JENKINS_HOME
Set the root directory used to load groovy hooks scripts.
jenkins.util.ProgressiveRendering.DEBUG_SLEEP
0
Debug/development option to slow down the cancelling of progressive rendering when the client fails to send a heartbeat.
JENKINS_HOME
~/.jenkins
While typically set as an environment variable, Jenkins also looks up the path to its home directory as a system property.
JENKINS_HOME
set via JNDI context has higher priority than this, but this takes precedence over the environment variable.
org.jenkinsci.main.modules.sshd.SSHD.idle-timeout
undefined
Allows to configure the SSHD client idle timeout (value in milliseconds). Default value is 10min (600000ms).
org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep.REMOTE_TIMEOUT
20 seconds
How long to wait, in seconds, before interrupting remote calls and forcing cleanup when the step is stopped. See JENKINS-46507 for more information.
org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep.USE_WATCHING
false
true
to enable the experimental push mode for durable task logging.
See JENKINS-52165 for more information.
org.jenkinsci.plugins.workflow.support.pickles.ExecutorPickle.timeoutForNodeMillis
5 minutes (300,000 milliseconds)
How long to wait, in milliseconds, before aborting the build if an agent has been removed. See JENKINS-36013 for more information.
org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution.REMOVED_NODE_DETECTION
true
false
to prevent Jenkins from aborting the build if an agent has been removed.
See JENKINS-49707 for more information.
org.kohsuke.stapler.Facet.allowViewNamePathTraversal
false
Allows specifying non-simple names for views, including ones resulting in path traversal. This is an escape hatch for the SECURITY-867 fix.
org.kohsuke.stapler.jelly.IncludeTag.skipLoggingClassSetter
false
Do not log attempts to set the
class
property of
st:include
tags directly.
No log messages should be emitted in regular use, but they can be disabled if they cause unnecessary noise in the system log.
org.kohsuke.stapler.RequestImpl.ALLOWED_HTTP_VERBS_FOR_FORMS
POST
HTTP verbs of requests that are allowed to provide
StaplerRequest#getSubmittedForm
or
@SubmittedForm
.
Escape hatch for a security hardening, see 2.277.2 upgrade guide.
stapler.jelly.noCache
false
Controls both caching of various cacheable resources (Jelly scripts etc.) as well as the
Expires
HTTP response header for some static resources.
Useful during development to see the effect of changes after reload.
stapler.jelly.trace
false
Enables tracing of Jelly view composition. View the resulting page source to see comments indicating which parts of the view were created from which view fragments.
stapler.legacyGetterDispatcherMode
false
Do not filter get methods at the Stapler framework level. Escape hatch for SECURITY-595.
stapler.legacyWebMethodDispatcherMode
false
Do not filter web methods ("do" actions) at the Stapler framework level. Escape hatch for SECURITY-595.
stapler.resourcePath
undefined
Additional debug resource paths. Set by the core development tooling so developers can see the effect of changes immediately after reloading the page.
stapler.trace
true
when run using
mvn jetty:run
(core war) or
mvn hpi:run
(plugins),
false
otherwise
Trace request handling and report the result using
Stapler-Trace-…
response headers.
Additionally renders a diagnostic HTTP 404 error page when the request could not be processed.
stapler.trace.per-request
false
Trace request handling (see above) for requests with the
X-Stapler-Trace
request header set.
Was this page helpful?
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.