(config)
| 7433 | } |
| 7434 | const [cls, label] = _SNMP_VERDICT_STYLE[d.verdict] || _SNMP_VERDICT_STYLE.unknown; |
| 7435 | let html = `<div class="mb-2 px-3 py-2 rounded border ${cls} text-sm">${label}</div>`; |
| 7436 | html += `<p class="text-xs text-gray-500 mb-2">Interface: ${escapeHtml(d.interface || '—')} · ${d.snmp_count} msgs (${d.rate}/s) · ${d.insecure ? '<span class="text-red-300">insecure v1/v2c present</span>' : 'v3-only'}${d.learned ? ' · <span class="text-gray-400">baseline learned now</span>' : ''}</p>`; |
| 7437 | const agents = d.agents || []; |
| 7438 | if (agents.length) { |
| 7439 | html += '<p class="text-xs uppercase text-gray-400 mt-2 mb-1">SNMP agents (' + agents.length + ')</p>' + |
| 7440 | '<table class="min-w-full text-xs text-gray-300 whitespace-nowrap"><thead>' + |
| 7441 | '<tr class="text-left text-gray-500"><th class="px-2 py-1">Agent</th><th class="px-2 py-1">Version</th><th class="px-2 py-1">Community</th><th class="px-2 py-1">Write</th><th class="px-2 py-1">State</th></tr>' + |
| 7442 | '</thead><tbody>' + |
| 7443 | agents.map(a => { |
| 7444 | const insec = !a.secure; |
| 7445 | return `<tr class="border-t border-slate-800"> |
| 7446 | <td class="px-2 py-1 font-mono ${insec ? 'text-red-300' : 'text-green-400'}">${escapeHtml(a.ip)}</td> |
| 7447 | <td class="px-2 py-1 ${a.secure ? 'text-green-400' : 'text-red-300'}">${escapeHtml((a.versions || []).join(', '))}${a.secure ? ' 🔒' : ''}</td> |
| 7448 | <td class="px-2 py-1 font-mono text-gray-400">${escapeHtml((a.communities || []).join(', ') || '—')}</td> |
| 7449 | <td class="px-2 py-1">${a.writes ? '<span class="text-red-300">RW</span>' : '<span class="text-gray-500">—</span>'}</td> |
| 7450 | <td class="px-2 py-1">${a.baseline ? '<span class="text-gray-500">known</span>' : '<span class="text-amber-300">NEW</span>'}</td> |
| 7451 | </tr>`; |
| 7452 | }).join('') + '</tbody></table>'; |
| 7453 | } |
| 7454 | const comms = d.communities || []; |
| 7455 | if (comms.length) { |
| 7456 | html += '<p class="text-xs uppercase text-gray-400 mt-2 mb-1">Community strings exposed (' + comms.length + ')</p>' + |
no test coverage detected