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

@security_packages/sentinelgate

v1.1.7

Published

SentinelGate is a lightweight security monitoring package for Node.js applications. It detects suspicious login behavior, computes a risk score, and provides a dashboard to visualize high-risk activities.

Downloads

90

Readme

SentinelGate

SentinelGate is a lightweight security monitoring package for Node.js applications. It detects suspicious login behavior, computes a risk score, and provides a dashboard to visualize high-risk activities.


Installation

npm install @security_packages/sentinelgate

Generating the Secret Key

Run the following command:

npx @security_packages/sentinelgate

This generates a secure dashboard access key and stores it in the .env file as:

SENTINELGATE_DASHBOARD_KEY=your_generated_key

Basic Setup

const express = require("express");
const Sentinel = require("@security_packages/sentinelgate");

const app = express();

app.use("/sentinelgate", Sentinel.sentinelGate());

Enables:

  • Dashboard UI → /sentinelgate
  • API endpoints → /sentinelgate/*

System Overview

SentinelGate operates as follows:

  1. A user attempts to log in
  2. System tracks anomalies:
    • Incorrect password attempts
    • CAPTCHA failures
    • Abnormal form submission time
    • Hidden parameter manipulation
  3. Data stored in MongoDB
  4. Risk score calculated
  5. High-risk activity shown in dashboard

MongoDB Initialization

await Sentinel.initParameters(
  dbName,
  collectionName,
  statsCollectionName,
  client,
  dbURL,
  req
);

Core Functions

1. initParameters(...)

await Sentinel.initParameters(...);

Initializes DB connection and collections.


2. wrongPassword(Username)

await Sentinel.wrongPassword(Username);

Tracks failed password attempts.


3. wrongCaptcha(Username)

await Sentinel.wrongCaptcha(Username);

Tracks CAPTCHA failures.


4. evaluateTime(start, end, Username)

await Sentinel.evaluateTime(loginStartTime, loginEndTime, Username);

Detects abnormal login timing.


5. hiddenFields(hiddenParams, Username, body)

await Sentinel.hiddenFields(hiddenParameters, Username, req.body);

Detects hidden parameter manipulation.


Example Integration

app.post("/login", async (req, res) => {
  await Sentinel.initParameters(
    dbName,
    collectionName,
    statsCollectionName,
    client,
    dbUrl,
    req
  );

  const {
    Username,
    Password,
    Captcha,
    enteredCaptcha,
    loginStartTime,
    loginEndTime
  } = req.body;

  if (Password !== "expectedPassword") {
    await Sentinel.wrongPassword(Username);
  }

  if (Captcha !== enteredCaptcha) {
    await Sentinel.wrongCaptcha(Username);
  }

  await Sentinel.evaluateTime(loginStartTime, loginEndTime, Username);
  await Sentinel.hiddenFields(hiddenParameters, Username, req.body);

  res.send("Login processed");
});

Dashboard Access

http://localhost:3000/sentinelgate

Features:

  • High-risk IP detection
  • Risk score visualization
  • Activity tracking
  • Charts (daily / weekly / monthly)

Risk Score Calculation

  • Wrong Password → +2
  • Wrong CAPTCHA → +2.5
  • Suspicious Timing → +3
  • Hidden Parameter Detection → +4

Only high-risk entries are displayed.


Security and Data Handling

  • Uses MongoDB with safe upsert operations
  • Avoids duplicate entries (Username + IP)
  • Stores only security-related data
  • No sensitive data exposed
  • Aggregated analytics maintained

Database Collections

Information Collection

  • Stores user/IP activity

Statistics Collection

  • Stores aggregated metrics

Available Routes

/sentinelgate            → Dashboard  
/sentinelgate/getIp      → IP data  
/sentinelgate/fetchData  → Chart data  
/sentinelgate/verify    → Auth  

Future Enhancements

  • Real-time alerts (Email/SMS)
  • Automated IP blocking
  • ML-based threat detection
  • Geo-location risk analysis

Summary

SentinelGate integrates seamlessly into existing applications with minimal setup and provides effective login security monitoring.