Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logveil_cli-0.1.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

logveil_cli-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for logveil_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 89b82f3b8b6e30c852541a99939c2e1110674d596e889310c77f07b73732ef98
MD5 c927f96bb40b52e71c380149dc65ff27
BLAKE2b-256 8738a5b063739b5f827c85152e8752df3e40f8470ba814d9c7d9dbe13b52fddb

See more details on using hashes here.

Provenance

The following attestation bundles were made for logveil_cli-0.1.1.tar.gz:

Publisher: publish.yml on piyuq11/logveil

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for logveil_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e330aed7e3b416562ef7c510123075efea5ba1fbc82edf1e9e5fa8c3015cd22
MD5 098344cf1fb71bd810b5a539af6d0f0b
BLAKE2b-256 3ca1a9f60d6b2a48278a871972852a58a36f479903d3275a228bbc437cc1373a

See more details on using hashes here.

Provenance

The following attestation bundles were made for logveil_cli-0.1.1-py3-none-any.whl:

Publisher: publish.yml on piyuq11/logveil

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page