Download the PHP package litesoc/litesoc-php without Composer

On this page you can find all versions of the php package litesoc/litesoc-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package litesoc-php

LiteSOC PHP SDK

Official PHP SDK for LiteSOC - Security event tracking and threat detection for your applications.

Latest Stable Version PHP Version Tests PHPStan License

Installation

Quick Start

Features

Security Intelligence (Automatic Enrichment)

When you provide user_ip, LiteSOC automatically enriches your events with:

🗺️ Geolocation

🛡️ Network Intelligence

📊 Threat Scoring

Events are auto-classified by severity:

Important: Always include user_ip for full Security Intelligence features.

Configuration Options

Tracking Events

Basic Usage

Batch Ingestion with trackBatch (v2.5.0+)

To reduce HTTP overhead and align with the backend batch ingestion contract, you can send up to 100 events in a single call:

Using Event Type Constants

Using SecurityEvents Class

With Severity Level

With Metadata

Convenience Methods

The SDK provides convenience methods for common security events:

Laravel Integration

Installation

The package auto-discovers the service provider and facade.

Configuration

Publish the config file:

Add your API key to .env:

Usage with Facade

Usage with Dependency Injection

Event Listener Integration

Middleware for Auth Events

Event Types

26 Standard Events (Primary)

These are the primary events for comprehensive security coverage:

Category Event Type Description
Auth auth.login_success Successful user login
Auth auth.login_failed Failed login attempt
Auth auth.logout User logout
Auth auth.password_reset Password reset completed
Auth auth.mfa_enabled MFA enabled on account
Auth auth.mfa_disabled MFA disabled on account
Auth auth.session_expired Session timeout/expiry
Auth auth.token_refreshed Token refresh
Authz authz.role_changed User role modified
Authz authz.permission_granted Permission assigned
Authz authz.permission_revoked Permission removed
Authz authz.access_denied Access denied event
Admin admin.privilege_escalation Admin privilege escalation
Admin admin.user_impersonation Admin impersonating user
Admin admin.settings_changed System settings modified
Admin admin.api_key_created New API key generated
Admin admin.api_key_revoked API key revoked
Admin admin.user_suspended User account suspended
Admin admin.user_deleted User account deleted
Data data.bulk_delete Bulk data deletion
Data data.sensitive_access PII/sensitive data accessed
Data data.export Data export operation
Security security.suspicious_activity Suspicious behavior detected
Security security.rate_limit_exceeded Rate limit triggered
Security security.ip_blocked IP address blocked
Security security.brute_force_detected Brute force attack detected

Extended Events (Backward Compatible)

Additional events for granular tracking:

Queue Management

Management API (Business/Enterprise)

The Management API allows you to query alerts and events programmatically. Requires a Business or Enterprise plan.

API Endpoints: These methods interact with /api/v1/alerts and /api/v1/events

Get Alerts

Get Single Alert

Resolve Alert

Get Events

Get Single Event

Plan Awareness & Quota Headers

The SDK automatically captures plan and quota information from API response headers:

Response Metadata

After any Management API call, you can access plan information:

Headers Parsed

Header Property Description
X-LiteSOC-Plan plan Current plan name (starter, business, enterprise)
X-LiteSOC-Retention retentionDays Data retention period in days
X-LiteSOC-Cutoff cutoffDate Earliest accessible data timestamp

ResponseMetadata Class

Plan-Restricted Features (403 Handling)

When accessing features that require a higher plan, the SDK throws PlanRestrictedException:

Exception Handling

The SDK provides specific exceptions for different error scenarios:

Exception Hierarchy

Error Handling (Silent Mode)

By default, the SDK fails silently (silent => true). To catch errors:

Debug Mode

Enable debug logging to troubleshoot issues:

For Laravel, set in your .env:

Non-Blocking / Async Usage

By default, the SDK is synchronous - HTTP requests block until complete. However, the SDK has safeguards:

True Non-Blocking with fastcgi_finish_request()

For PHP-FPM environments (Laravel, Symfony, etc.), you can achieve true non-blocking behavior by sending the response to the client before flushing events:

Laravel Middleware for Non-Blocking Flush

Create a middleware that flushes events after the response is sent:

Laravel Queued Jobs (Recommended for High-Traffic)

For high-traffic applications, dispatch events to a queue:

API Reference

Event Collection API (/api/v1/collect)

Method Description
track($eventName, $options) Queue a security event for sending
trackLoginFailed($actorId, $options) Track failed login attempt
trackLoginSuccess($actorId, $options) Track successful login
trackPrivilegeEscalation($actorId, $options) Track privilege escalation (critical)
trackSensitiveAccess($actorId, $resource, $options) Track sensitive data access
trackBulkDelete($actorId, $recordCount, $options) Track bulk deletion operation
trackRoleChanged($actorId, $oldRole, $newRole, $options) Track role/permission changes
trackAccessDenied($actorId, $resource, $options) Track access denied events
flush() Send all queued events immediately
shutdown() Graceful shutdown with flush

Events API (/api/v1/events)

Method Description
getEvents($limit, $filters) List events with pagination
getEvent($eventId) Get single event by ID

Filters for getEvents():

Alerts API (/api/v1/alerts)

Method Description
getAlerts($filters) List alerts with pagination
getAlert($alertId) Get single alert by ID
resolveAlert($alertId, $resolutionType, $notes) Mark alert as resolved
markAlertSafe($alertId, $notes) Mark alert as safe/false positive

Filters for getAlerts():

Resolution Types for resolveAlert():

License

MIT License - see LICENSE for details.

Links


All versions of litesoc-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package litesoc/litesoc-php contains the following files

Loading the files please wait ...