blocky icon indicating copy to clipboard operation
blocky copied to clipboard

feature: hide client ip/name in querylog

Open axelrindle opened this issue 2 years ago • 3 comments

I'd like to hide the Client IP and Name in the querylog for privacy reasons.

  • [x] Extend config
  • [x] Fix tests
  • [x] Implement for CSV etc. as well
  • [x] Move logic to QueryLoggingResolver.writeLog~~Resolve or LogEntry~~

axelrindle avatar Jun 28 '22 12:06 axelrindle

Codecov Report

Merging #575 (61175b7) into development (3009eec) will increase coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Current head 61175b7 differs from pull request most recent head 6751c15. Consider uploading reports for the commit 6751c15 to get more accurate results

@@               Coverage Diff               @@
##           development     #575      +/-   ##
===============================================
+ Coverage        92.74%   92.76%   +0.02%     
===============================================
  Files               37       37              
  Lines             3251     3260       +9     
===============================================
+ Hits              3015     3024       +9     
  Misses             170      170              
  Partials            66       66              
Impacted Files Coverage Δ
config/config.go 94.87% <ø> (ø)
querylog/database_writer.go 97.05% <100.00%> (+0.23%) :arrow_up:
resolver/query_logging_resolver.go 100.00% <100.00%> (ø)
resolver/upstream_resolver.go 91.15% <0.00%> (+0.12%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3009eec...6751c15. Read the comment docs.

codecov[bot] avatar Jun 29 '22 20:06 codecov[bot]

Thanks for your work! If I understand it right, "hideClient" is only used in databaseWriter (mysql and postgres), but not for CSV and console. I think, it would also make sense to hide client for all logging types, what do you think?

Maybe we can hide or obfuscate client/IP in QueryLoggingResolver.Resolve or LogEntry?

0xERR0R avatar Jun 29 '22 20:06 0xERR0R

Sounds good. I will try to implement this for CSV etc. as well.

Also moving the logic to a more central place is surely a good approach.

axelrindle avatar Jun 29 '22 21:06 axelrindle

replaced with #766

0xERR0R avatar Nov 24 '22 17:11 0xERR0R