Hello all –
I am one of the Jenkins admins at General Mills, and we are looking into using job-dsl plugin so that developers that use our Jenkins instance can define their jobs in code, check the job-dsl files in to their project, and a seed job will pick up those files and auto create/delete their Jenkins jobs.
TL;DR; We want to contribute back to the job-dsl plugin with a feature that allows scanning of the job-dsl code, and the ability to fail the Process Job DSLs step if a job-dsl method that is not in a whitelist is found, or a method that is on the Mandatory list is not found.
Proposal
We would like to contribute back to the job-dsl plugin with a feature that will allow Jenkins administrators to have some control over what is allowed in the job-dsl. Our idea is to for sure have a whitelist of steps, and possibly also a list of mandatory steps (we are defining reusable job-dsl blocks such as fxCopScan(), vs2015BuildStep(), artifactoryConfig(), checkmarxScanning(), etc. to encapsulate some of the complexity since there’s so much similarity between job definitions for our developers – screen shot of what I mean at the bottom of the email), and due to security we need to make sure that a subset of those are executed on every build. Since you already have job-dsl parsing built into your plugin, we thought that would be the most appropriate place to put it. Also, then others in the community that have these same needs could benefit. (these would all be options features of course)
The option added to scan job-dsl files in the Process Job DSLs step in the Job Config UI would look something like this:
Job-Dsl Scanning – checkbox to opt in. If checkbox is marked, the below options will appear.
- Whitelist (define steps that are allowed within the job dsl – if any jobs that are not in this whitelist are found the Process Job DSLs step will be failed)
- Mandatory Steps (list of steps that are mandatory – if any jobs defined in the job-dsls being processed do not contain these steps, the Project Job DSLs step will be failed)
*For both Whitelist and Mandatory, values could be specified in the UI, at a specific filepath, or using a dropdown to select a config file that’s globally configured (much like the Console Parsing plugin)
Our Administration Strategy Background
We are switching to this from templates because the templates we have are so locked down (we only have 2 job templates that work out of the box for 90% of developers; and they are only able to edit 4 text field parameters for these template implementations). When they want updates, beyond the parameters they can control, it’s a huge hassle for us. We want developers to be able to modify/tweak their job definitions themselves if our base job doesn’t work for some reason.
The one thing, however, that we need is the ability to somewhat restrict the things that they are adding to their jobs. We’ve looked into a few options, but the one that we have landed on is to have a whitelist and mandatory steps list of job-dsl methods that are allowed; defined somewhere in Jenkins, and to scan the job-dsl files before their processed to ensure that there’s nothing harmful/stupid in them.
(so in implementation, users wouldn’t have access to modify seed or created freestyle jobs, except through the job-dsl file in their project)
Is this change something that the community would be interested in for the job-dsl plugin?
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/3db160d4-4fd9-4217-b236-58f0bfa0ce69%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.