tellerops / teller

Cloud native secrets management for developers - never leave your command line for secrets.
https://github.com/tellerops/teller
Apache License 2.0
2.83k stars 186 forks source link

Fix redact for environment ( or perhaps other provider ) variables that expand to empty string #217

Closed darach closed 4 months ago

darach commented 7 months ago

Expected Behavior

Given a configuration that users the .env provider with a configuration containing any variable that mapss to the empty string

FOO=""

Redaction should ignore the variable.

Current Behavior

$ cat test.txt
This is a test
$ cat test.txt| teller redact
**REDACTED**T**REDACTED**h**REDACTED**i**REDACTED**s**REDACTED** **REDACTED**i**REDACTED**s**REDACTED** **REDACTED**a**REDACTED** **REDACTED**t**REDACTED**e**REDACTED**s**REDACTED**t**REDACTED**

Possible Solution

Preprocess and remove variables that expand to the empty string.

Steps to Reproduce

  1. Create a .teller.yml with an env provider as above
  2. Create a non empty test.txt file as above
  3. Redact the file with teller
  4. Every character will contain an unwanted **REDACTED**

Context

Ideally, environment variables should not expand to the empty string - but this will not always be practicable or possible

Specifications

jondot commented 4 months ago

Thanks, should be fixed with Teller 2.0 now.