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

resource vault_generic_secret should not print out the content of data_json to console #144

Closed
Vad1mo opened this issue Jun 26, 2018 · 2 comments

Comments

@Vad1mo
Copy link
Contributor

Vad1mo commented Jun 26, 2018

When running and trying to store generated secrets, the secrets are printed out on the screen during planning. This should be avoided as this is a security relevant providers that almost always will contain sensitive data. So by default they should not be printed out.

resource "vault_generic_secret" "example" {
  sensitive = true
  path = "secret/test"
  data_json = "${jsonencode(map("dbpasswd",var.dbpasswd))}"
}
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  + vault_generic_secret.example
      id:           <computed>
      data_json:    "{\"dbpasswd\":\"test123456\"}"
      disable_read: "false"
      path:         "secret/test"

Related to: hashicorp/terraform#16643, hashicorp/terraform#8076

Vad1mo added a commit to Vad1mo/terraform-provider-vault that referenced this issue Jun 27, 2018
This MR fixes hashicorp#144 and masks `data_json` as sensitive.
Vad1mo added a commit to Vad1mo/terraform-provider-vault that referenced this issue Jun 27, 2018
This MR fixes hashicorp#144 and masks `data_json` as sensitive.
@sidewinder12s
Copy link

@tyrannosaurus-becks Can this not be configurable with a default to true?

I was using vault_generic_secret for writing arbitrary configuration data into Vault and now diffs do not work.

@lvets
Copy link

lvets commented Dec 11, 2018

Please reopen this. I now get this when I do terraform plan:

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ vault_generic_secret.lcs-role
      data_json: <sensitive> => <sensitive> (attribute changed)

  ~ vault_generic_secret.pki-infra-consul-role
      data_json: <sensitive> => <sensitive> (attribute changed)

  ~ vault_generic_secret.pki-infra-haas-api-role
      data_json: <sensitive> => <sensitive> (attribute changed)

  ~ vault_generic_secret.pki-infra-hana-role
      data_json: <sensitive> => <sensitive> (attribute changed)

  ~ vault_generic_secret.pki-infra-hana-router-role
      data_json: <sensitive> => <sensitive> (attribute changed)

  ~ vault_generic_secret.pki-infra-vault-role
      data_json: <sensitive> => <sensitive> (attribute changed)

  ~ vault_generic_secret.pki-services-hana-gateway-saml-role
      data_json: <sensitive> => <sensitive> (attribute changed)

  ~ vault_generic_secret.pki-services-service-role
      data_json: <sensitive> => <sensitive> (attribute changed)
...

None of the above contains actual sensitive data... but now I cannot see what Terraform wants to change.

Also, why is stuff like this not in the Changelog?

dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this issue Jun 17, 2021
This MR fixes hashicorp#144 and masks `data_json` as sensitive.
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

Successfully merging a pull request may close this issue.

3 participants