jenkinsci / jenkinsci/workflow-cps-plugin

[JENKINS-47392] Audit mode for script security execution

Open
#1,379 2 comments 0 reactions 0 assignees View on GitHub
component:script-security-plugin component:workflow-cps-plugin enhancement imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
186
Forks
213
Avg merge
12h 12m
Merged PRs (30d)
8

Description

As a user of script security and especially pipeline code, it is frustrating to have to run code multiple times to identify all cases where methods need whitelisting. 

Instead, I'd like to be able to run code ONCE in an "audit mode" that listens for script security violations and generates a list of methods that may be whitelist-approved to permit the script to run inside the sandbox.  Additionally, we should log the violations (either in the build log or to an audit file), and note any blacklist violations (which should not be eligible for whitelisting).

Technical note: because the code is Turing Complete and in the case of Groovy the method dispatch is complex, it's impossible to identify all methods that might be invoked before running.  Thus this is likely the best we'd be able to do.

 

---
Originally reported by svanoort, imported from: Audit mode for script security execution


  • status: Open
  • priority: Major
  • component(s): script-security-plugin, workflow-cps-plugin
  • resolution: Unresolved
  • votes: 5
  • watchers: 10
  • imported: 2025-12-07

Raw content of original issue

As a user of script security and especially pipeline code, it is frustrating to have to run code multiple times to identify all cases where methods need whitelisting. 

Instead, I'd like to be able to run code ONCE in an "audit mode" that listens for script security violations and generates a list of methods that may be whitelist-approved to permit the script to run inside the sandbox.  Additionally, we should log the violations (either in the build log or to an audit file), and note any blacklist violations (which should not be eligible for whitelisting).

Technical note: because the code is Turing Complete and in the case of Groovy the method dispatch is complex, it's impossible to identify all methods that might be invoked before running.  Thus this is likely the best we'd be able to do.

 

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the script-security-plugin and workflow-cps-plugin components referenced in the issue, focusing on how sandbox violations and blacklist decisions are currently handled. Define the audit mode's execution and logging behavior, including the distinction between whitelist candidates and blacklist violations; done means one run produces an actionable audit without requiring repeated executions.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.