Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supported Colors and Terraform 12 JSON diff secrets masking #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mnatan
Copy link

@mnatan mnatan commented Aug 6, 2020

Credit to @1n for figuring out a way of stripping ANSI colours and diffing.

We are using this project with terraform-provider-helmfile.
It tends to generate big diffs with JSON and YAML files pretty printed and we sometimes see secrets leaking to the screen.

To support masking these cases we decided to just detect secrets with regex on ANSI-stripped terraform output and saving them to a new genericMatch structure.

It contains a list of confidential strings, that are then masked in ANSI-colored output before we print it out to the screen.

The whole codebase can be adapted to this approach, however due to time constraints, I was unable to do so.

@osterman
Copy link
Contributor

This looks great!

Ugh, looks like when I wrote the github action I forgot to actually run the tests. :/

Any chance you can add that? Otherwise, I'll have @aknysh take a look.

@osterman osterman requested a review from aknysh August 12, 2020 06:49
@mnatan
Copy link
Author

mnatan commented Aug 12, 2020

Hey @osterman, I'm super swamped with deployments right now. Happy to review though.

@aknysh
Copy link
Contributor

aknysh commented Aug 12, 2020

@mnatan thanks for the PR, please rebase

@mnatan
Copy link
Author

mnatan commented Aug 13, 2020

@aknysh rebased

@connorlwilkes
Copy link

This is really useful when using with Helmfile provider. Would be good if it can be merged soon if it looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants