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

Mask Elastic Beanstalk environment variable #27

Open
marcoacierno opened this issue Dec 12, 2020 · 0 comments
Open

Mask Elastic Beanstalk environment variable #27

marcoacierno opened this issue Dec 12, 2020 · 0 comments

Comments

@marcoacierno
Copy link

marcoacierno commented Dec 12, 2020

Hello!

I have an environment variable of an Elastic beanstalk resource

Something like this:

resource "aws_elastic_beanstalk_environment" "pycon_env" {
  name                = "${terraform.workspace}-env"
  application         = "${aws_elastic_beanstalk_application.pycon.name}"
  solution_stack_name = "64bit Amazon Linux 2018.03 v2.12.16 running Docker 18.06.1-ce"
  tier                = "WebServer"


  setting {
    namespace = "aws:elasticbeanstalk:application:environment"
    name      = "AWS_ACCESS_KEY_ID"
    value     = "${aws_iam_access_key.backend.id}"
  }

  setting {
    namespace = "aws:elasticbeanstalk:application:environment"
    name      = "AWS_SECRET_ACCESS_KEY"
    value     = "${aws_iam_access_key.backend.secret}"
  }
}

When I run terraform plan -no-color | tfmask the value of AWS_SECRET_ACCESS_KEY does not get replaced with ***

I was able to hide other stuff like the sentry dsn and more adding new parameters to TFMASK_VALUES_REGEX, I have something like this now:

(?i)^.*[^a-zA-Z](akia|aroa|asia|access|webhook|aws|setting|profile|database|host|username|address|dsn|oauth|oauth2|application|secret|token|password|key|result|id).*$

(side note, I also tried to hide the database host adding database and host to it, but doesn't work)

but I can't figure out how to hide that secret key :( Do you have any suggestion?

Thanks a lot!

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

1 participant