cboxdk/laravel-siem
Composer 安装命令:
composer require cboxdk/laravel-siem
包简介
The SIEM log-streaming delivery engine for Laravel — a durable transactional outbox, queued batched delivery with retry/backoff/dead-letter/circuit-breaker, SSRF-guarded HTTP egress, encrypted destination secrets, and PII redaction, on top of the framework-agnostic cboxdk/siem core.
关键字:
README 文档
README
The SIEM log-streaming delivery engine for Laravel: a durable transactional outbox, queued batched delivery with retry, dead-letter, and a per-stream circuit breaker, SSRF-guarded HTTP egress, encrypted destination secrets, and per-field PII redaction — shipping normalized security events to Splunk HEC, Elastic (ECS), Graylog (GELF), ArcSight/syslog (CEF), or any HTTP JSON collector.
This package is the Laravel wrapper over the framework-agnostic
cboxdk/siem core. The core owns the event model
and the formatters (the shape of the data); this package owns delivery (the
network, the durability, the secrets). An audit binding in
cboxdk/laravel-id consumes this layer to
stream a tamper-evident audit trail — that binding is a separate package.
Installation
composer require cboxdk/laravel-siem php artisan vendor:publish --tag="siem-migrations" php artisan vendor:publish --tag="siem-config" # optional php artisan migrate
The service provider is auto-discovered. Destination secrets use Laravel's
encrypter, so an APP_KEY is required (every Laravel app has one).
At a glance
use Cbox\LaravelSiem\Contracts\{LogStreams, StreamDispatcher}; use Cbox\LaravelSiem\Enums\Destination; use Cbox\Siem\ValueObjects\SiemEvent; // 1. Register a destination (endpoint SSRF-checked; secret encrypted, revealed once). app(LogStreams::class)->create( name: 'splunk-prod', destination: Destination::SplunkHec, endpointUrl: 'https://http-inputs.example.splunkcloud.com', secret: 'your-hec-token', redaction: ['password' => 'drop', 'email' => 'hash'], ); // 2. In your own DB transaction, write the event to the outbox (a cheap insert). DB::transaction(function () use ($event) { // ... your business write ... app(StreamDispatcher::class)->dispatch($event, app(LogStreams::class)->enabled()); }); // 3. The queued pump batches, redacts, formats, and ships it — off the request thread.
What it guarantees
- Deny-by-default — no enabled stream, nothing delivered.
- At-least-once, unordered — the outbox row commits in your transaction; a rolled-back caller leaves no orphan. Duplicates are possible; dedup by event id.
- Never blocks the request — all delivery is queued.
- Bounded everything — triple-bounded batches (records/bytes/age), bounded exponential backoff with jitter, a hard retry cap into a dead-letter, a bounded outbox with an explicit backpressure policy, and a per-stream circuit breaker.
- Safe egress — SSRF-guarded and DNS-pinned, TLS verification always on, secrets encrypted at rest and scrubbed from logs, PII redacted before formatting.
Destinations
| Destination | SIEM | Framing |
|---|---|---|
splunk_hec |
Splunk HEC | NDJSON to the collector event endpoint, Authorization: Splunk <token> |
elastic_ecs |
Elastic / Kibana | ECS JSON documents (NDJSON) |
graylog_gelf |
Graylog | GELF 1.1 over HTTP (never UDP) |
cef_http |
ArcSight / syslog | CEF lines over HTTP |
generic_json |
any HTTP collector | neutral single-line JSON |
Testing
Compose Cbox\LaravelSiem\Testing\InteractsWithLogStreams into your TestCase to
run the whole pipeline in memory: fakeStreamSink() binds an in-memory
FakeStreamSink, createLogStream(...) registers through the real registry, and
pumpStream($id) runs a delivery cycle synchronously. FakeHttpTransport programs
the HTTP fake for testing the real HttpStreamSink.
Requirements
- PHP 8.4+
- Laravel 12.x or 13.x
- A queue connection, a database, and an
APP_KEY.
Documentation
Full documentation lives in docs/.
The event core
The normalized SiemEvent, the formatters, and their escaping/threat model are
provided by cboxdk/siem. This package claims
only the Laravel delivery layer.
Credits
License
The MIT License (MIT). See LICENSE.md.
cboxdk/laravel-siem 适用场景与选型建议
cboxdk/laravel-siem 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 07 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Audit」 「laravel」 「delivery」 「outbox」 「ssrf」 「circuit-breaker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cboxdk/laravel-siem 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cboxdk/laravel-siem 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cboxdk/laravel-siem 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Log adding/updating/deleting of elements
Doctrine ORM provider for the auditor audit-log library.
PHP SDK for the Parcel Monkey UK API
PB Web Media Audit Bundle for Symfony
Serve Laravel Assets from a Content Delivery Network (CDN)
Simplest Auditable for Laravel Eloquent/Model
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-15