Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to configure ScriptApproval #415

Closed
odavid opened this issue Aug 3, 2018 · 7 comments
Closed

Is there a way to configure ScriptApproval #415

odavid opened this issue Aug 3, 2018 · 7 comments

Comments

@odavid
Copy link
Contributor

odavid commented Aug 3, 2018

Hi,

I am looking for a way to declare ScriptApproval.
Looking at ScriptApproval.java it seems there is no easy way to declare this using the CasC plugin.

Am I wrong? If currently there is no way to do it, how about creating a dedicated configurator for it?

@jetersen
Copy link
Member

jetersen commented Aug 3, 2018

I think it would require a dedicated configurator looking at the source code as you suggested.

@odavid
Copy link
Contributor Author

odavid commented Aug 3, 2018

This is what I thought... Will see what I can do about it...
10x!

@jetersen
Copy link
Member

jetersen commented Aug 3, 2018

Oh it definitely requires changes too: load() well mess with any configurator if I recall correctly from @ndeloof previous implementations

@ndeloof
Copy link
Contributor

ndeloof commented Aug 3, 2018

I don't think it will require changes, but for sure will require a custom Configurator to manage approvedScriptHashes, you probably want this configurator to expose a set of script to be pre-approved and configure to actually invoke preapprove. But doing so, as only a hash is stored we won't be able to export a relevant yaml structure. On the other side, asking end-user to configure hash for pre-approved scripts would be a UX non-sense.

@odavid
Copy link
Contributor Author

odavid commented Aug 3, 2018

Am working exactly on this kind of PR.
I believe it will look like the following:

scriptApproval:
  approvedSignatures:
    - method java.net.URI getHost
    - method java.net.URI getPort
    - new java.net.URI java.lang.String

@odavid
Copy link
Contributor Author

odavid commented Aug 3, 2018

I believe at least approvedSignatures should be supported.

@ndeloof
Copy link
Contributor

ndeloof commented Sep 13, 2018

discussion moved to jenkinsci/script-security-plugin#219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants