{"id":23095,"date":"2026-01-11T12:37:51","date_gmt":"2026-01-11T11:37:51","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=23095"},"modified":"2026-01-11T14:49:17","modified_gmt":"2026-01-11T13:49:17","slug":"vom-leak-zur-policy-gitleaks-als-baustein-fuer-secret-security-mit-gitleaks-nicht-nur-auf-dem-raspberry-pi","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=23095","title":{"rendered":"Vom Leak zur Policy: Gitleaks als Baustein f\u00fcr Secret-Security nicht nur auf dem Raspberry Pi"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2026\/01\/gitleaks.jpg\" alt=\"gitleaks\" width=\"2151\" height=\"1217\" \/><br \/>\nGitleaks ist ein Open-Source-Tool, mit dem sich hartkodierte Secrets wie Passw\u00f6rter, API-Keys oder Tokens in Git-Repositories und beliebigen Verzeichnissen unter Linux (ua.) automatisiert aufsp\u00fcren lassen. Durch seine konfigurierbaren Regeln und die Integration in lokale Workflows oder CI\/CD-Pipelines eignet es sich sowohl f\u00fcr Pentester als auch f\u00fcr Entwicklungsteams, die ihre Codebasis systematisch auf Leaks pr\u00fcfen wollen.<\/p>\n<p><strong>Einordnung und Sicherheitskontext<\/strong><!--more--><\/p>\n<p>-Gitleaks geh\u00f6rt zur Klasse der SAST-Werkzeuge, die Quellcode statisch auf verr\u00e4terische Muster wie Schl\u00fcssel, Tokens oder Zugangsdaten durchsuchen.<\/p>\n<p>-Das Tool unterst\u00fctzt inzwischen \u00fcber 160 Secret-Typen und kombiniert regul\u00e4re Ausdr\u00fccke mit Entropie-Heuristiken, um Zufallsstrings mit hoher Aussagekraft zu erkennen.<\/p>\n<p>-Typische Einsatzszenarien sind Security-Audits, Pentests von fremden Repositories sowie das Absichern der eigenen Git-Historie inklusive \u00e4lterer Commits vor versehentlich eingecheckten Geheimnissen.<br \/>\nInstallation unter Linux<\/p>\n<p>Unter Debian\/Ubuntu und anderen g\u00e4ngigen Distributionen l\u00e4sst sich Gitleaks direkt \u00fcber den Paketmanager installieren. Alternativ kann das aktuelle Release als Binary von GitHub bezogen werden.<\/p>\n<p>Installation auf einem Rapberry Pi ist schnell gemacht:<\/p>\n<p>Debian\/Ubuntu und Derivate:<\/p>\n<p>\t<strong>sudo apt update &#038;&#038; sudo apt install gitleaks\u00a0<\/strong><\/p>\n<p>Die Version ist aber nicht so aktuell, deshalb besser das aktuelle Binary <a href=\"https:\/\/github.com\/gitleaks\/gitleaks\/releases\" target=\"_blank\">laden<\/a> und installieren:<\/p>\n<pre class=\"lang:default decode:true \" >\r\n\r\n# Version laden\r\nwget https:\/\/github.com\/gitleaks\/gitleaks\/releases\/download\/v8.30.0\/gitleaks_8.30.0_linux_armv7.tar.gz\r\n\r\n# Auspacken und installieren\r\nsudo tar xf gitleaks_8.30.0_linux_armv7.tar.gz -C \/usr\/local\/bin gitleaks\r\n\r\n# Version checken\r\ngitleaks version\r\n# Ergebnis\r\n8.30.0\r\n<\/pre>\n<p>Dann mal der 1. Scann, in meinem Home Verzeichnis. Das Ergebeniss soll in eine Datei im Json-Format geschrieben werden:<\/p>\n<p><strong>gitleaks dir . -f json -r gitleaks-report.json<\/strong><\/p>\n<p>Nach ein paar Minuten kann das Ergebnis auf der Konsole ausgegeben werden:<\/p>\n<p><strong>cat gitleaks-report.json<\/strong><\/p>\n<p>Oder nur die Beschreibung und der Fundort mit <em>jq<\/em>:<\/p>\n<p><strong>jq -r &#8218;.[] | &#8222;\\(.File) &#8212;&#8212;>  \\(.Description)&#8220;&#8218; gitleaks-report.json<\/strong><\/p>\n<p>Liefert bei mir (fake) ua.<\/p>\n<pre class=\"lang:default decode:true \" >\r\n.zsh_history ------&gt;  Identified a Vault Service Token, potentially compromising infrastructure security and access to sensitive credentials.\r\n.zsh_history ------&gt;  Identified a Vault Service Token, potentially compromising infrastructure security and access to sensitive credentials.\r\n.zsh_history ------&gt;  Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.\r\n.zsh_history ------&gt;  Detected a Generic API Key, potentially exposing access to various services and sensitive operations.\r\nhistory.txt ------&gt;  Identified a Vault Service Token, potentially compromising infrastructure security and access to sensitive credentials.\r\nhistory.txt ------&gt;  Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.\r\nhistory.txt ------&gt;  Detected a Generic API Key, potentially exposing access to various services and sensitive operations.\r\n<\/pre>\n<p>Weitere Infos unter: <strong>gitleaks -v<\/strong> oder <a href=\"https:\/\/github.com\/gitleaks\/gitleaks\" target=\"_blank\">hier<\/a>.<\/p>\n<pre class=\"lang:default decode:true \" >\r\n\r\nGitleaks scans code, past or present, for secrets\r\n\r\nUsage:\r\n  gitleaks [command]\r\n\r\nAvailable Commands:\r\n  completion  Generate the autocompletion script for the specified shell\r\n  dir         scan directories or files for secrets\r\n  git         scan git repositories for secrets\r\n  help        Help about any command\r\n  stdin       detect secrets from stdin\r\n  version     display gitleaks version\r\n\r\nFlags:\r\n  -b, --baseline-path string          path to baseline with issues that can be ignored\r\n  -c, --config string                 config file path\r\n                                      order of precedence:\r\n                                      1. --config\/-c\r\n                                      2. env var GITLEAKS_CONFIG\r\n                                      3. env var GITLEAKS_CONFIG_TOML with the file content\r\n                                      4. (target path)\/.gitleaks.toml\r\n                                      If none of the four options are used, then gitleaks will use the default config\r\n      --diagnostics string            enable diagnostics (http OR comma-separated list: cpu,mem,trace). cpu=CPU prof, mem=memory prof, trace=exec tracing, http=serve via net\/http\/pprof\r\n      --diagnostics-dir string        directory to store diagnostics output files when not using http mode (defaults to current directory)\r\n      --enable-rule strings           only enable specific rules by id\r\n      --exit-code int                 exit code when leaks have been encountered (default 1)\r\n  -i, --gitleaks-ignore-path string   path to .gitleaksignore file or folder containing one (default \".\")\r\n  -h, --help                          help for gitleaks\r\n      --ignore-gitleaks-allow         ignore gitleaks:allow comments\r\n  -l, --log-level string              log level (trace, debug, info, warn, error, fatal) (default \"info\")\r\n      --max-archive-depth int         allow scanning into nested archives up to this depth (default \"0\", no archive traversal is done)\r\n      --max-decode-depth int          allow recursive decoding up to this depth (default 5)\r\n      --max-target-megabytes int      files larger than this will be skipped\r\n      --no-banner                     suppress banner\r\n      --no-color                      turn off color for verbose output\r\n      --redact uint[=100]             redact secrets from logs and stdout. To redact only parts of the secret just apply a percent value from 0..100. For example --redact=20 (default 100%)\r\n  -f, --report-format string          output format (json, csv, junit, sarif, template)\r\n  -r, --report-path string            report file (use \"-\" for stdout)\r\n      --report-template string        template file used to generate the report (implies --report-format=template)\r\n      --timeout int                   set a timeout for gitleaks commands in seconds (default \"0\", no timeout is set)\r\n  -v, --verbose                       show verbose output from scan\r\n      --version                       version for gitleaks\r\n\r\nUse \"gitleaks [command] --help\" for more information about a command.\r\n\r\n<\/pre>\n<p>Download <a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2026\/01\/gitleaks.pdf\">gitleaks.pdf<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gitleaks ist ein Open-Source-Tool, mit dem sich hartkodierte Secrets wie Passw\u00f6rter, API-Keys oder Tokens in Git-Repositories und beliebigen Verzeichnissen unter Linux (ua.) automatisiert aufsp\u00fcren lassen. Durch seine konfigurierbaren Regeln und die Integration in lokale Workflows oder CI\/CD-Pipelines eignet es sich sowohl f\u00fcr Pentester als auch f\u00fcr Entwicklungsteams, die ihre Codebasis systematisch auf Leaks pr\u00fcfen wollen. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=23095\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eVom Leak zur Policy: Gitleaks als Baustein f\u00fcr Secret-Security nicht nur auf dem Raspberry Pi\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[220,79,1319,7],"tags":[6019,325,6291,6289,6290,2492,6293,5015,6292,511,176],"class_list":["post-23095","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-programmierung","category-sicherheit-2","category-tools","tag-dir","tag-git","tag-git-scann","tag-gitleaks","tag-gitleaks-linux","tag-jq","tag-jspon","tag-leak","tag-leaks-zeigen","tag-scann","tag-sicherheit"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/23095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23095"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/23095\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=23095"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=23095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}