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

Add functionality to avoid support for .env files #1683

Open
1 task done
Juansecu opened this issue Apr 5, 2024 · 2 comments
Open
1 task done

Add functionality to avoid support for .env files #1683

Juansecu opened this issue Apr 5, 2024 · 2 comments

Comments

@Juansecu
Copy link

Juansecu commented Apr 5, 2024

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

.env files are really good for development purposes, but for production purposes, they could mean a security issue, because, if an attacker gains access to application's files, they will be able to get sensitive data for the functionality of any application using @nestjs/config module.

Said this, the support for .env files should be configurable.

Describe the solution you'd like

Add a property in the module options for avoiding to load .env files, so environment variables are only retrieved from the Operating System.

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

The motivation of adding this feature is improving the security of Nest.js applications in production environments.

@micalevisk
Copy link
Member

what's wrong with ignoreEnvFile flag? as mentioned in the docs https://docs.nestjs.com/techniques/configuration#disable-env-variables-loading

@Juansecu
Copy link
Author

Juansecu commented Apr 6, 2024

@micalevisk Oh, didn't know that property existed 😅. Sorry, my bad!

By the way, I will have to test it out before closing this issue, if you don't mind.

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

No branches or pull requests

2 participants