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

The password-attribute of site_credential gets exposed when executing terraform destroy. #3680

Closed
baosen opened this issue Jun 17, 2019 · 9 comments
Labels
bug upstream/terraform This issue is blocked on an upstream issue within Terraform (Terraform Core/CLI, The Plugin SDK etc)

Comments

@baosen
Copy link

baosen commented Jun 17, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.12.2
AzureRM Provider v1.30.1 (did not happen on v1.25)

Affected Resource(s)

  • azurerm_app_service

Terraform Configuration Files

resource "azurerm_resource_group" "group" {
  name     = "test-sdfqwerty"
  location = "westeurope"
}

resource "azurerm_app_service_plan" "plan" {
  name                = "${azurerm_resource_group.group.name}"
  location            = "${azurerm_resource_group.group.location}"
  resource_group_name = "${azurerm_resource_group.group.name}"

  kind     = "Linux"
  reserved = true

  sku {
    tier = "PremiumV2"
    size = "P1v2"
  }
}

resource "azurerm_app_service" "app" {
  name                = "${azurerm_resource_group.group.name}"
  location            = "${azurerm_resource_group.group.location}"
  resource_group_name = "${azurerm_resource_group.group.name}"

  app_service_plan_id     = "${azurerm_app_service_plan.plan.id}"
  https_only              = "true"
  client_affinity_enabled = "false"

  site_config {
    ftps_state       = "Disabled"
    always_on        = "true"
    linux_fx_version = "PYTHON|3.7"
  }

  identity {
    type = "SystemAssigned"
  }
}

Expected Behavior

Do not print out the password-attribute of site_credential. Should say (sensitive value).

Actual Behavior

The password-attribute of site_credential gets printed out. Does not say (sensitive value).

Steps to Reproduce

  1. terraform apply -auto-approve
  2. terraform destroy
@baosen
Copy link
Author

baosen commented Aug 19, 2019

Hi! Does anyone know what caused this?

@tombuildsstuff
Copy link
Member

hi @baosen

Thanks for opening this issue.

Taking a look at the code all the instances of this appear to be a Sensitive value - as such I'm wondering if you can upgrade the version of Terraform Core being used here and confirm if this still happens for you?

Thanks!

@baosen
Copy link
Author

baosen commented Aug 20, 2019

Upgrading Terraform Core means using the latest Terraform binary? :S. I've tried using the latest 64-bit Linux Terraform binary now, which when I run ./terraform version, it prints out:

Terraform v0.12.6

  • provider.azurerm v1.32.1

and then deployed and destroyed the same config as mentioned in the first post. The output is still the same, where the password leaks :(. See attachment.

leaking

(don't worry about the pass being open to the public in this screenshot, i've destroyed the test resources :) )

@ghost ghost removed the waiting-response label Aug 20, 2019
@aczelandi
Copy link
Contributor

aczelandi commented Sep 3, 2019

@baosen @tombuildsstuff we also see the same behavior but when running terraform plan.
We are on latest terraform version and latest azurerm provider version.

@PSanetra
Copy link

PSanetra commented Oct 9, 2019

This is still happening with Terraform 0.12.9 and azurerm 1.35.0

@brennerm
Copy link
Contributor

brennerm commented Dec 5, 2019

This issue comes from a bug in the Terraform Plugin SDK. For this reason it is currently not possible to mask parts of nested blocks. One option would be to mark the whole site_credential block as sensitive. But to me this sounds like a workaround for the actual problem.

@rahmancloud
Copy link

rahmancloud commented Jan 11, 2020

Quick workaround is to omit kube_config sensitive information using egrep:

terraform plan | egrep -v 'password|other_sensitive_attribute'

@tombuildsstuff tombuildsstuff added bug upstream/terraform This issue is blocked on an upstream issue within Terraform (Terraform Core/CLI, The Plugin SDK etc) and removed question labels Feb 13, 2020
@tombuildsstuff
Copy link
Member

👋

Since this issue needs to be fixed in the Terraform Plugin SDK rather than tracking this issue in multiple places I'm going to close this issue in favour of the upstream issue. Once that's been fixed we'll update the version of the Plugin SDK being used and this should get resolved - as such please subscribe to the upstream issue for updates.

Thanks!

@ghost
Copy link

ghost commented Mar 28, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug upstream/terraform This issue is blocked on an upstream issue within Terraform (Terraform Core/CLI, The Plugin SDK etc)
Projects
None yet
Development

No branches or pull requests

6 participants