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

Protect environment variables better #90

Open
scovetta opened this issue Dec 21, 2022 · 0 comments
Open

Protect environment variables better #90

scovetta opened this issue Dec 21, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation GHC_OSD Grace Hopper Conference Open Source Day Issues good first issue Good for newcomers help wanted Extra attention is needed

Comments

@scovetta
Copy link
Contributor

We need to pass some environment variables into the analysis container in order for tools like Snyk to use, or for the GitHub API to be queried.

We also install packages into the container, so we should expect environment variable to walk away.

Some options:

  • Trivially encode, or encrypt with a static password. An attacker would have to learn that the payload came from the Omega Analyzer in order to decode it, which is probably more trouble than it's worth.
  • Squirrel away the password inside the image -- maybe the first thing the image does when starting is pull those variables out of env and put them somewhere on disk. An attacker would have to have a malware payload specifically look for it.
  • Have the parts of analysis that involve running untrusted code happen at the very end, and clear environment variables right before it, so there's nothing left to lose.

I'm leaning toward the last one, which should be pretty straightforward. Places we run code:

  • For npm only -- CodeQL post-install - We install a module and then run CodeQL across the entire directory, to capture all transitive dependencies. As part of the analysis, CodeQL will attempt to build, running configure/make/etc.
  • For npm, pypi, and nuget -- The strace logic does an "install" (npm i, pip install, or dotnet add).
  • For npm only -- npm audit does an install first.

These already exist near the end of the script, we might just need to move Snyk Code and manalyze up a bit.

@scovetta scovetta added the good first issue Good for newcomers label Dec 21, 2022
@Cyber-JiuJiteria Cyber-JiuJiteria added documentation Improvements or additions to documentation help wanted Extra attention is needed GHC_OSD Grace Hopper Conference Open Source Day Issues labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation GHC_OSD Grace Hopper Conference Open Source Day Issues good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants