Files
jump-host/nodejs/models/index.js
T
wmantly 36e9d5b0b3 feat: initial jump-host — SSH jump host for the theta42 stack
An SSH jump host that authenticates users against the shared LDAP
directory, authorizes them from the SSO Manager's inventory graph, and
bridges them to downstream hosts — auditing everything.

- Username-grammar routing (uid_-_target@jump) + interactive TUI picker
- Inbound LDAP auth (publickey / password with off|local|all policy)
- Directory-driven access (LDAP groups x /api/discovery/resources?group=)
- Per-user key injection into sshPublicKey, connects downstream as the user
- Shell / exec / SFTP-subsystem bridging (WinSCP works)
- Web UI + HTTP API (:3002) for audit + metrics; LDAP-admin gated
- Packaged like proxy: ops/install.sh + systemd, all-in-one Docker, compose
- Tests: 23 unit + 3 integration (node --test), all green

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 15:48:49 -04:00

36 lines
1012 B
JavaScript

'use strict';
// model-redis backing (same store the other stack apps use). Table is the
// base class; getRedis() exposes the underlying node-redis client for the
// counters and sorted-set index in models/metrics.js and models/audit_event.js.
const conf = require('@simpleworkjs/conf');
const { setUpTable } = require('model-redis');
const Table = setUpTable(conf.redis);
module.exports = Table;
// The raw node-redis client (created + connecting inside model-redis) — used
// for the INCR counters and the sorted-set audit index. model-redis connects
// it asynchronously; ensure it's open before first use.
let readyPromise;
async function getRedis() {
const client = Table.redisClient;
if (!readyPromise) {
readyPromise = (async () => {
if (!client.isOpen) {
try { await client.connect(); } catch (_) { /* already connecting */ }
}
return client;
})();
}
await readyPromise;
return client;
}
module.exports.getRedis = getRedis;
require('./session');
require('./audit_event');