GithubHelp home page GithubHelp logo

isabella232 / credentials-obfuscation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rabbitmq/credentials-obfuscation

0.0 0.0 0.0 129 KB

Tiny library/OTP app for credential obfuscation

License: Other

Erlang 100.00%

credentials-obfuscation's Introduction

Credential Obfuscator

This is a small library OTP application that acts as a helper. It encrypts and decrypts sensitive data typically stored in processes state with a one-off key (key material must be provided on node start). One example of such sensitive data is credentials used to access remote services.

This is necessary to avoid the sensitive values logged when process state is dumped by the Erlang runtime (error_logger).

Note that this application cannot protect against heap dumping attacks and only helps avoid sensitive data appearing in log files.

Usage

First, make the credentials_obfuscation application a dependency of your project.

Then, during the start-up of your application, and after the credentials_obfuscation application starts, provide the secret value:

CookieBin = atom_to_binary(erlang:get_cookie(), latin1),
credentials_obfuscation:set_secret(CookieBin)

To use a random value, do the following:

Bytes = crypto:strong_rand_bytes(128),
credentials_obfuscation:set_secret(Bytes)

To encrypt and decrypt a binary or list value:

Encrypted = credentials_obfuscation:encrypt(<<"abc">>).
% => {encrypted,<<"KdH0bP4CYasbA3X79nKShEJhajQ7D7wz1G4yqJmDS4d7zRuuUhAPuQKxdDVgxQtO">>}

credentials_obfuscation:decrypt(Encrypted).
% => <<"abc">>

Lists (char lists in Elixir) will be converted to binaries before encryption. This means that decrypted values will also be returned as binaries.

License and Copyright

See LICENSE.

(c) 2019-2020 VMware, Inc or its affiliates.

credentials-obfuscation's People

Contributors

acogoluegnes avatar carlhoerberg avatar lukebakken avatar michaelklishin avatar

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.