The https://gitlab.wikimedia.org/repos/cloud/cloud-vps/networktests-tofu-provisioning repository uses a new model for setting the gitlab CI and tofu integration.
For us to get tofu plan for merge requests, we need to set the secret variables as not protected so they are available in MR branches.
Per the comment in https://phabricator.wikimedia.org/T370652#10206515:
I think that for repos/cloud you can limit the secrets exposure to MRs of branches within the repo, so it gets limited to members of the cloud team (we do so in toolforge to push images/charts to toolsbeta-harbor)
This has been implemented in a similar way.
This ticket is to verify that this is correct, before we move on with similar implementations in other tofu projects, like:
- T370652: tofu-infra: introduce additional gitlab-ci automation
- T390057: bootstrap Toolforge IaC automation
In particular, we want to verify that only "trusted" accounts can send MRs in a way that triggers gitlab CI/CD. If untrusted accounts can send arbitrary MRs that triggers the pipeline, they could submit a MR with a modified gitlab-ci.yaml file, with an 'echo $SECRET' and obtain the secrets required to perform arbitrary infrastructure changes.
