MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / postAPI

Function postAPI

web/scripts/ragnar_modern.js:11681–11702  ·  view source on GitHub ↗
(endpoint, data)

Source from the content-addressed store, hash-verified

11679 '</thead><tbody>' +
11680 findings.map(f => {
11681 const sev = _LDAP_SEV_STYLE[f.severity] || 'text-gray-400';
11682 return `<tr class="border-t border-slate-800 align-top">
11683 <td class="px-2 py-1 ${sev} uppercase">${escapeHtml(f.severity || '')}</td>
11684 <td class="px-2 py-1 ${sev}">${escapeHtml(f.code || '')}</td>
11685 <td class="px-2 py-1 font-mono text-gray-400">${escapeHtml((f.src || '') + ' → ' + (f.dst || ''))}</td>
11686 <td class="px-2 py-1 text-gray-400 whitespace-normal">${escapeHtml(f.message || '')}</td>
11687 </tr>`;
11688 }).join('') +
11689 '</tbody></table>';
11690 } else {
11691 html += '<p class="text-sm text-green-400/80">No findings — LDAP/AD traffic looks clean (or none seen on this segment).</p>';
11692 }
11693 out.innerHTML = html;
11694 } catch (e) {
11695 out.innerHTML = '<p class="text-sm text-red-400">Failed: ' + escapeHtml(e.message) + '</p>';
11696 } finally {
11697 _ndBusy(btn, false);
11698 }
11699}
11700
11701// ---- DTP Watch (passive VLAN-hopping / switch-spoofing scanner) -------------
11702const _DTP_VERDICT_STYLE = {
11703 clean: ['bg-green-950/40 border-green-900 text-green-400', '✓ No DTP trunk negotiation — ports are not forming trunks here'],
11704 'dtp-enabled': ['bg-amber-950/50 border-amber-800 text-amber-300', '⚠ DTP is enabled on this segment — disable with `switchport nonegotiate`'],
11705 'trunk-negotiation': ['bg-amber-950/50 border-amber-800 text-amber-300', '⚠ DTP is negotiating trunks — a rogue host could VLAN-hop'],

Callers 15

onRusenseTabToggledFunction · 0.70
onTerminalToggledFunction · 0.70
_ndRunTextFunction · 0.70
runMtrFunction · 0.70
runSpeedtestFunction · 0.70
runDnsFunction · 0.70
runPmtuFunction · 0.70
runIperfFunction · 0.70
toggleIperfServerFunction · 0.70
installNetToolFunction · 0.70
runPtpFunction · 0.70
aiAnalyzePcapFunction · 0.70

Calls 2

errorMethod · 0.80
networkAwareFetchFunction · 0.70

Tested by

no test coverage detected