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

[JENKINS-28298] Reject unauthenticated configurations via REST / CLI #21

Merged
merged 6 commits into from Mar 27, 2016
Merged

[JENKINS-28298] Reject unauthenticated configurations via REST / CLI #21

merged 6 commits into from Mar 27, 2016

Conversation

ikedam
Copy link
Member

@ikedam ikedam commented Mar 13, 2016

JENKINS-28298

See also https://wiki.jenkins-ci.org/display/JENKINS/JENKINS-28298

When using authorize-project <= 1.1.0 with Jenkins >= 1.545,
users can inject unauthenticated SpecificUserAuthorizationStrategy and SystemAuthorizationStrategy (SystemAuthorizationStrategy is not released yet).

Followings are required for the fundamental resolution:

  • Call XStream2#addCriticalField
    • Required Jenkins >= 1.551.
  • Use Jenkins >= 1.625

Jenkins 1.532 - 1.544 is not affected by this issue, and I know I can support those versions by using Java reflections to call XStream2#addCriticalField.

But I decided to change the target version to 1.625 as:

  • It results unnecessarily complicated codes to use Java reflections.
  • Those who use Jenkins 1.545 - 1.624 will be still affected this issue.

@ikedam
Copy link
Member Author

ikedam commented Mar 13, 2016

Following tests failed as I don't call XStream2#addCriticalField yet: https://jenkins.ci.cloudbees.com/job/plugins/job/authorize-project-plugin/73/

  • org.jenkinsci.plugins.authorizeproject.strategy.SpecificUsersAuthorizationStrategyTest.testCliFailure
  • org.jenkinsci.plugins.authorizeproject.strategy.SpecificUsersAuthorizationStrategyTest.testRestInterfaceFailure
  • org.jenkinsci.plugins.authorizeproject.strategy.SystemAuthorizationStrategyTest.testCliFailure
  • org.jenkinsci.plugins.authorizeproject.strategy.SystemAuthorizationStrategyTest.testRestInterfaceFailure

I'll add a commit to call XStream2#addCriticalField.

@oleg-nenashev
Copy link
Member

Looks good to me 👍
Maybe next time makes sense to use the SECURITY project next time.

@jenkinsadmin
Copy link
Member

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@ikedam
Copy link
Member Author

ikedam commented Mar 19, 2016

Rebased after merging other pull requests.

@ikedam
Copy link
Member Author

ikedam commented Mar 19, 2016

Updated:

  • Added dependency to script-security to avoid cyclic dependencies (test scope)
  • Use IdStrategy#equals to compare user ids.
  • Fixed findbugs warnings. Mainly null checks for Jenkins.getInstance.

@ikedam ikedam merged commit 5bcf6ca into jenkinsci:master Mar 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants