145 lines
6.8 KiB
HTML
145 lines
6.8 KiB
HTML
{% extends 'base.html' %}
|
|
{% block title %}Agents Qualys{% endblock %}
|
|
{% block content %}
|
|
<div class="flex justify-between items-center mb-4">
|
|
<div>
|
|
<h2 class="text-xl font-bold text-cyber-accent">Agents Qualys</h2>
|
|
<p class="text-xs text-gray-500 mt-1">Activation keys et versions des agents déployés</p>
|
|
</div>
|
|
<a href="/qualys/search" class="btn-sm bg-cyber-border text-cyber-accent px-4 py-2">Recherche</a>
|
|
</div>
|
|
|
|
<!-- KPIs agents -->
|
|
<div style="display:flex;flex-wrap:nowrap;gap:8px;margin-bottom:16px;">
|
|
<div class="card p-3 text-center" style="flex:1;min-width:0"><div class="text-2xl font-bold text-cyber-accent">{{ summary.total_assets or 0 }}</div><div class="text-xs text-gray-500">Total assets</div></div>
|
|
<div class="card p-3 text-center" style="flex:1;min-width:0"><div class="text-2xl font-bold text-cyber-green">{{ summary.active or 0 }}</div><div class="text-xs text-gray-500">Agents actifs</div></div>
|
|
<a href="#inactive-list" class="card p-3 text-center hover:bg-cyber-hover" style="flex:1;min-width:0"><div class="text-2xl font-bold text-cyber-red">{{ summary.inactive or 0 }}*</div><div class="text-xs text-gray-500">Agents inactifs</div></a>
|
|
<div class="card p-3 text-center" style="flex:1;min-width:0"><div class="text-2xl font-bold text-cyber-red">{{ no_agent_servers|length }}</div><div class="text-xs text-gray-500">Sans agent (prod)</div></div>
|
|
</div>
|
|
|
|
<!-- Activation Keys -->
|
|
<div class="card p-4 mb-4">
|
|
<h3 class="text-sm font-bold text-cyber-accent mb-3">Activation Keys</h3>
|
|
<table class="w-full table-cyber text-xs">
|
|
<thead><tr>
|
|
<th class="text-left p-2">Titre</th>
|
|
<th class="p-2">Statut</th>
|
|
<th class="p-2">Type</th>
|
|
<th class="p-2">Utilisés</th>
|
|
<th class="text-left p-2">Clé</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
{% for k in keys %}
|
|
<tr>
|
|
<td class="p-2 font-bold text-cyber-accent">{{ k.title }}</td>
|
|
<td class="p-2 text-center"><span class="badge {% if k.status == 'ACTIVE' %}badge-green{% else %}badge-red{% endif %}">{{ k.status }}</span></td>
|
|
<td class="p-2 text-center text-gray-400">{{ k.type }}</td>
|
|
<td class="p-2 text-center font-bold">{{ k.used }}</td>
|
|
<td class="p-2 font-mono text-gray-500" style="font-size:10px;">{{ k.key }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Statut agents -->
|
|
<div class="grid grid-cols-2 gap-4 mb-4">
|
|
<div class="card p-4">
|
|
<h3 class="text-sm font-bold text-cyber-accent mb-3">Statut des agents</h3>
|
|
{% if summary.statuses %}
|
|
<table class="w-full table-cyber text-xs">
|
|
<thead><tr><th class="text-left p-2">Statut</th><th class="p-2">Nombre</th></tr></thead>
|
|
<tbody>
|
|
{% for s in summary.statuses %}
|
|
<tr>
|
|
<td class="p-2"><span class="badge {% if 'ACTIVE' in (s.agent_status or '').upper() or 'STATUS_ACTIVE' in (s.agent_status or '').upper() %}badge-green{% elif 'INACTIVE' in (s.agent_status or '').upper() %}badge-red{% else %}badge-gray{% endif %}">{{ s.agent_status }}</span></td>
|
|
<td class="p-2 text-center font-bold">{{ s.cnt }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<p class="text-gray-500 text-xs">Aucune donnée</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="card p-4">
|
|
<h3 class="text-sm font-bold text-cyber-accent mb-3">Versions déployées</h3>
|
|
{% if summary.versions %}
|
|
<table class="w-full table-cyber text-xs">
|
|
<thead><tr><th class="text-left p-2">Version</th><th class="p-2">Nombre</th></tr></thead>
|
|
<tbody>
|
|
{% for v in summary.versions %}
|
|
<tr>
|
|
<td class="p-2 font-mono">{{ v.agent_version }}</td>
|
|
<td class="p-2 text-center font-bold">{{ v.cnt }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<p class="text-gray-500 text-xs">Aucune donnée</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Serveurs sans agent Qualys -->
|
|
{% if no_agent_servers %}
|
|
<div class="card p-4 mb-4">
|
|
<h3 class="text-sm font-bold text-cyber-red mb-3">Serveurs en production sans agent Qualys ({{ no_agent_servers|length }})</h3>
|
|
<table class="w-full table-cyber text-xs">
|
|
<thead><tr>
|
|
<th class="text-left p-2">Hostname</th>
|
|
<th class="p-2">OS</th>
|
|
<th class="p-2">Domaine</th>
|
|
<th class="p-2">Env</th>
|
|
<th class="p-2">Zone</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
{% for s in no_agent_servers %}
|
|
<tr>
|
|
<td class="p-2 font-mono text-cyber-accent">{{ s.hostname }}</td>
|
|
<td class="p-2 text-center">{{ s.os_family or '-' }}</td>
|
|
<td class="p-2 text-center text-gray-400">{{ s.domain or '-' }}</td>
|
|
<td class="p-2 text-center">{{ s.env or '-' }}</td>
|
|
<td class="p-2 text-center">{% if s.zone == 'DMZ' %}<span class="badge badge-red">DMZ</span>{% else %}{{ s.zone or '-' }}{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Agents inactifs -->
|
|
{% if inactive_agents %}
|
|
<div id="inactive-list" class="card p-4 mb-4">
|
|
<h3 class="text-sm font-bold text-cyber-red mb-3">* Agents inactifs ({{ inactive_agents|length }})</h3>
|
|
<div class="card p-3 mb-3 text-xs text-gray-400" style="background:#111827;">
|
|
<b>* Légende :</b> Ces serveurs ont un agent Qualys installé mais qui ne communique plus avec le cloud Qualys.
|
|
Causes possibles : serveur éteint, flux réseau bloqué (port 443 vers qualysagent.qualys.eu), agent crashé, ou OS non supporté (RHEL 5 EOL).
|
|
Tous ces agents sont en version <b>6.1.0.28</b> sur <b>RHEL 5.x</b> — dernier check-in le <b>14/11/2025</b>.
|
|
</div>
|
|
<table class="w-full table-cyber text-xs">
|
|
<thead><tr>
|
|
<th class="text-left p-2">Hostname</th>
|
|
<th class="p-2">OS</th>
|
|
<th class="p-2">Version agent</th>
|
|
<th class="p-2">Dernier check-in</th>
|
|
<th class="p-2">État</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
{% for a in inactive_agents %}
|
|
<tr>
|
|
<td class="p-2 font-mono text-cyber-accent">{{ a.hostname }}</td>
|
|
<td class="p-2 text-center text-gray-400">{{ a.os or '-' }}</td>
|
|
<td class="p-2 text-center font-mono">{{ a.agent_version or '-' }}</td>
|
|
<td class="p-2 text-center text-cyber-yellow">{% if a.last_checkin %}{{ (a.last_checkin|string)[:10] }}{% else %}-{% endif %}</td>
|
|
<td class="p-2 text-center">{{ a.etat or '-' }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|