承接 azaharizaman/nexus-audit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

azaharizaman/nexus-audit

Composer 安装命令:

composer require azaharizaman/nexus-audit

包简介

Cryptographically-verified, immutable audit engine with hash chains and digital signatures for Nexus ERP

README 文档

README

Cryptographically-verified, immutable audit engine for compliance and forensic analysis

Overview

The Nexus\Audit package provides an enterprise-grade, immutable audit trail with cryptographic hash chains and optional digital signatures. This package is the compliance engine designed for high-integrity, legally-defensible audit logging where tampering detection and state verification are critical.

Key Features

Cryptographic Hash Chains - Each audit record links to the previous via SHA-256 hashes
Optional Digital Signatures - Ed25519 signatures for non-repudiation
Per-Tenant Isolation - Separate hash chains and sequences per tenant
Dual-Mode Logging - Synchronous for critical events, async for high-volume
Tamper Detection - Automatic verification on retrieval
Sequence Integrity - Gap detection and monotonic ordering
Framework-Agnostic - Pure PHP 8.3+ with zero Laravel dependencies
Compliance-Ready - Meets SEC-AUD-0486, SEC-AUD-0490 requirements

Core Differences from AuditLogger

Feature Nexus\Audit (Engine) Nexus\AuditLogger (Utility)
Purpose Immutable, verifiable audit trail User-friendly search/export/timeline
Immutability Cryptographic hash chain enforcement Append-only by convention
Data Storage Raw, unmasked data for forensics Masked data for display
Write Mode Sync (critical) + Async (bulk) Primarily async
Verification Hash chain + signature verification None
Use Case Compliance, legal, security events Activity feeds, debugging, reporting

Architecture

Contracts

  • AuditEngineInterface - Core logging engine with sync/async methods
  • AuditRecordInterface - Immutable audit record with hash chain fields
  • AuditStorageInterface - Append-only persistence layer
  • AuditVerifierInterface - Hash chain and signature verification
  • AuditSequenceManagerInterface - Per-tenant sequence management

Value Objects

  • AuditHash - Immutable hash result (value + algorithm)
  • AuditSignature - Digital signature container
  • SequenceNumber - Tenant-scoped sequence tracking
  • AuditLevel - Severity levels (Low=1, Medium=2, High=3, Critical=4)
  • RetentionPolicy - Compliance-driven retention periods

Services

  • AuditEngine - Main orchestrator with hash chain logic
  • HashChainVerifier - Integrity verification service
  • AuditSequenceManager - Sequence number management
  • RetentionPolicyService - Automated purging

Installation

composer require azaharizaman/nexus-audit:"*@dev"

Usage

Synchronous Logging (Critical Events)

use Nexus\Audit\Contracts\AuditEngineInterface;
use Nexus\Audit\ValueObjects\AuditLevel;

$auditEngine = app(AuditEngineInterface::class);

// Critical security event - blocks until written with hash chain
$recordId = $auditEngine->logSync(
    tenantId: '01TENANT...',
    recordType: 'user_role_assigned',
    description: 'User John Doe assigned role: Administrator',
    subjectType: 'User',
    subjectId: '01USER...',
    causerType: 'User',
    causerId: '01ADMIN...',
    properties: ['role_id' => '01ROLE...', 'role_name' => 'Administrator'],
    level: AuditLevel::Critical
);

Asynchronous Logging (Bulk Operations)

// Non-critical access log - queued for async processing
$auditEngine->logAsync(
    tenantId: '01TENANT...',
    recordType: 'document_viewed',
    description: 'User viewed document',
    subjectType: 'Document',
    subjectId: '01DOC...',
    properties: ['ip_address' => '192.168.1.1'],
    level: AuditLevel::Low
);

Hash Chain Verification

use Nexus\Audit\Contracts\AuditVerifierInterface;

$verifier = app(AuditVerifierInterface::class);

// Verify entire chain for a tenant
$isValid = $verifier->verifyChainIntegrity('01TENANT...');

// Detect sequence gaps (potential deletion)
$gaps = $verifier->detectSequenceGaps('01TENANT...');

// Verify specific record
$record = $auditStorage->findById($recordId);
$verifier->verifyRecord($record); // Throws AuditTamperedException if invalid

Security Requirements Satisfied

  • SEC-AUD-0486 - Immutable audit logs (cryptographically enforced)
  • SEC-AUD-0490 - Cryptographic verification (hash chains + signatures)
  • SEC-AUD-0487 - Strict tenant isolation (per-tenant hash chains)
  • REL-AUD-0301 - Log sequence integrity (monotonic ordering)

Integration with Other Packages

  • Nexus\Crypto - SHA-256 hashing and Ed25519 signatures
  • Nexus\AuditLogger - Presentation layer built on Audit engine
  • Nexus\Identity - Critical identity events logged via Audit
  • Nexus\Finance - Financial transactions logged synchronously

Documentation

Quick Links

Package Documentation

Additional Resources

  • Architecture: Cryptographic hash chains with SHA-256, Ed25519 signatures, per-tenant isolation
  • Compliance: SOX, GDPR, HIPAA audit requirements
  • Security: Tamper detection, forensic investigation, non-repudiation

License

MIT License - See LICENSE file for details

azaharizaman/nexus-audit 适用场景与选型建议

azaharizaman/nexus-audit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 azaharizaman/nexus-audit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 azaharizaman/nexus-audit 我们能提供哪些服务?
定制开发 / 二次开发

基于 azaharizaman/nexus-audit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 36
  • 依赖项目数: 1
  • 推荐数: 2

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-04