Open grayside opened 1 year ago
This proposal cover my security concerns. We may wish to explore deployment environments (https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment). Environments can require approval before moving on to a deployment workflow step.
Background
This repository's source code is used with the hugo static site generator to build and deploy a website to GitHub Pages. We have a preview system that writes a complete site build to a subdirectory namespaced to the Pull Request to facilitate reviews. This preview system makes reviews much easier.
Problem
The preview system for the style guide is currently locked to changes pushed directly to the repository, no changes from forks:
https://github.com/GoogleCloudPlatform/samples-style-guide/blob/0bb1c7e9d98bd5e5de36374c012fc97b5418421a/.github/workflows/github_pages_preview.yml#L72
However, there can be significant contributions from folks working in a fork, such as #101.
The reason this is locked down is that providing write access to a fork is a pretty bad security risk.
Proposal
Learning from On
pull_request_target
, labels, and working with insecurity., @glasnt proposes using labels to toggle permission to run a workflow to test and label. I propose an even more restricted approach to allow the existing PR preview system to preview fork changes.preview: generate
label is applied by a maintainerpreview: failed
orpreview: ready
)As a further race condition measure:
Initial Security Assessment