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

"random_string" prints sensitive data to console #17

Closed
idevchris opened this issue Jan 15, 2018 · 4 comments
Closed

"random_string" prints sensitive data to console #17

idevchris opened this issue Jan 15, 2018 · 4 comments
Labels

Comments

@idevchris
Copy link

"random_string"uses the generated random string as id. The id will be printed to the console like "random_string.password: Refreshing state... (ID: s**********)" when executing terraform plan. If you want to use an random_string as an password, you won't like your sensitive data printed to the console.

Terraform Version

Terraform v0.11.2

  • provider.azurerm v1.0.1
  • provider.random v1.1.0

Affected Resource(s)

  • provider.random

Expected Behavior

random string should not use the result as id, because it could be sensitive data and will be output when running terraform plan: "random_string.password: Refreshing state... (ID: s**********)"

Actual Behavior

random string uses the result as id and outputs it when running "terraform plan"

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. create a "random_string"
  2. terraform plan
@dpmerron-ltd
Copy link

dpmerron-ltd commented Jun 12, 2018

I've raised a PR to add an additional option to the provider random_password which is essentially a code duplication of random_string but hides the output using the method shown in #18.

Feedback appreciated 👍

@simonclausen
Copy link

Having a separate random_password provider sounds like the best option to me. While I'm also looking for generating private strings with terraform for passwords, in some cases it's convenient to have the string output right there in the console.

@Bharathkumarraju
Copy link

when this will be released ...below one currently not working for me.

resource "random_password" "db_password" {
  length = 16
  special = true
  override_special = "!#()-[]<>"
}

resource "aws_db_instance" "bharaths_mysql" {
  instance_class = "db.t2.micro"
  identifier_prefix = "bharaths-terraform-up-and-running"
  engine = "mysql"
  allocated_storage = 10
  name = "bharaths_example_database"
  username = "bharath_admin"
  skip_final_snapshot     =  true
  apply_immediately = true
  password = random_password.db_password.result
  lifecycle {
    ignore_changes = ["password"]
  }
}

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants