Keep personal data out of your logs
Project description
Logstop.py
🔥 Keep personal data out of your logs
logger.info('Hi test@example.org!')
# Hi **********!
By default, scrubs:
- email addresses
- phone numbers
- credit card numbers
- Social Security numbers (SSNs)
- passwords in URLs
Works even when data is URL-encoded with plus encoding
Installation
Run:
pip install logstop
And add it to your logger:
from logstop import LogstopFilter
logger.addFilter(LogstopFilter())
Options
To scrub IP addresses (IPv4), use:
LogstopFilter(ip=True)
To scrub MAC addresses, use:
LogstopFilter(mac=True)
Disable default rules with:
LogstopFilter(
email=False,
phone=False,
credit_card=False,
ssn=False,
url_password=False
)
Notes
- To scrub existing log files, check out scrubadub
- To scan for unencrypted personal data in your database, check out pdscan
History
View the changelog
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/logstop.py.git
cd logstop.py
pip install -r requirements.txt
pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logstop-0.2.0.tar.gz.
File metadata
- Download URL: logstop-0.2.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80b1857e6aa670a3857893f1031c34cb9333ec19b10cbbc3583f84b10f36bbe0
|
|
| MD5 |
daf2bcdd63f3c1b185d9922e6257b30e
|
|
| BLAKE2b-256 |
fa9779d64a152aefcc1676abcdd056e7f63f10d3214034a0b730568207797795
|
File details
Details for the file logstop-0.2.0-py3-none-any.whl.
File metadata
- Download URL: logstop-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
949099f3126cd8893cef63c26cd02ce20976fb5f4111d15848cfb56b26194373
|
|
| MD5 |
8f2a9c31317f8dcc57956d524aeebf73
|
|
| BLAKE2b-256 |
98c924fd94e761b00571d0bcc23f0d8ee79a0df0f1835c037fa7e494dbebe0f6
|