36e9d5b0b3
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>
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
'use strict';
|
|
|
|
const express = require('express');
|
|
const audit = require('../models/audit_event');
|
|
const metrics = require('../models/metrics');
|
|
const registry = require('../services/session_registry');
|
|
const buildInfo = require('../models/build_info');
|
|
const conf = require('@simpleworkjs/conf');
|
|
|
|
const router = express.Router();
|
|
|
|
router.get('/', async (req, res, next) => {
|
|
try {
|
|
const [m, recent] = await Promise.all([
|
|
metrics.summary(),
|
|
audit.list({ page: 0, pageSize: 10 }),
|
|
]);
|
|
res.render('dashboard', {
|
|
name: conf.name, buildInfo, user: req.jumpUser,
|
|
metrics: { ...m, active: registry.count() },
|
|
active: registry.list(),
|
|
recent: recent.results,
|
|
});
|
|
} catch (err) { next(err); }
|
|
});
|
|
|
|
router.get('/sessions', (req, res) => {
|
|
res.render('sessions', { name: conf.name, buildInfo, user: req.jumpUser, active: registry.list() });
|
|
});
|
|
|
|
router.get('/audit', async (req, res, next) => {
|
|
try {
|
|
const page = Math.max(0, parseInt(req.query.page, 10) || 0);
|
|
const data = await audit.list({ page, pageSize: 50, uid: req.query.uid, target: req.query.target, status: req.query.status });
|
|
res.render('audit', { name: conf.name, buildInfo, user: req.jumpUser, data, query: req.query });
|
|
} catch (err) { next(err); }
|
|
});
|
|
|
|
module.exports = router;
|