HOTFIX: Split certificate analysis out, suppression list fixes (#2052)

This commit is contained in:
Ajin Abraham
2022-10-14 14:47:21 -07:00
committed by GitHub
parent 2387cd7cb6
commit 43ea3c0f43
3 changed files with 109 additions and 77 deletions
+17 -15
View File
@@ -133,21 +133,23 @@ function get_files(type, files){
}
function list_suppressions(){
action(document.location.origin + list_suppressions_url, { checksum: hash }, function(json) {
if (json.status==="ok") {
$(document).ready(function () {
action(document.location.origin + list_suppressions_url, { checksum: hash }, function(json) {
if (json.status==="ok") {
var tbl = $('#sup_table').DataTable();
tbl.clear().draw();
$(function() {
$.each(json.message, function(i, item) {
typ = item.SUPPRESS_TYPE
rule_ids = get_rules(typ, item.SUPPRESS_RULE_ID)
files = get_files(typ, item.SUPPRESS_FILES)
tbl.row.add([typ, rule_ids, files]).draw(false)
});
});
} else {
Swal.fire("Failed to list Suppression rules")
}
var tbl = $('#sup_table').DataTable();
tbl.clear().draw();
$(function() {
$.each(json.message, function(i, item) {
typ = item.SUPPRESS_TYPE
rule_ids = get_rules(typ, item.SUPPRESS_RULE_ID)
files = get_files(typ, item.SUPPRESS_FILES)
tbl.row.add([typ, rule_ids, files]).draw(false)
});
});
} else {
Swal.fire("Failed to list Suppression rules")
}
});
});
}
+31 -31
View File
@@ -198,35 +198,6 @@
{% if certificate_analysis.certificate_info %}
<div class="panel-body">
<p class="wrapped-text">{{ certificate_analysis.certificate_info }}</p>
<!--Cert status-->
<table class="basic">
<thead>
<tr>
<th>TITLE</th>
<th>SEVERITY</th>
<th>DESCRIPTION</th>
</tr>
</thead>
<tbody>
{% for find in certificate_analysis.certificate_findings %}
<tr>
<td>{{ find.2 }}</td>
<td>
{% if find.0 == 'high' %}
<span class="danger">high</span>
{% elif find.0 == 'secure' %}
<span class="success">secure</span>
{% elif find.0 == 'warning' %}
<span class="warning">warning</span>
{% elif find.0 == 'info' %}
<span class="info">info</span>
{% endif %}
</td>
<td>{{ find.1 }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<span class="danger">Failed to read Code Signing Certificate or none available.</span>
@@ -430,7 +401,6 @@
</table>
{% endif %}
<h2><i class="fas fa-lock"></i> NETWORK SECURITY</h2>
<table class="basic">
<thead>
@@ -468,7 +438,37 @@
{% endfor %}
</tbody>
</table>
<h2><i class="fas fa fa-id-card"></i> CERTIFICATE ANALYSIS</h2>
<table class="basic">
<thead>
<tr>
<th>TITLE</th>
<th>SEVERITY</th>
<th>DESCRIPTION</th>
</tr>
</thead>
<tbody>
{% if 'certificate_findings' in certificate_analysis %}
{% for find in certificate_analysis.certificate_findings %}
<tr>
<td>{{ find.2 }}</td>
<td>
{% if find.0 == 'high' %}
<span class="danger">high</span>
{% elif find.0 == 'secure' %}
<span class="success">secure</span>
{% elif find.0 == 'warning' %}
<span class="warning">warning</span>
{% elif find.0 == 'info' %}
<span class="info">info</span>
{% endif %}
</td>
<td>{{ find.1 }}</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
<h2><i class="fas fa-search"></i> MANIFEST ANALYSIS</h2>
<table class="basic">
<thead>
@@ -125,6 +125,14 @@
</p>
</a>
</li>
<li class="nav-item">
<a href="#certificate_analysis" class="nav-link">
<i class="nav-icon fa fa-id-card"></i>
<p>
Certificate Analysis
</p>
</a>
</li>
<li class="nav-item">
<a href="#manifest" class="nav-link">
<i class="fas fa-search nav-icon"></i>
@@ -671,37 +679,6 @@
</p>
{% if certificate_analysis %}
<pre><code>{{ certificate_analysis.certificate_info }}</code></pre>
<!--Cert status-->
<div class="table-responsive">
<table id="table_cert" class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>TITLE</th>
<th>SEVERITY</th>
<th>DESCRIPTION</th>
</tr>
</thead>
<tbody>
{% for find in certificate_analysis.certificate_findings %}
<tr>
<td>{{ find.2 }}</td>
<td>
{% if find.0 == 'high' %}
<span class="badge bg-danger">high</span>
{% elif find.0 == 'secure' %}
<span class="badge bg-success">secure</span>
{% elif find.0 == 'warning' %}
<span class="badge bg-warning">warning</span>
{% elif find.0 == 'info' %}
<span class="badge bg-info">info</span>
{% endif %}
</td>
<td>{{ find.1 }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
Failed to read Code Signing Certificate.
{% endif %}
@@ -947,6 +924,59 @@
</div>
</section>
<!-- ===========================end network security ================================== -->
<a id="certificate_analysis" class="anchor"></a>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<p>
<strong><i class="fas fa-lock"></i> CERTIFICATE ANALYSIS</strong>
</p>
<div class="table-responsive">
<table id="table_cert" class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>TITLE</th>
<th>SEVERITY</th>
<th>DESCRIPTION</th>
</tr>
</thead>
<tbody>
{% if certificate_analysis %}
{% for find in certificate_analysis.certificate_findings %}
<tr>
<td>{{ find.2 }}</td>
<td>
{% if find.0 == 'high' %}
<span class="badge bg-danger">high</span>
{% elif find.0 == 'secure' %}
<span class="badge bg-success">secure</span>
{% elif find.0 == 'warning' %}
<span class="badge bg-warning">warning</span>
{% elif find.0 == 'info' %}
<span class="badge bg-info">info</span>
{% endif %}
</td>
<td>{{ find.1 }}</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
</div>
</div><!-- /.card -->
</div>
<!-- end row -->
</div>
</div>
</section>
<!-- ===========================end certificate analysis ================================== -->
<a id="manifest" class="anchor"></a>
<section class="content">
<div class="container-fluid">