LONGINUSConnect an app
SENSOR v0.5 · PUBLIC BETA

Get your first security signal

Start with your app

Longinus is a small, self-hosted security sensor for long-running Node.js and Express servers. It watches selected paths, records requests, and sends Discord and email alerts. It is a public beta, not a managed security service.

Static sites, edge functions and serverless apps are not supported by this version. You need Node.js 20.6 or newer and permission to edit your server code and environment settings.

npm install https://longinuswatch.com/local-tripwire-sensor-0.5.0.tgz
node node_modules/local-tripwire-sensor/setup.mjs

Private settings

Run the setup command after installation. It creates .env.longinus with a random connection key and adds the private file and state folder to .gitignore. It never replaces an existing settings file.

Open .env.longinus and uncomment only the channels you configure. Load it with node --env-file=.env.longinus YOUR_ENTRY_FILE. In production, copy values to your hosting service’s secret settings. Keep all secret files outside public and static directories.

node --env-file=.env.longinus YOUR_ENTRY_FILE

Discord and email

For Discord, create a channel webhook under Server Settings, Integrations, Webhooks. Set DISCORD_WEBHOOK_URL on your server. For email, use your own Resend account: set RESEND_API_KEY, ALERT_EMAIL_FROM and ALERT_EMAIL_TO. The sender must be permitted by your provider, normally on a verified domain.

You can use either channel or both. They send independently, so one failing does not prevent the other from sending. Provider accepted means the service accepted the request; confirm receipt in the channel or inbox, including spam.

Email uses your provider account and its quotas. The sensor defaults to 60 email attempts per rolling 24 hours, per process, including tests. Multiple instances have separate budgets. No billing account, paid plan or centralized mail sender is created by Longinus.

DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/ID/TOKEN
RESEND_API_KEY=re_your_key
ALERT_EMAIL_FROM=alerts@your-verified-domain.com
ALERT_EMAIL_TO=you@example.com

Add the middleware

For Express, add the following after creating app and before your routes and static file middleware. Set origin to the exact console address you use. The default is the published Longinus site. Restart your server after changing code or settings.

import { longinus } from 'local-tripwire-sensor/connect';
app.use(longinus()); // before routes and static files

Verify detection and delivery

Connect with your HTTPS app origin and SENSOR_DASHBOARD_TOKEN. Verify installation sends a unique, non-secret test request to a watched path. The console checks that your sensor saw it. This test does not send notifications and is labeled Installation test.

Send test event checks notification delivery separately and shows the specific test result. Open its details for each channel. Tests are excluded from suspicious-request totals and the timeline. This is not a test of every route or vulnerability.

Repeated requests have a 60-second cooldown and 20 attempts per hour for each path and channel. A noisy path does not consume another path’s hourly budget, but the shared email daily cap still applies. Failed sends are recorded; there is no automatic retry queue.

Keep useful records

The latest 100 events and per-path summaries are held in memory. Set LONGINUS_STATE_FILE to a private persistent disk path to save and restore them. The setup file enables .longinus/state.json for local use. Give each process its own file; shared multi-process writes are unsupported.

Writes are batched at roughly two-second intervals. A sudden crash can lose recent changes. Ephemeral hosting disks can erase the file on redeploy. This is a bounded local snapshot, not a tamper-proof audit log. Check Saved history for errors and export records when needed.

If something does not work

Connection fails: check your app address, connection key, exact allowed console origin, HTTPS and proxy rules for /__tripwire/ routes. Installation check fails: confirm middleware order and whether a proxy or static server handles the watched path before Node.js.

Discord fails: check the webhook and outbound HTTPS. Email fails: check the API key, sender verification, recipient restrictions and provider quota. Wait 60 seconds before repeating a notification test. Both channels may be configured but not yet tested.

Coverage and limitations

Default paths are /.env, /.git/config and /backup.sql. The sensor decodes the URL path once before matching. Requests that reach the installed middleware and match are answered with 404. It does not detect all encodings or attacks, protect all secret files, scan vulnerabilities, or replace a WAF.

The console polls every 15 seconds while visible. A stopped app cannot send alerts, and there is no independent outage monitor. A request is not proof of compromise. A quiet dashboard is not proof that your app is safe.

Data, trust and cost

The sensor records watched path, method, time, source, event ID and channel results. It excludes IP addresses, cookies, request bodies and ordinary query strings. Alerts go to the channels you configure. Secrets remain on your server; the console holds only the dashboard key in tab memory.

There is no central event database or paid AI API. Your existing server and email provider supply compute, storage and sending. Their limits and charges still apply. Trust the console code because it handles your dashboard key; refresh or disconnect to clear it. Rotate a leaked key on your server.

To remove Longinus, remove its middleware and uninstall the package. Revoke the Discord webhook and Resend key if no other app uses them. Delete local state and settings only when you no longer need them.