Skip to content

primait/redact_ex

Repository files navigation

CI status Hex Docs

redact_ex

Utilities to redact sensitive data in Elixir projects

Redacting

By redacting we consider here the practice of hiding part of a potentially sensitive information, while keeping a small part of it to allow understanding that it may be a valid one.

For example, you may want to redact a telephone number in your logs, but keep the initial digits (e.g. the prefix) because that information is relevant to your understanding of the system, and at the same moment it does not expose any sensitive information.

Configuration

Usage

Full documentation is available on hexdocs

See RedactEx for general information about this library and its intended use See RedactEx.Redactor for generating fast redactors for strings See RedactEx.Redactable protocol for deriving redactable structs

Contributing

The recommended way to work is to use asdf language runtime versions manager.

You will find a .tool-versions.recommended file that - hopefully - is up to date with the versions used in CI.

Please be sure that your test pass with those versions before pushing to save yourself the wait for automatic checks.

# Use project's defaults
cp .tool-versions.recommended .tool-versions

TODO

  • Expand explanation of fallback custom implementations of algorithms
  • fix dialyzer :(

Open Points

  • Other ways of redacting (e.g. first X letters and last Y exposed, random redactors, ecc)
  • maybe-email redactor
  • define a default strict implementation for redact in the Any implementation?
  • some other default magic configuration in derive, e.g. a default module+function?
  • better handling of fallbacks for derived structs, and macro-generated helpers to "try_redact" structs that may be nil or other