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

Input step submitter parameter is ignored for administrators

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • Jenkins 2.151.0
      Pipeline Input Step: 2.9
    • pipeline-input-step-2.12

      I use the following snippet in my DSL pipeline

      operators = "ldapUserGroup"
      ChoiceParameterDefinition choice = new ChoiceParameterDefinition('continue', ['YES'] as String[], 'Description')
      returnValue = input message: 'DEPLOY ?', 
                          parameters: [choice], 
                          submitter: operators, 
                          submitterParameter: 'approver'
      

      I am not part of the ldapUserGroup thus I would expect the pipeline not to continue. However the pipeline continues anyway.

      07:39:05 Approved by Surname Lastname
      [Pipeline] }
      

      The same happens if i use a particular userID or list of userIDs rather than an ldapGroup

      operators = "userID0001,userID0002"
      ChoiceParameterDefinition choice = new ChoiceParameterDefinition('continue', ['YES'] as String[], 'Description')
      returnValue = input message: 'DEPLOY ?', 
                          parameters: [choice], 
                          submitter: operators, 
                          submitterParameter: 'approver'
      

          [JENKINS-56016] Input step submitter parameter is ignored for administrators

          papanito added a comment -

          Apparently, me as an administrator can answer the question. Other users, which are not administrator are rejected when answering the question.

          Is this the expected behaviour? If yes, I did not see this in the documentation, thus it would be good to mention this behaviour.

          papanito added a comment - Apparently, me as an administrator can answer the question. Other users, which are not administrator are rejected when answering the question. Is this the expected behaviour? If yes, I did not see this in the documentation, thus it would be good to mention this behaviour.

          Omit Rathore added a comment - - edited

          This is very dangerous issue , team relying on permissions control with submitter is broken. We had to revert to 2.8 .

           Ideal flow would be only user/team mentioned as submitter should be allowed to proceed.It is classical example of privilege escalation. It is kind of security threat.

          It's fine to have these feature if submitter is not mentioned.

          Omit Rathore added a comment - - edited This is very dangerous issue , team relying on permissions control with submitter is broken. We had to revert to 2.8 .  Ideal flow would be only user/team mentioned as submitter should be allowed to proceed.It is classical example of privilege escalation. It is kind of security threat. It's fine to have these feature if submitter is not mentioned.

          It seems that's the expected behavior due to https://issues.jenkins-ci.org/browse/JENKINS-48998. If you're an admin, you bypass the regular check of submitter user/group.

          svanoort could you confirm?

          Wadeck Follonier added a comment - It seems that's the expected behavior due to https://issues.jenkins-ci.org/browse/JENKINS-48998 . If you're an admin, you bypass the regular check of submitter user/group. svanoort could you confirm?

          Devin Nusbaum added a comment -

          wfollonier Yes, based on JENKINS-48998 it looks like it is expected that an admin can approve any input step, and this makes sense because an admin could do this anyway by rewriting the Pipeline, and if they have RUN_SCRIPTS permission as well, directly approve it via the script console or other tricky things.

          I guess we could update help-submitter.html to mention this explicitly.

          Devin Nusbaum added a comment - wfollonier Yes, based on JENKINS-48998 it looks like it is expected that an admin can approve any input step, and this makes sense because an admin could do this anyway by rewriting the Pipeline, and if they have RUN_SCRIPTS permission as well, directly approve it via the script console or other tricky things. I guess we could update help-submitter.html to mention this explicitly.

          papanito added a comment -

          papanito added a comment - I've created a pull request: https://github.com/jenkinsci/pipeline-input-step-plugin/pull/39

          Omit Rathore added a comment -

          Is there any use case where user is not an Admin  also not in submitter can still approve input step.

           

          Omit Rathore added a comment - Is there any use case where user is not an Admin  also not in submitter can still approve input step.  

          Devin Nusbaum added a comment -

          orathore I don't think so, if you think you have found such a case, and can reproduce it, please file a new issue in the SECURITY project and CC me on it.

          Devin Nusbaum added a comment - orathore I don't think so, if you think you have found such a case, and can reproduce it, please file a new issue in the SECURITY project and CC me on it.

          Devin Nusbaum added a comment -

          A PR was merged to update the documentation, but it has not been released yet.

          Devin Nusbaum added a comment - A PR was merged to update the documentation, but it has not been released yet.

          Hi, I've run into the same issue as being an Administrator allows me to approve my own processes. In my case this a problem, because I'm trying to implement a system where an additional administrator needs to approve the process, and the one that is requesting the process run is actually not in the list of the approvers acceptable. However, because of the issue mentioned above, this still allows the user to approve the process.

          Attila Tamas Zimler added a comment - Hi, I've run into the same issue as being an Administrator allows me to approve my own processes. In my case this a problem, because I'm trying to implement a system where an additional administrator needs to approve the process, and the one that is requesting the process run is actually not in the list of the approvers acceptable. However, because of the issue mentioned above, this still allows the user to approve the process.

          atzimler that could be an interesting scenario. Perhaps adding an option to allow/disallow admin in addition to the submitter list could do the trick. dnusbaum Do you think it's valuable to re-open this ticket or creating a new one? (or "refusing the scenario", also an option).

          Wadeck Follonier added a comment - atzimler that could be an interesting scenario. Perhaps adding an option to allow/disallow admin in addition to the submitter list could do the trick. dnusbaum Do you think it's valuable to re-open this ticket or creating a new one? (or "refusing the scenario", also an option).

          Devin Nusbaum added a comment -

          To me, it still seems pointless, because an admin could always approve the input indirectly through tools like the script console with their elevated permissions, or create a new job that does what they want, and just run that. Anyone with admin permissions should be considered trusted, and if you do not trust them, then they should not be an admin. If you do trust them, then this just seems like something to be enforced socially by making sure the message for the input requests that a different admin approve the input.

          Devin Nusbaum added a comment - To me, it still seems pointless, because an admin could always approve the input indirectly through tools like the script console with their elevated permissions, or create a new job that does what they want, and just run that. Anyone with admin permissions should be considered trusted, and if you do not trust them, then they should not be an admin. If you do trust them, then this just seems like something to be enforced socially by making sure the message for the input requests that a different admin approve the input.

          Hi, I've worked around the issue with actually adding cycles into the groovy description of the pipeline. I just wanted to add a note on the fact that for my scenario is not a trust issue, it is more of avoiding potential accidents with production systems. Our admin team can freely adjust the build process too, but we are responsible and don't do that either for the purpose of circumventing protective measures.

          Attila Tamas Zimler added a comment - Hi, I've worked around the issue with actually adding cycles into the groovy description of the pipeline. I just wanted to add a note on the fact that for my scenario is not a trust issue, it is more of avoiding potential accidents with production systems. Our admin team can freely adjust the build process too, but we are responsible and don't do that either for the purpose of circumventing protective measures.

          When will this released? As resolution is "fixed" I cannot vote and watch for this issue.

          Torsten Kleiber added a comment - When will this released? As resolution is "fixed" I cannot vote and watch for this issue.

          tkleiber You can find the releases including that correction at the top of the page https://github.com/jenkinsci/pipeline-input-step-plugin/commit/b0c006ed1be9bb5a55114d9239085ba4bfc48a82
          To access that page, you can scroll down in the PR page, and click on the link just after "merged commit".

          This ticket's status was forgotten, I will update it, thanks

          Wadeck Follonier added a comment - tkleiber You can find the releases including that correction at the top of the page https://github.com/jenkinsci/pipeline-input-step-plugin/commit/b0c006ed1be9bb5a55114d9239085ba4bfc48a82 To access that page, you can scroll down in the PR page, and click on the link just after "merged commit". This ticket's status was forgotten, I will update it, thanks

          Then you should reopen the issue because of regression.
          I have installed version 449.v77f0e8b_845c4 of the plugin and administrator can approve the input step despite he is not part of the submitter parameter.

          Torsten Kleiber added a comment - Then you should reopen the issue because of regression. I have installed version 449.v77f0e8b_845c4 of the plugin and administrator can approve the input step despite he is not part of the submitter parameter.

          Devin Nusbaum added a comment -

          tkleiber The resolution here should have been "Won't fix". If you look at the commit that Wadeck linked, you will see that the change is only to update the documentation to mention the current behavior. We will not change the behavior to prevent admins from approving the input, because it just does not make sense with the Jenkins security model.

          I think the nicest thing we could do would be to copy this logic into a new method that is used to add text like " (Admin override)" to the end of the "Proceed" button if the current user is only allowed to click the button because they are an admin (similar to what GitHub does when you bypass branch protections using your admin permissions to merge a PR on a repo). I do not have any time or plans to look into that myself, but anyone else is welcome to do so and file a PR.

          Devin Nusbaum added a comment - tkleiber The resolution here should have been "Won't fix". If you look at the commit that Wadeck linked, you will see that the change is only to update the documentation to mention the current behavior. We will not change the behavior to prevent admins from approving the input, because it just does not make sense with the Jenkins security model. I think the nicest thing we could do would be to copy this logic into a new method that is used to add text like " (Admin override)" to the end of the "Proceed" button if the current user is only allowed to click the button because they are an admin (similar to what GitHub does when you bypass branch protections using your admin permissions to merge a PR on a repo). I do not have any time or plans to look into that myself, but anyone else is welcome to do so and file a PR.

          Thanks Devin for the information, changed the resolution to "Won't fix"

          Wadeck Follonier added a comment - Thanks Devin for the information, changed the resolution to "Won't fix"

            papanito papanito
            papanito papanito
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: