Jenkins
cicd.jenkins
Protects against destructive Jenkins CLI/API operations like deleting jobs, nodes, credentials, or build history.
- 6blocking rules
- 9safe patterns
- 2Critical
- 2High
- 1Medium
- 1Low
[packs]
enabled = ["cicd.jenkins"]Evaluated when a command contains jenkins-cli, jenkins, doDelete.
Blocking rules
Each rule ID is cicd.jenkins:<name>. Use it in allowlists and [policy.rules].
Criticaljenkins-cli-delete-jobjenkins-cli delete-job deletes Jenkins jobs and can break pipelines.
Explanation
Deleting a Jenkins job removes the job configuration, build history, and all associated artifacts. Downstream jobs that depend on this job will fail. The job definition and history cannot be recovered without backups. Safer alternatives: - list-jobs: Review jobs before deletion - get-job: Export job XML configuration first - Disable the job instead of deleting
Criticaljenkins-curl-do-deletecurl POST to Jenkins doDelete endpoints deletes jobs or resources.
Explanation
POSTing to Jenkins doDelete endpoints triggers immediate deletion of jobs, builds, or other resources. This bypasses CLI safety checks and directly calls the internal deletion API. Resources cannot be recovered without backups. Safer alternatives: - Use jenkins-cli for safer deletion with confirmation - GET the resource configuration first for backup - Avoid direct API calls for destructive operations
Highjenkins-cli-delete-credentialsjenkins-cli delete-credentials removes stored credentials.
Explanation
Deleting credentials from Jenkins removes them from the credential store. Jobs and pipelines using these credentials will fail authentication. Credential values (passwords, tokens, keys) cannot be recovered after deletion. Safer alternatives: - get-credentials: Review credential metadata first - Update credentials instead of deleting - Search Jenkinsfiles for credential usage
Highjenkins-cli-delete-nodejenkins-cli delete-node deletes Jenkins nodes and can halt CI.
Explanation
Removing a Jenkins node (agent) disconnects it from the controller. Jobs configured to run on this node will fail or remain pending. Any running builds on the node will be aborted immediately. Safer alternatives: - get-node: Review node configuration first - Take node offline temporarily instead - Verify jobs don't require this specific node
Mediumjenkins-cli-delete-buildsjenkins-cli delete-builds removes build history and artifacts.
Explanation
Deleting builds removes build records, console logs, and artifacts for the specified build range. This affects audit trails, debugging capabilities, and any artifacts needed for deployments. Build history cannot be recovered. Safer alternatives: - list-jobs: Review job builds first - Download artifacts before deletion - Use build retention policies instead
Lowjenkins-cli-delete-viewjenkins-cli delete-view removes Jenkins views.
Explanation
Deleting a Jenkins view removes the view configuration. Jobs included in the view are not deleted, but the organizational structure is lost. Users relying on this view for job navigation will be affected. Safer alternatives: - list-views: Review views before deletion - Export view configuration if custom filters are used - Create a replacement view before removing
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
jenkins-cli-list-jobsjenkins-cli-get-jobjenkins-cli-buildjenkins-cli-who-am-ijenkins-cli-list-viewsjenkins-cli-list-pluginsjenkins-cli-get-nodejenkins-cli-get-credentialsjenkins-curl-explicit-get