Zurück zu den Updates
New releaseJul 22, 2026

secretlint v13.0.4

Erweiterbares Linting-Tool, um das Committen von Zugangsdaten zu verhindern.

Teilen

Secretlint Actions Status

Secretlint is that Pluggable linting tool to prevent committing credentials.

Secretlint ist ein pluggable Linting-Tool, um das Committen von Zugangsdaten zu verhindern.

Funktionen

  • Scanner: Findet Zugangsdaten in einem Projekt und meldet diese
  • Projektfreundlich: Einfache Einrichtung deines Projekts und Integration von CI-Diensten
  • Pre-Commit-Hook: Verhindert das Committen von Dateien mit Zugangsdaten
  • Pluggable: Ermöglicht das Erstellen eigener Regeln und eine flexible Konfiguration
  • Dokumentation: Beschreibt den Grund, warum eine Regel etwas als Secret erkennt

Schnelle Demo

Du kannst das Linting-Ergebnis von secretlint unter https://secretlint.github.io/ ansehen.

Schnellstart

Du kannst Secretlint in deinem Projekt mit einem einzigen Befehl ausprobieren.

Wenn du Docker bereits installiert hast:

docker run -v `pwd`:`pwd` -w `pwd` --rm -it secretlint/secretlint secretlint "**/*"

Wenn du Node.js bereits installiert hast:

npx @secretlint/quick-start "**/*"

Nach der Ausführung: Wenn du ein leeres Ergebnis erhältst und der Exit-Status 0 ist, ist dein Projekt sicher. Andernfalls erhältst du einen Fehlerbericht, und dein Projekt enthält Zugangsdaten als Rohdaten.

An example of secretlint results

Wenn du kontinuierliche Sicherheit möchtest, lies bitte die folgende Installationsanleitung und richte den Pre-Commit-Hook sowie CI ein.

Installation

Verwendung von Docker

Voraussetzungen: Erfordert Docker

Verwende unseren Docker-Container, um eine Umgebung mit Node.js und secretlint so schnell wie möglich herunterzuladen und auszuführen.

Du kannst alle Dateien im aktuellen Verzeichnis mit secretlint mit folgendem Befehl prüfen:

docker run -v `pwd`:`pwd` -w `pwd` --rm -it secretlint/secretlint secretlint "**/*"

Der Docker-Container secretlint/secretlint funktioniert von Grund auf ohne Konfiguration.

Dieses Docker-Image enthält integrierte Pakete:

Weitere Details findest du im Dockerfile von secretlint.

Verwendung von Node.js

Voraussetzungen: Erfordert Node.js 22+.

Secretlint ist in JavaScript geschrieben. Du kannst Secretlint mit npm installieren:

npm install secretlint @secretlint/secretlint-rule-preset-recommend --save-dev

Sie sollten dann eine Konfigurationsdatei einrichten:

npx secretlint --init

Abschließend können Sie Secretlint auf jede Datei oder jedes Verzeichnis wie folgt ausführen:

npx secretlint "**/*"

📝 Secretlint unterstützt Glob-Muster, und das Glob-Muster sollte in doppelte Anführungszeichen gesetzt werden.

Es ist auch möglich, Secretlint global mit npm install --global zu installieren. Wir empfehlen dies jedoch nicht, da einige Regeln global fehlschlagen können.

Verwendung eines Single-Executable-Binaries

Voraussetzungen: Keine

Du kannst den Befehl secretlint ohne Node.js verwenden, indem du ein Single-Executable-Binary nutzt.

  1. Lade das neueste Binary von der Releases-Seite herunter
  2. Ändere die Dateiberechtigungen auf ausführbar: chmod +x ./secretlint
  3. Führe ./secretlint --init aus, um eine Konfigurationsdatei zu erstellen
  4. Führe ./secretlint "**/*" aus, um dein Projekt zu linten

Weitere Details findest du in der README unter publish/binary-compiler.

Verwendung

secretlint --help zeigt die Verwendung an.

Secretlint CLI that scan secret/credential data.

Usage
$ secretlint [file|glob*]

Note
supported glob syntax is based on picomatch (the engine used by micromatch)
https://github.com/micromatch/picomatch#globbing-features
https://github.com/micromatch/micromatch#matching-features

Options
--init             setup config file. Create .secretlintrc.json file from your package.json
--format           [String] formatter name. Default: "stylish". Available Formatter: checkstyle, compact, github, jslint-xml, junit, pretty-error, stylish, tap, unix, json, mask-result, table
--output           [path:String] output file path that is written of reported result.
--secretlintrc     [path:String] path to .secretlintrc config file. Default: .secretlintrc.*
--secretlintignore [path:String] path to .secretlintignore file. Default: .secretlintignore
--stdinFileName    [String] filename to process STDIN content. Some rules depend on filename to check content.
--no-color         disable ANSI-color of output.
--no-terminalLink  disable terminalLink of output.
--no-maskSecrets   disable masking of secret values; secrets are masked by default.
--no-glob          disable glob pattern interpretation; treat all inputs as literal file paths.
--no-gitignore     disable .gitignore cascade respect; .gitignore files are
                   respected by default (since v13).

Options for Developer
--profile          Enable performance profile.
--secretlintrcJSON [String] a JSON string of .secretlintrc. use JSON string instead of rc file.

Experimental Options
--locale            [String] locale tag for translating message. Default: en

Examples
# Scan a single file
$ secretlint ./README.md

# Scan all files (wrap glob in double quotes to avoid shell expansion)
$ secretlint "**/*"
$ secretlint "source/**/*.ini"

# Treat inputs as literal paths (for SvelteKit (group) / Next.js [param] etc.)
$ secretlint --no-glob "src/(auth)/login.ts"

# Lint STDIN content (filename hint affects which rules apply)
$ echo "SECRET" | secretlint --stdinFileName=secret.txt

# Use a custom config file
$ secretlint "**/*" --secretlintrc=.secretlintrc.custom.json

# Scan files ignored by .gitignore (e.g. to verify build artifacts)
$ secretlint --no-gitignore "dist/**/*"

# Mask secrets in a file in-place
$ secretlint .zsh_history --format=mask-result --output=.zsh_history

# Output JSON for programmatic parsing
$ secretlint "**/*" --format=json --output=secretlint-report.json

# Output GitHub Actions annotations in CI
$ secretlint "**/*" --format=github

Exit Status
Secretlint exits with the following values:

    - 0:
      - Linting succeeded, no errors found.
      - Found only "warning" or "info" severity messages.
      - Found lint error but --output is specified.
    - 1:
      - Linting failed, errors found.
    - 2:
      - Unexpected error occurred, fatal error.

Konfiguration

Secretlint hat eine Konfigurationsdatei .secretlintrc.{json,yml,js}.

Nachdem Sie secretlint --init ausgeführt haben, befindet sich eine .secretlintrc.json-Datei in Ihrem Verzeichnis.

Kategorien