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

Unable to automate configuration of permissions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • envinject-plugin
    • Debian GNU/Linux 9
      Jenkins 2.190.2
      Env Inject Plugin 2.3.0
      Configuration as Code Plugin 1.32
      Role-based Authorization Strategy Plugin 2.15

      I'm trying to automate the configuration of the `Enable permissions` EnvInject plugin setting.

       

      I've tried using the Groovy code below: 

       

      import org.jenkinsci.plugins.envinject.EnvInjectPluginConfiguration
      EnvInjectPluginConfiguration config = GlobalConfiguration.all().get(EnvInjectPluginConfiguration.class) 
      config.setEnablePermissions(true) 
      config.save()
      

       

      And the following configuration as code configuration:

       

      security: 
         envinject: 
            hideInjectedVars: false
            enablePermissions: true 
            # Bad idea, see the security advisories 
            enableLoadingFromMaster: false
      

      Both of which tick the `Enable permissions` checkbox on the `Configure Global Security` page.

       

      However when I then go to manage roles I see the column title `Env. Inject` but no check boxes.

        

       

      I've also tried using the configuration as code plugin to enable this permission but that doesn't seem to fix the issue either.

       

      This has left me having to disable anyone from seeing environment variables to stop sensitive environment variables from being visible to anyone. Ideally I'd allow certain groups to see these to aid debugging.

       

            Unassigned Unassigned
            adamdougal Adam Dougal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: