mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
vulnerablities.cgi: add colours for vuln,smt and unknown output.
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
@@ -125,14 +125,22 @@ for my $vuln (sort keys %VULNERABILITIES) {
|
||||
$colour = "white";
|
||||
$bgcolour = ${Header::colourred};
|
||||
|
||||
# Mitigated
|
||||
} elsif ($status eq "Mitigation") {
|
||||
# Mitigated but smt is enabled
|
||||
} elsif ($status eq "Mitigation-SMT") {
|
||||
$status_message = $Lang::tr{'mitigated'};
|
||||
$colour = "black";
|
||||
$bgcolour = ${Header::colourorange};
|
||||
|
||||
# Mitigated
|
||||
} elsif ($status eq "Mitigation") {
|
||||
$status_message = $Lang::tr{'mitigated'};
|
||||
$colour = "black";
|
||||
$bgcolour = ${Header::colouryellow};
|
||||
|
||||
} else {
|
||||
next;
|
||||
$status_message = $status;
|
||||
$colour = "white";
|
||||
$bgcolour = ${Header::colourblue};
|
||||
}
|
||||
|
||||
my $table_colour = ($id++ % 2) ? $color{'color22'} : $color{'color20'};
|
||||
@@ -224,6 +232,14 @@ sub check_status($) {
|
||||
my $status = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
if ($status =~ /^(Vulnerable): (.*)$/) {
|
||||
return ($1, $2);
|
||||
}
|
||||
|
||||
if ($status =~ /^(Mitigation): (.*vulnerable.*)$/) {
|
||||
return ("Mitigation-SMT", $2);
|
||||
}
|
||||
|
||||
if ($status =~ /^(Mitigation): (.*)$/) {
|
||||
return ($1, $2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user