wyre-technology/node-blumira

GitHub: wyre-technology/node-blumira

一个零依赖的 TypeScript 客户端库,用于在 Node.js 应用中调用 Blumira SIEM API 以管理安全告警、设备和用户。

Stars: 0 | Forks: 0

# @wyre-technology/node-blumira [![Release](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/5bf2daf9c2113456.svg)](https://github.com/wyre-technology/node-blumira/actions/workflows/release.yml) [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [Blumira SIEM](https://blumira.com) API 的 Node.js 客户端库。零生产依赖,原生 `fetch`,TypeScript,支持 ESM/CJS 双模式。 ## 安装 ``` npm install @wyre-technology/node-blumira ``` ## 快速开始 ``` import { BlumiraClient } from '@wyre-technology/node-blumira'; const client = new BlumiraClient({ jwtToken: process.env.BLUMIRA_JWT_TOKEN!, }); // Check API health const health = await client.health.check(); console.log(health.data.api_name); // List open findings const findings = await client.findings.list({ status: 10 }); console.log(`${findings.meta.total_items} open findings`); // Resolve a finding await client.findings.resolve('finding-uuid', { resolution: 10, // Valid resolution_notes: 'Confirmed and remediated', }); // MSP: List all accounts const accounts = await client.msp.listAccounts(); for (const acct of accounts.data) { console.log(`${acct.name}: ${acct.open_findings} open findings`); } ``` ## API 覆盖范围 ### 组织端点 (`/org/`) | 资源 | 方法 | |----------|---------| | **Health** | `health.check()` | | **Findings** | `findings.list()`, `findings.get()`, `findings.getDetails()`, `findings.resolve()`, `findings.assignOwners()`, `findings.listComments()`, `findings.addComment()` | | **Agents/Devices** | `agents.listDevices()`, `agents.getDevice()` | | **Agents/Keys** | `agents.listKeys()`, `agents.getKey()` | | **Users** | `users.list()` | | **Resolutions** | `resolutions.list()` | ### MSP 端点 (`/msp/`) | 资源 | 方法 | |----------|---------| | **Accounts** | `msp.listAccounts()`, `msp.getAccount()` | | **Findings** | `msp.listAllFindings()`, `msp.listFindings()`, `msp.getFinding()`, `msp.resolveFinding()`, `msp.assignFindingOwners()`, `msp.listFindingComments()`, `msp.addFindingComment()` | | **Agents** | `msp.listDevices()`, `msp.getDevice()`, `msp.listKeys()`, `msp.getKey()` | | **Users** | `msp.listUsers()` | ## 配置 ``` const client = new BlumiraClient({ jwtToken: 'your-jwt-token', // Required baseUrl: 'https://api.blumira.com/public-api/v1', // Optional (default) maxRetries: 3, // Optional (default: 3) rateLimitPerMinute: 60, // Optional (default: 60) }); ``` ## 错误处理 ``` import { BlumiraError, AuthenticationError, NotFoundError } from '@wyre-technology/node-blumira'; try { await client.findings.get('nonexistent-id'); } catch (error) { if (error instanceof NotFoundError) { console.log('Finding not found'); } else if (error instanceof AuthenticationError) { console.log('Invalid JWT token'); } else if (error instanceof BlumiraError) { console.log(`API error ${error.statusCode}: ${error.message}`); } } ``` ## 许可证 Apache-2.0 — 详见 [LICENSE](LICENSE)。
标签:API客户端, GNU通用公共许可证, MITM代理, Node.js, TypeScript, 安全插件, 自动化攻击, 运维监控