Skip to content

Unable to mask inside yaml block. #35

@vishnu-techprescient-teika

Description

Hi, I am trying to test with kubectl manifest file, but tfmask is not working.

Without tfmask
Terraform will perform the following actions:

  # kubectl_manifest.test will be updated in-place
  ~ resource "kubectl_manifest" "test" {
        id                      = "/api/v1/namespaces/default/configmaps/vishnu-test-demo"
        name                    = "vishnu-test-demo"
      ~ yaml_body               = (sensitive value)
      ~ yaml_body_parsed        = <<-EOT
            apiVersion: v1
            data:
          -   password: ijMmsd1piZwz
          +   password: ijMms1piZwz_paa
            kind: ConfigMap
            metadata:
              name: vishnu-test-demo
        EOT
        # (12 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
With tfmask
Terraform will perform the following actions:

  # kubectl_manifest.test will be updated in-place
  ~ resource "kubectl_manifest" "test" {
        id                      = "######################################################"
        name                    = "vishnu-test-demo"
      ~ yaml_body               = (sensitive value)
      ~ yaml_body_parsed        = <<-EOT
            apiVersion: v1
            data:
          -   password: ijMmsd1piZwz
          +   password: ijMms1piZwz_paa
            kind: ConfigMap
            metadata:
              name: vishnu-test-demo
        EOT
        # (12 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

My env params:

export TFMASK_CHAR="#"                                                                                                       
export TFMASK_VALUES_REGEX="(?i)^.*(oauth|secret|token|password|key|result|id).*$"

command :
terraform plan -var-file=staging.tfvars -no-color | tfmask

Expected was to also mask the password section

I am using macos and build the latest release 0.7.0 from source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions