Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test workflow #71

Merged
merged 2 commits into from
Feb 8, 2021
Merged

Fix test workflow #71

merged 2 commits into from
Feb 8, 2021

Conversation

mob-sakai
Copy link
Contributor

@mob-sakai mob-sakai commented Jan 29, 2021

Changes

  • Fixed: The merged Dockerfile not being tested.
  • Checkout the minimum files needed to test from the merge commit.
  • Use the pull_request event instead of the pull_request_target event.
  • Change the machine-id. (This image will not be pushed.)
  • Embed UNITY_LICENSE.

Result: https://github.com/game-ci/docker/actions/runs/545523357

Checklist

  • Read the contribution guide and accept the code of conduct
  • Readme (updated or not needed)

EDIT: The test workflow should be stopped.

@github-actions
Copy link

Cat Gif

@mob-sakai
Copy link
Contributor Author

Oh, it's not enough.
The test workflow should be stopped.

@mob-sakai
Copy link
Contributor Author

NOTE: I will refrain from disclosing the specific vulnerability (i.e., how to get the secret).

@mob-sakai mob-sakai force-pushed the test/security branch 2 times, most recently from 23ead5b to 8702e44 Compare January 29, 2021 09:28
@mob-sakai mob-sakai changed the title fix(test): fix for 'pull_request_target' vulnerability The test workflow should be stopped Jan 29, 2021
@webbertakken
Copy link
Member

Actually there is nothing to gain by getting access to the repo and the threshold to abuse the vulnerability would require some manual work and can not easily be automated.

I think we can make the workflow more self-contained. Will get back to you about it after work.

@mob-sakai
Copy link
Contributor Author

If I fix the test workflow, a malicious user could get secrets.UNITY_LICENSE.

NOTE: For now, the test workflow is broken and do not test the Dockerfiles for merge commits.
Therefore, the test workflow is safe.

@asottile
Copy link

asottile commented Feb 1, 2021

Actually there is nothing to gain by getting access to the repo

A malicious user could compromise the integrity of the code, or outright delete it. A proof of concept is easy and would take at most a few minutes to write for this repository. Note that I detected this repository using some very simple automated tooling so anyone else could do the same.

The current workflow on [the primary branch] is susceptible to leaking both a write token and the UNITY_LICENSE -- I would really start by disabling the workflow entirely to mitigate the vulnerability and then work on a solution.

@game-ci game-ci deleted a comment from asottile Feb 1, 2021
@mob-sakai
Copy link
Contributor Author

@webbertakken
What do you think about the idea of setting up another machine_id for testing and embedding UNITY_LICENSE into the test workflow?
The embedded UNITY_LICENSE is worthless to most people who use unity-builder or unity-test-runner.

@webbertakken
Copy link
Member

I think it's a nice idea, however we actually need to verify that the machine id is in-tact after any changes.

I'm thinking perhaps lets revert and just hardcode the license afterall.

@mob-sakai
Copy link
Contributor Author

mob-sakai commented Feb 7, 2021

My suggestion:

  • Use the pull_request event instead of the pull_request_target event.
  • Change the machine-id. (This image will not be pushed.)
  • Embed UNITY_LICENSE.

Result: https://github.com/game-ci/docker/actions/runs/545523357

@mob-sakai mob-sakai changed the title The test workflow should be stopped Fix test workflow Feb 7, 2021
@mob-sakai
Copy link
Contributor Author

We can modify the test workflows for unity-builder and unity-test-runner with the same solution. 👍

@webbertakken
Copy link
Member

Yea lets do that. but let's just use the regular machine id to not create extra complexity and potential test-misses for when something actually goes wrong that affects the machine id.

I don't feel comfortable messing with machine id just for sake of saving a license that's going to be public anyway. If you remove that part, i'll merge this.

@mob-sakai
Copy link
Contributor Author

👍

@webbertakken webbertakken merged commit 6ab638b into game-ci:main Feb 8, 2021
@mob-sakai mob-sakai deleted the test/security branch February 9, 2021 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants