feat: 2.1.0 incidents, filter bar and IP analysis redesign; probe egress files fix
CI / Format and vet (pull_request) Successful in 1m1s
CI / Dependency audit (pull_request) Successful in 32s
CI / Tests (Linux, race detector) (pull_request) Successful in 1m55s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Skipped
Release / Build hub image (amd64) (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Publish tags (hub) (push) Skipped
Release / Publish tags (probe) (push) Skipped
Release / Gitea release (push) Skipped
CI / Format and vet (pull_request) Successful in 1m1s
CI / Dependency audit (pull_request) Successful in 32s
CI / Tests (Linux, race detector) (pull_request) Successful in 1m55s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Skipped
Release / Build hub image (amd64) (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Publish tags (hub) (push) Skipped
Release / Publish tags (probe) (push) Skipped
Release / Gitea release (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c92d4b359
commit
00c4ab6d4a
15 files changed
+1063
-238
No files matched your search
@@ -180,7 +180,17 @@
|
||||
'inc.meta': 'opened {a} · updated {b} · {n} occurrences',
|
||||
'inc.h.group': '{who} made {n} changes',
|
||||
'inc.copy': 'Copy', 'inc.copied': 'Copied',
|
||||
'inc.title.edit': 'Edit title'
|
||||
'inc.title.edit': 'Edit title',
|
||||
'inc.col.count': 'Hits', 'inc.unassigned': 'Unassigned', 'inc.evidence': 'What was detected',
|
||||
'inc.summary.none': 'No conclusion yet. Write what you found once you know.',
|
||||
'inc.sup.on': 'On: new identical findings are hidden from the outbound traffic page.',
|
||||
'inc.sup.what': 'Hide new findings with this same fingerprint from the outbound traffic page.',
|
||||
'inc.sup.more': 'How it works',
|
||||
'inc.sup.until': 'Suppressed until {date} (turned on {ago}).', 'inc.sup.until.short': 'Suppressed until {date}',
|
||||
'inc.sup.only.egress': 'Only tickets from outbound traffic findings can be suppressed.',
|
||||
'inc.sup.only.low': 'High or critical findings cannot be suppressed.',
|
||||
'inc.sup.for': 'Suppress for', 'inc.sup.days': '{n} days',
|
||||
'inc.sup.reopen': 'The ticket reopens by itself when the period ends or if the severity goes up.'
|
||||
},
|
||||
'pt-BR': {
|
||||
'inc.col.id': 'ID', 'inc.col.title': 'Título', 'inc.col.status': 'Status', 'inc.col.assignee': 'Responsável', 'inc.col.where': 'Servidor / destino', 'inc.col.seen': 'Última vez',
|
||||
@@ -194,7 +204,17 @@
|
||||
'inc.meta': 'aberto {a} · atualizado {b} · {n} ocorrências',
|
||||
'inc.h.group': '{who} fez {n} alterações',
|
||||
'inc.copy': 'Copiar', 'inc.copied': 'Copiado',
|
||||
'inc.title.edit': 'Editar título'
|
||||
'inc.title.edit': 'Editar título',
|
||||
'inc.col.count': 'Ocorr.', 'inc.unassigned': 'Sem responsável', 'inc.evidence': 'O que foi detectado',
|
||||
'inc.summary.none': 'Ainda sem conclusão. Escreva o que descobriu quando souber.',
|
||||
'inc.sup.on': 'Ligada: novos achados iguais ficam ocultos na página de tráfego de saída.',
|
||||
'inc.sup.what': 'Oculta da página de tráfego de saída os novos achados com esta mesma impressão digital.',
|
||||
'inc.sup.more': 'Como funciona',
|
||||
'inc.sup.until': 'Suprimido até {date} (ligado {ago}).', 'inc.sup.until.short': 'Suprimido até {date}',
|
||||
'inc.sup.only.egress': 'Só chamados de achados do tráfego de saída podem ser suprimidos.',
|
||||
'inc.sup.only.low': 'Achados de severidade alta ou crítica não podem ser suprimidos.',
|
||||
'inc.sup.for': 'Suprimir por', 'inc.sup.days': '{n} dias',
|
||||
'inc.sup.reopen': 'O chamado reabre sozinho quando o prazo vence ou se a severidade subir.'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -248,7 +268,7 @@
|
||||
// ------------------------------------------------------------ list
|
||||
function listView(host) {
|
||||
var seq = 0, on = true, timer = 0;
|
||||
var results = el('div', { class: 'inc-results' });
|
||||
var results = el('div', { class: 'inc-results', 'aria-live': 'polite', 'aria-busy': 'false' });
|
||||
var tabsBox = el('div', { class: 'inc-tabs', role: 'group', 'aria-label': t('inc.tabs') });
|
||||
var counts = null;
|
||||
|
||||
@@ -265,7 +285,7 @@
|
||||
if (ctx && ctx.host && ctx.host !== 'all') p.host = ctx.host;
|
||||
return p;
|
||||
}
|
||||
var search = el('input', { type: 'search', class: 'inc-search', autocomplete: 'off', placeholder: t('inc.search'), 'aria-label': t('inc.search') });
|
||||
var search = el('input', { type: 'search', class: 'inc-search', autocomplete: 'off', placeholder: t('inc.search') + ' /', 'aria-label': t('inc.search') });
|
||||
search.value = cur().q;
|
||||
var sevSel = el('select', { 'aria-label': t('inc.f.severity') });
|
||||
sevSel.appendChild(el('option', { value: '' }, t('inc.sev.all')));
|
||||
@@ -285,6 +305,14 @@
|
||||
sevSel.addEventListener('change', function () { U.setParam('sev', sevSel.value); reload(); });
|
||||
sortSel.addEventListener('change', function () { U.setParam('sort', sortSel.value === 'updated' ? '' : sortSel.value); reload(); });
|
||||
|
||||
function slash(e) {
|
||||
if (e.key !== '/' || e.ctrlKey || e.metaKey || e.altKey) return;
|
||||
var a = document.activeElement, tag = a && a.tagName;
|
||||
if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || (a && a.isContentEditable) || document.querySelector('dialog[open]')) return;
|
||||
e.preventDefault(); search.focus();
|
||||
}
|
||||
document.addEventListener('keydown', slash);
|
||||
search.setAttribute('aria-keyshortcuts', '/');
|
||||
var info = el('span', { class: 'inc-info', tabindex: '0', role: 'img', title: t('inc.lead'), 'aria-label': t('inc.lead') }, 'ⓘ');
|
||||
host.appendChild(el('div', { class: 'inc-bar' }, el('div', { class: 'inc-tabwrap' }, info, tabsBox), el('div', { class: 'inc-toolbar' }, search, sevSel, sortSel, newBtn)));
|
||||
host.appendChild(results);
|
||||
@@ -304,22 +332,24 @@
|
||||
});
|
||||
}
|
||||
function row(it) {
|
||||
var where = [it.host ? String(it.host) : '', it.dst ? it.dst + (it.dport ? ':' + it.dport : '') : ''].filter(Boolean).join(' · ');
|
||||
var full = [(it.workload || ''), it.dst ? '→ ' + it.dst + (it.dport ? ':' + it.dport : '') : ''].filter(Boolean).join(' ');
|
||||
// egress tickets: pattern on top, workload below (the auto title repeats both and gets cut)
|
||||
var sev = sevOf(it.severity), q = splitId(it);
|
||||
var dst = it.dst ? it.dst + (it.dport ? ':' + it.dport : '') : '';
|
||||
// egress tickets: pattern as the headline, workload -> destination in the meta line (the auto title repeats both and gets cut)
|
||||
var auto = it.source === 'egress' && it.kind && it.workload;
|
||||
var head = auto ? tr('eg.kind.' + it.kind, String(it.kind)) : String(it.title || it.id);
|
||||
var titleLine = el('span', { class: 'inc-main' + (auto ? ' two' : '') },
|
||||
el('span', { class: 'inc-mrow' }, el('strong', { class: 'inc-title', title: String(it.title || it.id) }, head),
|
||||
(it.tags && it.tags.length) ? el('span', { class: 'inc-rtags' }, tagChips(it.tags.slice(0, 1))) : null),
|
||||
auto ? el('span', { class: 'inc-sub mono', title: String(it.workload) }, String(it.workload)) : null);
|
||||
return el('a', { class: 'inc-row', href: U.href('incidents', idSegs(it)), title: full },
|
||||
dot(it.severity),
|
||||
el('span', { class: 'inc-id mono', title: splitId(it).full }, splitId(it).full),
|
||||
titleLine,
|
||||
el('span', { class: 'inc-st' }, statusBadge(it.status)),
|
||||
el('span', { class: 'inc-who' }, it.assignee ? String(it.assignee) : '—'),
|
||||
el('span', { class: 'inc-where mono' }, where),
|
||||
var head = auto ? tr('eg.kind.' + it.kind, String(it.kind)) : String(it.title || q.full);
|
||||
var meta = el('span', { class: 'inc-rmeta' }, el('span', { class: 'mono inc-rid' }, q.full));
|
||||
function add(node) { meta.appendChild(el('span', { class: 'inc-sep', 'aria-hidden': 'true' }, '·')); meta.appendChild(node); }
|
||||
if (auto) add(el('span', { class: 'mono inc-trunc', title: String(it.workload) + (dst ? ' → ' + dst : '') }, String(it.workload) + (dst ? ' → ' + dst : '')));
|
||||
else if (dst) add(el('span', { class: 'mono inc-trunc' }, dst));
|
||||
(Array.isArray(it.tags) ? it.tags.slice(0, 2) : []).forEach(function (g) { add(el('span', { class: 'inc-tag' }, String(g))); });
|
||||
if (it.suppress) add(el('span', { class: 'inc-tag inc-supl', title: it.suppress_until ? t('inc.sup.until.short', { date: U.fmt.date(it.suppress_until) }) : '' }, t('eg.suppressed.chip')));
|
||||
if (it.comment_count) add(el('span', { class: 'inc-cc', title: t(it.comment_count === 1 ? 'inc.comments.n.one' : 'inc.comments.n.other', { n: nf(it.comment_count) }) }, nf(it.comment_count)));
|
||||
return el('a', { class: 'inc-row inc-s-' + sev, href: U.href('incidents', idSegs(it)), title: String(it.title || q.full) },
|
||||
el('span', { class: 'inc-c-sev' }, el('span', { class: 'inc-sev inc-sev-' + sev }, t('inc.sev.' + sev))),
|
||||
el('span', { class: 'inc-main' }, el('strong', { class: 'inc-title' }, head), meta),
|
||||
el('span', { class: 'inc-c-st' }, statusBadge(it.status)),
|
||||
el('span', { class: 'inc-who' + (it.assignee ? '' : ' none') }, it.assignee ? String(it.assignee) : t('inc.unassigned')),
|
||||
el('span', { class: 'inc-cnt num', title: t('inc.t.count') }, '×' + nf(it.count || 1)),
|
||||
el('span', { class: 'inc-when' }, when(it.last_seen)));
|
||||
}
|
||||
function paint(r, f) {
|
||||
@@ -339,8 +369,8 @@
|
||||
box.appendChild(e);
|
||||
return;
|
||||
}
|
||||
box.appendChild(el('div', { class: 'inc-thead', 'aria-hidden': 'true' }, el('span'), el('span', null, t('inc.col.id')), el('span', null, t('inc.col.title')), el('span', null, t('inc.col.status')),
|
||||
el('span', null, t('inc.col.assignee')), el('span', null, t('inc.col.where')), el('span', { class: 'r' }, t('inc.col.seen'))));
|
||||
box.appendChild(el('div', { class: 'inc-thead', 'aria-hidden': 'true' }, el('span', null, t('inc.f.severity')), el('span', null, t('inc.col.title')), el('span', null, t('inc.col.status')),
|
||||
el('span', null, t('inc.col.assignee')), el('span', { class: 'r' }, t('inc.col.count')), el('span', { class: 'r' }, t('inc.col.seen'))));
|
||||
items.forEach(function (it) { box.appendChild(row(it)); });
|
||||
var total2 = r.total || items.length, pages = Math.max(1, Math.ceil(total2 / PER_PAGE));
|
||||
var pg = U.ui.pager({ page: f.p, pages: pages, total: total2, onPage: function (n) { U.setParam('p', n); load(); window.scrollTo(0, 0); } });
|
||||
@@ -366,7 +396,7 @@
|
||||
});
|
||||
}
|
||||
load();
|
||||
return { refresh: load, update: load, destroy: function () { on = false; seq++; clearTimeout(timer); } };
|
||||
return { refresh: load, update: load, destroy: function () { on = false; seq++; clearTimeout(timer); document.removeEventListener('keydown', slash); } };
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------ new ticket dialog
|
||||
@@ -425,7 +455,7 @@
|
||||
function detailView(host, id, idHost) {
|
||||
var seq = 0, on = true, tk = null, busy = false;
|
||||
var box = el('div', { class: 'inc-detail' });
|
||||
host.appendChild(el('a', { class: 'inc-back', href: U.href('incidents') }, '← ' + t('inc.back')));
|
||||
host.appendChild(el('nav', { class: 'inc-backnav', 'aria-label': t('inc.title') }, el('a', { class: 'inc-back', href: U.href('incidents') }, '← ' + t('inc.back'))));
|
||||
host.appendChild(box);
|
||||
var errBox = el('p', { class: 'inc-err', role: 'alert', hidden: true });
|
||||
|
||||
@@ -486,10 +516,19 @@
|
||||
}
|
||||
var q = el('div', { class: 'inc-quick', role: 'group', 'aria-label': t('inc.quick') },
|
||||
quick(t('inc.quick.fp'), 'false_positive', 'fp'), quick(t('inc.quick.tp'), 'true_positive', 'tp'), quick(t('inc.quick.resolve'), 'resolved', 'ok'));
|
||||
var meta = el('span', { class: 'inc-hint inc-metaline' }, t('inc.meta', { a: x.created_at ? U.fmt.ago(x.created_at) : '-', b: x.updated_at ? U.fmt.ago(x.updated_at) : '-', n: nf(x.count) }));
|
||||
return el('header', { class: 'inc-head' },
|
||||
el('div', { class: 'inc-h1' }, dot(x.severity), el('span', { class: 'inc-id mono' }, splitId(x).full), title, q),
|
||||
el('div', { class: 'inc-h2' }, sevBadge(x.severity), statusBadge(x.status), x.suppress ? el('span', { class: 'chip' }, t('eg.suppressed.chip')) : null, tagChips(x.tags), meta));
|
||||
var q2 = splitId(x), sev = sevOf(x.severity);
|
||||
var facts = el('p', { class: 'inc-facts' });
|
||||
function fact(k, v) { if (facts.firstChild) facts.appendChild(el('span', { class: 'inc-sep', 'aria-hidden': 'true' }, '·')); facts.appendChild(el('span', null, el('span', { class: 'inc-fk' }, k + ' '), v)); }
|
||||
fact(t('inc.t.created'), when(x.created_at));
|
||||
fact(t('inc.t.last'), when(x.last_seen || x.updated_at));
|
||||
fact(t('inc.t.count'), el('strong', { class: 'num' }, nf(x.count || 1)));
|
||||
if (x.assignee) fact(t('inc.f.assignee'), el('strong', null, String(x.assignee)));
|
||||
return el('header', { class: 'inc-head inc-s-' + sev },
|
||||
el('div', { class: 'inc-crumb mono' }, q2.host ? el('span', null, q2.host) : null, q2.host ? el('span', { class: 'inc-sep', 'aria-hidden': 'true' }, '/') : null, el('span', null, q2.num)),
|
||||
el('div', { class: 'inc-h1' }, title, q),
|
||||
el('div', { class: 'inc-h2' }, el('span', { class: 'inc-sev inc-sev-' + sev }, t('inc.sev.' + sev)), statusBadge(x.status),
|
||||
x.suppress ? el('span', { class: 'badge inc-supb' }, t('eg.suppressed.chip')) : null, tagChips(x.tags, 'inc-tag')),
|
||||
facts);
|
||||
}
|
||||
|
||||
// ---- properties (each control saves by itself)
|
||||
@@ -504,7 +543,9 @@
|
||||
tg.value = (x.tags || []).join(', ');
|
||||
var sup = el('input', { type: 'checkbox', id: 'inc-e-sup', role: 'switch', class: 'inc-switch', 'aria-describedby': 'inc-e-sup-h' });
|
||||
sup.checked = !!x.suppress;
|
||||
sup.disabled = SUPPRESSIBLE.indexOf(statusOf(x.status)) < 0;
|
||||
var hi = ['critical', 'high'];
|
||||
var supWhy = x.source !== 'egress' ? 'inc.sup.only.egress' : (hi.indexOf(sevOf(x.severity)) >= 0 || hi.indexOf(String(x.max_severity || '')) >= 0) ? 'inc.sup.only.low' : SUPPRESSIBLE.indexOf(statusOf(x.status)) < 0 ? 'inc.f.suppress.off' : '';
|
||||
sup.disabled = !x.suppress && !!supWhy;
|
||||
st.addEventListener('change', function () {
|
||||
var d = { status: st.value };
|
||||
if (x.suppress && SUPPRESSIBLE.indexOf(st.value) < 0) d.suppress = false;
|
||||
@@ -517,15 +558,28 @@
|
||||
me.addEventListener('click', function () { if (authorName() !== (x.assignee || '')) patch({ assignee: authorName() }); });
|
||||
tg.addEventListener('change', function () { var l = parseTags(tg.value); if (!sameList(l, x.tags)) patch({ tags: l }); });
|
||||
tg.addEventListener('keydown', function (e) { if (e.key === 'Enter') { e.preventDefault(); tg.blur(); } });
|
||||
sup.addEventListener('change', function () { patch({ suppress: sup.checked }); });
|
||||
var supHint = el('span', { class: 'inc-hint', id: 'inc-e-sup-h', title: t('inc.f.suppress.help') }, t('inc.sup.hint'));
|
||||
var days = el('select', { id: 'inc-e-days', 'aria-label': t('inc.sup.for') });
|
||||
[7, 30, 90].forEach(function (d) { var o = el('option', { value: String(d) }, t('inc.sup.days', { n: d })); if (d === 30) o.selected = true; days.appendChild(o); });
|
||||
sup.addEventListener('change', function () {
|
||||
if (sup.checked) patch({ suppress: true, suppress_until: Math.floor(Date.now() / 1000) + Number(days.value) * 86400 });
|
||||
else patch({ suppress: false });
|
||||
});
|
||||
var supState = x.suppress
|
||||
? t('inc.sup.until', { date: x.suppress_until ? U.fmt.date(x.suppress_until) : '-', ago: x.suppressed_at ? U.fmt.ago(x.suppressed_at) : '-' })
|
||||
: (supWhy ? t(supWhy) : t('inc.sup.what'));
|
||||
var supHint = el('details', { class: 'inc-why' }, el('summary', null, t('inc.sup.more')), el('p', { class: 'inc-hint' }, t('inc.f.suppress.help')));
|
||||
return el('section', { class: 'inc-card inc-props' }, el('h2', null, t('inc.props')),
|
||||
row(t('inc.f.status'), st, 'inc-e-status'),
|
||||
row(t('inc.f.severity'), sev, 'inc-e-sev'),
|
||||
row(t('inc.f.assignee'), el('div', { class: 'inc-stack' }, asg, me), 'inc-e-asg'),
|
||||
row(t('inc.f.tags'), el('div', { class: 'inc-stack' }, tg, el('span', { class: 'inc-hint', id: 'inc-e-tags-h' }, t('inc.f.tags.hint'))), 'inc-e-tags'),
|
||||
row(t('inc.sup.short'), el('div', { class: 'inc-stack' }, sup, supHint), 'inc-e-sup'),
|
||||
errBox);
|
||||
errBox,
|
||||
el('div', { class: 'inc-supbox' + (sup.disabled ? ' off' : '') + (x.suppress ? ' on' : '') },
|
||||
el('div', { class: 'inc-sup-row' }, el('label', { for: 'inc-e-sup' }, t('inc.f.suppress')), sup),
|
||||
el('p', { class: 'inc-hint', id: 'inc-e-sup-h' }, supState),
|
||||
(!x.suppress && !sup.disabled) ? el('div', { class: 'inc-sup-row' }, el('label', { for: 'inc-e-days', class: 'inc-hint' }, t('inc.sup.for')), days) : null,
|
||||
el('p', { class: 'inc-hint' }, t('inc.sup.reopen')),
|
||||
supHint));
|
||||
}
|
||||
|
||||
// ---- summary: conclusion + original detail
|
||||
@@ -536,9 +590,10 @@
|
||||
var has = !!(x.verdict || x.detail);
|
||||
node.classList.toggle('empty', !has && !edit);
|
||||
if (!has && !edit) {
|
||||
var add = el('button', { type: 'button', class: 'btn sm' }, '+ ' + t('inc.concl.add'));
|
||||
var add = el('button', { type: 'button', class: 'btn sm' }, t('inc.concl.add'));
|
||||
add.addEventListener('click', function () { render(true); });
|
||||
node.appendChild(add);
|
||||
node.appendChild(el('div', { class: 'inc-card-h' }, el('h2', null, t('inc.summary')), add));
|
||||
node.appendChild(el('p', { class: 'inc-hint' }, t('inc.summary.none')));
|
||||
return;
|
||||
}
|
||||
var head = el('div', { class: 'inc-card-h' }, el('h2', null, t('inc.summary')));
|
||||
@@ -558,8 +613,8 @@
|
||||
node.appendChild(ta);
|
||||
node.appendChild(el('div', { class: 'inc-btns' }, cn, sv));
|
||||
setTimeout(function () { ta.focus(); }, 0);
|
||||
} else if (x.verdict) node.appendChild(el('p', { class: 'inc-text' }, String(x.verdict)));
|
||||
if (x.detail) node.appendChild(el('pre', { class: 'inc-pre', 'aria-label': t('inc.detail.label') }, String(x.detail)));
|
||||
} else if (x.verdict) node.appendChild(el('div', { class: 'inc-verdict' }, el('h3', null, t('inc.f.verdict')), el('p', { class: 'inc-text' }, String(x.verdict))));
|
||||
if (x.detail) node.appendChild(el('div', { class: 'inc-evid' }, el('h3', null, t('inc.evidence')), el('pre', { class: 'inc-pre' }, String(x.detail))));
|
||||
}
|
||||
render(false);
|
||||
return node;
|
||||
@@ -647,7 +702,8 @@
|
||||
ul.appendChild(el('li', { class: 'inc-ev inc-grp' }, el('details', null,
|
||||
el('summary', null, el('span', { class: 'inc-ev-dot', 'aria-hidden': 'true' }), t('inc.h.group', { who: String(e.h.author || '-'), n: grp.length }), ' ', el('span', { class: 'inc-ev-when' }, when(e.at))), inner)));
|
||||
}
|
||||
return el('section', { class: 'inc-card inc-activity' }, el('div', { class: 'inc-card-h' }, el('h2', null, t('inc.activity'))), composer(), evs.length ? ul : null);
|
||||
return el('section', { class: 'inc-card inc-activity', 'aria-label': t('inc.activity') }, el('div', { class: 'inc-card-h' }, el('h2', null, t('inc.activity')), el('span', { class: 'inc-hint' }, t('inc.comments.n.' + ((x.comments || []).length === 1 ? 'one' : 'other'), { n: nf((x.comments || []).length) }))),
|
||||
composer(), evs.length ? ul : el('p', { class: 'inc-hint' }, t('inc.comments.none')));
|
||||
}
|
||||
|
||||
// ---- technical data
|
||||
|
||||
Reference in new issue
Block a user