Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

crypto-secrets

БесплатноЗапускает вложенные скриптыНе проверен

Audit application source code and configuration for cryptography and secrets hygiene issues: hardcoded API keys, committed .env files, private keys, weak…

superagent-aiот superagent-ai★ 82 звезды на GitHub

Об этом скилле

Cryptography and Secrets Hygiene

This skill turns the model into an application security auditor for one question: can this code leak secrets or rely on broken cryptography? It reads files on disk, runs an offline scanner, then adds the judgment regex cannot: exploitability, false-positive suppression, and framework-correct remediations.

The scanner is the first pass, not the verdict. Treat its findings as anchored candidates and confirm them against surrounding code before reporting.

How it works: two stages

  • Stage 1 — the scanner (deterministic, mechanical). scripts/scan.py walks the target, skips dependency/build directories, and flags unambiguous weak crypto, unsafe TLS/JWT patterns, and secret signatures. It is pure Python standard library: no pip install, no network, no credential validation, no target-code execution. It emits file:line, redacted evidence, markdown or JSON, and exits 1 when P0/P1 findings are present.
  • Stage 2 — you (semantic, judgment). Read each flagged file and nearby callsites. Decide if a secret is live or synthetic, whether MD5 is a checksum or password hashing, whether TLS verification is disabled only in a test harness, and what rotation or code change is required. Catch judgment-only issues the scanner misses, such as a weak key-management design spread across files.

Mental model

Risk is secret exposure × cryptographic consequence.

  • Secret exposure — where the value lives and who can read it: committed production key, client-side bundle, log output, test fixture, local example, or runtime-only environment.
  • Cryptographic consequence — what the flaw enables: credential reuse, token forgery, plaintext recovery, session prediction, downgrade, or deserialization code execution.

The same pattern can move between P0 and Informational depending on these axes. State the evidence and assumptions when scoring.

Workflow

Phase 1 — Discover and scan

Run the scanner over the requested target:

python3 scripts/scan.py <target-dir-or-file> --format markdown

Useful options:

python3 scripts/scan.py <target> --format json
python3 scripts/scan.py <target> --severity P0,P1
python3 scripts/scan.py <target> --include-secrets --no-crypto
python3 scripts/scan.py <target> --include-crypto --no-secrets

It scans common application source, config, docs, env, key, certificate, and container/deployment files while skipping dependency and generated directories.

Phase 2 — Confirm by category

Use the catalogs in references/crypto-checklist.yaml and references/secrets-patterns.yaml while reading surrounding code:

  • Secrets exposure — API keys, cloud credentials, OAuth/Bearer tokens, Slack/GitHub/Stripe tokens, database URLs, webhook URLs, PEM private keys, passwords in config, committed .env files.
  • Weak algorithms — MD5/SHA1 for passwords or security decisions, DES/3DES/RC4/Blowfish, AES-ECB, CBC/CTR without visible authentication.
  • Randomness — Math.random(), random.random(), rand(), java.util.Random, or timestamp-derived tokens used for secrets/session IDs.
  • KDF and password hashing — single-round hashes, low PBKDF2 iterations, missing salt, custom password hashing instead of Argon2id/bcrypt/scrypt/PBKDF2 with modern parameters.
  • TLS and certificates — disabled verification, old TLS/SSL versions, self-signed production certs, weak certificate key sizes.
  • JWT and token handling — alg: none, algorithm confusion, missing exp, weak/hardcoded signing secrets.
  • Key management — hardcoded encryption keys/IVs/nonces, private keys in repo, secrets logged or thrown in errors, no rotation path.
  • Serialization — unsafe pickle, yaml.load, ObjectInputStream, eval, exec, or dynamic Function on untrusted input.

Phase 3 — Report and remediate

For every confirmed finding, produce:

  • Severity (P0-P3 or Informational; read references/severity-rubric.md when scoring)
  • Category and stable rule id
  • file:line with redacted evidence for secrets
  • Current code — verbatim except secrets are redacted
  • Fixed code — a concrete secure rewrite, not just "use a vault"
  • Rationale — the exploit path in one or two sentences
  • Effort — Quick Fix / Moderate / Complex
  • Rotation required — yes/no for any exposed credential or private key

Assemble full reports with references/report-template.md. Default save path: ./crypto-secrets-audit-report-<timestamp>.md.

Finding format

When reporting inline, group by severity with P0 first:

[P0] secret-aws-access-key in services/payments/config.py:12
  A high-confidence AWS access key is committed in application config. Anyone
  with repo access can reuse it until rotation.

  Current:
    AWS_ACCESS_KEY_ID = "AKIA****XYZ"

  Fix:
    AWS_ACCESS_KEY_ID = os.environ["AWS_ACCESS_KEY_ID"]
    # Rotate the exposed IAM access key and remove it from git history.

  Rationale: Committed cloud
Полный SKILL.md на GitHub

Установить crypto-secrets в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/crypto-checklist.yamlreferences/report-template.mdreferences/secrets-patterns.yamlreferences/severity-rubric.mdscripts/detect_crypto.pyscripts/detect_secrets.pyscripts/scan.py

FAQ

Что делает скилл crypto-secrets?

Audit application source code and configuration for cryptography and secrets hygiene issues: hardcoded API keys, committed .env files, private keys, weak hashes, insecure encryption modes, unsafe randomness, bad KDF/password hashing, JWT signing mistakes, disabled TLS verification, and dangerous serialization. Runs a dependency-free offline scanner for high-recall findings, then the model confirms impact and writes concrete fixes with redacted evidence. Use when reviewing app code that handles encryption, tokens, sessions, certificates, or credentials; when asked to scan for hardcoded secrets, exposed API keys, weak crypto, AES-ECB/CBC misuse, MD5/SHA1 password hashing, insecure random tokens, verify=False, InsecureSkipVerify, rejectUnauthorized false, alg none JWTs, or committed private keys. Not for Terraform/Kubernetes-only audits (use infra-security), package install-hook risk (use supply-chain-security), or vetting an agent skill before install (use skill-security).

Как установить скилл crypto-secrets?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл crypto-secrets запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить crypto-secrets с