From d39601f4416e96baaf8f093100294200ddaf293f Mon Sep 17 00:00:00 2001 From: "Han Verstraete (OpenFaaS Ltd)" Date: Tue, 28 Feb 2023 09:23:06 +0100 Subject: [PATCH] Warn if dashboard uses auto generated keys Signed-off-by: Han Verstraete (OpenFaaS Ltd) --- main.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.go b/main.go index 734fbd2..aa3e5cc 100644 --- a/main.go +++ b/main.go @@ -246,6 +246,7 @@ func main() { autoscalerImage := "" autoscalerReplicas := 0 dashboardImage := "" + dashboardJWTSecret := false directFunctions := false probeFunctions := false @@ -368,6 +369,12 @@ func main() { for _, container := range dep.Spec.Template.Spec.Containers { if container.Name == "dashboard" { dashboardImage = container.Image + + for _, volumeMount := range container.VolumeMounts { + if volumeMount.Name == "dashboard-jwt" { + dashboardJWTSecret = true + } + } } } } @@ -580,6 +587,10 @@ Features detected: fmt.Printf("⚠️ Non-root flag is not set for the controller/operator\n") } + if len(dashboardImage) > 0 && dashboardJWTSecret == false { + fmt.Printf("⚠️ Dashboard uses auto generated signing keys: https://docs.openfaas.com/openfaas-pro/dashboard/#create-a-signing-key \n") + } + for _, namespace := range functionNamespaces { functions, ok := nsFunctions[namespace] if ok {