Skip to main content

CLI audit trail reader for TIBET provenance tokens

Project description

tibet-trail

CLI audit trail reader for TIBET provenance tokens. Reads, searches, and monitors JSONL files written by tibet-core FileStore.

Install

pip install tibet-trail

Commands

# Show recent tokens (default: 20)
tibet-trail log audit.jsonl [-n 50] [--format json|csv|text]

# Search by action/actor/time
tibet-trail search audit.jsonl --actor jis:hub --action "ping.*" --since 1h

# Trace provenance chain
tibet-trail trace audit.jsonl <token_id> [--depth 50]

# Live follow (tail -f style)
tibet-trail watch audit.jsonl [--filter-actor jis:hub]

# Verify integrity
tibet-trail verify audit.jsonl [--key <hex>]

# Statistics
tibet-trail stats audit.jsonl [--format json]

# Export to file
tibet-trail export audit.jsonl output.csv --format csv

Time Filters

The --since flag accepts relative times: 30s, 5m, 1h, 2d, 1w or ISO timestamps.

Python API

from tibet_trail import TrailReader

reader = TrailReader("audit.jsonl")

# Last 10 tokens
for token in reader.log(n=10):
    print(f"{token.timestamp}: {token.action} ({token.actor})")

# Search with regex
results = reader.search(action="ping.*", actor="jis:hub", since="1h")

# Trace chain
chain = reader.trace("tibet_20241217_abc12345")

# Verify integrity
report = reader.verify()
print(f"Integrity: {report['integrity']}")

# Stats
stats = reader.stats()
print(f"Total: {stats['total']}, Actors: {stats['actors']}")

Development

pip install -e ".[dev]"
pytest tests/ -v

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

tibet_trail-0.1.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

tibet_trail-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file tibet_trail-0.1.0.tar.gz.

File metadata

  • Download URL: tibet_trail-0.1.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for tibet_trail-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2b844704fdee21bc8c0fa8f379aaba7f907bd493adda9eae8140a13299494eb8
MD5 bf98cee41855b33c1d18a9196c0282b5
BLAKE2b-256 0e20600e92e83659cbfab32ae461e7feb2a6440a6c1d219ff2ad5f709bae17fd

See more details on using hashes here.

File details

Details for the file tibet_trail-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tibet_trail-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for tibet_trail-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0207e139708c77b0249ed762c42de1d8c05db61c16fb3b07d1d40a19bb1ccb04
MD5 a5fb9855a7e2ab6ed1de12a7d3d91ad7
BLAKE2b-256 91310ab06e0dbd9a8129b943463721a17c0b3ec59a73a17ef9b8104fbcd12e56

See more details on using hashes here.

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