
Research
Shai-Hulud Descends to Hades: Miasma Worm Campaign Spreads with New PyPI Wave
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.
@ziul285/gitleaks
Advanced tools
A lightweight and customizable tool for detecting sensitive data in your repositories. Git Leaks scans files for patterns like API keys, tokens, and other sensitive information based on default or user-defined configurations.
⚙️ Easily configurable via .gitleaksrc.json, with support for:
🔍 Default and custom regex-based patterns
📂 Ignored paths and excluded patterns
🧪 CLI + Husky integration for pre-commit/pre-push scans
🧵 Inline ignore support — skip specific lines with @gitleaks ignore
🔄 Reusable API for embedding into Node.js projects
.gitleaksrc.json.npm install @ziul285/gitleaks
git clone https://github.com/IKuuhakuI/gitleaks.git
cd gitleaks-scanner
npm install
Run Git Leaks in the root directory of your repository:
gitleaks [options]
| Flag | Alias | Type | Description |
|---|---|---|---|
--staged | -s | boolean | Scan only files in the staging area |
--all | -a | boolean | Scan all files in the repository (default) |
--quiet | -q | boolean | Suppress all output except errors |
--ignore | array | Additional paths to ignore during the scan | |
--patterns | -p | array | Specify additional patterns to scan for |
--exclude | -e | array | Exclude specific patterns from the scan |
--version | -v | boolean | Display the current version of the tool |
--help | -h | boolean | Show help message with usage details |
gitleaks --staged
gitleaks --all --quiet
gitleaks --all --ignore dist build
gitleaks --all --patterns "CUSTOM_PATTERN_1" "CUSTOM_PATTERN_2"
gitleaks --all --exclude githubToken
You can integrate Git Leaks with Husky to automatically scan files during Git operations like commit or push.
If Husky is not already installed in your project, run:
npm install husky --save-dev
Set up Husky in your project:
npx husky install
Add a Husky pre-commit hook to scan staged files for sensitive data:
npx husky add .husky/pre-commit "npx gitleaks --staged"
Optionally, add a pre-push hook to scan the entire repository before pushing:
npx husky add .husky/pre-push "npx gitleaks --all"
To verify the integration:
If you want to customize the hooks further, you can modify the commands in the .husky/pre-commit or .husky/pre-push files.
Example pre-commit file:
#!/bin/sh
npx gitleaks --staged --quiet
The project uses a .gitleaksrc.json file for custom configurations. This file should be located in the root directory of the repository you want to scan.
.gitleaksrc.json:{
"maxFileSizeKb": 500,
"ignoreExtensions": [".jpg", ".zip", ".log"],
"includePatterns": ["**/*.js", "src/**/*.ts"],
"customPatterns": ["TEST_KEY_[A-Za-z0-9]{10}"],
"ignorePaths": ["node_modules", ".git", "dist"],
"ignoredPatterns": ["awsAccessKey", "openAiSecretKey"]
}
| Field | Type | Description |
|---|---|---|
ignorePaths | string[] | Folders or files to skip entirely. |
ignoreExtensions | string[] | File extensions to skip (e.g., [".zip", ".log"]). |
maxFileSizeKb | number | Skip files larger than this (in kilobytes). |
includePatterns | string[] | Glob patterns for files to include (e.g., "**/*.js"). |
ignoredPatterns | string[] | Keys of default patterns to disable. |
customPatterns | string[] | User-defined regex patterns to scan for. |
.gitleaksrc.json is not present):{
"customPatterns": [],
"ignoredPatterns": [],
"ignorePaths": ["node_modules", ".git", "package.json", "package-lock.json"]
}
node index.js
The project uses Mocha and Chai for testing. Run the test suite with:
npm test
Ensure all major features are tested:
ignoredPatterns functionality.npm install gitleaks
const { scanRepository } = require("gitleaks/core/scanner");
(async () => {
const results = await scanRepository("/path/to/repo", {
ignorePaths: ["node_modules"],
customPatterns: ["MY_SECRET_[A-Za-z0-9]{20}"],
});
console.log(results);
})();
Contributions are welcome! Follow these steps to contribute:
git checkout -b feature-name).git commit -m "Add new feature").git push origin feature-name).This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A custom Gitleaks-like scanner for detecting sensitive data.
The npm package @ziul285/gitleaks receives a total of 361 weekly downloads. As such, @ziul285/gitleaks popularity was classified as not popular.
We found that @ziul285/gitleaks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.