feat: 1.4.1 pagination, network probes, survival by blocker, report polish
Release / Publish tags (push) Successful in 18s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m47s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 28s
CI / Format and vet (push) Successful in 23s
CI / Tests (Linux, race detector) (push) Successful in 1m24s
CI / Dependency audit (push) Successful in 24s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 5s
Release / Publish tags (push) Successful in 18s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m47s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 28s
CI / Format and vet (push) Successful in 23s
CI / Tests (Linux, race detector) (push) Successful in 1m24s
CI / Dependency audit (push) Successful in 24s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 5s
Backend pagination with one pager for sessions, IPs, campaigns and events; network probe source (port-scan, T1046, second firewall reason port-scan); host kit logs inbound probes; urutau call on the report cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f27d8441a9
commit
432f521ed1
40 files changed
+927
-136
No files matched your search
@@ -4,7 +4,7 @@
|
||||
'use strict';
|
||||
var STAGES = ['recon', 'probe', 'exploit', 'access', 'banned'];
|
||||
var ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 5h18l-7 8v6l-4 2v-8z"/></svg>';
|
||||
var SHOW = 100;
|
||||
var SHOW = 25;
|
||||
|
||||
function boot() {
|
||||
var U = window.Urutau;
|
||||
@@ -41,7 +41,8 @@
|
||||
'ss.c.fam': 'Family',
|
||||
'ss.c.replay': 'Replay',
|
||||
'ss.replay': 'Replay',
|
||||
'ss.more': 'Show more',
|
||||
'ss.n.one': '{n} session',
|
||||
'ss.n.other': '{n} sessions',
|
||||
'ss.none': 'No session matches these filters',
|
||||
'ss.esc': 'Escalation chains',
|
||||
'ss.esc.hint': 'The steps of the most serious sessions.',
|
||||
@@ -80,7 +81,8 @@
|
||||
'ss.c.fam': 'Família',
|
||||
'ss.c.replay': 'Reprodução',
|
||||
'ss.replay': 'Reproduzir',
|
||||
'ss.more': 'Mostrar mais',
|
||||
'ss.n.one': '{n} sessão',
|
||||
'ss.n.other': '{n} sessões',
|
||||
'ss.none': 'Nenhuma sessão combina com estes filtros',
|
||||
'ss.esc': 'Cadeias de escalada',
|
||||
'ss.esc.hint': 'Os passos das sessões mais graves.',
|
||||
@@ -100,14 +102,16 @@
|
||||
|
||||
var inst = null;
|
||||
function Page(root, ctx) {
|
||||
var self = this, data = null, seq = 0, alive = true, st = { stage: '', host: '', fam: '', shown: SHOW };
|
||||
var self = this, data = null, seq = 0, alive = true, st = { stage: '', host: '', fam: '' };
|
||||
this.ctx = ctx;
|
||||
var wrap = h('div', 'ss');
|
||||
root.appendChild(wrap);
|
||||
function load() {
|
||||
var my = ++seq;
|
||||
U.api('/api/v1/sessions/funnel', Object.assign({ host: self.ctx.host }, U.rangeParams())).then(function (d) {
|
||||
if (!alive || my !== seq) return; data = d; paint();
|
||||
U.api('/api/v1/sessions/funnel', Object.assign({ host: self.ctx.host, page: U.pageParam(), per_page: SHOW, stage: st.stage, host_f: st.host, fam: st.fam }, U.rangeParams())).then(function (d) {
|
||||
if (!alive || my !== seq) return;
|
||||
if (d.page > 1 && !(d.sessions || []).length && d.total) { U.setParam('p', d.pages); load(); return; } // stale link past the last page
|
||||
data = d; paint();
|
||||
}).catch(function () {
|
||||
if (!alive || my !== seq || data) return;
|
||||
var b = h('button', { type: 'button', class: 'btn', text: t('ss.retry') });
|
||||
@@ -116,6 +120,7 @@
|
||||
wrap.appendChild(h('div', 'state-error', h('strong', { text: t('ss.err') }), b));
|
||||
});
|
||||
}
|
||||
function refilter() { U.setParam('p', 1); load(); }
|
||||
function paint() {
|
||||
wrap.textContent = '';
|
||||
var d = data, n = d.sessions_n || 0, k = d.exploited || 0, range = U.rangeLabel({ inline: true });
|
||||
@@ -132,36 +137,32 @@
|
||||
bar.appendChild(i);
|
||||
b.appendChild(bar);
|
||||
b.appendChild(h('span', { class: 'ss-fn num', text: nf(v) }));
|
||||
b.addEventListener('click', function () { st.stage = st.stage === g ? '' : g; st.shown = SHOW; paint(); });
|
||||
b.addEventListener('click', function () { st.stage = st.stage === g ? '' : g; refilter(); });
|
||||
fb.appendChild(b);
|
||||
});
|
||||
wrap.appendChild(U.ui.panel({ title: t('ss.funnel'), help: 'term.session', hint: t('ss.funnel.hint') }, fb));
|
||||
// filters
|
||||
var hosts = {}, fams = {};
|
||||
d.sessions.forEach(function (s) { (s.hosts || []).forEach(function (x) { hosts[x] = 1; }); Object.keys(s.fams || {}).forEach(function (x) { fams[x] = 1; }); });
|
||||
var f = h('div', 'ss-filters');
|
||||
function sel(label, key, values, labeler) {
|
||||
var s = h('select', { 'aria-label': label });
|
||||
opt(s, '', label + ': ' + t('ss.f.all'));
|
||||
values.forEach(function (v) { opt(s, v, labeler ? labeler(v) : v); });
|
||||
s.value = values.indexOf(st[key]) >= 0 ? st[key] : '';
|
||||
s.addEventListener('change', function () { st[key] = s.value; st.shown = SHOW; paint(); });
|
||||
s.addEventListener('change', function () { st[key] = s.value; refilter(); });
|
||||
f.appendChild(s);
|
||||
}
|
||||
sel(t('ss.f.stage'), 'stage', STAGES, function (g) { return t('ss.stage.' + g); });
|
||||
sel(t('ss.f.host'), 'host', Object.keys(hosts).sort());
|
||||
sel(t('ss.f.fam'), 'fam', Object.keys(fams).sort());
|
||||
sel(t('ss.f.host'), 'host', d.hosts || []);
|
||||
sel(t('ss.f.fam'), 'fam', d.fams || []);
|
||||
// list
|
||||
var rows = d.sessions.filter(function (s) {
|
||||
return (!st.stage || stg(s.stage) === st.stage) && (!st.host || (s.hosts || []).indexOf(st.host) >= 0) && (!st.fam || (s.fams || {})[st.fam]);
|
||||
});
|
||||
var rows = d.sessions || [];
|
||||
var body = h('div');
|
||||
if (d.sampled) body.appendChild(h('p', { class: 'note', text: t('ss.sampled', { n: nf(d.sessions.length), m: nf(n) }) }));
|
||||
if (d.sampled && !st.stage && !st.host && !st.fam) body.appendChild(h('p', { class: 'note', text: t('ss.sampled', { n: nf(d.total), m: nf(n) }) }));
|
||||
body.appendChild(f);
|
||||
if (!rows.length) body.appendChild(U.ui.empty(t('ss.none')));
|
||||
else {
|
||||
var tb = h('tbody');
|
||||
rows.slice(0, st.shown).forEach(function (s) {
|
||||
rows.forEach(function (s) {
|
||||
var a = Math.floor(Date.parse(s.start) / 1000), b = Math.floor(Date.parse(s.end) / 1000);
|
||||
var rp = h('a', { class: 'btn ss-rp', href: '#/replay?ip=' + encodeURIComponent(s.ip) + '&from=' + encodeURIComponent(iso(a - 60)) + '&to=' + encodeURIComponent(iso(b + 60)), text: t('ss.replay') });
|
||||
function td(label, kid, cls) { return h('td', { 'data-label': label, class: cls || null }, kid); }
|
||||
@@ -178,11 +179,8 @@
|
||||
var th = h('tr');
|
||||
['ip', 'stage', 'start', 'dur', 'events', 'hosts', 'fam', 'replay'].forEach(function (c) { th.appendChild(h('th', { text: t('ss.c.' + c) })); });
|
||||
body.appendChild(h('table', 'stack ss-table', h('thead', null, th), tb));
|
||||
if (rows.length > st.shown) {
|
||||
var more = h('button', { type: 'button', class: 'btn', text: t('ss.more') });
|
||||
more.addEventListener('click', function () { st.shown += SHOW; paint(); });
|
||||
body.appendChild(more);
|
||||
}
|
||||
var pg = U.ui.pager({ page: d.page, pages: d.pages, total: d.total, totalText: U.pl('ss.n', d.total, { n: nf(d.total) }), onPage: function (n) { U.setParam('p', n); load(); } });
|
||||
if (pg) body.appendChild(pg);
|
||||
}
|
||||
wrap.appendChild(U.ui.panel({ title: t('ss.list') }, body));
|
||||
// escalation chains
|
||||
|
||||
Reference in new issue
Block a user