Redact secrets and personal data from logs locally
Project description
logveil
logveil removes common credentials and personal data from logs before they are pasted into issues, chats, or support tickets. It runs locally, reads streams line by line, and has no runtime dependencies.
It is designed for developers, support teams, maintainers, and anyone who needs to share diagnostic output without exposing credentials or personal information.
What it redacts
- Bearer tokens, GitHub tokens, OpenAI-style keys, and AWS access key IDs
- Private-key headers
- Password, token, API-key, and secret assignments
- Email addresses (optional)
- Sensitive values in nested JSON and JSONL objects
- Additional JSON keys supplied by the user
Install
python -m pip install logveil-cli
For local development:
python -m pip install -e .
Usage
Pipe a command through logveil:
my-command 2>&1 | logveil --report > safe.log
Sanitize a file:
logveil server.log -o server.safe.log
Preserve JSONL structure and redact a project-specific field:
logveil events.jsonl --jsonl --key session_id -o events.safe.jsonl
By default, malformed lines in JSONL input are treated as plain text so mixed log streams remain usable. Add --strict-jsonl to stop at the first malformed line.
Show a replacement count without mixing it into the sanitized output:
logveil server.log --report > server.safe.log
Keep email addresses when they are required for diagnosis:
logveil server.log --keep-emails
Try the included synthetic sample:
logveil examples/sample.log --report
Design principles
- Local only: no network requests and no telemetry
- Stream friendly: memory use does not grow with the input file
- Conservative: targeted rules avoid rewriting ordinary identifiers
- Composable: works with pipes, redirected output, and JSONL tooling
See the roadmap for planned improvements and the code of conduct for project participation guidelines.
Limits
Automated redaction reduces accidental disclosure but cannot recognize every secret format. Review sanitized output before publishing it. logveil deliberately avoids attempting to decode, validate, or transmit detected values. It is not a replacement for secret rotation after an exposure.
Contributing
Bug reports and small, focused pull requests are welcome. New detection rules should include tests with synthetic values and avoid matching ordinary identifiers.
Run the test suite with:
python -m unittest discover -s tests
License
MIT
Project details
Release history Release notifications | RSS feed
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 logveil_cli-0.1.1.tar.gz.
File metadata
- Download URL: logveil_cli-0.1.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89b82f3b8b6e30c852541a99939c2e1110674d596e889310c77f07b73732ef98
|
|
| MD5 |
c927f96bb40b52e71c380149dc65ff27
|
|
| BLAKE2b-256 |
8738a5b063739b5f827c85152e8752df3e40f8470ba814d9c7d9dbe13b52fddb
|
Provenance
The following attestation bundles were made for logveil_cli-0.1.1.tar.gz:
Publisher:
publish.yml on piyuq11/logveil
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logveil_cli-0.1.1.tar.gz -
Subject digest:
89b82f3b8b6e30c852541a99939c2e1110674d596e889310c77f07b73732ef98 - Sigstore transparency entry: 2186095898
- Sigstore integration time:
-
Permalink:
piyuq11/logveil@e0c2fd4b1c73a8dde7a26dc5ef6811782f0ec9f0 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/piyuq11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e0c2fd4b1c73a8dde7a26dc5ef6811782f0ec9f0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file logveil_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: logveil_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e330aed7e3b416562ef7c510123075efea5ba1fbc82edf1e9e5fa8c3015cd22
|
|
| MD5 |
098344cf1fb71bd810b5a539af6d0f0b
|
|
| BLAKE2b-256 |
3ca1a9f60d6b2a48278a871972852a58a36f479903d3275a228bbc437cc1373a
|
Provenance
The following attestation bundles were made for logveil_cli-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on piyuq11/logveil
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logveil_cli-0.1.1-py3-none-any.whl -
Subject digest:
5e330aed7e3b416562ef7c510123075efea5ba1fbc82edf1e9e5fa8c3015cd22 - Sigstore transparency entry: 2186095940
- Sigstore integration time:
-
Permalink:
piyuq11/logveil@e0c2fd4b1c73a8dde7a26dc5ef6811782f0ec9f0 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/piyuq11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e0c2fd4b1c73a8dde7a26dc5ef6811782f0ec9f0 -
Trigger Event:
release
-
Statement type: