安全软件
点击放大

Deprecated: This project is no longer maintained. Please consider using /bun-security-scanner instead.
<p align="center">
<a href=" src=" alt="npm "></a>
<a href=" src=" alt="npm downloads"></a>
<a href=" src=" alt="install size"></a>
<a href=" src=" alt="DeepWiki"></a>
<a href=" src=" alt="MIT License"></a>
</p>
A security scanner for Bun that integrates with Socket.dev to detect and supply chain risks in npm packages during installation.
<di="center">
<img src="
</div>
This project was inspired by ni.zsh's malware detection features and built specifically for Bun's new Security Scanner API introduced in v1.2.21. It integrates with Socket.dev's comprehensi database to provide real-time security scanning during package installation, helping protect applications from supply chain attacks and known . The scanner categorizes security issues into fatal (blocks installation) and warning (prompts user) levels, offering the same proacti checking that ni.zsh provides but natively integrated with Bun's package installation process.
To use this scanner, you need a Socket.dev API key. Follow these steps:
1. Visit and create an account
2. Create a project by installing the GitHub App to any repository (any repo works fine)
3. Na to your API tokens page:
4. Generate and copy your API token
For more details, see the ni.zsh Socket.de guide.
You can set the API key using either method:
#### Option A: En
#### Option B: CLI Tool
Add the scanner to your bunfig.toml:
Once configured, the scanner will automatically run during bun install:
The scanner uses Socket.dev's risk scoring system with two thresholds:
Note: Complex packages (bundled, using special Unicode characters, etc.) may trigger false positives. Always the package legitimacy before proceeding with installation.
Manage your Socket.dev API key:
API keys are securely stored using Bun.secrets, which provides nati/credential manager integration.
1. Package Detection: When bun install runs, Bun calls the scanner with package information
2. Socket.de: Scanner queries Socket.dev API for security issues and supply chain scores
3. Risk Assessment: E packages based on:
- Critical security issues (malware, backdoors)
- Supply chain risk scores (using 0.3 and 0.5 thresholds)
- General security
4. Decision: Returns ad with appropriate se levels
5. User Action: Bun either blocks installation (fatal) or prompts user (warning)
The scanner uses the following en :
BUN_SOCKET_TOKEN: Your Socket.dev API key (required)The scanner uses two configurable thresholds to categorize security risks:
FATAL_RISK_THRESHOLD = 0.3: Packages with risk scores below this threshold trigger fatal warnings (block installation)WARN_RISK_THRESHOLD = 0.5: Packages with risk scores between 0.3-0.5 trigger warning promptsSolution: Set the BUN_SOCKET_TOKEN en or use the CLI tool.
The scanner handles API errors gracefully and won't block installations due to network issues.
Socket.dev has API rate limits. The scanner respects these and will warn about quota issues.
MIT
开发语言:TypeScript
Star 数:25
该项目属于安全软件方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕A Bun security scanner that integrates with Socket.dev for package vulnerability detection展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | bun-socket-scanner - A Bun security scanner that integrates with Socket |
| 所属分类 | 安全软件 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 22:52:33 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 274 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |