Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-12080

job configuration corrupted when user isn't admin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Let's consider :

      • a user with job configuration rights and no overall admin right
      • a job containing a system groovy build step

      If the user edits the configuration, makes a change (even without altering the system groovy part) and then saves the configuration, an error message is displayed :

      Access Denied
      <username> is missing the Administer permission

      On Job save, Groovy plugin checks for admin permission to save the system groovy script. It may then fail. This should have been checked before rendering UI. The side effect is that the job config is partially saved (without user to know it) and may be corrupted (exception occurs on Project.submit() from builders.rebuildHetero, so job has been partially configured and not saved.

      The job configuration page, when including a system groovy script, should not be editable when user don't have ADMIN permission - Not sure about the cleaner way to implement the ADMIN only configuration

      OR the script should be set read-only for non ADMIN and then only displayed for information, but retrieved from another source than the standard incoming JSON request.

        Attachments

          Activity

          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          With a bit of additional work, I think it's possible to preserve the system groovy build step configuration without letting the current unprivileged user change it. The idea is to attach a hidden text field with an encrypted value of the system groovy build step script (it'd also need some additional information in it to prevent a replay attack.)

          Alternatively, we can make BuildStep a ReconfigurableDescribable in the core so that the values can be preserved more easily.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - With a bit of additional work, I think it's possible to preserve the system groovy build step configuration without letting the current unprivileged user change it. The idea is to attach a hidden text field with an encrypted value of the system groovy build step script (it'd also need some additional information in it to prevent a replay attack.) Alternatively, we can make BuildStep a ReconfigurableDescribable in the core so that the values can be preserved more easily.
          Hide
          ndeloof Nicolas De Loof added a comment -

          using a ReconfigurableDescribable seems more simple, isn't it ?
          just have to ignore user changes on non ADMIN and make the textarea read-only (for user to know it is not allowed to edit)

          Show
          ndeloof Nicolas De Loof added a comment - using a ReconfigurableDescribable seems more simple, isn't it ? just have to ignore user changes on non ADMIN and make the textarea read-only (for user to know it is not allowed to edit)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          src/main/java/hudson/plugins/groovy/SystemGroovy.java
          src/main/resources/hudson/plugins/groovy/SystemGroovy/config.jelly
          src/main/webapp/systemscript-projectconfig.html
          http://jenkins-ci.org/commit/groovy-plugin/d40a525294b920e11ba388060b58111c19f5c337
          Log:
          [FIXED JENKINS-12080] use a hidden, encrypted field to store configured script when user isn't admin

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/hudson/plugins/groovy/SystemGroovy.java src/main/resources/hudson/plugins/groovy/SystemGroovy/config.jelly src/main/webapp/systemscript-projectconfig.html http://jenkins-ci.org/commit/groovy-plugin/d40a525294b920e11ba388060b58111c19f5c337 Log: [FIXED JENKINS-12080] use a hidden, encrypted field to store configured script when user isn't admin
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_groovy #57
          [FIXED JENKINS-12080] use a hidden, encrypted field to store configured script when user isn't admin (Revision d40a525294b920e11ba388060b58111c19f5c337)

          Result = SUCCESS
          Nicolas De Loof :
          Files :

          • src/main/java/hudson/plugins/groovy/SystemGroovy.java
          • src/main/resources/hudson/plugins/groovy/SystemGroovy/config.jelly
          • src/main/webapp/systemscript-projectconfig.html
          Show
          dogfood dogfood added a comment - Integrated in plugins_groovy #57 [FIXED JENKINS-12080] use a hidden, encrypted field to store configured script when user isn't admin (Revision d40a525294b920e11ba388060b58111c19f5c337) Result = SUCCESS Nicolas De Loof : Files : src/main/java/hudson/plugins/groovy/SystemGroovy.java src/main/resources/hudson/plugins/groovy/SystemGroovy/config.jelly src/main/webapp/systemscript-projectconfig.html

            People

            • Assignee:
              vjuranek vjuranek
              Reporter:
              ndeloof Nicolas De Loof
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: