Skip to content

Commit 96cfb4d

Browse files
authored
Remove support for JMX over JMXMP (#618)
Remove support for JMX over JMXMP as it is insecure
1 parent 26c792f commit 96cfb4d

File tree

15 files changed

+2
-654
lines changed

15 files changed

+2
-654
lines changed

.github/workflows/compatibility-tests.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ jobs:
4040
- 3.2.11
4141
- 3.2.10
4242
- 3.2.9
43-
# - 3.2.8
4443
- 3.2.7
4544
- 3.2.6
4645
- 3.2.5
47-
- 3.1.5
4846
include:
4947
- compatibilityVersion: 3.2.11
5048
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
@@ -58,10 +56,6 @@ jobs:
5856
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
5957
compatibilitySelector: control-plane=coherence
6058
k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
61-
# - compatibilityVersion: 3.2.8
62-
# coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
63-
# compatibilitySelector: control-plane=coherence
64-
# k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
6559
- compatibilityVersion: 3.2.7
6660
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
6761
compatibilitySelector: control-plane=coherence
@@ -74,10 +68,6 @@ jobs:
7468
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
7569
compatibilitySelector: control-plane=coherence
7670
k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
77-
- compatibilityVersion: 3.1.5
78-
coherence-image: "ghcr.io/oracle/coherence-ce:21.12.4"
79-
compatibilitySelector: control-plane=coherence
80-
k8s: kindest/node:v1.21.14@sha256:27ef72ea623ee879a25fe6f9982690a3e370c68286f4356bf643467c552a3888
8171

8272
steps:
8373
- uses: actions/checkout@v3

api/v1/coherence_types.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -631,11 +631,6 @@ type JVMSpec struct {
631631
// Configure the JVM memory options.
632632
// +optional
633633
Memory *JvmMemorySpec `json:"memory,omitempty"`
634-
// Configure JMX using JMXMP.
635-
// Note: This should only be used in development as JMXMP does not have support for encrypted connections via TLS.
636-
// Use in production should ideally put the JMXMP port behind some sort of TLS enabled ingress or network policy.
637-
// +optional
638-
Jmxmp *JvmJmxmpSpec `json:"jmxmp,omitempty"`
639634
// A flag indicating whether to automatically add the default classpath for images
640635
// created by the JIB tool https://github.com/GoogleContainerTools/jib
641636
// If true then the /app/lib/* /app/classes and /app/resources
@@ -673,10 +668,6 @@ func (in *JVMSpec) UpdatePodTemplate(podTemplate *corev1.PodTemplateSpec) {
673668
c.Env = append(c.Env, in.Memory.CreateEnvVars()...)
674669
}
675670

676-
if in.Jmxmp != nil {
677-
c.Env = append(c.Env, in.Jmxmp.CreateEnvVars()...)
678-
}
679-
680671
if in.Gc != nil {
681672
gc = in.Gc
682673
}
@@ -1730,31 +1721,6 @@ func (in *JvmOutOfMemorySpec) CreateEnvVars() []corev1.EnvVar {
17301721
return envVars
17311722
}
17321723

1733-
// ----- JvmJmxmpSpec struct -------------------------------------------------------
1734-
1735-
// JvmJmxmpSpec is options for configuring JMX using JMXMP.
1736-
// +k8s:openapi-gen=true
1737-
type JvmJmxmpSpec struct {
1738-
// If set to true the JMXMP support will be enabled.
1739-
// Default is false
1740-
// +optional
1741-
Enabled *bool `json:"enabled,omitempty"`
1742-
// The port tht the JMXMP MBeanServer should bind to.
1743-
// If not set the default port is 9099
1744-
// +optional
1745-
Port *int32 `json:"port,omitempty"`
1746-
}
1747-
1748-
// CreateEnvVars creates any required environment variables for the Coherence container
1749-
func (in *JvmJmxmpSpec) CreateEnvVars() []corev1.EnvVar {
1750-
enabled := in != nil && in.Enabled != nil && *in.Enabled
1751-
1752-
envVars := []corev1.EnvVar{{Name: EnvVarJvmJmxmpEnabled, Value: strconv.FormatBool(enabled)}}
1753-
envVars = append(envVars, corev1.EnvVar{Name: EnvVarJvmJmxmpPort, Value: Int32PtrToStringWithDefault(in.Port, DefaultJmxmpPort)})
1754-
1755-
return envVars
1756-
}
1757-
17581724
// ----- PortSpecWithSSL struct ----------------------------------------------------
17591725

17601726
// PortSpecWithSSL defines a port with SSL settings for a Coherence component

api/v1/constants.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ const (
138138
DefaultManagementPort int32 = 30000
139139
// DefaultMetricsPort is the default Coherence metrics port
140140
DefaultMetricsPort int32 = 9612
141-
// DefaultJmxmpPort is the default JMX over JMXMP port
142-
DefaultJmxmpPort int32 = 9099
143141
// DefaultHealthPort is the default health port
144142
DefaultHealthPort int32 = 6676
145143
// DefaultUnicastPort is the default Coherence unicast port
@@ -247,8 +245,6 @@ const (
247245
EnvVarJvmMemoryNativeTracking = "JVM_NATIVE_MEMORY_TRACKING"
248246
EnvVarJvmOomExit = "JVM_OOM_EXIT"
249247
EnvVarJvmOomHeapDump = "JVM_OOM_HEAP_DUMP"
250-
EnvVarJvmJmxmpEnabled = "JVM_JMXMP_ENABLED"
251-
EnvVarJvmJmxmpPort = "JVM_JMXMP_PORT"
252248
EnvVarSpringBootFatJar = "COH_SPRING_BOOT_FAT_JAR"
253249
EnvVarCnbpEnabled = "COH_CNBP_ENABLED"
254250
EnvVarCnbpLauncher = "COH_CNBP_LAUNCHER"

api/v1/create_job_jvmspec_test.go

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -440,67 +440,3 @@ func TestCreateJobWithJvmSpecWithHeapDumpOnOomFalse(t *testing.T) {
440440
// assert that the Job is as expected
441441
assertJobCreation(t, deployment, jobExpected)
442442
}
443-
444-
func TestCreateJobWithJvmSpecWithJmxmpEnabledTrue(t *testing.T) {
445-
446-
spec := coh.CoherenceResourceSpec{
447-
JVM: &coh.JVMSpec{
448-
Jmxmp: &coh.JvmJmxmpSpec{
449-
Enabled: boolPtr(true),
450-
},
451-
},
452-
}
453-
454-
// Create the test deployment
455-
deployment := createTestCoherenceJob(spec)
456-
// Create expected Job
457-
jobExpected := createMinimalExpectedJob(deployment)
458-
addEnvVarsToJob(jobExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_ENABLED", Value: "true"})
459-
addEnvVarsToJob(jobExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_PORT", Value: "9099"})
460-
461-
// assert that the Job is as expected
462-
assertJobCreation(t, deployment, jobExpected)
463-
}
464-
465-
func TestCreateJobWithJvmSpecWithJmxmpEnabledFalse(t *testing.T) {
466-
467-
spec := coh.CoherenceResourceSpec{
468-
JVM: &coh.JVMSpec{
469-
Jmxmp: &coh.JvmJmxmpSpec{
470-
Enabled: boolPtr(false),
471-
},
472-
},
473-
}
474-
475-
// Create the test deployment
476-
deployment := createTestCoherenceJob(spec)
477-
// Create expected Job
478-
jobExpected := createMinimalExpectedJob(deployment)
479-
addEnvVarsToJob(jobExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_ENABLED", Value: "false"})
480-
addEnvVarsToJob(jobExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_PORT", Value: "9099"})
481-
482-
// assert that the Job is as expected
483-
assertJobCreation(t, deployment, jobExpected)
484-
}
485-
486-
func TestCreateJobWithJvmSpecWithJmxmpEnabledWithPort(t *testing.T) {
487-
488-
spec := coh.CoherenceResourceSpec{
489-
JVM: &coh.JVMSpec{
490-
Jmxmp: &coh.JvmJmxmpSpec{
491-
Enabled: boolPtr(true),
492-
Port: int32Ptr(1234),
493-
},
494-
},
495-
}
496-
497-
// Create the test deployment
498-
deployment := createTestCoherenceJob(spec)
499-
// Create expected Job
500-
jobExpected := createMinimalExpectedJob(deployment)
501-
addEnvVarsToJob(jobExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_ENABLED", Value: "true"})
502-
addEnvVarsToJob(jobExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_PORT", Value: "1234"})
503-
504-
// assert that the Job is as expected
505-
assertJobCreation(t, deployment, jobExpected)
506-
}

api/v1/create_statefulset_jvmspec_test.go

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2020, 2023, Oracle and/or its affiliates.
33
* Licensed under the Universal Permissive License v 1.0 as shown at
44
* http://oss.oracle.com/licenses/upl.
55
*/
@@ -440,67 +440,3 @@ func TestCreateStatefulSetWithJvmSpecWithHeapDumpOnOomFalse(t *testing.T) {
440440
// assert that the StatefulSet is as expected
441441
assertStatefulSetCreation(t, deployment, stsExpected)
442442
}
443-
444-
func TestCreateStatefulSetWithJvmSpecWithJmxmpEnabledTrue(t *testing.T) {
445-
446-
spec := coh.CoherenceResourceSpec{
447-
JVM: &coh.JVMSpec{
448-
Jmxmp: &coh.JvmJmxmpSpec{
449-
Enabled: boolPtr(true),
450-
},
451-
},
452-
}
453-
454-
// Create the test deployment
455-
deployment := createTestDeployment(spec)
456-
// Create expected StatefulSet
457-
stsExpected := createMinimalExpectedStatefulSet(deployment)
458-
addEnvVars(stsExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_ENABLED", Value: "true"})
459-
addEnvVars(stsExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_PORT", Value: "9099"})
460-
461-
// assert that the StatefulSet is as expected
462-
assertStatefulSetCreation(t, deployment, stsExpected)
463-
}
464-
465-
func TestCreateStatefulSetWithJvmSpecWithJmxmpEnabledFalse(t *testing.T) {
466-
467-
spec := coh.CoherenceResourceSpec{
468-
JVM: &coh.JVMSpec{
469-
Jmxmp: &coh.JvmJmxmpSpec{
470-
Enabled: boolPtr(false),
471-
},
472-
},
473-
}
474-
475-
// Create the test deployment
476-
deployment := createTestDeployment(spec)
477-
// Create expected StatefulSet
478-
stsExpected := createMinimalExpectedStatefulSet(deployment)
479-
addEnvVars(stsExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_ENABLED", Value: "false"})
480-
addEnvVars(stsExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_PORT", Value: "9099"})
481-
482-
// assert that the StatefulSet is as expected
483-
assertStatefulSetCreation(t, deployment, stsExpected)
484-
}
485-
486-
func TestCreateStatefulSetWithJvmSpecWithJmxmpEnabledWithPort(t *testing.T) {
487-
488-
spec := coh.CoherenceResourceSpec{
489-
JVM: &coh.JVMSpec{
490-
Jmxmp: &coh.JvmJmxmpSpec{
491-
Enabled: boolPtr(true),
492-
Port: int32Ptr(1234),
493-
},
494-
},
495-
}
496-
497-
// Create the test deployment
498-
deployment := createTestDeployment(spec)
499-
// Create expected StatefulSet
500-
stsExpected := createMinimalExpectedStatefulSet(deployment)
501-
addEnvVars(stsExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_ENABLED", Value: "true"})
502-
addEnvVars(stsExpected, coh.ContainerNameCoherence, corev1.EnvVar{Name: "JVM_JMXMP_PORT", Value: "1234"})
503-
504-
// assert that the StatefulSet is as expected
505-
assertStatefulSetCreation(t, deployment, stsExpected)
506-
}

api/v1/zz_generated.deepcopy.go

Lines changed: 0 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/about/04_coherence_spec.adoc

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ TIP: This document was generated from comments in the Go structs in the pkg/api/
3838
* <<JVMSpec,JVMSpec>>
3939
* <<JvmDebugSpec,JvmDebugSpec>>
4040
* <<JvmGarbageCollectorSpec,JvmGarbageCollectorSpec>>
41-
* <<JvmJmxmpSpec,JvmJmxmpSpec>>
4241
* <<JvmMemorySpec,JvmMemorySpec>>
4342
* <<JvmOutOfMemorySpec,JvmOutOfMemorySpec>>
4443
* <<LocalObjectReference,LocalObjectReference>>
@@ -328,7 +327,6 @@ m| useContainerLimits | If set to true Adds the -XX:+UseContainerSupport JVM op
328327
m| gc | Set JVM garbage collector options. m| &#42;<<JvmGarbageCollectorSpec,JvmGarbageCollectorSpec>> | false
329328
m| diagnosticsVolume | DiagnosticsVolume is the volume to write JVM diagnostic information to, for example heap dumps, JFRs etc. m| &#42;https://{k8s-doc-link}/#volume-v1-core | false
330329
m| memory | Configure the JVM memory options. m| &#42;<<JvmMemorySpec,JvmMemorySpec>> | false
331-
m| jmxmp | Configure JMX using JMXMP. Note: This should only be used in development as JMXMP does not have support for encrypted connections via TLS. Use in production should ideally put the JMXMP port behind some sort of TLS enabled ingress or network policy. m| &#42;<<JvmJmxmpSpec,JvmJmxmpSpec>> | false
332330
m| useJibClasspath | A flag indicating whether to automatically add the default classpath for images created by the JIB tool https://github.com/GoogleContainerTools/jib If true then the /app/lib/* /app/classes and /app/resources entries are added to the JVM classpath. The default value fif not specified is true. m| &#42;bool | false
333331
|===
334332
@@ -363,19 +361,6 @@ m| logging | Enable the following GC logging args -verbose:gc -XX:+PrintGCDetai
363361
364362
<<Table of Contents,Back to TOC>>
365363
366-
=== JvmJmxmpSpec
367-
368-
JvmJmxmpSpec is options for configuring JMX using JMXMP.
369-
370-
[cols="1,10,1,1"options="header"]
371-
|===
372-
| Field | Description | Type | Required
373-
m| enabled | If set to true the JMXMP support will be enabled. Default is false m| &#42;bool | false
374-
m| port | The port tht the JMXMP MBeanServer should bind to. If not set the default port is 9099 m| &#42;int32 | false
375-
|===
376-
377-
<<Table of Contents,Back to TOC>>
378-
379364
=== JvmMemorySpec
380365
381366
JvmMemorySpec is options for managing the JVM memory.

docs/jvm/010_overview.adoc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ Configuring the heap size and other memory settings.
6262
Using debugger settings.
6363
--
6464
65-
[CARD]
66-
.JMX
67-
[link=docs/jvm/080_jmx.adoc]
68-
--
69-
Using JMX.
70-
--
71-
7265
[CARD]
7366
.Use Container Limits
7467
[link=docs/jvm/090_container_limits.adoc]

docs/jvm/080_jmx.adoc

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)