vulnerablities.cgi: add colours for vuln,smt and unknown output.
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 22 May 2019 08:22:53 +0000 (10:22 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 22 May 2019 08:30:08 +0000 (10:30 +0200)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
html/cgi-bin/vulnerabilities.cgi

index 371ffa5..91db2f4 100644 (file)
@@ -125,14 +125,22 @@ for my $vuln (sort keys %VULNERABILITIES) {
                $colour = "white";
                $bgcolour = ${Header::colourred};
 
+       # 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::colourorange};
+               $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);
        }