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 security issue in CI #17545

Merged
merged 3 commits into from Jul 17, 2020
Merged

Fix security issue in CI #17545

merged 3 commits into from Jul 17, 2020

Conversation

haampie
Copy link
Member

@haampie haampie commented Jul 15, 2020

The spack-build-env.txt file may contains many secrets, but the obvious one is the private signing key in SPACK_SIGNING_KEY. This file is nonetheless uploaded as a build artifact to gitlab. For anyone running CI on a public version of Gitlab this is a major security problem. Even for private Gitlab instances it can be very problematic.

@adamjstewart adamjstewart added ci Issues related to Continuous Integration security labels Jul 15, 2020
@haampie
Copy link
Member Author

haampie commented Jul 15, 2020

Curiously github is not picking up a force push

@haampie haampie force-pushed the fix-ci-security branch 2 times, most recently from 00ea9f0 to ba2f3fe Compare July 15, 2020 16:58
@scottwittenburg
Copy link
Contributor

Thanks @haampie, this is a good catch. Do you think there might ever a need to be able to upload this artifact (e.g. in a private gitlab instance)? It could be an option which defaults to not uploading it. Otherwise I think I'm fine if it never gets uploaded. Obviously I'm never looking at it, I just thought it would be useful at one point, so I added it.

@scottwittenburg scottwittenburg self-requested a review July 15, 2020 17:35
Copy link
Contributor

@scottwittenburg scottwittenburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thanks @haampie! Can this be backported to the current v0.15 release? I'm not sure of the process for that.

Though it's just failing a test, which should be easy to fix, I can push a commit on this branch if you want.

@becker33 becker33 added this to In Review in Spack v0.15.2 release Jul 16, 2020
@tgamblin tgamblin merged commit 1fcc00d into spack:develop Jul 17, 2020
Spack v0.15.2 release automation moved this from In Review to Done Jul 17, 2020
@haampie haampie deleted the fix-ci-security branch July 17, 2020 07:02
scottwittenburg added a commit to scottwittenburg/spack that referenced this pull request Jul 17, 2020
The `spack-build-env.txt` file may contains many secrets, but the obvious one is the private signing key in `SPACK_SIGNING_KEY`. This file is nonetheless uploaded as a build artifact to gitlab. For anyone running CI on a public version of Gitlab this is a major security problem. Even for private Gitlab instances it can be very problematic.

Co-authored-by: Scott Wittenburg <scott.wittenburg@kitware.com>
scottwittenburg added a commit to scottwittenburg/spack that referenced this pull request Jul 21, 2020
The `spack-build-env.txt` file may contains many secrets, but the obvious one is the private signing key in `SPACK_SIGNING_KEY`. This file is nonetheless uploaded as a build artifact to gitlab. For anyone running CI on a public version of Gitlab this is a major security problem. Even for private Gitlab instances it can be very problematic.

Co-authored-by: Scott Wittenburg <scott.wittenburg@kitware.com>
scottwittenburg added a commit to scottwittenburg/spack that referenced this pull request Jul 21, 2020
The `spack-build-env.txt` file may contains many secrets, but the obvious one is the private signing key in `SPACK_SIGNING_KEY`. This file is nonetheless uploaded as a build artifact to gitlab. For anyone running CI on a public version of Gitlab this is a major security problem. Even for private Gitlab instances it can be very problematic.

Co-authored-by: Scott Wittenburg <scott.wittenburg@kitware.com>
becker33 pushed a commit that referenced this pull request Jul 23, 2020
The `spack-build-env.txt` file may contains many secrets, but the obvious one is the private signing key in `SPACK_SIGNING_KEY`. This file is nonetheless uploaded as a build artifact to gitlab. For anyone running CI on a public version of Gitlab this is a major security problem. Even for private Gitlab instances it can be very problematic.

Co-authored-by: Scott Wittenburg <scott.wittenburg@kitware.com>
scottwittenburg added a commit to scottwittenburg/spack that referenced this pull request Jul 28, 2020
This reverts commit 24dff9c.

keys, aws credentials, etc from the CI process.  But the spack-build.env
file can be useful for reproducing CI builds on the command line, so
now we first filter out the secrets before writing the environment
file, then continue uploading it as an artifact like before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Issues related to Continuous Integration security
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants