Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egeniq/monolog-gdpr
Some Monolog processors that help with GDPR compliance
https://github.com/egeniq/monolog-gdpr
avg gdpr logs monolog
Last synced: 2 months ago
JSON representation
Some Monolog processors that help with GDPR compliance
- Host: GitHub
- URL: https://github.com/egeniq/monolog-gdpr
- Owner: egeniq
- License: mit
- Created: 2018-05-16T07:21:06.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2022-05-30T19:24:33.000Z (over 2 years ago)
- Last Synced: 2024-05-12T11:05:23.655Z (5 months ago)
- Topics: avg, gdpr, logs, monolog
- Language: PHP
- Size: 21.5 KB
- Stars: 52
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# monolog-gdpr [![Build Status](https://github.com/egeniq/monolog-gdpr/actions/workflows/ci.yaml/badge.svg?branch=develop)](https://github.com/egeniq/monolog-gdpr/actions/workflows/ci.yaml)
Some Monolog processors that will help in relation to the security requirements under GDPR.
These processors will replace data with their SHA-1 equivalent, allowing you still to search
logsWARNING: These processors will json serialise your `$context`. This may cause some undesired side-effects.
## Installation
Install the latest version with```
$ composer require egeniq/monolog-gdpr
```## Salted hashes
This library supports salted hashes using `processor->setSalt()`. To compute your hashed
value you could use the following bash command:```bash
$ echo -n '[email protected]' | openssl sha1
```## RedactEmailProcessor
Replaces all e-mail addresses by their SHA-1 hash.Usage:
```PHP
pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));$processor = new RedactEmailProcessor();
// optionally you may configure a salt:
$processor->setSalt('h@tsefl@ts!');
$log->pushProcessor($processor);$log->log(Logger::DEBUG, 'This is a test for [email protected]', ['foo' => ['bar' => '[email protected]']]);
```## RedactIpProcessor
Replaces all ipv4 addresses by their SHA-1 hash.Usage:
```PHP
pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));$processor = new RedactIpProcessor();
// optionally you may configure a salt:
$processor->setSalt('h@tsefl@ts!');
$log->pushProcessor($processor);$log->log(Logger::DEBUG, 'This is a test for 127.0.0.1', ['foo' => ['bar' => '127.0.0.1']]);
```## License
Package is licensed under the MIT License - see the LICENSE file for details