Files
GLPI-Plugin-CVE-Prototype/public/cve_dashboard.html
2025-05-31 10:03:48 +02:00

488 lines
20 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GLPI CVE Plugin</title>
<!-- Include GLPI's CSS -->
<link rel="stylesheet" href="../css/styles.css">
<!-- Plugin specific CSS -->
<link rel="stylesheet" href="../css/cve.css">
<!-- Font Awesome for icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
</head>
<body class="glpi-standard-layout">
<div class="cve-container">
<!-- Plugin Header -->
<div class="cve-card mb-20">
<div class="cve-card-body">
<h1><i class="fas fa-shield-alt text-blue-600 mr-2"></i> CVE Management Plugin</h1>
<p class="text-gray-600">Manage and track Common Vulnerabilities and Exposures</p>
</div>
</div>
<!-- Navigation -->
<div class="cve-nav">
<a class="cve-nav-item active" data-target="cve-dashboard">
<i class="fas fa-tachometer-alt cve-nav-icon"></i>Dashboard
</a>
<a class="cve-nav-item" data-target="cve-list">
<i class="fas fa-shield-alt cve-nav-icon"></i>CVE Management
</a>
<a class="cve-nav-item" data-target="cve-sources">
<i class="fas fa-database cve-nav-icon"></i>Data Sources
</a>
<a class="cve-nav-item" data-target="cve-rules">
<i class="fas fa-cogs cve-nav-icon"></i>Rules
</a>
</div>
<!-- Dashboard Content -->
<div id="cve-dashboard" class="cve-content">
<!-- Statistics Cards -->
<div class="cve-stats-container">
<div class="cve-stat-card cve-critical">
<div class="cve-stat-icon">
<i class="fas fa-exclamation-triangle"></i>
</div>
<div class="cve-stat-content">
<div class="cve-stat-label">Critical Vulnerabilities</div>
<div class="cve-stat-value" id="critical-count">0</div>
</div>
<div class="cve-progress-bar">
<div class="cve-progress-bar-fill" id="critical-progress" style="width: 0%"></div>
</div>
</div>
<div class="cve-stat-card cve-high">
<div class="cve-stat-icon">
<i class="fas fa-exclamation-circle"></i>
</div>
<div class="cve-stat-content">
<div class="cve-stat-label">High Risk Vulnerabilities</div>
<div class="cve-stat-value" id="high-count">0</div>
</div>
<div class="cve-progress-bar">
<div class="cve-progress-bar-fill" id="high-progress" style="width: 0%"></div>
</div>
</div>
<div class="cve-stat-card cve-pending">
<div class="cve-stat-icon">
<i class="fas fa-clock"></i>
</div>
<div class="cve-stat-content">
<div class="cve-stat-label">Pending Analysis</div>
<div class="cve-stat-value" id="pending-count">0</div>
</div>
<div class="cve-progress-bar">
<div class="cve-progress-bar-fill" id="pending-progress" style="width: 0%"></div>
</div>
</div>
<div class="cve-stat-card cve-resolved">
<div class="cve-stat-icon">
<i class="fas fa-check-circle"></i>
</div>
<div class="cve-stat-content">
<div class="cve-stat-label">Resolved Issues</div>
<div class="cve-stat-value" id="resolved-count">0</div>
</div>
<div class="cve-progress-bar">
<div class="cve-progress-bar-fill" id="resolved-progress" style="width: 0%"></div>
</div>
</div>
</div>
<!-- Recent Vulnerabilities -->
<div class="cve-card">
<div class="cve-card-header">
<i class="fas fa-history mr-2"></i> Recent Vulnerabilities
</div>
<div class="cve-card-body">
<div class="table-responsive">
<table class="cve-table" id="recent-cve-table">
<thead>
<tr>
<th>CVE ID</th>
<th>Severity</th>
<th>CVSS</th>
<th>Published</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<!-- Populated by JavaScript -->
</tbody>
</table>
</div>
</div>
</div>
<!-- Severity Distribution Chart -->
<div class="cve-card mt-20">
<div class="cve-card-header">
<i class="fas fa-chart-bar mr-2"></i> Severity Distribution
</div>
<div class="cve-card-body">
<div class="cve-chart-container">
<div>
<div class="cve-chart-bar cve-chart-critical" style="height: 60px"></div>
<div class="cve-chart-label">CRITICAL</div>
<div class="cve-chart-value" id="chart-critical-count">0</div>
</div>
<div>
<div class="cve-chart-bar cve-chart-high" style="height: 120px"></div>
<div class="cve-chart-label">HIGH</div>
<div class="cve-chart-value" id="chart-high-count">0</div>
</div>
<div>
<div class="cve-chart-bar cve-chart-medium" style="height: 80px"></div>
<div class="cve-chart-label">MEDIUM</div>
<div class="cve-chart-value" id="chart-medium-count">0</div>
</div>
<div>
<div class="cve-chart-bar cve-chart-low" style="height: 40px"></div>
<div class="cve-chart-label">LOW</div>
<div class="cve-chart-value" id="chart-low-count">0</div>
</div>
</div>
<div class="text-center mt-10">
<p class="text-gray-500">Total vulnerabilities: <span id="total-cve-count">0</span></p>
</div>
</div>
</div>
</div>
<!-- CVE Management Content -->
<div id="cve-list" class="cve-content" style="display: none;">
<div class="cve-card">
<div class="cve-card-header">
<i class="fas fa-shield-alt mr-2"></i> CVE Management
</div>
<div class="cve-card-body">
<!-- Filters -->
<div class="cve-filters">
<div class="cve-filter-group">
<i class="fas fa-search cve-filter-icon"></i>
<input type="text" id="cve-search" class="cve-filter-input" placeholder="Search CVE ID or description...">
</div>
<div class="cve-filter-group">
<i class="fas fa-filter cve-filter-icon"></i>
<select id="severity-filter" class="cve-filter-select">
<option value="">All Severities</option>
<option value="CRITICAL">Critical</option>
<option value="HIGH">High</option>
<option value="MEDIUM">Medium</option>
<option value="LOW">Low</option>
</select>
</div>
<div class="cve-filter-group">
<i class="fas fa-filter cve-filter-icon"></i>
<select id="status-filter" class="cve-filter-select">
<option value="">All Statuses</option>
<option value="NEW">New</option>
<option value="ANALYZED">Analyzed</option>
<option value="ASSIGNED">Assigned</option>
<option value="RESOLVED">Resolved</option>
</select>
</div>
</div>
<!-- CVE Table -->
<div class="table-responsive">
<table class="cve-table" id="cve-table">
<thead>
<tr>
<th class="cve-sortable" data-column="cve_id">CVE ID</th>
<th>Description</th>
<th class="cve-sortable" data-column="severity">Severity</th>
<th class="cve-sortable" data-column="cvss">CVSS</th>
<th class="cve-sortable" data-column="published">Published</th>
<th class="cve-sortable" data-column="status">Status</th>
<th class="text-right">Actions</th>
</tr>
</thead>
<tbody>
<!-- Populated by JavaScript -->
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Data Sources Content -->
<div id="cve-sources" class="cve-content" style="display: none;">
<div class="cve-card">
<div class="cve-card-header">
<i class="fas fa-database mr-2"></i> CVE Data Sources
</div>
<div class="cve-card-body">
<div class="cve-btn-container">
<button id="add-source-btn" class="btn btn-primary">
<i class="fas fa-plus mr-1"></i> Add Source
</button>
</div>
<!-- Add Source Form -->
<div id="add-source-section" class="cve-form-section" style="display: none;">
<h3 class="cve-form-title">Add New Data Source</h3>
<form id="add-source-form">
<div class="cve-form-grid">
<div class="cve-form-group">
<label class="cve-form-label">Source Name*</label>
<input type="text" id="source-name" class="cve-form-input" required>
</div>
<div class="cve-form-group">
<label class="cve-form-label">API URL*</label>
<input type="text" id="source-url" class="cve-form-input" required>
</div>
<div class="cve-form-group">
<label class="cve-form-label">API Key (if required)</label>
<input type="password" id="source-api-key" class="cve-form-input">
</div>
<div class="cve-form-group">
<label class="cve-form-label">Sync Frequency (hours)</label>
<input type="number" id="source-frequency" class="cve-form-input" value="24" min="1" max="168">
</div>
<div class="cve-form-group">
<label class="cve-form-label">
<input type="checkbox" id="source-active" class="cve-form-checkbox" checked>
Active (enable synchronization)
</label>
</div>
</div>
<div class="cve-form-actions">
<button type="button" class="btn btn-secondary" onclick="$('#add-source-section').hide()">Cancel</button>
<button type="submit" class="btn btn-success">
<i class="fas fa-save mr-1"></i> Save Source
</button>
</div>
</form>
</div>
<!-- Sources Table -->
<table class="cve-table" id="sources-table">
<thead>
<tr>
<th>Source Name</th>
<th>URL</th>
<th>Frequency</th>
<th>Last Sync</th>
<th>Status</th>
<th>Active</th>
<th class="text-right">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>National Vulnerability Database (NVD)</td>
<td>https://services.nvd.nist.gov/rest/json/cves/2.0</td>
<td>Every 4 hours</td>
<td>2024-05-15 08:00:00</td>
<td><span class="badge badge-success">SUCCESS</span></td>
<td><span class="badge badge-success">Active</span></td>
<td class="text-right">
<button class="btn btn-sm btn-primary"><i class="fas fa-sync"></i></button>
<button class="btn btn-sm btn-danger"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td>MITRE CVE Database</td>
<td>https://cveawg.mitre.org/api/</td>
<td>Every 24 hours</td>
<td>2024-05-14 22:00:00</td>
<td><span class="badge badge-success">SUCCESS</span></td>
<td><span class="badge badge-success">Active</span></td>
<td class="text-right">
<button class="btn btn-sm btn-primary"><i class="fas fa-sync"></i></button>
<button class="btn btn-sm btn-danger"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td>CISA KEV Catalog</td>
<td>https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json</td>
<td>Every 12 hours</td>
<td>2024-05-15 04:00:00</td>
<td><span class="badge badge-success">SUCCESS</span></td>
<td><span class="badge badge-success">Active</span></td>
<td class="text-right">
<button class="btn btn-sm btn-primary"><i class="fas fa-sync"></i></button>
<button class="btn btn-sm btn-danger"><i class="fas fa-trash"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Rules Content -->
<div id="cve-rules" class="cve-content" style="display: none;">
<div class="cve-card">
<div class="cve-card-header">
<i class="fas fa-cogs mr-2"></i> CVE Processing Rules
</div>
<div class="cve-card-body">
<div class="cve-btn-container">
<button id="add-rule-btn" class="btn btn-primary">
<i class="fas fa-plus mr-1"></i> Add Rule
</button>
</div>
<!-- Add Rule Form -->
<div id="add-rule-section" class="cve-form-section" style="display: none;">
<h3 class="cve-form-title">Add New Rule</h3>
<form id="add-rule-form">
<div class="cve-form-grid">
<div class="cve-form-group" style="grid-column: span 2;">
<label class="cve-form-label">Rule Name*</label>
<input type="text" id="rule-name" class="cve-form-input" required>
</div>
<div>
<h4 class="mb-10">Criteria</h4>
<div class="cve-form-group">
<label class="cve-form-label">Severity</label>
<select id="rule-severity" class="cve-form-select">
<option value="CRITICAL">Critical</option>
<option value="HIGH">High</option>
<option value="MEDIUM">Medium</option>
<option value="LOW">Low</option>
</select>
</div>
<div class="cve-form-group">
<label class="cve-form-label">Priority</label>
<input type="number" id="rule-priority" class="cve-form-input" value="1" min="1">
<p class="mt-5 text-xs text-gray-500">Lower numbers are processed first</p>
</div>
</div>
<div>
<h4 class="mb-10">Actions</h4>
<div class="cve-form-group">
<label class="cve-form-label">
<input type="checkbox" id="create-ticket" class="cve-form-checkbox" checked>
Create ticket automatically
</label>
</div>
<div class="cve-form-group ml-20">
<label class="cve-form-label">Ticket Priority</label>
<select id="ticket-priority" class="cve-form-select">
<option value="VERY HIGH">Very High</option>
<option value="HIGH">High</option>
<option value="NORMAL" selected>Normal</option>
<option value="LOW">Low</option>
</select>
</div>
<div class="cve-form-group">
<label class="cve-form-label">
<input type="checkbox" id="notify-admins" class="cve-form-checkbox">
Send email notification
</label>
</div>
<div class="cve-form-group">
<label class="cve-form-label">
<input type="checkbox" id="add-to-report" class="cve-form-checkbox">
Add to vulnerability report
</label>
</div>
</div>
<div class="cve-form-group" style="grid-column: span 2;">
<label class="cve-form-label">
<input type="checkbox" id="rule-active" class="cve-form-checkbox" checked>
Active (enable this rule)
</label>
</div>
</div>
<div class="cve-form-actions">
<button type="button" class="btn btn-secondary" onclick="$('#add-rule-section').hide()">Cancel</button>
<button type="submit" class="btn btn-success">
<i class="fas fa-save mr-1"></i> Save Rule
</button>
</div>
</form>
</div>
<!-- Rules Table -->
<table class="cve-table" id="rules-table">
<thead>
<tr>
<th>Priority</th>
<th>Rule Name</th>
<th>Criteria</th>
<th>Actions</th>
<th>Status</th>
<th class="text-right">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Critical Vulnerabilities - Immediate Ticket</td>
<td><span class="badge badge-danger">CRITICAL</span></td>
<td>
<span class="badge badge-purple">Create Ticket</span>
<span class="badge badge-info">Notify</span>
</td>
<td><span class="badge badge-success">Active</span></td>
<td class="text-right">
<button class="btn btn-sm btn-primary">Edit</button>
<button class="btn btn-sm btn-danger"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td>2</td>
<td>High Risk - Production Systems</td>
<td><span class="badge badge-warning">HIGH</span></td>
<td>
<span class="badge badge-purple">Create Ticket</span>
</td>
<td><span class="badge badge-success">Active</span></td>
<td class="text-right">
<button class="btn btn-sm btn-primary">Edit</button>
<button class="btn btn-sm btn-danger"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td>3</td>
<td>Medium Risk - Batch Report</td>
<td><span class="badge badge-info">MEDIUM</span></td>
<td>
<span class="badge badge-success">Report</span>
</td>
<td><span class="badge badge-success">Active</span></td>
<td class="text-right">
<button class="btn btn-sm btn-primary">Edit</button>
<button class="btn btn-sm btn-danger"><i class="fas fa-trash"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Plugin JS -->
<script src="../js/cve.js"></script>
</body>
</html>