Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Feature Request: Support masking output #5

Closed
osterman opened this issue Jan 14, 2019 · 5 comments
Closed

Feature Request: Support masking output #5

osterman opened this issue Jan 14, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@osterman
Copy link

osterman commented Jan 14, 2019

what

  • Support replacing strings matching regexes with a masking character (E.g. *)

why

  • One of the challenges with terraform in a CI/CD context is leaking sensitive information

interfaces

Create a .scenery.yaml:

mask:
  character: '*'
  patterns:
  # Mask all UUIDs
  - '/\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b/'

Usage:

terraform apply 2>&1 | scenery --mask

related

@dmlittle
Copy link
Owner

@osterman thanks for opening up an issue with this suggestion!

I think the feature request and reasoning makes sense. I can't promise a timeline nor implementation details but I'll use this issue to keep track of the progress of this feature.

@dmlittle dmlittle added the enhancement New feature or request label Jan 15, 2019
@osterman
Copy link
Author

Here's an example using a random_string resource.

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place
-/+ destroy and then create replacement
Terraform will perform the following actions:
  ~ aws_ssm_parameter.mq_master_password
      value:       <sensitive> => <sensitive> (attribute changed)
-/+ random_string.mq_admin_password (new resource required)
      id:          "none" => <computed> (forces new resource)
      length:      "16" => "16"
      lower:       "true" => "true"
      min_lower:   "0" => "0"
      min_numeric: "0" => "0"
      min_special: "0" => "0"
      min_upper:   "0" => "0"
      number:      "true" => "true"
      result:      "hHz1cRAgUbKLSsAR" => <computed>
      special:     "false" => "true" (forces new resource)
      upper:       "true" => "true"
Plan: 1 to add, 1 to change, 1 to destroy.
------------------------------------------------------------------------

@osterman
Copy link
Author

A PR for a random_password resource was just opened yesterday.

hashicorp/terraform-provider-random#52

Though we're trying to solve the general case when we cannot immediately upstream the right fix in terraform.

@osterman
Copy link
Author

We wrote tfmask to address this: https://github.com/cloudposse/tfmask

@dmlittle
Copy link
Owner

dmlittle commented Mar 8, 2021

Scenery is not actively maintained and the repo will be archived momentarily. I no longer have the time to maintain this tool nor do I think it should be kept being used as Terraform 0.11 has been deprecated for over a year now (scenery can only parse Terraform 0.11 plan outputs). Terraform 0.14 has some plan output changes as well as introduced the concept of concise diff plan outputs which does most of what scenery currently does.

If you'd like to add new functionality as you cannot upgrade your terraform version feel free you fork the repo.

@dmlittle dmlittle closed this as completed Mar 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants