localvore-today / secure_log_formatter Goto Github PK
View Code? Open in Web Editor NEWSecure log formatting for Elixir
License: MIT License
Secure log formatting for Elixir
License: MIT License
Hi there,
I have a potential use case for this library to be optionally incorporate into Og and two possible ways of doing it.
The ideal approach would be where sanitize/1
functions are made public and docless perhaps in your library and then I can invoke them where I please in Og.
The less desirable approach is to apply the inspect function from SecureLogFormatter directly - because i was hoping to sanitize and then apply an option of different formatters.
This might not suit you though & I'll totally understand if it's ๐ .. I can probably work with option 2. if needs be.
Let me know what you think.
The erlang error logger gives us the text as a charlist so my regex is not correctly applied to it
in this example the elixir Logger correctly redacts the password but the error loggers output is not redacted
iex(1)> require Logger; Logger.error "password: "secret""
14:09:55.353 [error] password: [REDACTED]
iex(2)> :error_logger.error_msg "password: "secret""
14:10:13.134 [error] password: "secret"
i've fixed this as part of PR #11
dan
Hi
i noticed today that if you have handle_sasl_reports set to true you get some errors.
It seems to be do to with structures like this: [1,2 | 3] which although is a list, cannot be enumerated over!
SecureLogFormatter.sanitize([1,2|3])
** (FunctionClauseError) no function clause matching in Enum."-map/2-lists^map/1-0-"/2
stacktrace:
(elixir) lib/enum.ex:1229: Enum."-map/2-lists^map/1-0-"(#Function<2.12591307/1 in SecureLogFormatter.sanitize/1>, 3)
(elixir) lib/enum.ex:1229: Enum."-map/2-lists^map/1-0-"/2
(elixir) lib/enum.ex:1229: Enum."-map/2-lists^map/1-0-"/2
test/secure_log_formatter_test.exs:22: (test)
When you change the config for a pattern, field or replacement for the secure_log_formatter configuration, the dependency will have to be recompiled in order for the change to take effect. This is because the configuration is compiled as module attributes at compile time in SecureLogFormatter.
Recompilation
mix do deps.compile secure_log_formatter --force
?? Add to discussion below other solutions
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.