Skip to content

feat(vault): canary secret templates + generator - #260

Open
LiorFink00 wants to merge 1 commit into
mainfrom
feat/vault-canary-templates
Open

feat(vault): canary secret templates + generator#260
LiorFink00 wants to merge 1 commit into
mainfrom
feat/vault-canary-templates

Conversation

@LiorFink00

Copy link
Copy Markdown
Collaborator

Task 3 of #255 (secret-manager honeytokens) — the canary credential templates.

Changes

  • 45 template YAMLs under templates/ (stripe, github, slack, aws, datadog, okta, salesforce, gcp, azure, snowflake, ...). Each declares name/slug/category, a value format (prefix/length/charset), suggested_paths, and metadata. Pure format specs — no real secrets; actual values are minted at runtime.
  • services/templates.pylist_templates() / get_template(slug) / generate_value(template), loading templates/ under REPO_ROOT (cached, sorted by category→name). generate_value mints a fresh fake credential matching the format (charsets: alphanumeric, dash, special, hex, uppercase).
  • DockerfileCOPY templates/ so the loader finds them in the image (it previously only copied server/, plugins/, agent/).

Scope

Independent of the other vault tasks (#257 framework, #259 models). Consumed later by the vault routes/UI to offer canary formats.

Safety

I scanned all 45 templates — they contain only format descriptors (prefix/length/charset) and example paths, no literal credentials. The only "password" match is the credential-type name "Bitbucket App Password".

Tests

tests/test_templates.py — 10 tests: listing, category sort, required shape on every template, get-by-slug, and generate_value across prefix/length/alphanumeric/hex/uppercase + uniqueness. ruff clean.

Part of #255.

Task 3 of the secret-manager honeytoken feature (#255): realistic-but-fake
credential templates for popular SaaS tools, and a generator that mints a fresh
fake value from one. The value authenticates to nothing - a read of it in a
secrets manager is the signal.

- 45 template YAMLs under templates/ (stripe, github, slack, aws, datadog, okta,
  salesforce, ...): each declares name/slug/category, a value format
  (prefix/length/charset), suggested vault paths, and metadata. Pure format
  specs - no real secrets; values are minted at runtime.
- services/templates.py: list_templates() / get_template(slug) /
  generate_value(template), reading templates/ under REPO_ROOT (cached).
- Dockerfile: COPY templates/ into the image so the loader finds them at runtime.

Ported from the enterprise implementation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018DARDAxeg4NM8FKoyGMQZy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant