SECURITY-218: Update to latest cli-shutdown.groovy

Update to the latest version of the script:
3b8e932110/cli-shutdown.groovy


Change-Id: Ief950cffb24229aea8cbcabf62d3339aca6c9630
This commit is contained in:
Ramy Asselin 2015-11-07 18:09:41 -08:00
parent 390d82fc09
commit 953fcaf25c
1 changed files with 6 additions and 1 deletions

View File

@ -30,6 +30,7 @@ THE SOFTWARE.
import jenkins.*;
import jenkins.model.*;
import hudson.model.*;
// disabled CLI access over TCP listener (separate port)
def p = AgentProtocol.all()
@ -38,5 +39,9 @@ p.each { x ->
}
// disable CLI access over /cli URL
def removal = { lst ->
lst.each { x -> if (x.getClass().name.contains("CLIAction")) lst.remove(x) }
}
def j = Jenkins.instance;
j.actions.each { x -> if (x.getClass().name.contains("CLIAction")) j.actions.remove(x) }
removal(j.getExtensionList(RootAction.class))
removal(j.actions)