From 3497dc057b43749ad1f21b96135192b2d2ad699c Mon Sep 17 00:00:00 2001 From: RamiBerm Date: Sun, 30 May 2021 15:54:07 +0300 Subject: [PATCH] Update consts.go and messageSensitiveDataCleaner.go --- api/pkg/utils/consts.go | 5 ++--- api/pkg/utils/messageSensitiveDataCleaner.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/api/pkg/utils/consts.go b/api/pkg/utils/consts.go index 0b1a99f3d..fcaf5d5b5 100644 --- a/api/pkg/utils/consts.go +++ b/api/pkg/utils/consts.go @@ -4,6 +4,5 @@ const maskedFieldPlaceholderValue = "[REDACTED]" var personallyIdentifiableDataFields = []string {"token", "authorization", "authentication", "cookie", "userid", "password", "username", "user", "key", "passcode", "pass", "auth", "authtoken", "jwt", "bearer", "clientid", "clientsecret", "redirecturi", "phonenumber", - "zip", "zipcode", "address", "country", "city", "state", "residence", - "name", "firstname", "lastname", "suffix", "middlename", "fname", "lname", - "mname", "birthday", "birthday", "birthdate", "bday", "sender", "receiver"} + "zip", "zipcode", "address", "country", "firstname", "lastname", + "middlename", "fname", "lname", "birthdate"} diff --git a/api/pkg/utils/messageSensitiveDataCleaner.go b/api/pkg/utils/messageSensitiveDataCleaner.go index d87e21e8d..b1be71eb3 100644 --- a/api/pkg/utils/messageSensitiveDataCleaner.go +++ b/api/pkg/utils/messageSensitiveDataCleaner.go @@ -7,7 +7,6 @@ import ( "mizuserver/pkg/tap" "net/url" "strings" - ) func FilterSensitiveInfoFromHarRequest(harOutputItem *tap.OutputChannelItem) { @@ -87,6 +86,7 @@ func filterJsonMap(jsonMap map[string] interface{}) { } } +// replaces sensitive query params in url string (http://service/api?userId=bob&password=123&type=login -> http://service/api?userId=[REDACTED]&password=[REDACTED]&type=login) func filterUrl(originalUrl string) string { parsedUrl, err := url.Parse(originalUrl) if err != nil {