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

hidden .env variables in config #1632

Closed
tgrrr opened this issue Mar 21, 2019 · 4 comments
Closed

hidden .env variables in config #1632

tgrrr opened this issue Mar 21, 2019 · 4 comments

Comments

@tgrrr
Copy link

tgrrr commented Mar 21, 2019

🌈 Feature

Allow private .env (or other) variables to be added in the configuration section

It's a popular request, see:
#1373
#1629
#1119

Add UPPERCASE_VARIABLES in the configuration section
Variables are globally accessible in the sandbox as UPPERCASE_VARIABLES
This would allow us to demo things like a google map api, without exposing our keys to the world.

create react app, dotenv, etc are all fine.

Here's an example that I couldn't finish without exposing my keys to the world:
https://codesandbox.io/s/z3vrzpz7m

@SaraVieira
Copy link
Contributor

Sorry, my mistake!

Yeah, this has been something we been thinking of and could write to a .env file that would be inivisble

@lbogdan
Copy link
Contributor

lbogdan commented Mar 21, 2019

Hey @tgrrr , thanks for the feature request!

As sandboxes run in the browser, there's really no way to have secrets inside a sandbox, because if the users' browser has access to them (and it of course needs access during execution), users will also have access to them. "Hiding" or obfuscating them somehow won't work, as security by obscurity is never a good idea.

That doesn't mean it's not possible, but you'll have to use a server sandbox, a feature which, incidentally, just went out of beta today! There's no docs for that yet (improving docs is one of our priorities for the near future), but they're quite intuitive to use, and you can see how they work in this tweet.

If you're interested in more details about containers and / or secrets, you can also reach us on Spectrum.

@Lathryx
Copy link

Lathryx commented Mar 26, 2021

I see that server sandboxes have the ability to contain secrets, but what about using secrets in something like the create-react-app template, which isn't a server sandbox, but often uses secrets for API keys and such?

@andrasbacsai
Copy link
Contributor

As @lbogdan wrote before:

As sandboxes run in the browser, there's really no way to have secrets inside a sandbox because if the users' browser has access to them (and it of course needs access during execution), users will also have access to them. "Hiding" or obfuscating them somehow won't work, as security by obscurity is never a good idea.

If there will be such a feature in the browser sandboxes, it will be visible to everybody. That's why it is not implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants