Security hooks for the Tatu DevSecOps platform
Project description
tatu-hook
A security hook that evaluates security rules locally and reports events to the Tatu DevSecOps dashboard.
What it does
tatu-hook runs as a Claude Code hook on developer machines. It intercepts tool calls (file writes, shell commands, etc.) and evaluates them against security rules — blocking secrets, destructive commands, PII exposure, and code vulnerabilities in real time.
- Secrets detection — AWS keys, GitHub tokens, Stripe keys, private keys, passwords
- PII/LGPD compliance — Brazilian CPF/CNPJ, email addresses, credit cards
- Destructive command blocking —
rm -rf,DROP TABLE,git push --force - SAST scanning — SQL injection, XSS, command injection patterns
- YARA rules — Advanced multi-condition pattern matching
Install
pip install tatu-hook
# With YARA rule support:
pip install "tatu-hook[yara]"
Quick start
Create an API key in the Tatu dashboard (Settings > API Keys), then:
tatu-hook init --api-url https://tatu.your-domain.com --api-key tatu_xxxxx
This creates ~/.tatu/manifest.json, syncs the latest rules, and registers hooks in ~/.claude/settings.json automatically.
Options:
--scope project— register hooks in.claude/settings.json(current directory) instead of globally--no-register— skip hook registration (for users who manage settings externally)
How it works
- SessionStart — Syncs rules from the Tatu API (version check, downloads only if outdated)
- PreToolUse / PostToolUse — Evaluates content against cached rules (regex + optional YARA)
- Policy modes:
audit(default) — Logs what would be blocked, never denies. Safe for onboarding.strict— Actively blocks Claude Code operations that match rules.
- Events are reported asynchronously to the dashboard (fire-and-forget, non-blocking)
Local cache
Rules are cached at ~/.tatu/ for offline resilience:
~/.tatu/
├── manifest.json # Version, API URL, API key
├── rules/ # Synced YAML rule templates
└── yara/ # Synced YARA rules
If the API is unreachable, tatu-hook falls back to cached rules silently.
CLI reference
tatu-hook --version # Show version
tatu-hook init --api-url URL --api-key KEY # Initialize configuration
tatu-hook run --event session-start # Sync rules on session start
tatu-hook run --event pre # Evaluate PreToolUse hook
tatu-hook run --event post # Evaluate PostToolUse hook
Requirements
- Python 3.10+
- PyYAML 6.0+
- (Optional) yara-python 4.5+ for YARA rule evaluation
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 tatu_hook-0.2.0.tar.gz.
File metadata
- Download URL: tatu_hook-0.2.0.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bd05b23f1e23542aae6460de83502fa0a5d2a7c5348f16d6f9cd99c945b9a57
|
|
| MD5 |
6026357fcc1744c9abeedbedb1da1e68
|
|
| BLAKE2b-256 |
49b583c335600c28a23cdf1bdae8f9ccff599d95263e5268d71755c6c928de8c
|
Provenance
The following attestation bundles were made for tatu_hook-0.2.0.tar.gz:
Publisher:
publish-tatu-hook.yml on laboratoriohacker-com/tatu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tatu_hook-0.2.0.tar.gz -
Subject digest:
5bd05b23f1e23542aae6460de83502fa0a5d2a7c5348f16d6f9cd99c945b9a57 - Sigstore transparency entry: 1115435927
- Sigstore integration time:
-
Permalink:
laboratoriohacker-com/tatu@12d8429cf6648e0b20cc5ab7d842472b7817161e -
Branch / Tag:
refs/tags/tatu-hook-v0.2.0 - Owner: https://github.com/laboratoriohacker-com
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-tatu-hook.yml@12d8429cf6648e0b20cc5ab7d842472b7817161e -
Trigger Event:
push
-
Statement type:
File details
Details for the file tatu_hook-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tatu_hook-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b2bb6bdb1a8673502a12b23a3f4ecb2d242ba13b35a8cd08442304d44076982
|
|
| MD5 |
3c6177f1db0b5d2588c051ef0b46aca6
|
|
| BLAKE2b-256 |
2817c469e2d262a8cc30c6555915daf45577ff62040cbd38630aca7d6ae74b25
|
Provenance
The following attestation bundles were made for tatu_hook-0.2.0-py3-none-any.whl:
Publisher:
publish-tatu-hook.yml on laboratoriohacker-com/tatu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tatu_hook-0.2.0-py3-none-any.whl -
Subject digest:
0b2bb6bdb1a8673502a12b23a3f4ecb2d242ba13b35a8cd08442304d44076982 - Sigstore transparency entry: 1115435937
- Sigstore integration time:
-
Permalink:
laboratoriohacker-com/tatu@12d8429cf6648e0b20cc5ab7d842472b7817161e -
Branch / Tag:
refs/tags/tatu-hook-v0.2.0 - Owner: https://github.com/laboratoriohacker-com
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-tatu-hook.yml@12d8429cf6648e0b20cc5ab7d842472b7817161e -
Trigger Event:
push
-
Statement type: