Before You Start
You need three pieces of information:
- Jenkins Base URL — the address of your Jenkins server (e.g. https://jenkins.example.com)
- Username — a Jenkins account that has administrator access
- API Token — a token generated for that account (see below)
Creating a Jenkins API Token
An API token is safer than using your password and can be revoked independently.
- Sign in to Jenkins with the account you want to use
- Click your username in the top-right corner, then click Security
- Scroll down to the API Token section
- Click Add new Token, give it a name (e.g.
entrust-discovery), then click Generate - Copy the token value immediately — it is only shown once
Required Jenkins Permissions
The script plugin executes Groovy scripts on the Jenkins Script Console (/scriptText) to extract certificate and credential data directly from the Java runtime. This requires a higher privilege level than the REST-based plugin.
Overall/Administer | Required. The Jenkins Script Console is restricted to administrators. Without this permission the server returns 403 and the plugin cannot run. |
Why Overall/Administer?
The plugin posts a Groovy script to the Jenkins Script Console to programmatically open Java KeyStores (CertificateCredentialsImpl.getKeyStore()) and read file-credential content (FileCredentialsImpl.getContent()). These operations are only available through the Script Console, which Jenkins restricts to accounts with full administrator rights. The script never extracts private key material — only public certificates and metadata are read.
Verifying Script Console Access
Before configuring the plugin, confirm that the service account can reach the Script Console:
- Sign in to Jenkins with the service account
- Navigate to Manage Jenkins → Script Console (or go to
<your-jenkins-url>/script) - If you see the Groovy script input box, the account has the required access
- If you see a 403 / "access denied" page, the account needs the Overall/Administer permission
Granting the Required Permission
The steps depend on which Security Realm / Authorization Strategy your Jenkins installation uses.
Matrix-based Security (built-in or LDAP realm)
- Go to Manage Jenkins → Security
- Under Authorization, select Matrix-based security (or Project-based Matrix Authorization Strategy)
- Add the service account row and tick: Overall/Administer
- Click Save
Role Strategy Plugin (role-strategy)
- Go to Manage Jenkins → Manage and Assign Roles → Manage Roles
- Create a Global role (e.g.
discovery-admin) with: Overall/Administer - Go to Assign Roles, assign the role to the service account
- Click Save