Have button to show values (or just rely on the edit button to show the values)
Log an audit even for the viewing (EE only?)
I am not a fan of restricting view access to Master or any other role. It just doesn't make sense given that a developer can print out the variables in a CI script.
We have a separate proposals for environment-specific variables (#20367 (closed)), role-specific variables (#23861 (moved)), and service-level variables (#23859 (moved)).
As written in the docs... you can put your credentials for the ci process right in this place. but im a bit afraid that this credentials are showing in plaintext, everyone can read it.
This page should only be accessed by owners of the repo so I don't think everyone can read it, but you may be right in thinking that they should initially be hidden although it may be useful to be able to see what you've entered as a Secure Variable at some point in the past.
To protect secure variables, that can leak thorough a build log you should configure CI in your project to hide build logs. It can be done for public projects as well.
This has been on my mind for quite some time, as I use Gitlab CI variables extensively, especially for the deploy stage. I was about to create another issue, but will add my thoughts as a comment here instead.
Anyone with Master access to a project can read all secret variables in plain text. This removes the ability to audit access to secrets. Even if secrets are printed out as part of a build, at least you know how and when they were leaked. In the current system anyone with Master access (including the admin of Gitlab) can read the secrets without anyone's knowledge. This is OK for smaller teams, but as the organisation grows it becomes more important to clearly define, restrict and audit access to secrets.
One way to handle this would be to flag some Gitlab CI variables as "hidden", which would hide their values on the variables page.
From there you could further restrict "hidden" variables to only be available on builds on specific branches - this would let you protect variables by protecting branches. Currently, any user with Developer access to the project can, knowing the name of the variable, create a build that echos/prints the secret variable. This cannot be prevented by hiding the build log.
The problem is that even if we remove the content of the secret variables from the web UI, anyone with Master access to the project could alter the .gitlab-ci.yml to use the content of the secret variables and store it somewhere in a build artifact which could then be downloaded.
Have button to show values (or just rely on the edit button to show the values)
Log an audit even for the viewing (EE only?)
I am not a fan of restricting view access to Master or any other role. It just doesn't make sense given that a developer can print out the variables in a CI script.
We have a separate proposal somewhere for environment-specific variables, and I believe we've discussed letting variables be restricted to different roles, but it would be consistently applied. i.e. if a variable is for Masters only, it would be read-write for them, and non-existent for everyone else. That way if you wanted to restrict deployments so developers couldn't access production systems, it would work. But then those developers wouldn't be able to trigger a deploy at all either. Anyway, that proposal isn't fully fleshed out yet so shouldn't be a blocker for this.
If the above proposal works, I'd be fine with proposing it for 8.14.
@ericrange That's a good suggestion, but seems like something we can do in a second iteration. Having a button to show the variables means less accidental disclosures and the ability to log to the audit trail. Asking for your password before showing variables would slightly decrease the chance of someone using your laptop/phone to access them, but with browsers autofilling passwords, that's not much of a safety net these days.
@dimitrieh Thanks. Can you create a new issue to track that iteration? Personally, I like seeing the variable keys and having the values masked rather than hiding the entire section, but we could add a password verification after clicking on the Show button. At any rather, this satisfies my immediate needs, so puts the password check at a much lower priority.