npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aegisscan-node

v1.0.1

Published

Defensive Security Event Ingestion SDK for AegisScan

Readme

aegisscan-node

Official lightweight Node.js SDK for AegisScan — Web Application Security Telemetry & SOC Ingestion Platform.

npm version License: MIT

aegisscan-node enables backend applications (Express, Next.js, Fastify, NestJS) to stream defensive security telemetry, failed authentications, privilege escalations, suspicious payloads, and rate limit triggers directly into your AegisScan SOC Engine with zero performance overhead.


📦 Installation

npm install aegisscan-node

or with yarn / pnpm / bun:

yarn add aegisscan-node
pnpm add aegisscan-node
bun add aegisscan-node

🚀 Quick Start

1. Initialize the Client

// CommonJS
const { AegisScan } = require("aegisscan-node");

// or ES Modules / TypeScript
import { AegisScan } from "aegisscan-node";

const security = new AegisScan({
  apiKey: process.env.AEGISSCAN_API_KEY, // Or pass your Project API Key from AegisScan Dashboard
  endpoint: "https://your-aegisscan-domain.com" // Defaults to http://localhost:3000
});

🛡️ Usage Examples

1. Track Failed Login (Brute-Force & Credential Stuffing Detection)

Send telemetry whenever an authentication attempt fails. AegisScan's correlation engine automatically detects brute-force attacks and spikes.

app.post("/api/auth/login", async (req, res) => {
  const { email, password } = req.body;
  const user = await authenticateUser(email, password);

  if (!user) {
    // 🚨 Report failed login to AegisScan SOC
    await security.loginFailed({
      userId: email,
      sourceIp: req.ip || req.headers["x-forwarded-for"],
      endpoint: "/api/auth/login",
      metadata: { reason: "invalid_credentials" }
    });

    return res.status(401).json({ error: "Invalid credentials" });
  }

  // Report successful login
  await security.loginSuccess({
    userId: user.id,
    sourceIp: req.ip,
    endpoint: "/api/auth/login"
  });

  return res.json({ token: "jwt-token" });
});

2. Detect Unauthorized & Privilege Escalation (BOLA / IDOR)

Report unauthorized attempts to access protected or administrative endpoints.

// In your authorization middleware
if (user.role !== "ADMIN") {
  await security.unauthorizedAccess({
    userId: user.id,
    sourceIp: req.ip,
    endpoint: req.originalUrl,
    metadata: { requiredRole: "ADMIN", userRole: user.role }
  });

  return res.status(403).json({ error: "Forbidden" });
}

3. Log Suspicious WAF / Injection Requests

Catch SQL injection probes, XSS payloads, or traversal patterns in request query params/bodies:

await security.suspiciousRequest({
  userId: req.user?.id,
  sourceIp: req.ip,
  endpoint: req.originalUrl,
  metadata: {
    matchedPattern: "SQLi_UNION_SELECT",
    payload: req.query.search
  }
});

4. Rate Limit Bursts

When your API rate limiter trips for a suspicious IP:

await security.rateLimitTriggered({
  sourceIp: req.ip,
  endpoint: req.path,
  metadata: { limit: 100, windowMs: 60000 }
});

📚 API Reference

| Method | Parameters | Description | | :--- | :--- | :--- | | security.loginFailed(data) | { userId?, sourceIp?, endpoint?, metadata? } | Reports a failed authentication attempt. | | security.loginSuccess(data) | { userId?, sourceIp?, endpoint?, metadata? } | Reports a successful authentication event. | | security.unauthorizedAccess(data) | { userId?, sourceIp?, endpoint?, metadata? } | Flags a 401/403 access control violation. | | security.adminAccess(data) | { userId?, sourceIp?, endpoint?, metadata? } | Logs administrative privilege usage. | | security.rateLimitTriggered(data) | { sourceIp?, endpoint?, metadata? } | Logs a 429 rate limit violation. | | security.suspiciousRequest(data) | { sourceIp?, endpoint?, metadata? } | Reports detected malicious payloads or scan signatures. | | security.sendEvent(eventData) | { type, userId?, sourceIp?, endpoint?, metadata? } | Generic telemetry ingestion dispatcher. |


⚙️ Configuration Options

interface AegisScanOptions {
  apiKey?: string;    // AegisScan Project API Key (falls back to process.env.AEGISSCAN_API_KEY)
  endpoint?: string;  // Base URL of your AegisScan server (defaults to http://localhost:3000)
}

📄 License

MIT © AegisScan