Exécuter et démontrer l'outil obfsck

VérifiéPrudence

Construire, exécuter, tester et démontrer obfsck, une boîte à outils Rust de rédaction de secrets/PII avec 5 binaires. Utiliser demo.py pour piloter redact, scan, api, mcp et analyzer.

Spar Skills Guide Bot
SecuriteIntermédiaire
24/08/2026
Claude CodeCursorCodex
#secret-redaction#rust#mcp#cli#demo-runner

Recommandé pour

Synthèse automatique

Runbook opérationnel pour compiler, exécuter et démontrer obfsck, une boîte à outils Rust de rédaction de secrets et de PII, ainsi que ses cinq binaires.

Points forts

  • Couvre les cinq binaires (redact, scan, analyzer, api, obfsck-mcp) avec la sortie attendue vérifiée pour chaque mode.
  • Un pilote unique, `demo/demo.py --bin all`, exerce tous les binaires en une seule commande sans écrire d'artefacts sur disque.
  • Documente les pièges concrets : `required-features = ["analyzer"]`, codes de sortie (1 pour scan, 2 pour l'erreur clap), absence de `--version`, nom de binaire `obfsck-mcp` et non `mcp`.
  • Donne aussi les invocations directes en une ligne quand le pilote n'est pas nécessaire (redact sur stdin, JSON-RPC sur stdio).

Limites

  • Spécifique au dépôt obfsck : tous les chemins sont relatifs à sa racine, le skill est inutilisable ailleurs.
  • Suppose une toolchain Rust et `uv` déjà présents sur le PATH, et une version de Rust pilotée par mise.
  • Le fichier fourni s'interrompt au milieu de la section « human path » ; la description évoque des captures d'écran alors que la démo ne produit volontairement aucun artefact.
Quand l'utiliser

À utiliser lorsque vous travaillez dans le dépôt obfsck et devez le compiler, vérifier un binaire précis ou faire une démonstration de rédaction, de scan de diff, de l'API REST ou du serveur MCP.

Quand l'éviter

À éviter si vous voulez rédiger des secrets dans un autre projet, ou si le dépôt obfsck et les outils Rust/uv ne sont pas disponibles.

Analyse de sécurité

Prudence
Score qualité85/100

The skill is a legitimate developer/demo guide for a redaction toolkit. It uses powerful tools (bash, cargo build, uv-run Python, a local HTTP server, gitleaks subprocess) but all for benign local build/test/demo purposes on loopback. There is no curl|sh, no exfiltration of secrets/tokens, no obfuscated payloads, and no instruction to disable safety. Rated caution only because it compiles and executes repo code and binds a local port.

Points d'attention
  • •Directs execution of code from the repo: `cargo build --release` and `uv run demo/demo.py` compile and run Rust/Python, so auditing a skill that auto-runs repo code warrants care.
  • •Spawns the external `gitleaks` CLI and pipes a synthetic diff to it (noted as a potential hang vector with `subprocess.run` timeouts).
  • •Starts a local network server (`api` bound to 127.0.0.1:5000 / a free port) and speaks JSON-RPC over stdio — network/process surface, though local-only and legitimate.
  • •Fixtures embed secret-like values (AWS canonical example key, synthetic Slack token) — low risk since they are public/dummy examples, but the pattern of handling secret-shaped literals deserves note.
  • •File appears truncated mid-gotcha ('- **`redac'), so full risk cannot be fully confirmed from the visible text.
Comment cette analyse est faite

Exemples

Build all five binaries
Build obfsck in release mode with the analyzer feature and confirm that redact, scan, analyzer, api, and obfsck-mcp all ended up in target/release.
Tour every binary
Run the obfsck demo driver for all binaries and walk me through what each mode prints.
Scan a diff for secrets
Use obfsck's scan binary with --no-gitleaks on this git diff, show me the findings, and tell me the exit code.

name: run-obfsck description: Build, run, test, and demo obfsck — a secret/PII redaction toolkit with 5 binaries (redact, scan, analyzer, api, obfsck-mcp). Use when asked to run obfsck, build it, test it, demo it, screenshot its output, or drive any of its binaries (redact secrets, scan a diff, start the REST API, query the MCP server, or run the alert analyzer).

obfsck is a Rust workspace that builds 5 binaries around one redaction engine. Drive it via demo/demo.py --bin <name> (a uv-run Python/rich script) — that is the primary agent path below; it exercises every binary programmatically and is what this skill was verified against.

All paths below are relative to the repo root (obfsck/).

Prerequisites

Rust toolchain and uv are expected to already be on PATH (this repo is mise-managed — mise.toml pins the Rust version). Nothing else to install; uv run demo/demo.py auto-installs its own deps (rich, pyyaml) from the PEP 723 header at the top of the file.

cargo --version   # verified: works out of the box in this container
uv --version      # verified: uv 0.10.9

Build

cargo build --release --features analyzer

Builds all 5 binaries to target/release/: redact, scan, analyzer, api, obfsck-mcp. analyzer is obfsck's own default feature (see Cargo.toml), so --features analyzer is technically redundant but keep it explicit — the 4 server/analyzer binaries have required-features = ["analyzer"] and silently don't build without it.

Run (agent path)

uv run demo/demo.py --bin all       # tours every binary in one run
uv run demo/demo.py --bin redact    # original showcase — obfuscation levels
uv run demo/demo.py --bin scan      # unified-diff secret scanner
uv run demo/demo.py --bin mcp       # JSON-RPC stdio MCP server
uv run demo/demo.py --bin analyzer  # LLM alert-analysis CLI
uv run demo/demo.py --bin api       # axum REST server

Each mode is self-contained and prints rich-formatted panels to stdout — no artifacts land on disk, this is a terminal demo, not a screenshot tool. Verified output for each mode:

| --bin | What it does | Verified result | |---|---|---| | redact (default) | Pipes each demo/examples/*.yaml fixture through redact at 3 levels | Renders a before/after table per fixture; [REDACTED-*] tokens highlighted | | scan | Feeds a synthetic git diff with a Slack bot token through scan --no-gitleaks | scan: 2 finding(s) detected (exit 1) — pattern hit + structural hit on the same line | | mcp | Sends tools/list then tools/call (audit) over stdio JSON-RPC to obfsck-mcp | tools/list returns the audit/generate-filters schema; audit returns {"hits":[{"count":1,"label":"SLACK-BOT"}]} | | analyzer | Runs analyzer --dry-run --loki-url http://127.0.0.1:1 (deliberately unreachable) | Exit 1, prints the miette fancy diagnostic chain (obfsck::analyzer::http → client error (Connect) → Connection refused) | | api | Starts api on a free port, GET /health and GET /, tears it down | {"status":"healthy","service":"alert-analysis-api"} (200), then the index HTML page |

Redact in file mode (bypasses the fixture showcase):

uv run demo/demo.py --bin redact demo/examples/00_levels.yaml --level minimal

Direct invocation without the driver, if you just need one binary:

echo 'AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE' | target/release/redact --level minimal
# → AWS_ACCESS_KEY_ID=[REDACTED-AWS-KEY]

target/release/redact --level minimal  # exit 2, clap usage error — no --version flag exists

obfsck-mcp (note: crate/bin name is obfsck-mcp, not mcp) speaks line-delimited JSON-RPC on stdin/stdout:

echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | target/release/obfsck-mcp

Run (human path)

target/release/api --host 127.0.0.1 --port 5000   # Ctrl-C to stop
# → binds and logs "Alert Analysis API starting"; GET /health works with
#   no backend configured, GET /api/analyze needs a real Loki/VictoriaLogs
#   + LLM provider config to do anything useful.

Test

cargo test --workspace --features analyzer
# or: just test

Verified: 26 test binaries, all pass (203 individual tests across unit + integration + property + golden suites). 5 tests are ignored by design (network tests, gated behind explicit opt-in).


Gotchas

  • scan --no-gitleaks is required in any scripted/driver context. Without it, scan spawns the real gitleaks CLI and pipes the diff to its stdin on a background thread while reading stdout/stderr on the main thread — if gitleaks is on PATH this can hang past any reasonable subprocess timeout (hit a 10s TimeoutExpired in subprocess.run before adding the flag). The driver always passes --no-gitleaks.
  • The repo's own .obfsck.toml allowlist can silently neuter your own demo fixtures. .obfsck.toml allowlists AKIAIOSFODNN7EXAMPLE (AWS's canonical example key) so the pre-commit hook doesn't flag it in demo/examples/. That allowlist is loaded by every scan invocation from this repo, including the demo driver — a scan demo fixture using that exact key silently reports "clean" (exit 0) instead of finding it. Check .obfsck.toml and ~/.config/obfsck/allowlist before picking a fixture value, or the demo will quietly stop demonstrating anything.
  • A fixture secret literal in demo.py's own source trips the pre-commit scan-diff hook on this repo — the hook scans the staged diff of every commit, including edits to the demo file itself. SAMPLE_DIFF's Slack token is built via "-".join([...]) instead of one contiguous string literal so the source bytes don't match the pattern, while the assembled value (used at runtime, piped into scan) still does. If you add a new fixture secret to demo.py, split it the same way or the commit will fail its own pre-commit hook.
  • redact has no --version flag. target/release/redact --version exits 2 with a clap "unrecognized argument" error, not a version string.
  • api/analyzer construct their backend clients at startup without a network call — AlertAnalyzer::from_config just builds reqwest clients, it doesn't ping Loki/the LLM provider. So api starts and answers /health fine even with an unreachable LOKI_URL; the error only surfaces on /api/analyze or when analyzer actually calls fetch_alerts. That's what the analyzer --dry-run demo exploits to show the miette error path deterministically and fast (127.0.0.1:1 refuses instantly, no DNS/timeout wait).

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/run-and-demo-obfsck-redaction-toolkit-mt6repmm/download' --output '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md.part' && mv '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md.part' '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Extrait original : Prerequisites

Rust toolchain and uv are expected to already be on PATH (this repo is mise-managed — mise.toml pins the Rust version). Nothing else to install; uv run demo/demo.py auto-installs its own deps (rich, pyyaml) from the PEP 723 header at the top of the file.

cargo --version   # verified: works out of the box in this container
uv --version      # verified: uv 0.10.9

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md' && test -s '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/run-obfsck' && cp -R '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm' '.claude/skills/run-obfsck'

Cursor
test -f '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md' && test -s '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/run-obfsck' && cp -R '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm' '.cursor/skills/run-obfsck'

Codex
test -f '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md' && test -s '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/run-obfsck' && cp -R '.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm' '.agents/skills/run-obfsck'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm'

openskills read 'run-and-demo-obfsck-redaction-toolkit-mt6repmm'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/run-and-demo-obfsck-redaction-toolkit-mt6repmm/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires