Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions convert/plugin_names.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const (
responseRateLimitingPluginName = "response-ratelimiting"
samlPluginName = "saml"
serviceProtectionPluginName = "service-protection"
solaceConsumePluginName = "solace-consume"
solaceLogPluginName = "solace-log"
solaceUpstreamPluginName = "solace-upstream"
tcpLogPluginName = "tcp-log"
upstreamOauthPluginName = "upstream-oauth"
)
13 changes: 13 additions & 0 deletions convert/plugin_updates_314.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ var sslVerifyPluginConfigSetters = map[string][]pluginConfigDefaultSetter{
},
acmePluginName: {
newNestedBoolDefaultSetter("storage_config.redis.ssl_verify"),
newNestedBoolDefaultSetter("storage_config.vault.tls_verify"),
},
aiAwsGuardrailPluginName: {
newNestedBoolDefaultSetter("ssl_verify"),
},
aiAzureContentSafetyPluginName: {
newNestedBoolDefaultSetter("ssl_verify"),
},
aiLlmAsJudgePluginName: {
newNestedBoolDefaultSetter("https_verify"),
},
aiProxyAdvancedPluginName: aiVectorDBSSLVerifySetters(),
aiRagInjectorPluginName: aiVectorDBSSLVerifySetters(),
aiRateLimitingAdvancedPluginName: {
Expand Down Expand Up @@ -141,6 +145,15 @@ var sslVerifyPluginConfigSetters = map[string][]pluginConfigDefaultSetter{
serviceProtectionPluginName: {
newNestedBoolDefaultSetter("redis.ssl_verify"),
},
solaceConsumePluginName: {
newNestedBoolDefaultSetter("session.ssl_validate_certificate"),
},
solaceLogPluginName: {
newNestedBoolDefaultSetter("session.ssl_validate_certificate"),
},
solaceUpstreamPluginName: {
newNestedBoolDefaultSetter("session.ssl_validate_certificate"),
},
tcpLogPluginName: {
newNestedBoolDefaultSetter("ssl_verify"),
},
Expand Down
52 changes: 51 additions & 1 deletion convert/plugin_updates_314_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,56 @@ func TestUpdateLegacyPluginConfigFor314_SSLVerifyFields(t *testing.T) {
"https_verify": false,
},
},
{
name: "sets ai-llm-as-judge https_verify",
plugin: &file.FPlugin{Plugin: kong.Plugin{
Name: kong.String(aiLlmAsJudgePluginName),
Config: kong.Configuration{},
}},
expected: kong.Configuration{
"https_verify": false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field had a default true before 3.14 - https://developer.konghq.com/plugins/ai-llm-as-judge/reference/3.12/ - do we still want to set it to false?

same for tls_verify in plugin acme - https://developer.konghq.com/plugins/acme/reference/3.12/

},
},
{
name: "sets acme vault tls_verify when vault config exists",
plugin: &file.FPlugin{Plugin: kong.Plugin{
Name: kong.String(acmePluginName),
Config: kong.Configuration{
"storage_config": map[string]interface{}{
"vault": map[string]interface{}{},
},
},
}},
expected: kong.Configuration{
"storage_config": map[string]interface{}{
"vault": map[string]interface{}{
"tls_verify": false,
},
},
},
},
{
name: "sets solace-consume session ssl_validate_certificate when session config exists",
plugin: &file.FPlugin{Plugin: kong.Plugin{
Name: kong.String(solaceConsumePluginName),
Config: kong.Configuration{
"session": map[string]interface{}{},
},
}},
expected: kong.Configuration{
"session": map[string]interface{}{
"ssl_validate_certificate": false,
},
},
},
{
name: "does not invent missing solace session config",
plugin: &file.FPlugin{Plugin: kong.Plugin{
Name: kong.String(solaceLogPluginName),
Config: kong.Configuration{},
}},
expected: kong.Configuration{},
},
}

for _, tt := range tests {
Expand All @@ -169,7 +219,7 @@ func TestUpdateLegacyPluginConfigFor314_LDAPVerifyHost(t *testing.T) {

func TestUpdateLegacyPluginConfigFor314_LeavesUnsupportedPluginUnchanged(t *testing.T) {
plugin := &file.FPlugin{Plugin: kong.Plugin{
Name: kong.String(aiLlmAsJudgePluginName),
Name: kong.String(opaPluginName),
Config: kong.Configuration{"foo": "bar"},
}}

Expand Down
30 changes: 29 additions & 1 deletion convert/rulesets/310-to-314/entrypoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ rules:
In Kong Gateway 3.14, TLS verification is enabled by default for plugin HTTP clients
that use https_verify.
given:
- $..plugins[?(@.name == 'azure-functions' || @.name == 'forward-proxy')].config
- $..plugins[?(@.name == 'ai-llm-as-judge' || @.name == 'azure-functions' || @.name == 'forward-proxy')].config
message: >-
Kong Gateway 3.14 enables TLS certificate verification by default. Plugins that use
https_verify will now verify certificates unless you set https_verify to false explicitly.
Expand Down Expand Up @@ -142,3 +142,31 @@ rules:
then:
- field: session_memcached_ssl_verify
function: defined

acme-vault-tls-verify-plugin-check:
description: >-
In Kong Gateway 3.14, TLS verification is enabled by default for the Acme plugin's
vault storage backend.
given:
- $..plugins[?(@.name == 'acme')].config.storage_config.vault
message: >-
Kong Gateway 3.14 enables TLS certificate verification by default. The Acme plugin vault
storage backend will now verify TLS certificates unless you set tls_verify to false explicitly.
severity: warn
then:
- field: tls_verify
function: defined

solace-ssl-validate-certificate-plugin-check:
description: >-
In Kong Gateway 3.14, TLS certificate validation is enabled by default for Solace plugin
session connections.
given:
- $..plugins[?(@.name == 'solace-consume' || @.name == 'solace-log' || @.name == 'solace-upstream')].config.session
message: >-
Kong Gateway 3.14 enables TLS certificate verification by default. Solace plugins will now
validate session TLS certificates unless you set ssl_validate_certificate to false explicitly.
severity: warn
then:
- field: ssl_validate_certificate
function: defined
Loading