Download the PHP package loguard/loguard-sdk without Composer
On this page you can find all versions of the php package loguard/loguard-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download loguard/loguard-sdk
More information about loguard/loguard-sdk
Files in loguard/loguard-sdk
Package loguard-sdk
Short Description Official LoGuard security telemetry SDK for PHP.
License MIT
Informations about the package loguard-sdk
LoGuard SDK for PHP
The official PHP client for sending security events to LoGuard. The core package does not depend on a framework. Adapters are included for Laravel, PSR-15 and CodeIgniter 3.
Requirements
- PHP 8.1 or newer
- cURL, JSON and mbstring extensions
- HTTPS access to the LoGuard API
Installation
Composer is the preferred installation method:
If the deployment environment cannot install Composer packages, use the
official standalone ZIP from the LoGuard GitHub release. Download and verify
the archive during deployment, extract it outside the public web root, and
load its local autoload.php.
Do not load PHP code remotely from a CDN at request time.
See Standalone installation for the complete procedure.
Plain PHP
event() is synchronous. Use it from workers, commands or flows where the
result is required. For a web request, prefer eventAsync() with a durable
spool or a framework queue.
Durable delivery
The request only writes a small file using an atomic rename. A separate worker can drain the directory:
Run the worker from systemd, Supervisor, cron or your existing job runner. Use a
directory writable only by the application user. The spool is bounded by
default and returns false when full; register Client::onDropped() to send
that condition to your metrics or logs.
HTTP capture
Automatic capture is built around three framework-neutral objects:
RequestContextdescribes the completed request and response.CapturePolicysays which responses and fields may be recorded.HttpEventFactorycreates the event.
Query parameters, request bodies and headers are opt-in. Common secret field names are always removed. JSON bodies are subject to byte and nesting limits, and every event is sanitized again before signing.
Laravel
Publish the configuration and register the middleware:
For production, set LOGUARD_QUEUE_EVENTS=true and run a Laravel queue worker.
The queue job performs one transport attempt; Laravel owns the retry policy.
PSR-15
Install your preferred PSR-7 implementation together with:
Add LoGuard\Sdk\Psr15\LoGuardMiddleware after routing so the adapter can
read the optional route.name request attribute.
CodeIgniter 3
Create the client in application bootstrap and register
LoGuard\Sdk\CodeIgniter3\LoGuardHook::capture as a post_system hook.
Keep the SDK instance in your dependency container or a small application
factory. Do not put the API key in hooks.php; read it from the environment.
The supplied CI3 hook uses the same capture policy as the other adapters. It does not contain project-specific routes, authentication logic or Blynex code.
Privacy defaults
- No request headers, query parameters or body fields are captured by default.
- Authorization, cookies, tokens, passwords and payment secrets are denied even if mistakenly placed in an allowlist.
- Arbitrary
metais recursively filtered, bounded and truncated. - Forwarded addresses are trusted only through configured proxy CIDRs.
- User IDs should be opaque internal identifiers. Do not send email addresses.
Failure behavior
Synchronous calls throw typed LoGuard exceptions. Asynchronous capture is fail-open: SDK failures do not change the application response. Network redirects are never followed, TLS verification cannot be disabled, response bodies are bounded, and invalid JSON is rejected.
Defaults are deliberately conservative:
- request timeout: 3 seconds
- attempts per synchronous send: 2
- maximum serialized event: 64 KiB
- in-memory batch: 50 events
Testing
See docs/SECURITY.md for the threat model and docs/OPERATIONS.md for rollout and worker guidance.
All versions of loguard-sdk with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *