question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configure Script Approvals

See original GitHub issue

Your checklist for this issue

🚨 Please review the guidelines for contributing to this repository.

  • Link to any upstream changes that might be required (for example Jenkins Core pull request)

I don’t think there are any dependencies to implement this, but I don’t know enough about the internals to know for sure.

Feature Request

It is already possible to configure approvedSignatures:

security:
  scriptApproval:
    approvedSignatures:
      - "some signature"

But it isn’t possible to configure approved scripts or hashes of approved scripts, which is what’s technically being approved.

I’m working on migrating from jenkins-startup-scripts, where this is a built in feature. The implementation is quite simple, so I don’t see why this couldn’t be included in JCasC.

Obtaining the hashes is a bit of a pain, as it requires you to run the job that needs the script approvals, then approve them in the UI and finally grab the hashes from scriptApproval.xml in JENKINS_HOME. So we might want to simplify that by letting the user provide the whole script, but getting feature parity with the jenkins-startup-scripts is a good start.

So here is my suggestion:

security:
  scriptApproval:
    approvedScriptHashes:
      - "some hash"

To make life easier, we could also have:

security:
  scriptApproval:
    approvedScripts:
      - "some script"

However that is a bit more effort and mostly a nice to have. The first one is essential, though.

I’m happy to create a PR, but I don’t have any experience with this code base, so I would be happy if someone wants to help out. Also, if there are any workarounds available right now, please let me know.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
timjacommented, Mar 14, 2022
1reaction
codiophilecommented, Jun 17, 2020

For anyone watching this issue, I reported it for the script-security-plugin in JIRA:

https://issues.jenkins-ci.org/browse/JENKINS-62708

Read more comments on GitHub >

github_iconTop Results From Across the Web

In-process Script Approval - Jenkins
Script approval provides three options: Approve, Deny, and "Approve assuming permissions check." While the purpose of the first two are self-evident, the third ......
Read more >
Script Security Plugin - Jenkins
The first, and simpler, security system is to allow any kind of script to be run, but only with an administrator's approval. There...
Read more >
jenkinsci/configuration-as-code-plugin - Gitter
Hello all, I am trying to upgrade Jenkins to 2.361.2 and CasC plugin version of 1512.vb_79d418d5fc8. However, when I apply salt-state on a...
Read more >
Create and run scripts - Configuration Manager - Microsoft Learn
In the Configuration Manager console, click Software Library. In the Software Library workspace, click Scripts. In the Script list, choose the ...
Read more >
Custom Shell Script Approvals - Harness.io Docs
In your Pipeline, in Pipeline Stages, click +. · Select Approval Step. · Select Custom Shell Script in the Ticketing System. · Enter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found