scaleway / terraform-provider-scaleway

Terraform Scaleway provider
https://www.terraform.io/docs/providers/scaleway/
Mozilla Public License 2.0
199 stars 125 forks source link

fix(mnq): mark field 'file' as sensitive #2790

Closed ojroques closed 3 weeks ago

ojroques commented 3 weeks ago

Currently, when creating NATS credentials, the field 'file' is not marked as sensitive. While it does not cause issue during creation since this value is not yet computed, it causes issue during deletion where the secret is leaked:

  # scaleway_mnq_nats_credentials.key-manager will be destroyed
  # (because scaleway_mnq_nats_credentials.key-manager is not in configuration)
  - resource "scaleway_mnq_nats_credentials" "key-manager" {
      - account_id = (sensitive value) -> null
      - file       = <<-EOT
            -----BEGIN NATS USER JWT-----
             XXX REDACTED XXX
            ------END NATS USER JWT------

            ************************* IMPORTANT *************************
            NKEY Seed printed below can be used to sign and prove identity.
            NKEYs are sensitive and should be treated as secrets.

            -----BEGIN USER NKEY SEED-----
            XXX REDACTED XXX
            ------END USER NKEY SEED------

            *************************************************************
        EOT -> null
      - id         = "REDACTED" -> null
      - name       = "key-manager.fr-srr.nats" -> null
      - region     = "fr-srr" -> null
    }