#11126 new view vulnerabilities scanner

This commit is contained in:
Daniel Cebrian 2023-10-13 12:25:25 +02:00
parent 2228011812
commit 533201197a
9 changed files with 31168 additions and 5 deletions

View File

@ -271,7 +271,7 @@ module_plugin pandora_netusage
module_plugin autodiscover --default
# Plugin for inventory on the agent.
#module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
#module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route vulnerabilities
# Log collection modules. This will collect log files for forensic analysis and store everything
# This is for LOG monitoring. Different than log monitoring.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Vulnerability scanner@svg</title>
<g id="Vulnerability-scanner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M1,15 C1.55228475,15 2,15.4477153 2,16 L2,18 L4,18 C4.55228475,18 5,18.4477153 5,19 C5,19.5522847 4.55228475,20 4,20 L1,20 C0.44771525,20 0,19.5522847 0,19 L2.22044605e-16,16 C2.22044605e-16,15.4477153 0.44771525,15 1,15 Z M19,15 C19.5522847,15 20,15.4477153 20,16 L20,19 C20,19.5522847 19.5522847,20 19,20 L16,20 C15.4477153,20 15,19.5522847 15,19 C15,18.4477153 15.4477153,18 16,18 L18,18 L18,16 C18,15.4477153 18.4477153,15 19,15 Z M10,3.054 L10.2249383,3.05813847 C13.4344251,3.17642824 16,5.81560306 16,9.054 L16,14.0937431 L13.104,16.031 L12.0698805,13.7307161 L14.2125487,13.4284958 C14.556044,13.3800462 14.7107272,12.9297411 14.4915053,12.6217094 L10.3337249,6.72755475 C10.2297804,6.58020088 10.0683722,6.50924823 9.91239579,6.53116927 C9.62831588,6.5712384 9.45479699,6.90055719 9.56613598,7.20888317 L10.9914706,11.1541491 L8.78753031,11.4650118 C8.51830424,11.5029857 8.34782116,11.7998997 8.42525378,12.0959539 L9.92,18.054 L4,14.0937431 L4,9.054 C4,5.81560306 6.56557489,3.17642824 9.77506174,3.05813847 L10,3.054 Z M4,0 C4.55228475,-1.01453063e-16 5,0.44771525 5,1 C5,1.55228475 4.55228475,2 4,2 L2,2 L2,4 C2,4.55228475 1.55228475,5 1,5 C0.44771525,5 2.22044605e-16,4.55228475 2.22044605e-16,4 L0,1 C0,0.44771525 0.44771525,1.01453063e-16 1,0 L4,0 Z M19,0 C19.5522847,1.01453063e-16 20,0.44771525 20,1 L20,4 C20,4.55228475 19.5522847,5 19,5 C18.4477153,5 18,4.55228475 18,4 L18,2 L16,2 C15.4477153,2 15,1.55228475 15,1 C15,0.44771525 15.4477153,-1.01453063e-16 16,0 Z" id="Scan" fill="#3F3F3F" transform="translate(10, 10) scale(1, -1) translate(-10, -10)"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1013,6 +1013,7 @@ function get_build_setup_charts($type, $options, $data)
$chart->setCircumference($options['circumference']);
}
$stacked = false;
if (isset($options['scales']) === true
&& empty($options['scales']) === false
&& is_array($options['scales']) === true
@ -1037,7 +1038,9 @@ function get_build_setup_charts($type, $options, $data)
$scalesYFonts->setSize(((int) $config['font_size'] + 2));
}
if ($options['scales']['r'] !== false) {
if (isset($options['scales']['r']) === true
&& $options['scales']['r'] !== false
) {
// Defaults scalesFont R.
$scalesRFonts = $scales->getR()->pointLabels()->getFonts();
$scalesRFonts->setStyle('normal');
@ -1066,6 +1069,13 @@ function get_build_setup_charts($type, $options, $data)
}
}
if (isset($options['scales']['x']['stacked']) === true
&& empty($options['scales']['x']['stacked']) === false
) {
$scales->getX()->setStacked($options['scales']['x']['stacked']);
$stacked = true;
}
if (isset($options['scales']['x']['ticks']) === true
&& empty($options['scales']['x']['ticks']) === false
&& is_array($options['scales']['x']['ticks']) === true
@ -1111,6 +1121,13 @@ function get_build_setup_charts($type, $options, $data)
}
}
if (isset($options['scales']['y']['stacked']) === true
&& empty($options['scales']['y']['stacked']) === false
) {
$scales->getY()->setStacked($options['scales']['y']['stacked']);
$stacked = true;
}
if (isset($options['scales']['y']['ticks']) === true
&& empty($options['scales']['y']['ticks']) === false
&& is_array($options['scales']['y']['ticks']) === true
@ -1224,7 +1241,18 @@ function get_build_setup_charts($type, $options, $data)
$setData->setLabel('data')->setBorderColor($borders);
$setData->setLabel('data')->setBorderWidth(2);
$setData->setLabel('data')->data()->exchangeArray(array_values($data));
if ($chart->options()->getScales()->getX()->isStacked() === true) {
foreach ($data as $key => $dataset) {
$dataSet1 = $chart->createDataSet();
$dataSet1->setBackgroundColor($dataset['backgroundColor']);
$dataSet1->setLabel($dataset['label']);
$dataSet1->data()->exchangeArray($dataset['data']);
$dataSet1->setStack($dataset['stack']);
$chart->addDataSet($dataSet1);
}
} else {
$setData->setLabel('data')->data()->exchangeArray(array_values($data));
}
// Para las horizontales.
if (isset($options['axis']) === true
@ -1239,6 +1267,7 @@ function get_build_setup_charts($type, $options, $data)
foreach ($data as $key => $dataset) {
$dataSet1 = $chart->createDataSet();
$dataSet1->setBackgroundColor($dataset['backgroundColor']);
$dataSet1->setLabel($dataset['label']);
$dataSet1->setBorderColor($dataset['borderColor']);
$dataSet1->setPointBackgroundColor($dataset['pointBackgroundColor']);
$dataSet1->setPointBorderColor($dataset['pointBorderColor']);
@ -1271,7 +1300,7 @@ function get_build_setup_charts($type, $options, $data)
break;
}
if ($type !== 'RADAR' && $type !== 'LINE') {
if ($type !== 'RADAR' && $type !== 'LINE' && $stacked !== true) {
$chart->addDataSet($setData);
}

View File

@ -0,0 +1,138 @@
.details_table b {
font-size: 12px;
}
.details_table {
width: 99% !important;
}
.dataTables_length {
margin: 10px 0px 20px 20px;
}
.custom-filter {
width: 95%;
margin: 21px auto;
}
.custom-filter label {
font-size: 13px !important;
margin-right: 10px;
}
.dataTables_paginate.paging_simple_numbers {
margin: 10px 20px 20px 0px;
margin-right: 20px !important;
}
.row-graphs {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: center;
max-width: 90%;
margin: 0 auto;
}
.col-md-3 {
width: 30%;
margin: 10px;
}
.col-md-6 {
width: 35%;
margin: 10px;
}
.col-md-1 {
width: 15%;
margin: 10px;
}
.col-md-2 {
width: 30%;
margin: 10px;
}
.col-md-7 {
width: 40%;
margin: 10px;
}
.col-md-9 {
width: 63%;
margin: 10px;
}
.pdd_b_40px {
padding-bottom: 40px !important;
}
#reach-metrics {
margin-bottom: 45px;
}
#score-bar {
max-width: 85%;
margin: 0 auto;
}
#bar {
height: 100%;
}
.marks {
color: #9f9f9f;
}
.title {
font-size: 19px;
font-weight: 600;
color: #3f3f3f;
}
.score {
font-weight: 700;
font-size: 24px;
color: #3f3f3f;
}
.message {
color: #0000008c;
}
.status {
font-size: 15px;
margin-left: 20px;
}
.marks {
display: flex;
justify-content: space-between;
}
.labels-bar {
display: flex;
justify-content: space-between;
padding: 0px 8px;
}
.date {
font-weight: 400;
color: #0000008c;
margin-left: 13px;
}
#content-bar {
border: 1px solid #d7d7d7;
width: 100%;
height: 30px;
border-radius: 5px;
}
@media (max-width: 1500px) {
.col-md-3 {
width: 40%;
}
.col-md-1 {
width: 20%;
}
.col-md-2 {
width: 45%;
}
.col-md-6 {
width: 88%;
}
.col-md-7 {
width: 80%;
}
}

View File

@ -1869,7 +1869,7 @@ if (enterprise_installed() === true && security_hardening_installed() === true)
$security_hardening['active'] = ($tab === 'security_hardening');
}
if (enterprise_installed() === true) {
if (enterprise_installed() === true && (bool) $agent['vul_scan_enabled'] === true) {
$vulnerabilities['text'] = html_print_menu_button(
[
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=vulnerabilities&id_agente='.$id_agente,

View File

@ -4414,4 +4414,14 @@ CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` (
`graph_modules` TEXT NULL,
`interval` INT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- ---------------------------------------------------------------------
-- Table `tgraph_analytics_filter`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `pandora_cve` (
`cve_id` VARCHAR(20),
`cvss_score` DECIMAL(5, 2),
`cvss_vector` VARCHAR(50),
PRIMARY KEY (`cve_id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;

File diff suppressed because it is too large Load Diff

View File

@ -87,6 +87,10 @@ class DataSet implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
*/
protected $axis;
/**
* @var string|null
*/
protected $stack;
/**
* @return string
*/
@ -404,4 +408,28 @@ class DataSet implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
return $this;
}
/**
* Get the value of stack
*
* @return string|null
*/
public function getStack()
{
return $this->stack;
}
/**
* Set the value of stack
*
* @param string|null $stack
*
* @return self
*/
public function setStack($stack)
{
$this->stack = $stack;
return $this;
}
}