
betterleaks v2.0.0-rc.16
फ़ाइलसिस्टम, git इतिहास, कंटेनर और क्लाउड स्रोतों के लिए तेज़, कॉन्फ़िगर करने योग्य सीक्रेट्स स्कैनर, जिसमें Expr-आधारित फ़िल्टरिंग, क्रेडेंशियल सत्यापन और विश्लेषण शामिल है।
Betterleaks
+ ○
▾
Betterleaks एक कॉन्फ़िगर करने योग्य, तेज़ और संपूर्ण सीक्रेट्स स्कैनर है। इसे Gitleaks बनाने वाले लोगों द्वारा अनुरक्षित किया जाता है, जिसमें मूल लेखक भी शामिल हैं। डिटेक्शन इंजन कैसे काम करता है, यह जानने के लिए ब्लॉग पोस्ट की यह श्रृंखला देखें: 1. Regex is all you need, 2. Rare Not Random, 3. Express YourCELf, 4. Better generic secrets detection.
उल्लेखनीय विशेषताएँ
| विशेषता | विवरण |
|---|---|
| सरल प्राथमिकता निर्धारण | ट्राइएज को 123 जितना आसान बनाने के लिए विश्वास, सत्यापन स्थिति और विश्लेषित गंभीरता स्कोर के आधार पर रैंक करें। |
| सीक्रेट्स सत्यापन | Expr का उपयोग करके सीधे नियम परिभाषा के भीतर से अतुल्यकालिक HTTP अनुरोध करके सत्यापित करें कि पता लगाया गया सीक्रेट सक्रिय है या नहीं। |
| सीक्रेट्स विश्लेषण | वैध क्रेडेंशियल्स को प्रदाता-तटस्थ पहचान, खाता, क्षमता और गंभीरता की जानकारी के साथ समृद्ध करें। |
| सीक्रेट्स निरस्तीकरण | वैकल्पिक रूप से सीक्रेट्स को निरस्त करें। |
| Expr-आधारित फ़िल्टरिंग | संदर्भगत नियम फ़िल्टर लिखें जो फ़्रैगमेंट (डेटा खंड) विशेषताओं (जैसे git लेखक, कमिट संदेश और फ़ाइल पथ) और फ़ाइंडिंग डेटा का मूल्यांकन करके गलत सकारात्मक परिणामों को कम करते हैं। |
| BPE फ़िल्टरिंग | यह मापने के लिए BPE टोकनाइज़ेशन का उपयोग करके प्राकृतिक भाषा के गलत सकारात्मक परिणामों को फ़िल्टर करें कि कोई स्ट्रिंग कितनी "दुर्लभ" या गैर-मानवीय है। |
| तेज़ स्कैन | उचित डिफ़ॉल्ट समानांतरकरण सेटिंग्स, ahocorasick कीवर्ड फ़िल्टर और re2 के माध्यम से तेज़ प्रदर्शन प्राप्त करें। |
| नए स्रोत | GitHub, GitLab, Hugging Face, S3 और अन्य जैसे स्रोतों के लिए समर्थन। नए स्रोत जोड़ना भी आसान है! |
| कंटेनर इमेज | सभी प्लेटफ़ॉर्म, ऐतिहासिक परतों, कॉन्फ़िगरेशन और एम्बेडेड प्रमाणनों को स्कैन करें, डाइजेस्ट प्रोवेनेंस और हटाए गए/अधिलेखित पथ की रिपोर्टिंग के साथ। कंटेनर गाइड देखें। |
| पोर्टेबिलिटी | किसी भी आधुनिक OS/Arch पर चलता है। छोटे बाइनरी को किसी भी सिस्टम में एकीकृत किया जा सकता है। |
इंस्टॉलेशन
main शाखा v2 विकास के लिए है। V1 रखरखाव और दस्तावेज़ीकरण v1.x शाखा पर उपलब्ध हैं।
v1 से अपग्रेड कर रहे हैं? CLI, कॉन्फ़िग, रिपोर्ट और SDK परिवर्तनों के लिए v2 माइग्रेशन गाइड देखें।
पहले स्थिर v2 रिलीज़ तक, पैकेज मैनेजर और Docker latest टैग
अभी भी v1 प्रदान कर सकते हैं। तब तक v2 आज़माने के लिए माइग्रेशन गाइड के रिलीज़ कैंडिडेट निर्देश
का उपयोग करें।
# Package managers
brew install betterleaks
brew install --cask betterleaks/tap/betterleaks
# Fedora Linux
sudo dnf install betterleaks
# Containers (stable v2)
docker pull ghcr.io/betterleaks/betterleaks:v2
# Go
go install github.com/betterleaks/betterleaks/v2@latest
# Source
git clone https://github.com/betterleaks/betterleaks
cd betterleaks
make build
Stable v2 रिलीज़ टैप के betterleaks cask और Docker :v2 तथा
:latest टैग को अपडेट करती हैं। Homebrew core अलग से अपडेट होता है। v1 को
v2 के साथ-साथ इंस्टॉल रखने के लिए, brew install --cask betterleaks/tap/betterleaks@1 (कमांड:
betterleaks-v1) या Docker :v1 टैग का उपयोग करें।
उपयोग
स्कैन डिफ़ॉल्ट रूप से क्रेडेंशियल प्रोवाइडर अनुरोधों के बिना सीक्रेट्स का पता लगाते हैं। क्रेडेंशियल जाँचने के लिए
-v / --validate का उपयोग करें, या पहचान और अनुमतियाँ भी हल करने के लिए -a / --analyze का उपयोग करें।
विश्लेषण का अर्थ है सत्यापन। इन चरणों को पर्यावरण के माध्यम से सक्षम करने के लिए
BETTERLEAKS_VALIDATE=true या BETTERLEAKS_ANALYZE=true सेट करें। स्पष्ट फ़्लैग संबंधित वेरिएबल को ओवरराइड करते हैं।
# Scan the filesystem
betterleaks /path/to/target
# Equivalent explicit command
betterleaks filesystem /path/to/target
# Short command alias
betterleaks fs /path/to/target
# Flags may also precede the command
betterleaks --no-banner fs /path/to/target
# Validate detected credentials
betterleaks fs /path/to/target -v
# Validate and analyze identity and permissions
betterleaks fs /path/to/target -a
# Scan a git repo
betterleaks git /path/to/repo
# Also scan merge commit patches (against the first parent)
betterleaks git /path/to/repo --include=merges
# Scan a remote PR's commits relative to its base branch
betterleaks git https://github.com/owner/repo \
--clone-ref=refs/pull/123/head --revision=main..refs/pull/123/head
# Automatically detect a remote repository and scan its history
betterleaks https://github.com/betterleaks/betterleaks
# The default command can also be named explicitly
betterleaks auto https://github.com/betterleaks/betterleaks
# Explicitly download and scan a web response (without crawling)
betterleaks url https://example.com/config.txt
# Scan GitHub org
betterleaks github https://github.com/betterleaks
# Scan GitHub user
betterleaks github https://github.com/cooluser123456789 --include issues,prs,actions,releases,gists
# Scan a PR's title, description, and comments
betterleaks github https://github.com/betterleaks/betterleaks/pull/113
# Scan GitLab group or project
betterleaks gitlab https://gitlab.com/mygroup
betterleaks gitlab https://gitlab.com/mygroup/myproject --include issues,mrs,releases,ci-jobs
# Scan a specific GitLab merge request
betterleaks gitlab https://gitlab.com/mygroup/myproject/-/merge_requests/42
# Scan Hugging Face models, datasets, Spaces, and buckets
betterleaks huggingface https://huggingface.co/myorg
betterleaks hf https://huggingface.co/datasets/myorg/mydataset
betterleaks hf --include=discussions,prs https://huggingface.co/myorg/model
betterleaks hf hf://buckets/myorg/mybucket/path
# Scan a public s3 dataset (Common Crawl).
betterleaks s3 https://commoncrawl.s3.us-east-1.amazonaws.com/crawl-data/CC-MAIN-2018-17/segments/1524125937193.1/warc/
# Enumerate and scan every bucket in a Cloudflare R2 account
betterleaks s3 'https://<account-id>.r2.cloudflarestorage.com/*'
# Scan a registry image: every platform, historical layer, and image metadata
betterleaks container ghcr.io/owner/app:latest
# Scan one platform of a public image without saved registry credentials
betterleaks container ubuntu:24.04 --platform linux/amd64 --anonymous
# Scan an image from the local Docker daemon, or a `docker save` archive
betterleaks container --daemon docker myapp:latest
betterleaks container --archive image.tar
# Scan stdin
cat some_file.txt | betterleaks stdin
# Revalidate a known credential without running detection
printf '%s\n' "$GITHUB_TOKEN" | betterleaks validate --rule github-pat
# Find rule IDs that support credential analysis
betterleaks config show ids --analysis
# Validate it and resolve identity and permissions
printf '%s\n' "$GITHUB_TOKEN" | betterleaks analyze --rule github-pat
# Print only its status (for example, VALID)
printf '%s\n' "$GITHUB_TOKEN" | betterleaks validate --rule github-pat --simple
Git URL स्कैन पूरी ब्रांच और टैग हिस्ट्री, साथ ही नोट्स, को एक अस्थायी बेयर रिपॉज़िटरी में फ़ेच करते हैं। विशिष्ट रिव्यू रेफ़्स या पैटर्न जोड़ने के लिए --clone-ref का उपयोग करें, या सभी विज्ञापित रेफ़्स फ़ेच करने के लिए --clone-all-refs का उपयोग करें। रिसोर्स चयन, कमिट फ़िल्टर और स्टेज्ड-चेंज स्कैन के लिए Git स्कैनिंग गाइड देखें।