FrenchDevRemote 2 years ago

put it in an .env file and add the .env file to .gitignore?

  • muttled 2 years ago

    I was thinking the other day that there had to be a better way of storing API keys than just in a file that's not sent to source control but I really can't come up with something that isn't just security by obscurity or basically requires a human to type a credential from memory every time the server is rebooted. Maybe some sort of hardware key or the virtual equivalent in a container?

    • atmosx 2 years ago

      You can create abstractions using apps that will access the local keychain (usually password protected) and expose secrets to the local env whole running the app “a-la Doppler, secret hub, etc”. There is aws-vault which follows a similar pattern.

      Other than that, no way you can go around the fact that the token needs to be exposed at runtime… Another security layer is using temp credentials but still you need the original creds to issue the temp creds…

    • FrenchDevRemote 2 years ago

      for a closed source project you can probably do better but for an open source project i don't see a better way to dit

  • mooreds 2 years ago

    Yup! And then documenting the .env file keys and values so that other users know where to get the proper values to add to it.

    • joshstrange 2 years ago

      Adding a `.env.sample` or similar with dummy values and comments is extremely helpful along side top-level documentation

danenania 2 years ago

Check out https://www.envkey.com (disclaimer: I'm the founder).

It's open source. It uses client-side end-to-end encryption to avoid trusting the host server. You can either use our cloud (easiest option, free for up to 7 users, 2 minute setup) or self-host it (bit more work).