From e5807a08ced0ce8ff0813cc0c8b1762a50764e8b Mon Sep 17 00:00:00 2001 From: Brad Gregory Date: Wed, 27 May 2020 16:30:34 -0700 Subject: [PATCH] adding pattern to regex --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index ab17468..9e88475 100644 --- a/main.go +++ b/main.go @@ -67,10 +67,10 @@ var versionedExpressions = map[string]expression{ "^(.*?): (.*?) +\\[id=(.*?)\\]$", ), reTfPlanLine: regexp.MustCompile( - "^( +)([ ~a-zA-Z0-9%._-]+)=( +)([\"<])(.*?)([>\"]) +-> +(\\()(.*)(\\))(.*)$", + "^( +)([ +~a-zA-Z0-9%._-]+)=( +)([\"<])(.*?)([>\"])( +-> +(\\()(.*)(\\))(.*))?$", ), reTfPlanCurrentResource: regexp.MustCompile( - "^([~/+-]+) (.*?) +(.*) (.*) (.*)$", + "^([~/+-]+|^\\s+[~/+-]+) (.*?) +(.*) (.*) (.*)$", ), resourceIndex: 3, assign: "=", @@ -85,7 +85,7 @@ func main() { var tfmaskChar = getEnv("TFMASK_CHAR", "*") // Pattern representing sensitive output var tfmaskValuesRegex = getEnv("TFMASK_VALUES_REGEX", - "(?i)^.*(oauth|secret|token|password|key|result|id).*$") + "(?i)^.*(oauth|secret|token|password|key|result|id|recipient).*$") // Pattern representing sensitive resource var tfmaskResourceRegex = getEnv("TFMASK_RESOURCES_REGEX", "(?i)^(random_id|random_string).*$")