GithubHelp home page GithubHelp logo

localvore-today / secure_log_formatter Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 3.0 11 KB

Secure log formatting for Elixir

License: MIT License

Elixir 100.00%
elixir formatting logging secure-logging

secure_log_formatter's Issues

[request] make the sanitize function public

Hi there,

I have a potential use case for this library to be optionally incorporate into Og and two possible ways of doing it.

  1. 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.

  2. 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.

text in charlists is not replace

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

handle_sasl_reports: true causes errors

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)

recompilation gottcha

#4

Issue:

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.

Proposed Solutions:

  1. Recompilation
    mix do deps.compile secure_log_formatter --force

  2. ?? Add to discussion below other solutions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.