Skip to content

Store secrets in the Secret Manager #587

Closed

Description

@FearlessHyena

Currently the secrets are encrypted via KMS and stored as environment variables in each Lambda
It would be much cleaner (and probably secure) if the secrets were instead stored in the Secret Manager and read in directly in the corresponding Lambdas

Another benefit of this approach is that the secrets can be directly updated in the Secret Manager and the Lambda would always have access to the latest secret without any changes
In the current model, if you want to, say rotate the KMS, you'll have to re-encrypt the secrets with the new key and update the environment variables

Activity

  1. npalm commented on Mar 8, 2021

    @npalm
    Member

    At the time we have implement we had a thought about both approaches. Cannot find any good design decsion log :( But we took into account would like to give the user of the module a choice and keep the costs low. Therefore we choose KMS and give the user to option to set his own KMS key instead of let the module create one.

    I welcome alternatives. But I really like to give the user as much flexibilty as possible, with keep security in scope. Another rationale is to keep the costs of the runner to a bare minimum for those who would to like to use the runners with almost no load.

    Feel free to suggest a more detailed changed, can you keep in mind what kind of migration steps are required? And what the mandatory costs aspects are involved in the change?

  2. Procrat commented on May 5, 2021

    @Procrat
    Contributor

    Because we didn't want to store these secrets in our Terraform state, we changed it on our fork to read them from the AWS Parameter Store. This is the relevant PR. In no way does it keep in mind the issues that Niek raised here, so I didn't bother creating an upstream PR, but perhaps it can help some people who have similar requirements.

  3. npalm commented on May 5, 2021

    @npalm
    Member

    Thanks @Procrat will check you branch.

  4. mcaulifn commented on Jun 17, 2021

    @mcaulifn
    Contributor

    The environment variables have a max size of 4kb. By adding instance types and having a longer environment name, the limit has been exceeded.

    Standard Parameter Store usage is free, and that should include secure strings.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions