]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
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 371ffa5473d73139986070f1f15c3f677e1ad548..91db2f4c380952fef6f16ef14a1e7ede1b95f971 100644 (file)
@@ -125,14 +125,22 @@ for my $vuln (sort keys %VULNERABILITIES) {
                $colour = "white";
                $bgcolour = ${Header::colourred};
 
                $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";
        # Mitigated
        } elsif ($status eq "Mitigation") {
                $status_message = $Lang::tr{'mitigated'};
                $colour = "black";
-               $bgcolour = ${Header::colourorange};
+               $bgcolour = ${Header::colouryellow};
 
        } else {
 
        } else {
-               next;
+               $status_message = $status;
+               $colour = "white";
+               $bgcolour = ${Header::colourblue};
        }
 
        my $table_colour = ($id++ % 2) ? $color{'color22'} : $color{'color20'};
        }
 
        my $table_colour = ($id++ % 2) ? $color{'color22'} : $color{'color20'};
@@ -224,6 +232,14 @@ sub check_status($) {
        my $status = <FILE>;
        close(FILE);
 
        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);
        } 
        if ($status =~ /^(Mitigation): (.*)$/) {
                return ($1, $2);
        }