serverless-aws-secrets icon indicating copy to clipboard operation
serverless-aws-secrets copied to clipboard

Expose the secret only during runtime

Open robin-thomas opened this issue 2 years ago • 0 comments

Rather than exposing the secret during the build stage (sls deploy), figure out a way whereby the secret shall be exposed only during runtime.

Some possible ways:

  1. Replace all instances of process.env.SECRET_ENV_VAR with a shim that connects to AWS Secrets Manager and retrieve the secret during runtime
  2. Encrypts the secret during build stage, and decrypt it during runtime
  3. Inject the secret into code (not safe, since the secret can be determined by anyone who can see the lambda code)

robin-thomas avatar Sep 17 '23 23:09 robin-thomas