CLI for managing Tracebit canary credentials on headless servers
Project description
tracebit-python
Python CLI for deploying Tracebit canary credentials on headless servers.
Tracebit provides canary tokens — fake credentials that trigger alerts when used by an attacker. Their official CLI requires browser-based OAuth, which doesn't work on headless servers. This tool uses the Tracebit API directly with pre-generated API tokens.
Installation
pip install tracebit-python
Or from source:
git clone https://github.com/SiteRelEnby/tracebit-python
cd tracebit-python
pip install -e .
Quick Start
1. Get an API token
Log in to community.tracebit.com and create an API token from the web UI.
2. Configure
tracebit configure
# paste your API token when prompted
Or use an environment variable:
export TRACEBIT_API_TOKEN=your-token-here
3. Deploy a canary
tracebit deploy aws --profile staging
This issues canary AWS credentials from Tracebit, writes them to
~/.aws/credentials under the specified profile, and confirms the
deployment. If anyone (or anything) uses these credentials, Tracebit
fires an alert.
4. Test it
tracebit trigger aws
Runs aws sts get-caller-identity against the canary profile. You should
see an alert on the Tracebit dashboard within a few minutes.
5. Keep credentials fresh
Canary credentials expire after ~12 hours. Set up a cron job to refresh them:
# crontab -e
0 */6 * * * /path/to/tracebit refresh --hours 4
Commands
tracebit configure [TOKEN]
Save an API token to ~/.config/tracebit/token. Reads from argument, stdin,
or interactive prompt.
tracebit deploy aws
Issue and deploy canary AWS credentials.
| Option | Default | Description |
|---|---|---|
--name |
hostname | Credential name (shown on Tracebit dashboard) |
--profile |
staging |
AWS profile name in ~/.aws/credentials |
--region |
from API | AWS region |
--labels |
Metadata as key=value pairs |
|
--force |
Replace existing profile (expires old canary first) |
Choose a realistic profile name — staging, backup, legacy-admin, etc.
The whole point is for these to look like real credentials to an attacker.
tracebit refresh
Re-issue any credentials expiring within the given threshold. Designed to run from cron.
| Option | Default | Description |
|---|---|---|
--hours |
2 |
Refresh credentials expiring within this many hours |
tracebit trigger aws
Test-fire a canary by calling aws sts get-caller-identity with the canary
profile. Requires the AWS CLI to be installed.
| Option | Default | Description |
|---|---|---|
--name |
first found | Credential name to trigger |
tracebit show
Display deployed canary credentials, their profiles, and expiration status.
tracebit remove
Remove canary credentials locally and expire them on Tracebit's server.
| Option | Default | Description |
|---|---|---|
--name |
all | Name of credential to remove |
Global Options
| Option | Description |
|---|---|
--token TOKEN |
API token (overrides env var and config file) |
--base-url URL |
Override Tracebit API URL |
--json |
JSON output (where supported) |
Token Resolution
The API token is resolved in this order:
--tokencommand-line flagTRACEBIT_API_TOKENenvironment variable~/.config/tracebit/tokenfile
How It Works
- Issue — requests canary AWS credentials from the Tracebit API
- Deploy — writes them to
~/.aws/credentialsand~/.aws/configunder the chosen profile name - Confirm — tells Tracebit the credentials were deployed, so it starts monitoring for usage
- Alert — any AWS API call using these credentials triggers a detection on the Tracebit dashboard
The credentials have an explicit deny policy — they can't actually do anything in AWS. But any attempt to use them (by an attacker who found them on disk, in a config file, etc.) is logged and alerted on.
File Permissions
~/.aws/directory:0700~/.aws/credentials,~/.aws/config:0600~/.config/tracebit/token:0600~/.config/tracebit/state.json:0600
License
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 tracebit_python-0.1.1.tar.gz.
File metadata
- Download URL: tracebit_python-0.1.1.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c36f1e9623337ab485707a78ca050b8ed97dfbb4b5584818e457a13bf68078a
|
|
| MD5 |
ec21139cd3e2097d0b9a077b5f7e8c9b
|
|
| BLAKE2b-256 |
6c191c50dbe7f6187c814a90445717c147bf3719fb48daf98d627697a316f631
|
Provenance
The following attestation bundles were made for tracebit_python-0.1.1.tar.gz:
Publisher:
release.yml on SiteRelEnby/tracebit-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tracebit_python-0.1.1.tar.gz -
Subject digest:
7c36f1e9623337ab485707a78ca050b8ed97dfbb4b5584818e457a13bf68078a - Sigstore transparency entry: 1022254439
- Sigstore integration time:
-
Permalink:
SiteRelEnby/tracebit-python@0a97a84b2938a8f6902b5ff06ab7ab756e70e89e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/SiteRelEnby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0a97a84b2938a8f6902b5ff06ab7ab756e70e89e -
Trigger Event:
push
-
Statement type:
File details
Details for the file tracebit_python-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tracebit_python-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.4 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 |
ae0409e0206a17ee27191308d2bab5d104c43697e7a300d67554ba43172b166b
|
|
| MD5 |
410b99b385619185f5512ceabc05d521
|
|
| BLAKE2b-256 |
2a3f15094570d3751bc904e0cc5884746b8c8300c31b59cd32ca944b840050c9
|
Provenance
The following attestation bundles were made for tracebit_python-0.1.1-py3-none-any.whl:
Publisher:
release.yml on SiteRelEnby/tracebit-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tracebit_python-0.1.1-py3-none-any.whl -
Subject digest:
ae0409e0206a17ee27191308d2bab5d104c43697e7a300d67554ba43172b166b - Sigstore transparency entry: 1022254506
- Sigstore integration time:
-
Permalink:
SiteRelEnby/tracebit-python@0a97a84b2938a8f6902b5ff06ab7ab756e70e89e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/SiteRelEnby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0a97a84b2938a8f6902b5ff06ab7ab756e70e89e -
Trigger Event:
push
-
Statement type: