configmap: option to not trust incoming tracing spans (#7045)
* validate the sender of tracing spans * add location-specific setting
This commit is contained in:
parent
e4001df41e
commit
7d5452d00b
9 changed files with 124 additions and 34 deletions
|
|
@ -1440,7 +1440,7 @@ func httpsListener(addresses []string, co string, tc config.TemplateConfig) []st
|
|||
return out
|
||||
}
|
||||
|
||||
func buildOpentracingForLocation(isOTEnabled bool, location *ingress.Location) string {
|
||||
func buildOpentracingForLocation(isOTEnabled bool, isOTTrustSet bool, location *ingress.Location) string {
|
||||
isOTEnabledInLoc := location.Opentracing.Enabled
|
||||
isOTSetInLoc := location.Opentracing.Set
|
||||
|
||||
|
|
@ -1448,25 +1448,21 @@ func buildOpentracingForLocation(isOTEnabled bool, location *ingress.Location) s
|
|||
if isOTSetInLoc && !isOTEnabledInLoc {
|
||||
return "opentracing off;"
|
||||
}
|
||||
|
||||
opc := opentracingPropagateContext(location)
|
||||
if opc != "" {
|
||||
opc = fmt.Sprintf("opentracing on;\n%v", opc)
|
||||
}
|
||||
|
||||
return opc
|
||||
} else if !isOTSetInLoc || !isOTEnabledInLoc {
|
||||
return ""
|
||||
}
|
||||
|
||||
if isOTSetInLoc && isOTEnabledInLoc {
|
||||
opc := opentracingPropagateContext(location)
|
||||
if opc != "" {
|
||||
opc = fmt.Sprintf("opentracing on;\n%v", opc)
|
||||
}
|
||||
|
||||
return opc
|
||||
opc := opentracingPropagateContext(location)
|
||||
if opc != "" {
|
||||
opc = fmt.Sprintf("opentracing on;\n%v", opc)
|
||||
}
|
||||
|
||||
return ""
|
||||
if (!isOTTrustSet && !location.Opentracing.TrustSet) ||
|
||||
(location.Opentracing.TrustSet && !location.Opentracing.TrustEnabled) {
|
||||
opc = opc + "\nopentracing_trust_incoming_span off;"
|
||||
}
|
||||
|
||||
return opc
|
||||
}
|
||||
|
||||
// shouldLoadOpentracingModule determines whether or not the Opentracing module needs to be loaded.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue