This repository was archived by the owner on Aug 30, 2019. It is now read-only.
filters: apply replace rules only after obfuscation#477
Merged
Conversation
gbbr
force-pushed
the
gbbr/replace-after
branch
from
September 27, 2018 09:03
840b4fa to
7fe4773
Compare
gbbr
force-pushed
the
gbbr/replace-after
branch
from
September 27, 2018 09:08
7fe4773 to
0f579af
Compare
tylerbenson
approved these changes
Sep 27, 2018
tylerbenson
left a comment
There was a problem hiding this comment.
Few questions and comments, but from what I can see as a go newb it seems ok.
| Receiver *HTTPReceiver | ||
| Concentrator *Concentrator | ||
| Filters []filters.Filter | ||
| Blacklister *filters.Blacklister |
There was a problem hiding this comment.
Can I suggest Denylister instead?
rails/rails#33677
Contributor
Author
There was a problem hiding this comment.
I'm more along the lines of the second comment in that thread.
| cfg.ReplaceTags = []*config.ReplaceRule{{ | ||
| Name: "resource.name", | ||
| Re: regexp.MustCompile("AND.*"), | ||
| Repl: "...", |
There was a problem hiding this comment.
This replacement is something that would normally break the parser for normalization, right?
Contributor
Author
There was a problem hiding this comment.
Possibly, although that wasn't the case being tested here. But you're right, this is yet another bug that is resolved by this change.
palazzem
approved these changes
Sep 28, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #462
Problem:
sql.querytag created by the agent is also affected by the replace rules because it is a copy of the resulting resource. This change moves the replacer after obfuscation, when thesql.querytag is already created, leaving the original (obfuscated) query visible to the user. This also makes more sense from a UX point of view because our users will want to provide regular expressions for replacements based on what they see in the UI, which is the post-obfuscation entry.Changes to
filterpackage:FilterinterfaceresourceFilterasBlacklistertagReplacerasReplacerChanges to processor:
ReplacerandBlacklisterand run them in the correct order.Blacklisterearly andReplaceronly after obfuscation.