forked from jenkinsci/artifactory-plugin
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Make plugin CSP compliant #952
Open
yaroslavafenkin
wants to merge
12
commits into
jfrog:master
Choose a base branch
from
yaroslavafenkin:csp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…igurator/config.jelly`
…leConfigurator/config.jelly`
…igurator/config.jelly`
* remove unused `updateDeps` function declaration * use CSP compliant version of `st:bind`
…veConfigurator/config.jelly`
…blisher/config.jelly`
…figurator/config.jelly`
yaroslavafenkin
requested a deployment
to
frogbot
November 28, 2024 13:37 — with
GitHub Actions
Waiting
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's an ongoing Content Security Project in Jenkins (blog post in case you want to know more) where we work towards making plugins CSP compatible. This initiative will also be followed by an implementation of a CSP enforcement mechanism in Jenkins core.
This PR targets to address all of the violations currently present in the plugin.
Note⚠️
None of this has been tested against a real artifactory instance. I've focused on making sure the behaviour is the same before and after my change, checked if all event handlers are properly attached, the same data is passed as arguments, if objects are created properly and in correct scope.
JENKINS-74041
Commit: 61062e3
Inline event handler has been extracted to a separate JS file. Inline usages of
st:bind
inside JS script block have been replaced by CSP compliant version ofst:bind
.Before the change
After the change
JENKINS-74042
Commit: c6e0a7d
Inline usage of
st:bind
inside JS script block has been replaced by CSP compliant version ofst:bind
.Before the change
After the change
JENKINS-74043
Commit: ccbb39e
Inline JS script block has been moved to its own separate JS file and included via
st:adjunct
. Inline event handler has been extracted to a separate JS file.There's a part that I find problematic. Script attempts to find an element with ID of
useCredentialsPluginoverridingDeployerCredentials
. I haven't found any usages of such ID in the repo, so script never finds one and throws an error. That error is caught by the catch block and script recursively calls itself again with 0 delay. While achieving nothing it causes a huge performance issue. I've for now set the delay for the recursive call to 1 second, and also log an error.Before the change
After the change
JENKINS-74044
Commit: 728d8e9
Inline event handler has been extracted to a separate JS file.
Before the change
After the change
JENKINS-74045
Commit: d1f2d85
Inline usage of
st:bind
inside JS script block has been replaced by CSP compliant version ofst:bind
.Before the change
After the change
JENKINS-74046
Commit: 1fcfdac
Inline usage of
st:bind
inside JS script block has been replaced by CSP compliant version ofst:bind
. Inline script block containing the declaration ofupdateDeps
has been removed as no calls of the function were found in the repository.Before the change
After the change
JENKINS-74047
Commit: 171e1bb
Inline event handler and inline script block extracted to appropriate JS files.
Before the change
After the change
JENKINS-74048
Commit: 4708587
Inline usage of
st:bind
inside JS script block has been replaced by CSP compliant version ofst:bind
.Before the change
After the change
JENKINS-74049
Commit: 0fc0ab0
Removed the whole file as
customRadioButton
tag is unused. Query: https://github.com/search?q=repo%3Ajfrog%2Fjenkins-artifactory-plugin%20customRadioButton&type=codeJENKINS-74050
Commit: 9262b4f
Inline event handler and inline script block extracted to appropriate JS files. Inline
st:bind
removed completely as the object it created was not used and had no methods.Before the change
After the change
JENKINS-74051
Commit: f92c8ee
Inline usages of
st:bind
inside JS script block have been replaced by CSP compliant version ofst:bind
.Before the change
After the change
JENKINS-74052
Commit: cfde874
Inline event handlers extracted to a JS file. Conditional script blocks also extracted to a JS file preserving the logic.
Before the change
After the change