-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Vulnerabilities in Istio Gateway Secret Rotation #2075
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,7 +172,7 @@ func (gsh *GatewaySecretHandler) StartRootCertificateWatch(clientset *kubernetes | |
}) | ||
if err != nil { | ||
log.Error(err, "unable to start watching root certificate") | ||
panic(err) | ||
return | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to reviewer: Checkmarx was complaining that the panic is not properly handled. Since this is a go routine, I think the panic would anyway just abort the startup of the watch. Therefore we can also just return here since the error is logged and the go routine will "gracefully" stop. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The startup of the watch is vital to the function of the istio gateway secret - the secret that allows TLS for SKR webhook communication. I believe that not being able to set up that secret is an extreme situation (highly unlikely though), and the runtime should stop the execution. If panic is not suitable in this case. I would suggest exiting with a bootstrap error code like so |
||
} | ||
|
||
WatchEvents(ctx, secretWatch.ResultChan(), gsh.manageGatewaySecret, log) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to reviewer: Checkmarx was complaining about potential race conditions on
config
andkcpClient
. With this change, we keep using config and kcpClient in the current thread, and only then branch of to the go routine.