
Research
/Security News
Laravel Lang Compromised with RCE Backdoor Across 700+ Versions
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.
@stackone/audit
Advanced tools
Audit logging client for StackOne projects. Records events to Kafka and queries them via Tinybird OLAP database.
Audit logging client for StackOne projects. Records events to Kafka and queries them via Tinybird OLAP database.
This package uses the tech stack provided by the Connect Monorepo global setup. Please check the root README for more information.
AuditEvent typePlease check the root README for requirements.
npm install @stackone/audit
import { AuditClient } from '@stackone/audit';
const client = new AuditClient({
kafkaClientConfig: { brokers: ['localhost:9092'] },
olapConfig: {
baseUrl: 'https://api.tinybird.co',
token: process.env.TINYBIRD_TOKEN
},
logger: myLogger
});
await client.initialize();
await client.recordEvent({
service: 'idp',
organizationId: 'org-123',
userId: 'user-456',
action: 'user.login',
success: true
});
await client.recordEvent({
service: 'api',
organizationId: 'org-123',
action: 'document.created',
details: {
documentId: 'doc-789',
documentType: 'invoice',
fileSize: 1024
}
});
await client.recordEvent(event, { enabled: false });
const events = await client.queryEvents({
organizationId: 'org-123',
pageSize: 50
});
const loginEvents = await client.queryEvents({
organizationId: 'org-123',
action: ['user.login', 'user.logout'],
startTime: new Date('2024-01-01'),
endTime: new Date('2024-01-31'),
pageNumber: 1,
pageSize: 100
});
const multiOrgEvents = await client.queryEvents({
organizationId: ['org-123', 'org-456'],
userId: ['user-1', 'user-2', 'user-3'],
success: true
});
const failures = await client.queryEvents({
service: 'idp',
success: false,
startTime: new Date(Date.now() - 24 * 60 * 60 * 1000) // Last 24 hours
});
AuditClientMain client for recording and querying audit events.
kafkaClientConfig - Kafka broker configurationolapConfig - OLAP database (Tinybird) configuration
baseUrl - Tinybird API base URLtoken - Tinybird authentication tokenlogger - Logger instance for audit operationsgetKafkaClient - Custom Kafka client builder (optional, for testing)getHttpClient - Custom HTTP client builder (optional, for testing)initialize(): Promise<void>Initializes the audit client by connecting to Kafka. Must be called before recording events.
recordEvent(event: AuditEvent, options?: AuditOptions): Promise<void>Records an audit event to Kafka. The event is automatically enriched with eventId and eventTime.
Event Fields:
service (required) - Name of the service generating the eventorganizationId (optional) - Organization identifieruserId (optional) - User identifieraction (optional) - Action identifier (e.g., 'user.login', 'document.created')subAction (optional) - Sub-action identifiersuccess (optional) - Whether the action was successfuldetails (optional) - Additional event metadataeventTime (optional) - Timestamp of the event (defaults to now)Options:
enabled (default: true) - Whether to actually send the eventqueryEvents(query: AuditQuery): Promise<AuditEvent[]>Queries audit events from the OLAP database. Returns events that match ALL specified filters (AND logic).
Query Filters:
service - Filter by service name(s) (string or string[])organizationId - Filter by organization ID(s) (string or string[])userId - Filter by user ID(s) (string or string[])action - Filter by action(s) (string or string[])subAction - Filter by sub-action(s) (string or string[])success - Filter by success status (boolean)startTime - Filter events after this timestamp (inclusive)endTime - Filter events before this timestamp (inclusive)pageNumber - Page number for pagination (1-indexed)pageSize - Number of events per pageThrows:
Error if HTTP client is not configured or OLAP token is missingZodError if the response fails schema validationAuditEventType representing an audit event.
type AuditEvent = {
eventId?: string;
service: string;
organizationId?: string;
userId?: string;
action?: string;
subAction?: string;
success?: boolean;
details?: Record<string, unknown>;
eventTime?: Date;
};
# clean build output
$ npm run clean
# build package
$ npm run build
# run tests
$ npm run test
# run tests on watch mode
$ npm run test:watch
# run linter
$ npm run lint
# run linter and try to fix any error
$ npm run lint:fix
FAQs
Audit logging client for StackOne projects. Records events to Kafka and queries them via Tinybird OLAP database.
The npm package @stackone/audit receives a total of 284 weekly downloads. As such, @stackone/audit popularity was classified as not popular.
We found that @stackone/audit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.

Security News
Socket found a malicious postinstall hook across 700+ GitHub repos, including PHP packages on Packagist and Node.js project repositories.

Security News
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain