Skip to content

Conversation

@dakujem
Copy link
Contributor

@dakujem dakujem commented Sep 22, 2020

This feature adds possibility to define/configure a custom "scrubber" in a flexible way.
A scrubber allows for custom variable filtering to prevent sensitive data leak.
It expands the currently built-in "keys to hide" scrubbing mechanism, and should IMHO replace it by next major release.

This allows for (among others):

  • scrubbing based on value and/or keys (current scrubbing only works with keys)
  • scrubbing based on regexp matching (current scubbing only matches exact match, case-insensitive)
Tracy\Debugger::getBlueScreen()->scrubber = function(string $key, $val = null): bool {
    return
        # matches `password`, `password_repeat`, `check_password`, `DATABASE_PASSWORD`, ....
        preg_match('#password#i', $key) ||
        # matches DSN defined connections for services etc.
        ( is_string($val) && preg_match('#^https://#i', $val) )
    ;
}

... and any logic users want to easily fit into it.

Backwards compatibile.

Closes #431

with back compatibility
@dakujem
Copy link
Contributor Author

dakujem commented Sep 23, 2020

Added tests that improve code coverage.

@dakujem
Copy link
Contributor Author

dakujem commented Oct 5, 2020

Is there any way to push this PR forward? @JanTvrdik
It is quite critical for a client and we had to fall back to a workaround without tracy for the time being.
Thanks a lot!

@dg
Copy link
Member

dg commented Oct 6, 2020

Thanks, nice implementation!

@dg dg merged commit 2451aea into nette:master Oct 6, 2020
dg pushed a commit that referenced this pull request Oct 6, 2020
dg pushed a commit that referenced this pull request Oct 13, 2020
dg pushed a commit that referenced this pull request Oct 14, 2020
dg pushed a commit that referenced this pull request Oct 14, 2020
dg pushed a commit that referenced this pull request Oct 14, 2020
dg pushed a commit that referenced this pull request Oct 14, 2020
dg pushed a commit that referenced this pull request Oct 14, 2020
dg pushed a commit that referenced this pull request Oct 14, 2020
dg pushed a commit that referenced this pull request Oct 14, 2020
dg pushed a commit that referenced this pull request Oct 21, 2020
dg pushed a commit that referenced this pull request Oct 29, 2020
dg pushed a commit that referenced this pull request Oct 29, 2020
dg pushed a commit that referenced this pull request Oct 30, 2020
dg pushed a commit that referenced this pull request Nov 2, 2020
dg pushed a commit that referenced this pull request Nov 12, 2020
dg pushed a commit that referenced this pull request Nov 29, 2020
dg pushed a commit that referenced this pull request Dec 9, 2020
dg pushed a commit that referenced this pull request Dec 9, 2020
dg pushed a commit that referenced this pull request Dec 9, 2020
dg pushed a commit that referenced this pull request Dec 9, 2020
dg pushed a commit that referenced this pull request Dec 9, 2020
dg pushed a commit that referenced this pull request Dec 9, 2020
dg pushed a commit that referenced this pull request Dec 9, 2020
dg pushed a commit that referenced this pull request Dec 9, 2020
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.

Improve scrubbing/filtering capabilities of BlueScreen

3 participants