Skip to content
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

Warn on missing TLS secret #9875

Merged
merged 54 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
43f195f
update api and code
jbohanon Aug 6, 2024
bb44d44
codegen
jbohanon Aug 6, 2024
304b6d4
kubernetes e2e
jbohanon Aug 8, 2024
531e91d
fix tests
jbohanon Aug 8, 2024
e9ba457
Merge main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 8, 2024
e322dcb
add changelog
jbohanon Aug 8, 2024
647804e
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 8, 2024
816ef5b
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 8, 2024
82f2438
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 8, 2024
3ba2380
fixes
jbohanon Aug 9, 2024
06a5999
Adding changelog file to new location
Aug 9, 2024
b847a7e
Deleting changelog file from old location
Aug 9, 2024
52c04a5
fix listener_subsystem_test
jbohanon Aug 9, 2024
c3ce3eb
tee gha output and grep for success/fail
jbohanon Aug 9, 2024
5e5223d
fix kubernetes e2e test
jbohanon Aug 9, 2024
eb65fc5
kube2e
jbohanon Aug 9, 2024
1e9f256
Merge branch 'main' of ssh://github.com/solo-io/gloo into jbohanon/mi…
jbohanon Aug 9, 2024
13ff84b
update action
jbohanon Aug 12, 2024
d85c578
unset ns env var when test installation run finishes
jbohanon Aug 12, 2024
4df4e4f
fix helm test import
jbohanon Aug 12, 2024
b7dc251
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 12, 2024
bda0de3
revert gha
jbohanon Aug 12, 2024
6beb2c7
Merge branch 'jbohanon/missing-tls-secret' of ssh://github.com/solo-i…
jbohanon Aug 12, 2024
ad09a1e
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 13, 2024
fbd5c27
Adding changelog file to new location
Aug 14, 2024
0f1b807
Deleting changelog file from old location
Aug 14, 2024
9123836
Merge branch 'main' into jbohanon/missing-tls-secret
jbohanon Aug 15, 2024
759aa30
PR feedback
jbohanon Aug 15, 2024
dc26e9a
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 15, 2024
c5a1163
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 15, 2024
266343f
update comment
jbohanon Aug 16, 2024
849ec77
add settings API for warning
jbohanon Aug 16, 2024
9745908
settings option for warning instead of error
jbohanon Aug 16, 2024
4a00783
update changelog
jbohanon Aug 16, 2024
23eaa92
helm and tests
jbohanon Aug 16, 2024
e0c7b84
fix build issues and codegen
jbohanon Aug 16, 2024
1ee3b05
missing curlies >_>
jbohanon Aug 16, 2024
de34f50
helm values fixes
jbohanon Aug 16, 2024
e2a98ab
missed one
jbohanon Aug 16, 2024
2dd6438
wrong value in test setup
jbohanon Aug 16, 2024
97d46c6
helm tests are actually passing now... excellent...
jbohanon Aug 16, 2024
a8c4afd
fix translation tests
jbohanon Aug 16, 2024
efb1631
put breaking change verbage in changelog
jbohanon Aug 16, 2024
b7c9d8e
add setting to preserve missing secret error to test manifest
jbohanon Aug 16, 2024
4500382
revert allow_warnings test
jbohanon Aug 19, 2024
6eeb021
add icky sleep
jbohanon Aug 19, 2024
25d0a89
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 19, 2024
ffdc5b1
expand admin server assertions, move server tls test
jbohanon Aug 19, 2024
faa8d41
remove extra skeleton
jbohanon Aug 19, 2024
9aa94bb
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 19, 2024
e65e20a
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 19, 2024
383cd6f
rename bool and fix logic
jbohanon Aug 20, 2024
bd91d85
update setting in always accept test
jbohanon Aug 20, 2024
2df643e
Merge refs/heads/main into jbohanon/missing-tls-secret
soloio-bulldozer[bot] Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions changelog/v1.18.0-beta16/missing-tls-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
changelog:
- type: BREAKING_CHANGE
issueLink: https://github.com/solo-io/gloo/issues/6957
resolvesIssue: false
description: >-
Fix for issue where a missing TLS secret was treated by validation as an error,
potentially bringing down the entire HTTPS gateway if the gloo pod restarts while
in this bad state. This is a breaking change in the default behavior of validation.

To disable this behavior, use the helm setting `gateway.validation.warnMissingTlsSecret=false`
or the same field on the Settings CR. This field has no effect if allowWarnings is false or
acceptAllResources is true.
- type: HELM
issueLink: https://github.com/solo-io/gloo/issues/6957
resolvesIssue: false
description: >-
New field gateway.validation.warnMissingTlsSecret controls whether missing TLS secrets referenced
in SslConfig and UpstreamSslConfig will be treated as a warning instead of an error during validation.
Defaults to true. This field has no effect if allowWarnings is false or acceptAllResources is true.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/content/reference/values.txt
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@
|gateway.validation.enabled|bool|true|enable Gloo Edge API Gateway validation hook (default true)|
|gateway.validation.alwaysAcceptResources|bool|true|unless this is set this to false in order to ensure validation webhook rejects invalid resources. by default, validation webhook will only log and report metrics for invalid resource admission without rejecting them outright.|
|gateway.validation.allowWarnings|bool|true|set this to false in order to ensure validation webhook rejects resources that would have warning status or rejected status, rather than just rejected.|
|gateway.validation.warnMissingTlsSecret|bool|true|set this to false in order to treat missing tls secret references as errors, causing validation to fail.|
|gateway.validation.serverEnabled|bool|true|By providing the validation field (parent of this object) the user is implicitly opting into validation. This field allows the user to opt out of the validation server, while still configuring pre-existing fields such as warn_route_short_circuiting and disable_transformation_validation.|
|gateway.validation.disableTransformationValidation|bool|false|set this to true to disable transformation validation. This may bring signifigant performance benefits if using many transformations, at the cost of possibly incorrect transformations being sent to Envoy. When using this value make sure to pre-validate transformations.|
|gateway.validation.warnRouteShortCircuiting|bool|false|Write a warning to route resources if validation produced a route ordering warning (defaults to false). By setting to true, this means that Gloo Edge will start assigning warnings to resources that would result in route short-circuiting within a virtual host.|
Expand Down
3 changes: 3 additions & 0 deletions install/helm/gloo/crds/gloo.solo.io_v1_Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@ spec:
type: string
validationWebhookTlsKey:
type: string
warnMissingTlsSecret:
nullable: true
type: boolean
warnRouteShortCircuiting:
nullable: true
type: boolean
Expand Down
1 change: 1 addition & 0 deletions install/helm/gloo/generate/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ type GatewayValidation struct {
Enabled *bool `json:"enabled,omitempty" desc:"enable Gloo Edge API Gateway validation hook (default true)"`
AlwaysAcceptResources *bool `json:"alwaysAcceptResources,omitempty" desc:"unless this is set this to false in order to ensure validation webhook rejects invalid resources. by default, validation webhook will only log and report metrics for invalid resource admission without rejecting them outright."`
AllowWarnings *bool `json:"allowWarnings,omitempty" desc:"set this to false in order to ensure validation webhook rejects resources that would have warning status or rejected status, rather than just rejected."`
WarnMissingTlsSecret *bool `json:"warnMissingTlsSecret,omitempty" desc:"set this to false in order to treat missing tls secret references as errors, causing validation to fail."`
ServerEnabled *bool `json:"serverEnabled,omitempty" desc:"By providing the validation field (parent of this object) the user is implicitly opting into validation. This field allows the user to opt out of the validation server, while still configuring pre-existing fields such as warn_route_short_circuiting and disable_transformation_validation."`
DisableTransformationValidation *bool `json:"disableTransformationValidation,omitempty" desc:"set this to true to disable transformation validation. This may bring signifigant performance benefits if using many transformations, at the cost of possibly incorrect transformations being sent to Envoy. When using this value make sure to pre-validate transformations."`
WarnRouteShortCircuiting *bool `json:"warnRouteShortCircuiting,omitempty" desc:"Write a warning to route resources if validation produced a route ordering warning (defaults to false). By setting to true, this means that Gloo Edge will start assigning warnings to resources that would result in route short-circuiting within a virtual host."`
Expand Down
2 changes: 1 addition & 1 deletion install/helm/gloo/templates/18-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ spec:
{{- if .Values.gateway.validation.enabled }}
validation:
proxyValidationServerAddr: "gloo:{{ .Values.gloo.deployment.validationPort }}"
{{- /* need to do this weird if/else because Helm cannot differentiate between 'false' and 'unset' */}}
alwaysAccept: {{ .Values.gateway.validation.alwaysAcceptResources }}
allowWarnings: {{ .Values.gateway.validation.allowWarnings }}
warnMissingTlsSecret: {{ .Values.gateway.validation.warnMissingTlsSecret }}
serverEnabled: {{ .Values.gateway.validation.serverEnabled }}
disableTransformationValidation: {{ .Values.gateway.validation.disableTransformationValidation }}
warnRouteShortCircuiting: {{ .Values.gateway.validation.warnRouteShortCircuiting }}
Expand Down
3 changes: 2 additions & 1 deletion install/helm/gloo/values-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ gateway:
secretName: gateway-validation-certs
alwaysAcceptResources: true
allowWarnings: true
warnMissingTlsSecret: true
serverEnabled: true
disableTransformationValidation: false
warnRouteShortCircuiting: false
Expand Down Expand Up @@ -318,4 +319,4 @@ global:
# additionalLabels adds a label to all object metadata
additionalLabels: {}
# securitySettings defines global security settings such as `floatingUserId`
securitySettings: {}
securitySettings: {}
56 changes: 28 additions & 28 deletions install/test/fixtures/settings/compressed_proxy_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ metadata:
name: default
namespace: {{ . }}
spec:
discovery:
fdsMode: WHITELIST
gateway:
readGatewaysFromAllNamespaces: false
compressedProxySpec: true
enableGatewayController: true
isolateVirtualHostsBySslConfig: false
gloo:
regexMaxProgramSize: 1024
enableRestEds: false
xdsBindAddr: 0.0.0.0:9977
restXdsBindAddr: 0.0.0.0:9976
proxyDebugBindAddr: 0.0.0.0:9966
disableKubernetesDestinations: false
disableProxyGarbageCollection: false
invalidConfigPolicy:
invalidRouteResponseBody: Gloo Gateway has invalid configuration. Administrators should run `glooctl check` to find and fix config errors.
invalidRouteResponseCode: 404
replaceInvalidRoutes: false
istioOptions:
appendXForwardedHost: true
enableAutoMtls: false
enableIntegration: false
kubernetesArtifactSource: {}
kubernetesConfigSource: {}
kubernetesSecretSource: {}
refreshRate: 60s
discoveryNamespace: {{ . }}
discovery:
fdsMode: WHITELIST
gateway:
readGatewaysFromAllNamespaces: false
compressedProxySpec: true
enableGatewayController: true
isolateVirtualHostsBySslConfig: false
gloo:
regexMaxProgramSize: 1024
enableRestEds: false
xdsBindAddr: 0.0.0.0:9977
restXdsBindAddr: 0.0.0.0:9976
proxyDebugBindAddr: 0.0.0.0:9966
disableKubernetesDestinations: false
disableProxyGarbageCollection: false
invalidConfigPolicy:
invalidRouteResponseBody: Gloo Gateway has invalid configuration. Administrators should run `glooctl check` to find and fix config errors.
invalidRouteResponseCode: 404
replaceInvalidRoutes: false
istioOptions:
appendXForwardedHost: true
enableAutoMtls: false
enableIntegration: false
kubernetesArtifactSource: {}
kubernetesConfigSource: {}
kubernetesSecretSource: {}
refreshRate: 60s
discoveryNamespace: {{ . }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,46 @@ metadata:
name: default
namespace: {{ . }}
spec:
discovery:
fdsMode: WHITELIST
gateway:
enableGatewayController: true
readGatewaysFromAllNamespaces: false
isolateVirtualHostsBySslConfig: false
validation:
alwaysAccept: true
allowWarnings: true
serverEnabled: true
disableTransformationValidation: false
warnRouteShortCircuiting: false
proxyValidationServerAddr: gloo:9988
validationServerGrpcMaxSizeBytes: 104857600
gloo:
regexMaxProgramSize: 1024
enableRestEds: false
xdsBindAddr: 0.0.0.0:9977
restXdsBindAddr: 0.0.0.0:9976
proxyDebugBindAddr: 0.0.0.0:9966
disableKubernetesDestinations: false
disableProxyGarbageCollection: false
invalidConfigPolicy:
invalidRouteResponseBody: Gloo Gateway has invalid configuration. Administrators should run `glooctl check` to find and fix config errors.
invalidRouteResponseCode: 404
replaceInvalidRoutes: false
istioOptions:
appendXForwardedHost: true
enableAutoMtls: false
enableIntegration: false
consulDiscovery:
useTlsTagging: true
tlsTagName: tag
splitTlsServices: true
rootCa:
name: testName
namespace: testNamespace
kubernetesArtifactSource: {}
kubernetesConfigSource: {}
kubernetesSecretSource: {}
refreshRate: 60s
discoveryNamespace: {{ . }}
discovery:
fdsMode: WHITELIST
gateway:
enableGatewayController: true
readGatewaysFromAllNamespaces: false
isolateVirtualHostsBySslConfig: false
validation:
alwaysAccept: true
allowWarnings: true
warnMissingTlsSecret: true
serverEnabled: true
disableTransformationValidation: false
warnRouteShortCircuiting: false
proxyValidationServerAddr: gloo:9988
validationServerGrpcMaxSizeBytes: 104857600
gloo:
regexMaxProgramSize: 1024
enableRestEds: false
xdsBindAddr: 0.0.0.0:9977
restXdsBindAddr: 0.0.0.0:9976
proxyDebugBindAddr: 0.0.0.0:9966
disableKubernetesDestinations: false
disableProxyGarbageCollection: false
invalidConfigPolicy:
invalidRouteResponseBody: Gloo Gateway has invalid configuration. Administrators should run `glooctl check` to find and fix config errors.
invalidRouteResponseCode: 404
replaceInvalidRoutes: false
istioOptions:
appendXForwardedHost: true
enableAutoMtls: false
enableIntegration: false
consulDiscovery:
useTlsTagging: true
tlsTagName: tag
splitTlsServices: true
rootCa:
name: testName
namespace: testNamespace
kubernetesArtifactSource: {}
kubernetesConfigSource: {}
kubernetesSecretSource: {}
refreshRate: 60s
discoveryNamespace: {{ . }}
Loading
Loading