Closed consideRatio closed 1 year ago
More information in the github docs but there's also a degree of trust that informs how to do each pin:
The downside of 1. is that we need to update actions often, and especially means we won't get security updates if we don't stay on top of it (dependabot helps, I think?). So there can actually be a downside security-wise of pinning if it's the action itself that has a vulnerability (e.g. the codecov action contents had the vulnerability, the action repo itself was not compromised). For instance, I think it would be reasonable to trust @docker
as much as @actions
, but we can make that choice on a per-org or even per-action basis.
@minrk good points, then I suggest we trust @docker
alongside @actions
going onwards and raise discussions if there are other orgs and associated actions we want to trust or not.
dockerspawner, jupyter-remote-desktop-proxy, jupyter-server-proxy, jupyterhub-idle-culler: pypa/gh-action-pypi-publish@v1.4.1 / @v1.3.0 (latest is 1.4.2)
Feels okay for me to trust even though I would prefer we just do the terminal command ourselves directly to upload a package. Perhaps use @release/v1
which is a branch with the latest v1 releases instead of @v1.4.1
if we use the action?
Suggestion: we retain use of the pypa action, we trust it, and reference @release/v1
branch. Ok?
@sgibson91 @betatim @minrk what do you think about use of the following actions in mybinder.org-deploy's CD workflow jobs?
I think this use of a secret in a pull_request triggered workflow is harmless because it won't be made available. But, if it won't have any effect, we should not have it there just to be sure.
We use: google-github-actions/setup-gcloud@master (v0 is available, v0.2.1 is latest), azure/setup-kubectl@v1, sliteteam/github-action-git-crypt-unlock@a09ea5079c1b0e1887d4c8d7a4b20f00b5c2d06b, azure/docker-login@v1, nick-invision/retry@39da88d5f7d15a96aed861dbabbe8b7443e3182a
I think we pin where it make sense etc for these actions.
Suggestion: we retain use of the pypa action, we trust it, and reference @release/v1 branch. Ok?
Yeah, I think that's okay. It doesn't do much, so we could also do our own python -m build . && twine upload dist/*
which works for ~all Python packages like you did for docker login.
Yeah, I think that's okay. It doesn't do much, so we could also do our own python -m build . && twine upload dist/* which works for ~all Python packages like you did for docker login.
In https://github.com/jupyterhub/sudospawner/pull/69/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34R23-R36 I've added a suggestion on the equivalent of using the PyPA action.
It is pretty much to run: twine check
and twine upload
, of which twine check
now can be part of our test.
I don't think we should track this further than we have done by making the default permission for GITHUB_TOKEN that actions can access be contents:read
in the entire jupyterhub org.
I've created this issue to coordinate security work across the org.
As initiated by @manics practically in https://github.com/jupyterhub/action-major-minor-tag-calculator/pull/75 and by the discussion in https://github.com/jupyterhub/team-compass/issues/398#issuecomment-823825014, we should do various things for our GitHub repos' GitHub workflows to improve the security posture against compromised GitHub actions.
Action points for each repo
In all GitHub workflows' jobs that are referencing a GitHub secret such as
secrets.GITHUB_TOKEN
or a manually configured such assecrets.DOCKERHUB_TOKEN
, we should:Consider what actions we use and if we trust them
Pin the action references to a specific git commit hashes and make an inline comment
# associated tag: v1.2.3
for easier maintainabilityIf needed, we should add write permissions explicitly for the
secrets.GITHUB_TOKEN
which previously had them by default but doesn't any more as we made them read-only by default in the JupyterHub github org. This will be needed for jobs that update branches or tags in the repo for example.Non-archived repositories to consider
Has GHA in use
Doesn't have GHA in use, but have a need for tests/GHA
Doesn't have GHA in use, and have no need for it
Script to list repos of relevance
I used this script to get the names of repo's of relevance to create the lists above.