Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
15 lines
413 B
Groovy
15 lines
413 B
Groovy
#!groovy
|
|
|
|
import jenkins.model.*
|
|
import hudson.security.*
|
|
import jenkins.security.s2m.AdminWhitelistRule
|
|
|
|
def instance = Jenkins.getInstance()
|
|
|
|
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
|
|
hudsonRealm.createAccount("admin", "vulhub")
|
|
instance.setSecurityRealm(hudsonRealm)
|
|
|
|
def strategy = new FullControlOnceLoggedInAuthorizationStrategy()
|
|
instance.setAuthorizationStrategy(strategy)
|
|
instance.save() |