Cryptographic file inventory and exfiltration detection — powered by CertiSigma
Project description
CertiSigma Census
Cryptographic file inventory and exfiltration detection — powered by CertiSigma.
Census scans directories, computes SHA-256 hashes, attests them via the CertiSigma API (three-layer cryptographic proof: ECDSA T0, qualified TSA T1, Bitcoin T2), and maintains a local manifest. When suspect files surface, Census compares their hashes against the registry to prove — with cryptographic certainty — whether they match inventoried assets.
Installation
pip install certisigma-census
# With watch mode (filesystem monitoring)
pip install certisigma-census[watch]
Requires Python 3.10+.
Quick Start
1. Inventory scan
export CERTISIGMA_API_KEY=cs_...
# Scan a directory and attest all file hashes
census scan /path/to/sensitive-files --source inventory-hr
# Dry run — hash only, no attestation
census scan /path/to/files --dry-run
# Scan only PDFs and Word docs, skip files over 100 MB
census scan /data --include "*.pdf" --include "*.docx" --max-size 100M
# Resume an interrupted scan
census scan /data --source quarterly --manifest inventory.db --resume
This produces a .census-manifest.db (SQLite) mapping each hash to its file path, size, and attestation metadata.
2. Breach comparison
# Compare suspect files against the CertiSigma registry
census compare /path/to/suspect-files --manifest /path/to/.census-manifest.db
# Save report as JSON or CSV
census compare /suspect --output report.json
census compare /suspect --output report.csv
Exit code: 0 if no matches, 1 if matches found.
3. Manifest status and export
# Show summary
census status /path/to/.census-manifest.db
# Export manifest as CSV for compliance reporting
census export manifest.db --format csv --output inventory.csv
# Export as JSON
census export manifest.db --format json --output inventory.json
4. Watch mode (continuous monitoring)
# Watch a directory for changes and attest new/modified files
census watch /path/to/files --source "production"
# Dry run — hash only, no attestation
census watch /data --dry-run
# Network mount — use polling
census watch /mnt/share --polling --poll-interval 10
Requires: pip install certisigma-census[watch]
How It Works
- Scan — Census walks the directory, computes SHA-256 for each file (streamed, constant memory), and builds a local manifest.
- Attest — Hashes are sent in batches (up to 100 per call) to the CertiSigma API. Each hash receives a three-layer cryptographic proof (T0 ECDSA signature, T1 qualified TSA timestamp, T2 Bitcoin anchor).
- Compare — Suspect files are hashed and verified against the registry via
POST /verify/batch. Matches prove the file was previously inventoried, regardless of filename or directory structure changes.
The original file content never leaves the client. Only SHA-256 hashes are transmitted.
Features
| Feature | Description | Docs |
|---|---|---|
| File filters | --include, --exclude globs; --min-size, --max-size |
scanning.md |
| Resume scans | --resume skips unchanged files, preserves attestation state |
scanning.md |
| CSV/JSON export | Compare reports and manifest export in both formats | comparison.md |
| Retry with backoff | Automatic retry on 429/5xx with exponential backoff | retry-and-resilience.md |
| Structured logging | --log-format json for SIEM/ELK integration |
logging.md |
| Progress bars | Visual feedback for scan, attest, and compare operations | scanning.md |
| SQLite manifest | WAL mode, indexed lookups, auto-migration from JSON | manifest.md |
| Watch mode | Continuous filesystem monitoring with batch attestation | watching.md |
Full documentation: docs/features/
CLI Reference
Global options
| Option | Description |
|---|---|
-v / --verbose |
Enable debug logging |
--log-format text|json |
Log output format (default: text) |
--version |
Show version |
census scan
| Option | Description |
|---|---|
--source LABEL |
Source label for attestations |
--manifest PATH |
Manifest output path (default: <dir>/.census-manifest.db) |
--api-key KEY |
API key (or set CERTISIGMA_API_KEY) |
--base-url URL |
Override API base URL |
--dry-run |
Hash only, no attestation |
--resume |
Resume interrupted scan |
--include GLOB |
Include files matching pattern (repeatable) |
--exclude GLOB |
Exclude files matching pattern (repeatable) |
--min-size SIZE |
Skip files smaller than SIZE (e.g. 1K, 10M) |
--max-size SIZE |
Skip files larger than SIZE (default: 5G) |
census compare
| Option | Description |
|---|---|
--manifest PATH |
Local manifest for cross-referencing |
--output PATH |
Save report (.json or .csv by extension) |
--include/--exclude/--min-size/--max-size |
Same filters as scan |
census export
| Option | Description |
|---|---|
--format csv|json |
Output format (default: csv) |
--output PATH |
Output file (default: stdout) |
census status
Takes a manifest path as argument. No additional options.
census watch
| Option | Description |
|---|---|
--debounce SECS |
Quiet period before processing (default: 2.0s) |
--batch-interval SECS |
Max time between attestation batches (default: 30s) |
--scan-on-start / --no-scan-on-start |
Baseline scan before watching (default: on) |
--on-delete ignore|mark|remove |
Action on file deletion (default: ignore) |
--polling |
Use PollingObserver for NFS/CIFS mounts |
--poll-interval SECS |
Polling interval (default: 5s) |
--source/--manifest/--api-key/--dry-run |
Same as census scan |
--include/--exclude/--min-size/--max-size |
Same filters as scan |
Requires: pip install certisigma-census[watch]
Dependencies
certisigma— Official CertiSigma Python SDKclick— CLI framework
Optional: watchdog — Filesystem monitoring (only for census watch)
License
MIT — Ten Sigma Sagl
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 certisigma_census-0.3.0.tar.gz.
File metadata
- Download URL: certisigma_census-0.3.0.tar.gz
- Upload date:
- Size: 54.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b648e733bea2255e8bdb9130b0ed58408e1790232174915870d96e42d760c8b
|
|
| MD5 |
28ecdbf853ce8b9253355f5bdd118da2
|
|
| BLAKE2b-256 |
d06d5af0f80c5bc3ccdfaf65cd5d97512a29b9c383c31f92cd8a3c11368afc2c
|
Provenance
The following attestation bundles were made for certisigma_census-0.3.0.tar.gz:
Publisher:
publish.yml on massimocavallin/certisigma-census
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
certisigma_census-0.3.0.tar.gz -
Subject digest:
1b648e733bea2255e8bdb9130b0ed58408e1790232174915870d96e42d760c8b - Sigstore transparency entry: 1133121655
- Sigstore integration time:
-
Permalink:
massimocavallin/certisigma-census@63d609f79d2e2df9ee90c62d1bbd9c7c809889e1 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/massimocavallin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63d609f79d2e2df9ee90c62d1bbd9c7c809889e1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file certisigma_census-0.3.0-py3-none-any.whl.
File metadata
- Download URL: certisigma_census-0.3.0-py3-none-any.whl
- Upload date:
- Size: 21.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 |
b9f2ca2d5a556acaa7da192a586885b238afd1bd5596a57227adc2bfcf1dd40d
|
|
| MD5 |
9155a5bd37bbd3dd63d8073f73061b71
|
|
| BLAKE2b-256 |
d992fce26d4efe2e912dddfd22739412cbe77595fd7a014af4652f9c27d9cc86
|
Provenance
The following attestation bundles were made for certisigma_census-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on massimocavallin/certisigma-census
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
certisigma_census-0.3.0-py3-none-any.whl -
Subject digest:
b9f2ca2d5a556acaa7da192a586885b238afd1bd5596a57227adc2bfcf1dd40d - Sigstore transparency entry: 1133121716
- Sigstore integration time:
-
Permalink:
massimocavallin/certisigma-census@63d609f79d2e2df9ee90c62d1bbd9c7c809889e1 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/massimocavallin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63d609f79d2e2df9ee90c62d1bbd9c7c809889e1 -
Trigger Event:
push
-
Statement type: