Skip to content

Commit

Permalink
usm: java-tls: Delete implementation (#30079)
Browse files Browse the repository at this point in the history
  • Loading branch information
guyarb authored Oct 16, 2024
1 parent 122c53f commit ea7d8a5
Show file tree
Hide file tree
Showing 54 changed files with 16 additions and 2,599 deletions.
1 change: 0 additions & 1 deletion comp/metadata/inventoryagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ The payload is a JSON dict with the following fields
- `feature_usm_kafka_enabled` - **bool**: True if Kafka monitoring is enabled for Universal Service Monitoring (see: `service_monitoring_config.enable_kafka_monitoring` config option in `system-probe.yaml`)
- `feature_usm_postgres_enabled` - **bool**: True if Postgres monitoring is enabled for Universal Service Monitoring (see: `service_monitoring_config.enable_postgres_monitoring` config option in `system-probe.yaml`)
- `feature_usm_redis_enabled` - **bool**: True if Redis monitoring is enabled for Universal Service Monitoring (see: `service_monitoring_config.enable_redis_monitoring` config option in `system-probe.yaml`)
- `feature_usm_java_tls_enabled` - **bool**: True if HTTPS monitoring through java TLS is enabled for Universal Service Monitoring (see: `service_monitoring_config.tls.java.enabled` config option in `system-probe.yaml`).
- `feature_usm_go_tls_enabled` - **bool**: True if HTTPS monitoring through GoTLS is enabled for Universal Service Monitoring (see: `service_monitoring_config.tls.go.enabled` config option in `system-probe.yaml`).
- `feature_discovery_enabled` - **bool**: True if discovery module is enabled (see: `discovery.enabled` config option).
- `feature_dynamic_instrumentation_enabled` - **bool**: True if dynamic instrumentation module is enabled (see: `dynamic_instrumentation.enabled` config option).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ func (ia *inventoryagent) fetchSystemProbeMetadata() {
ia.data["feature_usm_kafka_enabled"] = sysProbeConf.GetBool("service_monitoring_config.enable_kafka_monitoring")
ia.data["feature_usm_postgres_enabled"] = sysProbeConf.GetBool("service_monitoring_config.enable_postgres_monitoring")
ia.data["feature_usm_redis_enabled"] = sysProbeConf.GetBool("service_monitoring_config.enable_redis_monitoring")
ia.data["feature_usm_java_tls_enabled"] = sysProbeConf.GetBool("service_monitoring_config.tls.java.enabled")
ia.data["feature_usm_http2_enabled"] = sysProbeConf.GetBool("service_monitoring_config.enable_http2_monitoring")
ia.data["feature_usm_istio_enabled"] = sysProbeConf.GetBool("service_monitoring_config.tls.istio.enabled")
ia.data["feature_usm_http_by_status_code_enabled"] = sysProbeConf.GetBool("service_monitoring_config.enable_http_stats_by_status_code")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ func TestInitData(t *testing.T) {
"feature_usm_kafka_enabled": true,
"feature_usm_postgres_enabled": true,
"feature_usm_redis_enabled": true,
"feature_usm_java_tls_enabled": true,
"feature_usm_http2_enabled": true,
"feature_usm_istio_enabled": true,
"feature_usm_http_by_status_code_enabled": true,
Expand Down Expand Up @@ -490,7 +489,6 @@ func TestFetchSystemProbeAgent(t *testing.T) {
assert.False(t, ia.data["feature_usm_kafka_enabled"].(bool))
assert.False(t, ia.data["feature_usm_postgres_enabled"].(bool))
assert.False(t, ia.data["feature_usm_redis_enabled"].(bool))
assert.False(t, ia.data["feature_usm_java_tls_enabled"].(bool))
assert.False(t, ia.data["feature_usm_http2_enabled"].(bool))
assert.False(t, ia.data["feature_usm_istio_enabled"].(bool))
assert.True(t, ia.data["feature_usm_http_by_status_code_enabled"].(bool))
Expand Down Expand Up @@ -543,7 +541,6 @@ func TestFetchSystemProbeAgent(t *testing.T) {
assert.False(t, ia.data["feature_usm_enabled"].(bool))
assert.False(t, ia.data["feature_usm_kafka_enabled"].(bool))
assert.False(t, ia.data["feature_usm_postgres_enabled"].(bool))
assert.False(t, ia.data["feature_usm_java_tls_enabled"].(bool))
assert.False(t, ia.data["feature_usm_http2_enabled"].(bool))
assert.False(t, ia.data["feature_usm_istio_enabled"].(bool))
assert.False(t, ia.data["feature_usm_http_by_status_code_enabled"].(bool))
Expand Down Expand Up @@ -644,7 +641,6 @@ dynamic_instrumentation:
assert.True(t, ia.data["feature_usm_kafka_enabled"].(bool))
assert.True(t, ia.data["feature_usm_postgres_enabled"].(bool))
assert.True(t, ia.data["feature_usm_redis_enabled"].(bool))
assert.True(t, ia.data["feature_usm_java_tls_enabled"].(bool))
assert.True(t, ia.data["feature_usm_http2_enabled"].(bool))
assert.True(t, ia.data["feature_usm_istio_enabled"].(bool))
assert.True(t, ia.data["feature_usm_http_by_status_code_enabled"].(bool))
Expand Down
34 changes: 4 additions & 30 deletions pkg/network/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ import (
)

const (
spNS = "system_probe_config"
netNS = "network_config"
smNS = "service_monitoring_config"
evNS = "event_monitoring_config"
smjtNS = smNS + ".tls.java"
spNS = "system_probe_config"
netNS = "network_config"
smNS = "service_monitoring_config"
evNS = "event_monitoring_config"

defaultUDPTimeoutSeconds = 30
defaultUDPStreamTimeoutSeconds = 120
Expand Down Expand Up @@ -110,10 +109,6 @@ type Config struct {
// hooking the system-probe test binary. Defaults to true.
GoTLSExcludeSelf bool

// EnableJavaTLSSupport specifies whether the tracer should monitor HTTPS
// traffic done through Java's TLS implementation
EnableJavaTLSSupport bool

// MaxTrackedHTTPConnections max number of http(s) flows that will be concurrently tracked.
// value is currently Windows only
MaxTrackedHTTPConnections int64
Expand All @@ -126,21 +121,6 @@ type Config struct {
// Currently Windows only
HTTPMaxRequestFragment int64

// JavaAgentDebug will enable debug output of the injected USM agent
JavaAgentDebug bool

// JavaAgentArgs arguments pass through injected USM agent
JavaAgentArgs string

// JavaAgentAllowRegex (Higher priority) define a regex, if matching /proc/pid/cmdline the java agent will be injected
JavaAgentAllowRegex string

// JavaAgentBlockRegex define a regex, if matching /proc/pid/cmdline the java agent will not be injected
JavaAgentBlockRegex string

// JavaDir is the directory to load the java agent program from
JavaDir string

// UDPConnTimeout determines the length of traffic inactivity between two
// (IP, port)-pairs before declaring a UDP connection as inactive. This is
// set to /proc/sys/net/netfilter/nf_conntrack_udp_timeout on Linux by
Expand Down Expand Up @@ -411,12 +391,6 @@ func New() *Config {
EnableEbpfless: cfg.GetBool(join(netNS, "enable_ebpfless")),

// Service Monitoring
EnableJavaTLSSupport: cfg.GetBool(join(smjtNS, "enabled")),
JavaAgentDebug: cfg.GetBool(join(smjtNS, "debug")),
JavaAgentArgs: cfg.GetString(join(smjtNS, "args")),
JavaAgentAllowRegex: cfg.GetString(join(smjtNS, "allow_regex")),
JavaAgentBlockRegex: cfg.GetString(join(smjtNS, "block_regex")),
JavaDir: cfg.GetString(join(smjtNS, "dir")),
EnableGoTLSSupport: cfg.GetBool(join(smNS, "tls", "go", "enabled")),
GoTLSExcludeSelf: cfg.GetBool(join(smNS, "tls", "go", "exclude_self")),
EnableHTTPStatsByStatusCode: cfg.GetBool(join(smNS, "enable_http_stats_by_status_code")),
Expand Down
29 changes: 0 additions & 29 deletions pkg/network/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,25 +176,6 @@ func TestEnableHTTPMonitoring(t *testing.T) {
})
}

func TestEnableJavaTLSSupport(t *testing.T) {
t.Run("via YAML", func(t *testing.T) {
mockSystemProbe := mock.NewSystemProbe(t)
mockSystemProbe.SetWithoutSource("service_monitoring_config.tls.java.enabled", true)
cfg := New()

require.True(t, cfg.EnableJavaTLSSupport)
})

t.Run("via ENV variable", func(t *testing.T) {
mock.NewSystemProbe(t)
t.Setenv("DD_SERVICE_MONITORING_CONFIG_TLS_JAVA_ENABLED", "true")
cfg := New()

require.True(t, cfg.EnableJavaTLSSupport)
})

}

func TestEnableHTTP2Monitoring(t *testing.T) {
t.Run("via YAML", func(t *testing.T) {
mockSystemProbe := mock.NewSystemProbe(t)
Expand Down Expand Up @@ -293,16 +274,6 @@ func TestEnableRedisMonitoring(t *testing.T) {
})
}

func TestDefaultDisabledJavaTLSSupport(t *testing.T) {
mock.NewSystemProbe(t)
cfg := New()

_, err := sysconfig.New("", "")
require.NoError(t, err)

assert.False(t, cfg.EnableJavaTLSSupport)
}

func TestDefaultDisabledHTTP2Support(t *testing.T) {
mock.NewSystemProbe(t)
cfg := New()
Expand Down
2 changes: 0 additions & 2 deletions pkg/network/ebpf/c/prebuilt/usm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include "protocols/postgres/decoding.h"
#include "protocols/redis/decoding.h"
#include "protocols/sockfd-probes.h"
#include "protocols/tls/java/erpc_dispatcher.h"
#include "protocols/tls/java/erpc_handlers.h"
#include "protocols/tls/https.h"
#include "protocols/tls/native-tls.h"
#include "protocols/tls/tags-types.h"
Expand Down
58 changes: 0 additions & 58 deletions pkg/network/ebpf/c/protocols/tls/java/erpc_dispatcher.h

This file was deleted.

Loading

0 comments on commit ea7d8a5

Please sign in to comment.