Open BeTheFlow95 opened 2 years ago
Hi @BeTheFlow95 thanks for opening the issue! The root cause here is the nested sensitive property issue in Terraform SDK https://github.com/hashicorp/terraform-plugin-sdk/issues/201. Similar to #9042
Thanks for the hint @myc2h6o .
The issue shouldn't be treated like it was in #9042. It doesn't seem likely that anything is going to happen soon in the plugin sdk. From a security perspective it is better to mark the entire shared_access_policy
attribute as sensitive (as done in https://github.com/cloudscale-ch/terraform-provider-cloudscale/issues/60). Yes it is not a great UX, but the security concern of spilling all the saps weighs heavier. And if a user wants to see the sap config in their output they can use azurerm_iothub_shared_access_policy
.
Hi @bastiandg yes it makes sense to mark the entire shared_access_policy
as sensitive in terms of security.
I took a look at other similar issues, I found in azurerm_kubernetes_cluster
, nested properties kube_admin_config
and kube_config
are switched to sensitive entirely and is controlled by an environment variable by this change and later changes to sensitive by default in 3.0 by this change. However, there are also some other occurrences where we wait for the upstream SDK to be fixed. Another example #10385.
@katbyte to possibly comment on this. Are we going to use a new environment variable to control the sensitive flag of this?
Is there an existing issue for this?
Community Note
Terraform Version
1.2.4
AzureRM Provider Version
2.96.0
Affected Resource(s)/Data Source(s)
azurerm_iothub, azurerm_iothub_shared_access_policy
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Actual Behaviour
Steps to Reproduce
terraform apply
terraform state show azurerm_iothub.iothub
Shows the secrets as described above
terraform appy
terraform state show azurerm_iothub_shared_access_policy.iothub_sap
Hides the keys as expected
Important Factoids
No response
References
No response