# Create Honeytokens > Úsalo al generar o plantar honeytokens, canary tokens, decoys o tripwire credentials de GitGuardian en .env.example, configs de ejemplo, repos antes de publicarse, wikis o scripts de deploy. Fuente: https://skillsagentes.com/skills/gitguardian/agent-skills/create-honeytokens Markdown: https://skillsagentes.com/skills/gitguardian/agent-skills/create-honeytokens.md Repositorio: https://github.com/GitGuardian/agent-skills Autor: GitGuardian Licencia: MIT Actualizado: hace 10 días Coste de contexto: 64 tok instalada, 3.3k tok al activarse, 12k tok con todos los archivos del bundle Bundle: 4 archivos, 47 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add GitGuardian/agent-skills --skill create-honeytokens --agent claude-code # Cursor npx -y skills add GitGuardian/agent-skills --skill create-honeytokens --agent cursor # Codex npx -y skills add GitGuardian/agent-skills --skill create-honeytokens --agent codex # Gemini CLI npx -y skills add GitGuardian/agent-skills --skill create-honeytokens --agent gemini # Windsurf npx -y skills add GitGuardian/agent-skills --skill create-honeytokens --agent windsurf # Cline npx -y skills add GitGuardian/agent-skills --skill create-honeytokens --agent cline ``` ## Qué hace - Genera decoy credentials AWS (honeytokens) con `ggshield honeytoken create` o `create-with-context` - Guía dónde plantarlos (.env.example, repos antes de publicarse, wikis, scripts de deploy) para detectar fugas futuras - Escribe los valores directamente a disco con `-o` sin exponerlos en la conversación - Verifica scopes y rol de GitGuardian antes de crear el token y gestiona la recuperación de permisos ## Cuándo usarla - El usuario crea un .env.example, config.sample o credentials.template - El usuario va a abrir código (open-source) un repo previamente privado - El usuario escribe un script de deploy, Helm chart, workflow de CI/CD o Dockerfile con credenciales de ejemplo - El usuario menciona explícitamente «honeytoken», «canary token», «decoy» o quiere detectar fugas futuras ## Cuándo no - La tarea es detectar o remediar secretos reales ya existentes en código o historial (usa scan-secrets) - El usuario necesita un decoy para un proveedor distinto de AWS - El único lugar disponible para plantarlo es algo que un atacante nunca encontraría ## Qué la activa - "Crea un honeytoken de AWS para plantar en nuestro .env.example" - "Vamos a hacer público este repo, planta un canary token antes de publicarlo" - "Necesito un decoy credential para el script de deploy" - "Genera una tripwire credential para la wiki interna del equipo" ## Antes de instalar - Requiere ggshield CLI autenticado contra un workspace de GitGuardian, rol Manager o superior y un token con el scope honeytokens:write; no disponible en el plan Free. ## Archivos - SKILL.md — 13 KB - references/ggshield-cli-setup.md — 14 KB - references/gitguardian-platform.md — 6 KB - references/planting-strategy.md — 14 KB ## SKILL.md Reproducido tal cual desde GitGuardian/agent-skills bajo MIT. Esta sección es el documento original y está en inglés. # ggshield — Create Honeytokens ## Overview A honeytoken is a **decoy credential** that does nothing useful but raises an alert the moment someone tries to authenticate with it. Plant them in places attackers look (example configs, abandoned repos, internal wikis, deploy scripts) so any unauthorized read of that location triggers a notification on the GitGuardian dashboard. `ggshield honeytoken` generates these decoys. For now, only **AWS** honeytokens are supported — they look like real AWS access keys but route to GitGuardian's monitoring infrastructure. **Core rule:** every honeytoken must be planted somewhere an attacker might actually find. A honeytoken sitting only on the user's laptop is wasted. Always confirm the planting location with the user before generating one. ## Start Here — Read This Before Doing Anything **Do not skip this section.** Before you call `ggshield honeytoken create`: 1. **Confirm the planting surface with the user explicitly.** Ask: "Where do you want me to plant this?" If the answer is vague ("just somewhere"), surface the candidate list from the When to Use section — `.env.example`, pre-publication open-source repo, internal wiki page, deploy script, archived repo, container image, public artifact. Do not generate first and ask later. 2. **Double-check the planting surface is not in the production import graph.** If a teammate can `import { fn } from './services/Foo'` on the default branch and call it, your own CI will fire the honeytoken from real code. Prefer non-importable file types (`.env`, `.yaml`, `.json`, `.csv`, runbook pages), isolated directories (`tests/fixtures/`, `examples/`, `archived/`), or a non-default branch. Full tactics — including the "real to attackers, decoy to defenders" dual-audience principle — in [references/planting-strategy.md](references/planting-strategy.md) → "Avoiding self-triggering". 3. **Keep the honeytoken values out of the conversation.** Always pass `-o` so `ggshield` writes the values straight to disk, and never read, print, or retype them. Never overwrite data that is already in the planting file. See [Planting without exposing the values](#planting-without-exposing-the-values). 4. **Always pass a meaningful `--description`.** The alert fires months later, often to a different on-call. `"planted in repo X / file Y on 2026-MM-DD"` beats `"test"` by a wide margin. If the user doesn't supply one, propose one before generating. 5. **Run Onboarding first if the CLI isn't set up.** If `ggshield --version` fails, follow [references/ggshield-cli-setup.md](references/ggshield-cli-setup.md). If `ggshield api-status` doesn't show `honeytokens:write` in the `Token scopes:` line, walk through **Onboarding (first use)** below before attempting `honeytoken create`. The agent can drive the scope upgrade on the user's behalf — see [references/gitguardian-platform.md](references/gitguardian-platform.md). ## When to Use Proactively suggest a honeytoken when: - The user is creating an `.env.example`, `config.sample`, `credentials.template`, or any "fill in your own keys" example file — these get copied, forked, and occasionally pushed publicly with real credentials by accident - The user mentions open-sourcing or publishing a previously-private repository — plant before publication, then audit the alert feed - The user is writing a deploy script, Helm chart, CI/CD workflow, or Dockerfile with placeholder credentials — replace the placeholder with a honeytoken so any future leak is detected - The user is auditing exposure surface (Docker images, public artifacts, archived repos) and wants forward-looking detection - The user is preparing internal documentation (Confluence, Notion, internal wikis, README runbooks) that references credentials — plant decoys there to catch credential exfiltration from those systems - The user explicitly says "honeytoken", "canary token", "decoy", "tripwire credentials", or asks how to detect future leaks For *where* to plant (concrete placement strategy, naming conventions, monitoring) see [references/planting-strategy.md](references/planting-strategy.md). For shared `ggshield` install, authentication, headless setup, CI tokens, and hook-install commands, see [references/ggshield-cli-setup.md](references/ggshield-cli-setup.md). For auth/scope recovery, instance URLs, headless setup, and the GitGuardian public docs URL pattern, see [references/gitguardian-platform.md](references/gitguardian-platform.md). ## When Not to Use Do not use this skill when: - The task is to detect or remediate *real* secrets that already exist in code, files, or history — use `scan-secrets`. Honeytokens are decoys you plant, not secrets you find. - The user needs a decoy for a provider other than AWS. `ggshield honeytoken` currently issues AWS-shaped tokens only; do not fabricate a fake key for another provider. - The only available planting spot is somewhere an attacker would never look (a private local file the user alone sees). A honeytoken that no one can stumble on raises no alert and is wasted — confirm a real planting surface first. ## Quick Start (if ggshield is already installed and authorized) ```bash ggshield api-status # verify the PAT includes honeytokens:write ggshield honeytoken create --type AWS \ --name "-" \ --description "" \ -o ``` If `api-status` shows `honeytokens:write` is missing from `Token scopes:`, run the scope-recovery flow from [references/gitguardian-platform.md](references/gitguardian-platform.md) (you can drive it on the user's behalf). If `ggshield --version` fails, follow [references/ggshield-cli-setup.md](references/ggshield-cli-setup.md) first. ## Onboarding (first use) ### Prerequisites `ggshield honeytoken` requires more than the standard scan setup: 1. **GitGuardian role:** the user must have **Manager** access level (or higher) on their GitGuardian workspace. Free tier and lower-permission seats cannot create honeytokens. Check via Settings → Members on the GitGuardian dashboard. 2. **Personal Access Token scope:** the PAT used by `ggshield` must include the **`honeytokens:write`** scope. Verify with `ggshield api-status` (the response lists active scopes). If either is missing, `ggshield honeytoken create` exits with `403 Forbidden` or "Insufficient permissions" — see Troubleshooting. ### Setup If the standard `ggshield` setup is already complete but `ggshield api-status` does not show the `honeytokens:write` scope, run the scope-recovery flow from [references/gitguardian-platform.md](references/gitguardian-platform.md) with `` = `honeytokens:write`. If `ggshield` itself is not installed or not authenticated at all, follow [references/ggshield-cli-setup.md](references/ggshield-cli-setup.md) first, then run the scope-recovery flow if `honeytokens:write` is still missing. ## Commands Two forms — pick based on context: ```bash # Bare honeytoken — just the credentials, no surrounding code ggshield honeytoken create --type AWS --name --description "" -o # Honeytoken wrapped in a realistic-looking file (preferred when planting in code) ggshield honeytoken create-with-context --type AWS --name --description "" --language python -o ``` Use `create-with-context` when the honeytoken will live inside a code file — `ggshield` wraps the credentials in a plausible, language-appropriate snippet (e.g., a Python `boto3` client setup, a Node.js AWS SDK init). The context makes the decoy look like a real, copy-pasted credential, dramatically improving its chance of being used by an attacker. Use the bare `create` form when you just need the credentials to drop into a non-code location (a Notion page, a Confluence runbook, an `.env.example` line). Key flags: | Flag | Effect | |---|---| | `--type AWS` | **Required.** Only AWS is currently supported | | `--name ` | Honeytoken name. If omitted, auto-generated with a `ggshield-` prefix. Use a name that helps you find it later in the dashboard | | `--description ` | Up to 250 characters. Record *where you planted it* and *why* — this is what you'll read months later when an alert fires | | `-o, --output ` | For `create`, append the honeytoken to this file (or create it). For `create-with-context`, write the wrapping snippet to this file and **replace its whole content** if it exists | | `--language ` | (`create-with-context` only) Force the wrapper language. Inferred from the output filename if not set | Exit codes: `0` = honeytoken created, non-zero = error (most commonly auth / permissions, see Troubleshooting). ### Planting without exposing the values A honeytoken looks like a real AWS key. Keep its values out of the conversation, transcripts, and logs, where a reader could trigger the decoy: - Always pass `-o `. `ggshield honeytoken create` appends `aws_access_key_id=...` and `aws_secret_access_key=...` lines to the file and prints only the ID, name, and dashboard URL. - If the file already has empty placeholder lines for these keys (for example `AWS_ACCESS_KEY_ID=` with nothing after the `=`), delete them first, then run with `-o`. Never delete or overwrite a line that has a value, even one that looks like a placeholder. - Do not plant with the GitGuardian MCP `generate_honeytoken` tool. Its response contains the values. - Do not open, `cat`, or retype the planted file. - Do not label the decoy in the file. A comment such as "GitGuardian honeytoken" tells an attacker the key is fake. The dashboard name and `--description` already record where it was planted. - Use `create-with-context -o` only with a path that does not exist yet. It replaces the whole content of an existing file. - If the planting surface is only reachable through a tool call (a wiki or Notion page), write the honeytoken to a temporary file with `-o` and ask the user to paste the values in. - Tell the user that their ggshield pre-commit hook will flag the planted file when they commit it. This is expected. ## Best Practices - **Always set a meaningful `--description`.** The dashboard alert shows it months later when someone trips the wire. `"planted in repo X / file Y on 2026-05-21 by mathieu"` beats `"test"` by a wide margin. - **One honeytoken per planting location.** Don't reuse the same token in multiple places — when it fires, you want to know exactly which surface was compromised. - **Prefer `create-with-context` for code files.** A naked credential string in a Python file looks fake; a `boto3.client()` call with the credentials inline looks real. Real-looking decoys catch real attackers. - **Plant in the source of truth.** A honeytoken in `.env.example` only helps if devs actually use that template. Walk through the user's deploy story to find the *real* attractive surfaces (internal wikis, abandoned repos, deploy scripts, container images). - **Never plant a honeytoken anywhere your production import graph can reach.** If a teammate can legitimately `import` the honeytoken-containing module from production code, the next CI run fires your own decoy. `ggshield honeytoken create-with-context -o services/Foo.ts` is a classic foot-gun — the file looks real to attackers, but also gets imported by real code. Plant in non-importable file types (`.env`, `.yaml`, `.json`, `.csv`, runbook pages), isolated directories (`tests/fixtures/`, `examples/`, `archived/`), or a non-default branch instead. Full tactics in [references/planting-strategy.md](references/planting-strategy.md) → "Avoiding self-triggering". ## Troubleshooting **`403 Forbidden` / "Insufficient permissions"** — the current PAT lacks `honeytokens:write`, or the user is below **Manager** role. The fix is the standard scope-recovery flow: `ggshield auth logout` + `ggshield auth login --scopes honeytokens:write`. See [references/gitguardian-platform.md](references/gitguardian-platform.md) for the full procedure — both commands are runnable on the user's behalf, the OAuth flow handles scope upgrade without any manual PAT creation, and the same file covers the Manager-role caveat and headless login (`--method oob` first, with `--method token` as fallback). **`--type` is required** — pass `--type AWS`. No other types are supported yet (this will change). **Any other or unlisted error** — before improvising a fix, consult GitGuardian's AI-agent docs index at https://docs.gitguardian.com/llms.txt to locate the relevant page, then append `.md` to that page's URL to read it as Markdown. Search there first rather than guessing. ## Dónde encaja - Categoría: [Seguridad](https://skillsagentes.com/categorias/seguridad.md) — Auditorías, revisión de dependencias, manejo de secretos y modelado de amenazas. - Creador: [GitGuardian](https://skillsagentes.com/creators/gitguardian.md) — 6 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Triage Incidents](https://skillsagentes.com/skills/gitguardian/agent-skills/triage-incidents.md): Para triar incidentes de secretos de GitGuardian ya detectados, ver qué se filtra o rotar credenciales marcadas, o tras una alerta de Public Monitoring. Funciona vía el servidor GitGuardian Developer MCP. - [Scan Secrets](https://skillsagentes.com/skills/gitguardian/agent-skills/scan-secrets.md): Escanea ficheros, cambios staged, commits, historial, imágenes Docker o paquetes en busca de secretos codificados, ante una petición de escaneo, auditoría o filtración sospechosa. - [Check Hmsl](https://skillsagentes.com/skills/gitguardian/agent-skills/check-hmsl.md): Comprueba si una credencial conocida ya se filtró públicamente mediante HasMySecretLeaked (HMSL) de GitGuardian; el agente solo prepara comandos, el usuario los ejecuta. - [Install Hooks](https://skillsagentes.com/skills/gitguardian/agent-skills/install-hooks.md): Instala o repara hooks que revisan la presencia de secretos en cada commit, push o acción de un asistente de IA; usa scan-secrets para un escaneo puntual o una investigación de fuga. - [Scan Machine](https://skillsagentes.com/skills/gitguardian/agent-skills/scan-machine.md): Escanea todo el equipo de un desarrollador en busca de credenciales (repos, dotfiles, configs de AWS/kube/docker/npm, historial de shell, cachés de agentes IA) con ggshield machine scan. ## Skills relacionadas - [Check Hmsl](https://skillsagentes.com/skills/gitguardian/agent-skills/check-hmsl.md): Comprueba si una credencial conocida ya se filtró públicamente mediante HasMySecretLeaked (HMSL) de GitGuardian; el agente solo prepara comandos, el usuario los ejecuta. - [Install Hooks](https://skillsagentes.com/skills/gitguardian/agent-skills/install-hooks.md): Instala o repara hooks que revisan la presencia de secretos en cada commit, push o acción de un asistente de IA; usa scan-secrets para un escaneo puntual o una investigación de fuga. - [Scan Machine](https://skillsagentes.com/skills/gitguardian/agent-skills/scan-machine.md): Escanea todo el equipo de un desarrollador en busca de credenciales (repos, dotfiles, configs de AWS/kube/docker/npm, historial de shell, cachés de agentes IA) con ggshield machine scan. - [Scan Secrets](https://skillsagentes.com/skills/gitguardian/agent-skills/scan-secrets.md): Escanea ficheros, cambios staged, commits, historial, imágenes Docker o paquetes en busca de secretos codificados, ante una petición de escaneo, auditoría o filtración sospechosa. - [Triage Incidents](https://skillsagentes.com/skills/gitguardian/agent-skills/triage-incidents.md): Para triar incidentes de secretos de GitGuardian ya detectados, ver qué se filtra o rotar credenciales marcadas, o tras una alerta de Public Monitoring. Funciona vía el servidor GitGuardian Developer MCP. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)