Przejdź do treści
Biblioteka skilli
Bezpieczeństwo · Przegląd i audyt

hardcoded-secrets

/hardcoded-secrets

Wykrywa klucze API, hasła i tokeny wpisane wprost w kodzie, zanim trafią do repozytorium.

Repozytorium
soundcheck ↗
Licencja
MIT
Ostatnia zmiana repozytorium
30.07.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
2
Przestarzałość

Brak sygnałów. Repozytorium zmienione 30.07.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wykrywa klucze API, hasła i tokeny wpisane wprost w kodzie, zanim trafią do repozytorium.

Oryginalny opis (EN)

Detects API keys, passwords, tokens, and credentials embedded directly in source code. Use when writing code that contains API keys, passwords, tokens, connection strings, or private keys as string literals. Also invoke when embedding credentials in configuration files, environment setup scripts, or test fixtures that could be committed to version control.

Jak działa

  1. What this checks
  2. Vulnerable patterns
  3. Fix immediately
  4. Verification
  5. References
Sekcje z nagłówków SKILL.md, w oryginale · 53 linii, 406 słów
Podgląd SKILL.md
---
name: hardcoded-secrets
description: Detects API keys, passwords, tokens, and credentials embedded directly in
  source code. Use when writing code that contains API keys, passwords,
  tokens, connection strings, or private keys as string literals. Also invoke
  when embedding credentials in configuration files, environment setup
  scripts, or test fixtures that could be committed to version control.
---

# Hardcoded Secrets Security Check (CWE-798)

## What this checks

Protects against credentials, API keys, and secrets embedded directly in source code.
Hardcoded secrets end up in version control history, build artifacts, and container
images. Once committed, secrets are effectively public — even if the commit is reverted,
the secret remains in git history.

## Vulnerable patterns

- String literal that resembles a production API key, access token, or session secret assigned to a constant
- Hardcoded password or shared-secret literal used as the only credential check
- Connection string with embedded username and password committed to source
- Private key material (PEM, PKCS#8, SSH) pasted inline as a string literal
- Cloud-provider access keys, OAuth client secrets, or webhook signing keys in source or config files

## Fix immediately

Flag the hardcoded secret and explain the risk. Translate the principles below to the
audited file's language and deployment environment — use that stack's documented secret
loader, env-var helper, or secrets-manager client.

For each finding, establish these properties:

1. **Secrets are loaded from outside the source tree.** Environment variable,
   secrets manager (AWS Secrets Manager, HashiCorp Vault, 1Password), KMS, or OS
   keystore. No string literal that resembles a real credential appears in source
   — not in code, not in config files, not in test fixtures.
2. **Missing secrets fail loudly at load time, not silently at first use.** A
   required-env lookup with no fallback, a required-field check, or an early
   fatal log guarantees a misconfigured deploy crashes immediately rather than
   running with an empty string that mysteriously fails later.
3. **Test fixtures use obviously fake values** — placeholder strings that read as
   "do not use" — that cannot be mistaken for production credentials and will
   never unlock a real service if leaked.
4. **Rotation does not require a code change.** If rotating the credential means
   editing source and redeploying, the secret is effectively hardcoded even if
   it's technically loaded through a constant. Rotation happens by updating the
   external store and restarting.

## Verification

- [ ] No string literal in the code resembles a production API key, password, token, private key, or connection string with embedded credentials
- [ ] All credentials are loaded from environment variables, secrets managers, or encrypted configuration — never from source code
- [ ] Test fixtures use obviously fake values that cannot be mistaken for real credentials

## References

- CWE-798 ([Use of Hard-coded Credentials](https://cwe.mitre.org/data/definitions/798.html))
- CWE-259 ([Use of Hard-coded Password](https://cwe.mitre.org/data/definitions/259.html))

Wersje

W bazie nie ma innych skilli o nazwie hardcoded-secrets.

Migawka bazy z 13.11.2026 · wersja paczki e42060cfc4df (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100envsave
    Pobiera sekrety z EnvSave przez nieprzejrzyste klucze zamiast zaszywać hasła i tokeny w kodzie.
  • 100secrets
    Wyszukuje zaszyte hasła, klucze API, pliki .env w commitach i wyciek tokenów, także w historii gita.
  • 100secrets-detector
    Wykrywa zaszyte sekrety, klucze API i hasła w kodzie źródłowym, na przykład przed commitem.
  • 100sh-kb-secrets
    Pomaga znaleźć klucze API, hasła i tokeny zapisane w kodzie, konfiguracji lub logach, wg CWE-798 i OWASP A05.
  • 100secrets-scanner
    Wykrywa zakodowane na sztywno sekrety w kodzie, plikach konfiguracyjnych i historii gita, z oceną wagi i krokami naprawy.
  • 100scanning-for-hardcoded-secrets
    Skanuje kod źródłowy w poszukiwaniu zahardkodowanych poświadczeń, takich jak klucze AWS, tokeny GitHub, Stripe i Slack, klucze API, sekrety JWT i klucze prywatne, przed commitem lub audytem.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.