From 24b62cefba83a0019fa08c5e9a5c83eae08ce8a6 Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Thu, 28 Nov 2024 13:25:53 +0100 Subject: [PATCH 01/59] [CWS] fix missing opts Tagger on macos (#31560) --- pkg/security/probe/opts_others.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/security/probe/opts_others.go b/pkg/security/probe/opts_others.go index 59cf8dccb1453..03c5f82382a78 100644 --- a/pkg/security/probe/opts_others.go +++ b/pkg/security/probe/opts_others.go @@ -8,8 +8,12 @@ // Package probe holds probe related files package probe +import "github.com/DataDog/datadog-agent/pkg/security/resolvers/tags" + // Opts defines some probe options type Opts struct { // DontDiscardRuntime do not discard the runtime. Mostly used by functional tests DontDiscardRuntime bool + // Tagger will override the default one. Mainly here for tests. + Tagger tags.Tagger } From 0f9693ff47d7ecc36a270ee2c056a991d25b0a07 Mon Sep 17 00:00:00 2001 From: Alexandre Yang Date: Thu, 28 Nov 2024 14:29:49 +0100 Subject: [PATCH 02/59] [ha-agent] Run HA enabled integrations only on leader agent (#31186) Co-authored-by: Jen Gilbert --- .../agent_check_metadata_test.go | 2 + .../collector/collectorimpl/collector.go | 16 ++- .../collectorimpl/collector_demux_test.go | 2 + .../collector/collectorimpl/collector_test.go | 2 + comp/haagent/def/component.go | 3 + comp/haagent/impl/config.go | 9 ++ comp/haagent/impl/haagent.go | 9 ++ comp/haagent/impl/haagent_comp.go | 4 +- comp/haagent/impl/haagent_test.go | 71 ++++++++++ comp/haagent/mock/mock.go | 4 + pkg/collector/runner/runner.go | 6 +- pkg/collector/runner/runner_test.go | 21 +-- pkg/collector/worker/worker.go | 11 ++ pkg/collector/worker/worker_test.go | 122 ++++++++++++++++-- ...ent-collector-worker-22f3972469c669c3.yaml | 11 ++ 15 files changed, 264 insertions(+), 29 deletions(-) create mode 100644 releasenotes/notes/NDMII-3154-ha-agent-collector-worker-22f3972469c669c3.yaml diff --git a/comp/collector/collector/collectorimpl/agent_check_metadata_test.go b/comp/collector/collector/collectorimpl/agent_check_metadata_test.go index 114dd0b8f93df..f997bd0332518 100644 --- a/comp/collector/collector/collectorimpl/agent_check_metadata_test.go +++ b/comp/collector/collector/collectorimpl/agent_check_metadata_test.go @@ -16,6 +16,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" "github.com/DataDog/datadog-agent/comp/core" "github.com/DataDog/datadog-agent/comp/core/config" + haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" "github.com/DataDog/datadog-agent/pkg/collector/externalhost" "github.com/DataDog/datadog-agent/pkg/serializer" "github.com/DataDog/datadog-agent/pkg/util/fxutil" @@ -36,6 +37,7 @@ func TestExternalHostTags(t *testing.T) { c := newCollector(fxutil.Test[dependencies](t, core.MockBundle(), demultiplexerimpl.MockModule(), + haagentmock.Module(), fx.Provide(func() optional.Option[serializer.MetricSerializer] { return optional.NewNoneOption[serializer.MetricSerializer]() }), diff --git a/comp/collector/collector/collectorimpl/collector.go b/comp/collector/collector/collectorimpl/collector.go index f90b0c61cec88..94b10a962d3ed 100644 --- a/comp/collector/collector/collectorimpl/collector.go +++ b/comp/collector/collector/collectorimpl/collector.go @@ -24,6 +24,7 @@ import ( flaretypes "github.com/DataDog/datadog-agent/comp/core/flare/types" log "github.com/DataDog/datadog-agent/comp/core/log/def" "github.com/DataDog/datadog-agent/comp/core/status" + haagent "github.com/DataDog/datadog-agent/comp/haagent/def" metadata "github.com/DataDog/datadog-agent/comp/metadata/runner/runnerimpl" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" pkgCollector "github.com/DataDog/datadog-agent/pkg/collector" @@ -48,17 +49,19 @@ const ( type dependencies struct { fx.In - Lc fx.Lifecycle - Config config.Component - Log log.Component + Lc fx.Lifecycle + Config config.Component + Log log.Component + HaAgent haagent.Component SenderManager sender.SenderManager MetricSerializer optional.Option[serializer.MetricSerializer] } type collectorImpl struct { - log log.Component - config config.Component + log log.Component + config config.Component + haAgent haagent.Component senderManager sender.SenderManager metricSerializer optional.Option[serializer.MetricSerializer] @@ -119,6 +122,7 @@ func newCollector(deps dependencies) *collectorImpl { c := &collectorImpl{ log: deps.Log, config: deps.Config, + haAgent: deps.HaAgent, senderManager: deps.SenderManager, metricSerializer: deps.MetricSerializer, checks: make(map[checkid.ID]*middleware.CheckWrapper), @@ -186,7 +190,7 @@ func (c *collectorImpl) start(_ context.Context) error { c.m.Lock() defer c.m.Unlock() - run := runner.NewRunner(c.senderManager) + run := runner.NewRunner(c.senderManager, c.haAgent) sched := scheduler.NewScheduler(run.GetChan()) // let the runner some visibility into the scheduler diff --git a/comp/collector/collector/collectorimpl/collector_demux_test.go b/comp/collector/collector/collectorimpl/collector_demux_test.go index e142221841f90..b68f7a91e546a 100644 --- a/comp/collector/collector/collectorimpl/collector_demux_test.go +++ b/comp/collector/collector/collectorimpl/collector_demux_test.go @@ -21,6 +21,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" + haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id" @@ -84,6 +85,7 @@ func (suite *CollectorDemuxTestSuite) SetupTest() { suite.SenderManagerMock = NewSenderManagerMock(suite.demux) suite.c = newCollector(fxutil.Test[dependencies](suite.T(), core.MockBundle(), + haagentmock.Module(), fx.Provide(func() sender.SenderManager { return suite.SenderManagerMock }), diff --git a/comp/collector/collector/collectorimpl/collector_test.go b/comp/collector/collector/collectorimpl/collector_test.go index 1aea4301bc791..44ddc7e2f357c 100644 --- a/comp/collector/collector/collectorimpl/collector_test.go +++ b/comp/collector/collector/collectorimpl/collector_test.go @@ -22,6 +22,7 @@ import ( "github.com/DataDog/datadog-agent/comp/collector/collector/collectorimpl/internal/middleware" "github.com/DataDog/datadog-agent/comp/core" "github.com/DataDog/datadog-agent/comp/core/config" + haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" "github.com/DataDog/datadog-agent/pkg/aggregator" "github.com/DataDog/datadog-agent/pkg/collector/check" checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id" @@ -97,6 +98,7 @@ func (suite *CollectorTestSuite) SetupTest() { suite.c = newCollector(fxutil.Test[dependencies](suite.T(), core.MockBundle(), demultiplexerimpl.MockModule(), + haagentmock.Module(), fx.Provide(func() optional.Option[serializer.MetricSerializer] { return optional.NewNoneOption[serializer.MetricSerializer]() }), diff --git a/comp/haagent/def/component.go b/comp/haagent/def/component.go index 2472322d9a400..f1d3f53ce3fa5 100644 --- a/comp/haagent/def/component.go +++ b/comp/haagent/def/component.go @@ -22,4 +22,7 @@ type Component interface { // SetLeader takes the leader agent hostname as input, if it matches the current agent hostname, // the isLeader state is set to true, otherwise false. SetLeader(leaderAgentHostname string) + + // ShouldRunIntegration returns true if the integration should be run + ShouldRunIntegration(integrationName string) bool } diff --git a/comp/haagent/impl/config.go b/comp/haagent/impl/config.go index 2417106455a7d..4fea0af76d0fd 100644 --- a/comp/haagent/impl/config.go +++ b/comp/haagent/impl/config.go @@ -9,6 +9,15 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" ) +// validHaIntegrations represent the list of integrations that will be considered as +// an "HA Integration", meaning it will only run on the leader Agent. +// At the moment, the list of HA Integrations is hardcoded here, but we might provide +// more dynamic way to configure which integration should be considered HA Integration. +var validHaIntegrations = map[string]bool{ + "snmp": true, + "network_path": true, +} + type haAgentConfigs struct { enabled bool group string diff --git a/comp/haagent/impl/haagent.go b/comp/haagent/impl/haagent.go index 5328d039da2d3..050596256e16a 100644 --- a/comp/haagent/impl/haagent.go +++ b/comp/haagent/impl/haagent.go @@ -50,6 +50,15 @@ func (h *haAgentImpl) SetLeader(leaderAgentHostname string) { h.isLeader.Store(agentHostname == leaderAgentHostname) } +// ShouldRunIntegration return true if the agent integrations should to run. +// When ha-agent is disabled, the agent behave as standalone agent (non HA) and will always run all integrations. +func (h *haAgentImpl) ShouldRunIntegration(integrationName string) bool { + if h.Enabled() && validHaIntegrations[integrationName] { + return h.isLeader.Load() + } + return true +} + func (h *haAgentImpl) onHaAgentUpdate(updates map[string]state.RawConfig, applyStateCallback func(string, state.ApplyStatus)) { h.log.Debugf("Updates received: count=%d", len(updates)) diff --git a/comp/haagent/impl/haagent_comp.go b/comp/haagent/impl/haagent_comp.go index f922325a9a440..19697bba7d464 100644 --- a/comp/haagent/impl/haagent_comp.go +++ b/comp/haagent/impl/haagent_comp.go @@ -28,8 +28,8 @@ type Provides struct { // NewComponent creates a new haagent component func NewComponent(reqs Requires) (Provides, error) { - haAgentConfigs := newHaAgentConfigs(reqs.AgentConfig) - haAgent := newHaAgentImpl(reqs.Logger, haAgentConfigs) + haAgentConf := newHaAgentConfigs(reqs.AgentConfig) + haAgent := newHaAgentImpl(reqs.Logger, haAgentConf) var rcListener rctypes.ListenerProvider if haAgent.Enabled() { reqs.Logger.Debug("Add onHaAgentUpdate RCListener") diff --git a/comp/haagent/impl/haagent_test.go b/comp/haagent/impl/haagent_test.go index b91e33f27c4b6..c427220404696 100644 --- a/comp/haagent/impl/haagent_test.go +++ b/comp/haagent/impl/haagent_test.go @@ -169,3 +169,74 @@ func Test_haAgentImpl_onHaAgentUpdate(t *testing.T) { }) } } + +func Test_haAgentImpl_ShouldRunIntegration(t *testing.T) { + testAgentHostname := "my-agent-hostname" + tests := []struct { + name string + leader string + agentConfigs map[string]interface{} + expectShouldRunIntegration map[string]bool + }{ + { + name: "ha agent enabled and agent is leader", + // should run HA-integrations + // should run "non HA integrations" + agentConfigs: map[string]interface{}{ + "hostname": testAgentHostname, + "ha_agent.enabled": true, + "ha_agent.group": testGroup, + }, + leader: testAgentHostname, + expectShouldRunIntegration: map[string]bool{ + "snmp": true, + "network_path": true, + "unknown_integration": true, + "cpu": true, + }, + }, + { + name: "ha agent enabled and agent is not leader", + // should skip HA-integrations + // should run "non HA integrations" + agentConfigs: map[string]interface{}{ + "hostname": testAgentHostname, + "ha_agent.enabled": true, + "ha_agent.group": testGroup, + }, + leader: "another-agent-is-leader", + expectShouldRunIntegration: map[string]bool{ + "snmp": false, + "network_path": false, + "unknown_integration": true, + "cpu": true, + }, + }, + { + name: "ha agent not enabled", + // should run all integrations + agentConfigs: map[string]interface{}{ + "hostname": testAgentHostname, + "ha_agent.enabled": false, + "ha_agent.group": testGroup, + }, + leader: testAgentHostname, + expectShouldRunIntegration: map[string]bool{ + "snmp": true, + "network_path": true, + "unknown_integration": true, + "cpu": true, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + haAgent := newTestHaAgentComponent(t, tt.agentConfigs) + haAgent.Comp.SetLeader(tt.leader) + + for integrationName, shouldRun := range tt.expectShouldRunIntegration { + assert.Equalf(t, shouldRun, haAgent.Comp.ShouldRunIntegration(integrationName), "fail for integration: "+integrationName) + } + }) + } +} diff --git a/comp/haagent/mock/mock.go b/comp/haagent/mock/mock.go index 52142737704c9..37c5cf4aa9916 100644 --- a/comp/haagent/mock/mock.go +++ b/comp/haagent/mock/mock.go @@ -44,6 +44,10 @@ func (m *mockHaAgent) SetEnabled(enabled bool) { m.enabled = enabled } +func (m *mockHaAgent) ShouldRunIntegration(_ string) bool { + return true +} + // Component is the component type. type Component interface { haagent.Component diff --git a/pkg/collector/runner/runner.go b/pkg/collector/runner/runner.go index e6ba495f02f2b..a388e73dea776 100644 --- a/pkg/collector/runner/runner.go +++ b/pkg/collector/runner/runner.go @@ -14,6 +14,7 @@ import ( "go.uber.org/atomic" + haagent "github.com/DataDog/datadog-agent/comp/haagent/def" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" "github.com/DataDog/datadog-agent/pkg/collector/check" checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id" @@ -40,6 +41,7 @@ var ( // Runner is the object in charge of running all the checks type Runner struct { senderManager sender.SenderManager + haAgent haagent.Component isRunning *atomic.Bool id int // Globally unique identifier for the Runner workers map[int]*worker.Worker // Workers currrently under this Runner's management @@ -52,11 +54,12 @@ type Runner struct { } // NewRunner takes the number of desired goroutines processing incoming checks. -func NewRunner(senderManager sender.SenderManager) *Runner { +func NewRunner(senderManager sender.SenderManager, haAgent haagent.Component) *Runner { numWorkers := pkgconfigsetup.Datadog().GetInt("check_runners") r := &Runner{ senderManager: senderManager, + haAgent: haAgent, id: int(runnerIDGenerator.Inc()), isRunning: atomic.NewBool(true), workers: make(map[int]*worker.Worker), @@ -117,6 +120,7 @@ func (r *Runner) AddWorker() { func (r *Runner) newWorker() (*worker.Worker, error) { worker, err := worker.NewWorker( r.senderManager, + r.haAgent, r.id, int(workerIDGenerator.Inc()), r.pendingChecksChan, diff --git a/pkg/collector/runner/runner_test.go b/pkg/collector/runner/runner_test.go index 6ae3cd335c81b..b6a02aab0739f 100644 --- a/pkg/collector/runner/runner_test.go +++ b/pkg/collector/runner/runner_test.go @@ -15,6 +15,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/atomic" + haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" "github.com/DataDog/datadog-agent/pkg/aggregator" checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id" "github.com/DataDog/datadog-agent/pkg/collector/check/stub" @@ -152,7 +153,7 @@ func TestNewRunner(t *testing.T) { testSetUp(t) pkgconfigsetup.Datadog().SetWithoutSource("check_runners", "3") - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) defer r.Stop() @@ -166,7 +167,7 @@ func TestRunnerAddWorker(t *testing.T) { testSetUp(t) pkgconfigsetup.Datadog().SetWithoutSource("check_runners", "1") - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) defer r.Stop() @@ -181,7 +182,7 @@ func TestRunnerStaticUpdateNumWorkers(t *testing.T) { testSetUp(t) pkgconfigsetup.Datadog().SetWithoutSource("check_runners", "2") - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) defer func() { r.Stop() @@ -212,7 +213,7 @@ func TestRunnerDynamicUpdateNumWorkers(t *testing.T) { assertAsyncWorkerCount(t, 0) min, max, expectedWorkers := testCase[0], testCase[1], testCase[2] - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) for checks := min; checks <= max; checks++ { @@ -234,7 +235,7 @@ func TestRunner(t *testing.T) { checks[idx] = newCheck(t, fmt.Sprintf("mycheck_%d:123", idx), false, nil) } - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) defer r.Stop() @@ -262,7 +263,7 @@ func TestRunnerStop(t *testing.T) { checks[idx].RunLock.Lock() } - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) defer r.Stop() @@ -320,7 +321,7 @@ func TestRunnerStopWithStuckCheck(t *testing.T) { blockedCheck.RunLock.Lock() blockedCheck.StopLock.Lock() - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) defer r.Stop() @@ -369,7 +370,7 @@ func TestRunnerStopCheck(t *testing.T) { blockedCheck.RunLock.Lock() blockedCheck.StopLock.Lock() - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) defer func() { r.Stop() @@ -413,7 +414,7 @@ func TestRunnerScheduler(t *testing.T) { sched1 := newScheduler() sched2 := newScheduler() - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) defer r.Stop() @@ -433,7 +434,7 @@ func TestRunnerShouldAddCheckStats(t *testing.T) { testCheck := newCheck(t, "test", false, nil) sched := newScheduler() - r := NewRunner(aggregator.NewNoOpSenderManager()) + r := NewRunner(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent()) require.NotNil(t, r) defer r.Stop() diff --git a/pkg/collector/worker/worker.go b/pkg/collector/worker/worker.go index 00a0b40668135..144ecf58240f2 100644 --- a/pkg/collector/worker/worker.go +++ b/pkg/collector/worker/worker.go @@ -10,6 +10,7 @@ import ( "fmt" "time" + haagent "github.com/DataDog/datadog-agent/comp/haagent/def" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" "github.com/DataDog/datadog-agent/pkg/collector/check" checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id" @@ -53,11 +54,13 @@ type Worker struct { runnerID int shouldAddCheckStatsFunc func(id checkid.ID) bool utilizationTickInterval time.Duration + haAgent haagent.Component } // NewWorker returns an instance of a `Worker` after parameter sanity checks are passed func NewWorker( senderManager sender.SenderManager, + haAgent haagent.Component, runnerID int, ID int, pendingChecksChan chan check.Check, @@ -84,6 +87,7 @@ func NewWorker( checksTracker, shouldAddCheckStatsFunc, senderManager.GetDefaultSender, + haAgent, pollingInterval, ) } @@ -98,6 +102,7 @@ func newWorkerWithOptions( checksTracker *tracker.RunningChecksTracker, shouldAddCheckStatsFunc func(id checkid.ID) bool, getDefaultSenderFunc func() (sender.Sender, error), + haAgent haagent.Component, utilizationTickInterval time.Duration, ) (*Worker, error) { @@ -115,6 +120,7 @@ func newWorkerWithOptions( runnerID: runnerID, shouldAddCheckStatsFunc: shouldAddCheckStatsFunc, getDefaultSenderFunc: getDefaultSenderFunc, + haAgent: haAgent, utilizationTickInterval: utilizationTickInterval, }, nil } @@ -135,6 +141,11 @@ func (w *Worker) Run() { checkLogger := CheckLogger{Check: check} longRunning := check.Interval() == 0 + if !w.haAgent.ShouldRunIntegration(check.String()) { + checkLogger.Debug("Check is an HA integration and current agent is not leader, skipping execution...") + continue + } + // Add check to tracker if it's not already running if !w.checksTracker.AddCheck(check) { checkLogger.Debug("Check is already running, skipping execution...") diff --git a/pkg/collector/worker/worker_test.go b/pkg/collector/worker/worker_test.go index 129ed30a499e8..3bbd9e659e224 100644 --- a/pkg/collector/worker/worker_test.go +++ b/pkg/collector/worker/worker_test.go @@ -15,7 +15,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/atomic" + "go.uber.org/fx" + "github.com/DataDog/datadog-agent/comp/core/config" + logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" + haagentimpl "github.com/DataDog/datadog-agent/comp/haagent/impl" + haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" "github.com/DataDog/datadog-agent/pkg/aggregator" "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" @@ -26,6 +31,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/collector/runner/tracker" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/metrics/servicecheck" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) type testCheck struct { @@ -122,16 +128,16 @@ func TestWorkerInit(t *testing.T) { mockShouldAddStatsFunc := func(checkid.ID) bool { return true } senderManager := aggregator.NewNoOpSenderManager() - _, err := NewWorker(senderManager, 1, 2, nil, checksTracker, mockShouldAddStatsFunc) + _, err := NewWorker(senderManager, haagentmock.NewMockHaAgent(), 1, 2, nil, checksTracker, mockShouldAddStatsFunc) require.NotNil(t, err) - _, err = NewWorker(senderManager, 1, 2, pendingChecksChan, nil, mockShouldAddStatsFunc) + _, err = NewWorker(senderManager, haagentmock.NewMockHaAgent(), 1, 2, pendingChecksChan, nil, mockShouldAddStatsFunc) require.NotNil(t, err) - _, err = NewWorker(senderManager, 1, 2, pendingChecksChan, checksTracker, nil) + _, err = NewWorker(senderManager, haagentmock.NewMockHaAgent(), 1, 2, pendingChecksChan, checksTracker, nil) require.NotNil(t, err) - worker, err := NewWorker(senderManager, 1, 2, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) + worker, err := NewWorker(senderManager, haagentmock.NewMockHaAgent(), 1, 2, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) assert.Nil(t, err) assert.NotNil(t, worker) } @@ -150,7 +156,7 @@ func TestWorkerInitExpvarStats(t *testing.T) { go func(idx int) { defer wg.Done() - worker, err := NewWorker(aggregator.NewNoOpSenderManager(), 1, idx, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) + worker, err := NewWorker(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent(), 1, idx, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) assert.Nil(t, err) worker.Run() @@ -172,7 +178,7 @@ func TestWorkerName(t *testing.T) { for _, id := range []int{1, 100, 500} { expectedName := fmt.Sprintf("worker_%d", id) - worker, err := NewWorker(aggregator.NewNoOpSenderManager(), 1, id, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) + worker, err := NewWorker(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent(), 1, id, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) assert.Nil(t, err) assert.NotNil(t, worker) @@ -224,7 +230,7 @@ func TestWorker(t *testing.T) { pendingChecksChan <- testCheck1 close(pendingChecksChan) - worker, err := NewWorker(aggregator.NewNoOpSenderManager(), 100, 200, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) + worker, err := NewWorker(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent(), 100, 200, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) require.Nil(t, err) wg.Add(1) @@ -284,6 +290,7 @@ func TestWorkerUtilizationExpvars(t *testing.T) { checksTracker, mockShouldAddStatsFunc, func() (sender.Sender, error) { return nil, nil }, + haagentmock.NewMockHaAgent(), 100*time.Millisecond, ) require.Nil(t, err) @@ -354,7 +361,7 @@ func TestWorkerErrorAndWarningHandling(t *testing.T) { } close(pendingChecksChan) - worker, err := NewWorker(aggregator.NewNoOpSenderManager(), 100, 200, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) + worker, err := NewWorker(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent(), 100, 200, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) require.Nil(t, err) AssertAsyncWorkerCount(t, 0) @@ -399,7 +406,7 @@ func TestWorkerConcurrentCheckScheduling(t *testing.T) { pendingChecksChan <- testCheck close(pendingChecksChan) - worker, err := NewWorker(aggregator.NewNoOpSenderManager(), 100, 200, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) + worker, err := NewWorker(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent(), 100, 200, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) require.Nil(t, err) worker.Run() @@ -453,7 +460,7 @@ func TestWorkerStatsAddition(t *testing.T) { pendingChecksChan <- squelchedStatsCheck close(pendingChecksChan) - worker, err := NewWorker(aggregator.NewNoOpSenderManager(), 100, 200, pendingChecksChan, checksTracker, shouldAddStatsFunc) + worker, err := NewWorker(aggregator.NewNoOpSenderManager(), haagentmock.NewMockHaAgent(), 100, 200, pendingChecksChan, checksTracker, shouldAddStatsFunc) require.Nil(t, err) worker.Run() @@ -505,6 +512,7 @@ func TestWorkerServiceCheckSending(t *testing.T) { func() (sender.Sender, error) { return mockSender, nil }, + haagentmock.NewMockHaAgent(), pollingInterval, ) require.Nil(t, err) @@ -575,6 +583,7 @@ func TestWorkerSenderNil(t *testing.T) { func() (sender.Sender, error) { return nil, fmt.Errorf("testerr") }, + haagentmock.NewMockHaAgent(), pollingInterval, ) require.Nil(t, err) @@ -615,6 +624,7 @@ func TestWorkerServiceCheckSendingLongRunningTasks(t *testing.T) { func() (sender.Sender, error) { return mockSender, nil }, + haagentmock.NewMockHaAgent(), pollingInterval, ) require.Nil(t, err) @@ -628,6 +638,98 @@ func TestWorkerServiceCheckSendingLongRunningTasks(t *testing.T) { mockSender.AssertNumberOfCalls(t, "ServiceCheck", 0) } +func TestWorker_HaIntegration(t *testing.T) { + testHostname := "myhost" + + tests := []struct { + name string + haAgentEnabled bool + setLeaderValue string + expectedSnmpCheckRunCount int + expectedUnknownCheckRunCount int + }{ + { + name: "ha-agent enabled and is leader", + // should run HA-integrations + // should run "non HA integrations" + haAgentEnabled: true, + setLeaderValue: testHostname, + expectedSnmpCheckRunCount: 1, + expectedUnknownCheckRunCount: 1, + }, + { + name: "ha-agent enabled and not leader", + // should skip HA-integrations + // should run "non HA integrations" + haAgentEnabled: true, + setLeaderValue: "leader-is-another-agent", + expectedSnmpCheckRunCount: 0, + expectedUnknownCheckRunCount: 1, + }, + { + name: "ha-agent disabled", + // When ha-agent is disabled, the agent behave as standalone agent (non HA) and will always run all integrations. + // should run all integrations + haAgentEnabled: false, + setLeaderValue: "", + expectedSnmpCheckRunCount: 1, + expectedUnknownCheckRunCount: 1, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + expvars.Reset() + + var wg sync.WaitGroup + + checksTracker := tracker.NewRunningChecksTracker() + pendingChecksChan := make(chan check.Check, 10) + mockShouldAddStatsFunc := func(checkid.ID) bool { return true } + + snmpCheck := newCheck(t, "snmp:123", false, nil) + unknownCheck := newCheck(t, "unknown-check:123", false, nil) + + pendingChecksChan <- snmpCheck + pendingChecksChan <- unknownCheck + close(pendingChecksChan) + + agentConfigs := map[string]interface{}{ + "hostname": testHostname, + "ha_agent.enabled": tt.haAgentEnabled, + "ha_agent.group": "my-group-01", + } + logComponent := logmock.New(t) + agentConfigComponent := fxutil.Test[config.Component](t, fx.Options( + config.MockModule(), + fx.Replace(config.MockParams{Overrides: agentConfigs}), + )) + requires := haagentimpl.Requires{ + Logger: logComponent, + AgentConfig: agentConfigComponent, + } + haagentcomp, _ := haagentimpl.NewComponent(requires) + haagentcomp.Comp.SetLeader(tt.setLeaderValue) + + worker, err := NewWorker(aggregator.NewNoOpSenderManager(), haagentcomp.Comp, 100, 200, pendingChecksChan, checksTracker, mockShouldAddStatsFunc) + require.Nil(t, err) + + wg.Add(1) + go func() { + defer wg.Done() + worker.Run() + }() + + wg.Wait() + + assert.Equal(t, tt.expectedSnmpCheckRunCount, snmpCheck.RunCount()) + assert.Equal(t, tt.expectedUnknownCheckRunCount, unknownCheck.RunCount()) + + // make sure the check is deleted from checksTracker + assert.Equal(t, 0, len(checksTracker.RunningChecks())) + }) + } +} + // getWorkerUtilizationExpvar returns the utilization as presented by expvars // for a named worker. func getWorkerUtilizationExpvar(t *testing.T, name string) float64 { diff --git a/releasenotes/notes/NDMII-3154-ha-agent-collector-worker-22f3972469c669c3.yaml b/releasenotes/notes/NDMII-3154-ha-agent-collector-worker-22f3972469c669c3.yaml new file mode 100644 index 0000000000000..fa04e9cd53682 --- /dev/null +++ b/releasenotes/notes/NDMII-3154-ha-agent-collector-worker-22f3972469c669c3.yaml @@ -0,0 +1,11 @@ +# Each section from every release note are combined when the +# CHANGELOG.rst is rendered. So the text needs to be worded so that +# it does not depend on any information only available in another +# section. This may mean repeating some details, but each section +# must be readable independently of the other. +# +# Each section note must be formatted as reStructuredText. +--- +enhancements: + - | + [ha-agent] Run HA enabled integrations only on leader Agent From b80f86c8411b2bef986860e2498637027f39e113 Mon Sep 17 00:00:00 2001 From: Gustavo Caso Date: Thu, 28 Nov 2024 14:48:37 +0100 Subject: [PATCH 03/59] Revert "[ASCII-2562] Migrate forward eventplatform component to the latest file structure" (#31563) --- cmd/agent/subcommands/run/command.go | 4 +- cmd/agent/subcommands/snmp/command.go | 6 +- .../subcommands/run/command.go | 4 +- .../subcommands/start/command.go | 4 +- cmd/dogstatsd/subcommands/start/command.go | 4 +- cmd/process-agent/command/main_common.go | 4 +- cmd/process-agent/subcommands/check/check.go | 4 +- cmd/serverless-init/metric/metric_test.go | 3 +- comp/agent/bundle_test.go | 4 +- comp/aggregator/bundle_test.go | 4 +- .../demultiplexerimpl/demultiplexer.go | 2 +- .../demultiplexer_fake_sampler_mock.go | 4 +- .../demultiplexerimpl/status_test.go | 4 +- .../test_agent_demultiplexer.go | 11 +- .../sendermanager.go | 5 +- .../collectorimpl/collector_demux_test.go | 3 +- .../eventplatform/{def => }/component.go | 8 +- .../{mock => }/component_mock.go | 7 +- .../epforwarder.go | 64 ++++++++--- .../eventplatformimpl/epforwarder_mock.go | 27 +++++ .../eventplatformimpl/epforwarder_mockgen.go | 101 ++++++++++++++++++ .../eventplatform/eventplatformimpl/params.go | 22 ++++ comp/forwarder/eventplatform/fx-mock/fx.go | 21 ---- comp/forwarder/eventplatform/fx-noop/fx.go | 21 ---- comp/forwarder/eventplatform/fx/fx.go | 17 --- .../forwarder/eventplatform/impl-noop/noop.go | 39 ------- .../eventplatform/mock/epforwarder_mock.go | 36 ------- .../eventplatform/mock/epforwarder_mockgen.go | 77 ------------- .../eventplatformreceiverimpl/format.go | 2 +- comp/ndmtmp/bundle_test.go | 7 +- comp/ndmtmp/forwarder/component.go | 4 +- comp/ndmtmp/forwarder/component_mock.go | 4 +- .../forwarder/forwarderimpl/forwarder.go | 5 +- .../forwarder/forwarderimpl/forwarder_mock.go | 9 +- comp/netflow/flowaggregator/aggregator.go | 6 +- .../netflow/flowaggregator/aggregator_test.go | 22 ++-- comp/netflow/server/integration_test.go | 7 +- comp/netflow/testutil/testutil.go | 2 +- comp/networkpath/bundle_test.go | 4 +- .../npcollectorimpl/npcollector.go | 6 +- .../npcollectorimpl/npcollector_test.go | 6 +- .../npcollectorimpl/npcollector_testutils.go | 11 +- .../npcollectorimpl/npcollectorcomp.go | 30 +++--- comp/process/bundle_test.go | 4 +- comp/snmpscan/impl/devicescan.go | 5 +- comp/snmpscan/impl/snmpscan.go | 9 +- .../forwarder/forwarderimpl/forwarder.go | 2 +- .../forwarder/forwarderimpl/forwarder_test.go | 2 +- comp/snmptraps/status/statusimpl/status.go | 2 +- .../status/statusimpl/status_test.go | 2 +- pkg/aggregator/aggregator.go | 23 +++- pkg/aggregator/aggregator_test.go | 2 +- pkg/aggregator/check_sampler_bench_test.go | 6 +- pkg/aggregator/demultiplexer_agent.go | 6 +- pkg/aggregator/demultiplexer_agent_test.go | 6 +- pkg/aggregator/demultiplexer_mock.go | 6 +- pkg/aggregator/demultiplexer_test.go | 66 ++++++++---- pkg/aggregator/mocksender/mocksender.go | 10 +- pkg/aggregator/sender_test.go | 20 ++-- pkg/cli/subcommands/check/command.go | 7 +- .../corechecks/containerimage/processor.go | 2 +- .../containerimage/processor_test.go | 2 +- .../containerlifecycle/processor.go | 2 +- .../cisco-sdwan/report/metadata.go | 2 +- .../corechecks/networkpath/networkpath.go | 2 +- pkg/collector/corechecks/sbom/processor.go | 2 +- .../corechecks/sbom/processor_test.go | 2 +- .../corechecks/servicediscovery/events.go | 2 +- .../internal/report/report_device_metadata.go | 2 +- pkg/diagnose/runner.go | 4 +- .../invocationlifecycle/lifecycle_test.go | 3 +- pkg/serverless/logs/logs_test.go | 3 +- .../metrics/enhanced_metrics_test.go | 3 +- tasks/components.py | 1 + 74 files changed, 445 insertions(+), 400 deletions(-) rename comp/forwarder/eventplatform/{def => }/component.go (91%) rename comp/forwarder/eventplatform/{mock => }/component_mock.go (60%) rename comp/forwarder/eventplatform/{impl => eventplatformimpl}/epforwarder.go (90%) create mode 100644 comp/forwarder/eventplatform/eventplatformimpl/epforwarder_mock.go create mode 100644 comp/forwarder/eventplatform/eventplatformimpl/epforwarder_mockgen.go create mode 100644 comp/forwarder/eventplatform/eventplatformimpl/params.go delete mode 100644 comp/forwarder/eventplatform/fx-mock/fx.go delete mode 100644 comp/forwarder/eventplatform/fx-noop/fx.go delete mode 100644 comp/forwarder/eventplatform/fx/fx.go delete mode 100644 comp/forwarder/eventplatform/impl-noop/noop.go delete mode 100644 comp/forwarder/eventplatform/mock/epforwarder_mock.go delete mode 100644 comp/forwarder/eventplatform/mock/epforwarder_mockgen.go diff --git a/cmd/agent/subcommands/run/command.go b/cmd/agent/subcommands/run/command.go index 88c47aa47ef3a..9c126f014aab2 100644 --- a/cmd/agent/subcommands/run/command.go +++ b/cmd/agent/subcommands/run/command.go @@ -89,7 +89,7 @@ import ( dogstatsdStatusimpl "github.com/DataDog/datadog-agent/comp/dogstatsd/status/statusimpl" "github.com/DataDog/datadog-agent/comp/forwarder" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" langDetectionCl "github.com/DataDog/datadog-agent/comp/languagedetection/client" @@ -424,7 +424,7 @@ func getSharedFxOption() fx.Option { langDetectionClimpl.Module(), metadata.Bundle(), orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDefaultParams()), - eventplatformfx.Module(), + eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()), eventplatformreceiverimpl.Module(), // injecting the shared Serializer to FX until we migrate it to a proper component. This allows other diff --git a/cmd/agent/subcommands/snmp/command.go b/cmd/agent/subcommands/snmp/command.go index 516818867c618..4dba953403985 100644 --- a/cmd/agent/subcommands/snmp/command.go +++ b/cmd/agent/subcommands/snmp/command.go @@ -23,7 +23,7 @@ import ( nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/fx-noop" "github.com/DataDog/datadog-agent/comp/forwarder" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx" @@ -97,7 +97,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()), forwarder.Bundle(defaultforwarder.NewParams(defaultforwarder.WithFeatures(defaultforwarder.CoreFeatures))), orchestratorimpl.Module(orchestratorimpl.NewDefaultParams()), - eventplatformfx.Module(), + eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()), compressionfx.Module(), nooptagger.Module(), eventplatformreceiverimpl.Module(), @@ -160,7 +160,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { aggregator.Bundle(demultiplexerimpl.NewDefaultParams()), orchestratorimpl.Module(orchestratorimpl.NewDefaultParams()), forwarder.Bundle(defaultforwarder.NewParams(defaultforwarder.WithFeatures(defaultforwarder.CoreFeatures))), - eventplatformfx.Module(), + eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()), eventplatformreceiverimpl.Module(), compressionfx.Module(), nooptagger.Module(), diff --git a/cmd/cluster-agent-cloudfoundry/subcommands/run/command.go b/cmd/cluster-agent-cloudfoundry/subcommands/run/command.go index 9aa1076c8ec4a..b16485b36f9e4 100644 --- a/cmd/cluster-agent-cloudfoundry/subcommands/run/command.go +++ b/cmd/cluster-agent-cloudfoundry/subcommands/run/command.go @@ -46,7 +46,7 @@ import ( workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" "github.com/DataDog/datadog-agent/comp/forwarder" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformfxnoop "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-noop" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx" @@ -89,7 +89,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { compressionfx.Module(), demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()), orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDisabledParams()), - eventplatformfxnoop.Module(), + eventplatformimpl.Module(eventplatformimpl.NewDisabledParams()), eventplatformreceiverimpl.Module(), // setup workloadmeta diff --git a/cmd/cluster-agent/subcommands/start/command.go b/cmd/cluster-agent/subcommands/start/command.go index 98a671dad950d..f85419780b657 100644 --- a/cmd/cluster-agent/subcommands/start/command.go +++ b/cmd/cluster-agent/subcommands/start/command.go @@ -58,7 +58,7 @@ import ( workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" "github.com/DataDog/datadog-agent/comp/forwarder" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformfxnoop "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-noop" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx" @@ -141,7 +141,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { compressionfx.Module(), demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()), orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDefaultParams()), - eventplatformfxnoop.Module(), + eventplatformimpl.Module(eventplatformimpl.NewDisabledParams()), eventplatformreceiverimpl.Module(), // setup workloadmeta wmcatalog.GetCatalog(), diff --git a/cmd/dogstatsd/subcommands/start/command.go b/cmd/dogstatsd/subcommands/start/command.go index ea7fe59c8051a..245ff9139caff 100644 --- a/cmd/dogstatsd/subcommands/start/command.go +++ b/cmd/dogstatsd/subcommands/start/command.go @@ -40,7 +40,7 @@ import ( dogstatsdServer "github.com/DataDog/datadog-agent/comp/dogstatsd/server" "github.com/DataDog/datadog-agent/comp/forwarder" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformfxnoop "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-noop" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx" @@ -149,7 +149,7 @@ func RunDogstatsdFct(cliParams *CLIParams, defaultConfPath string, defaultLogFil )), secretsimpl.Module(), orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDisabledParams()), - eventplatformfxnoop.Module(), + eventplatformimpl.Module(eventplatformimpl.NewDisabledParams()), eventplatformreceiverimpl.Module(), hostnameimpl.Module(), localTaggerfx.Module(tagger.Params{}), diff --git a/cmd/process-agent/command/main_common.go b/cmd/process-agent/command/main_common.go index 5c8d983e90b95..188c9684fd30b 100644 --- a/cmd/process-agent/command/main_common.go +++ b/cmd/process-agent/command/main_common.go @@ -38,7 +38,7 @@ import ( workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" compstatsd "github.com/DataDog/datadog-agent/comp/dogstatsd/statsd" - eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" hostMetadataUtils "github.com/DataDog/datadog-agent/comp/metadata/host/hostimpl/utils" "github.com/DataDog/datadog-agent/comp/networkpath" @@ -134,7 +134,7 @@ func runApp(ctx context.Context, globalParams *GlobalParams) error { process.Bundle(), eventplatformreceiverimpl.Module(), - eventplatformfx.Module(), + eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()), // Provides the rdnssquerier module rdnsquerierfx.Module(), diff --git a/cmd/process-agent/subcommands/check/check.go b/cmd/process-agent/subcommands/check/check.go index 5f88b17cb11ef..ad2181d4ac90c 100644 --- a/cmd/process-agent/subcommands/check/check.go +++ b/cmd/process-agent/subcommands/check/check.go @@ -32,7 +32,7 @@ import ( wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" - eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" hostMetadataUtils "github.com/DataDog/datadog-agent/comp/metadata/host/hostimpl/utils" "github.com/DataDog/datadog-agent/comp/networkpath/npcollector" @@ -127,7 +127,7 @@ func MakeCommand(globalParamsGetter func() *command.GlobalParams, name string, a // Provide eventplatformimpl module eventplatformreceiverimpl.Module(), - eventplatformfx.Module(), + eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()), // Provide rdnsquerier module rdnsquerierfx.Module(), diff --git a/cmd/serverless-init/metric/metric_test.go b/cmd/serverless-init/metric/metric_test.go index 874e10c13316d..facd4acabca0c 100644 --- a/cmd/serverless-init/metric/metric_test.go +++ b/cmd/serverless-init/metric/metric_test.go @@ -14,6 +14,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" + "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl" log "github.com/DataDog/datadog-agent/comp/core/log/def" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" @@ -64,5 +65,5 @@ func TestAddShutdownMetric(t *testing.T) { } func createDemultiplexer(t *testing.T) demultiplexer.FakeSamplerMock { - return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule()) + return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule(), hostnameimpl.MockModule()) } diff --git a/comp/agent/bundle_test.go b/comp/agent/bundle_test.go index b392cba7ca396..8a1820206ee81 100644 --- a/comp/agent/bundle_test.go +++ b/comp/agent/bundle_test.go @@ -14,7 +14,7 @@ import ( workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" workloadmetafxmock "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx-mock" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" "github.com/DataDog/datadog-agent/pkg/util/fxutil" @@ -27,7 +27,7 @@ func TestBundleDependencies(t *testing.T) { compressionmock.MockModule(), defaultforwarder.MockModule(), orchestratorimpl.MockModule(), - eventplatformmock.MockModule(), + eventplatformimpl.MockModule(), demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()), workloadmetafxmock.MockModule(workloadmeta.NewParams()), ) diff --git a/comp/aggregator/bundle_test.go b/comp/aggregator/bundle_test.go index 0b4b33bae168d..2a38d5a0ac603 100644 --- a/comp/aggregator/bundle_test.go +++ b/comp/aggregator/bundle_test.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core" nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/fx-noop" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" @@ -25,7 +25,7 @@ func TestBundleDependencies(t *testing.T) { compressionmock.MockModule(), defaultforwarder.MockModule(), orchestratorForwarderImpl.MockModule(), - eventplatformmock.MockModule(), + eventplatformimpl.MockModule(), nooptagger.Module(), haagentmock.Module(), ) diff --git a/comp/aggregator/demultiplexer/demultiplexerimpl/demultiplexer.go b/comp/aggregator/demultiplexer/demultiplexerimpl/demultiplexer.go index 0b4dba5fafbb9..b6b1dd7d56310 100644 --- a/comp/aggregator/demultiplexer/demultiplexerimpl/demultiplexer.go +++ b/comp/aggregator/demultiplexer/demultiplexerimpl/demultiplexer.go @@ -18,7 +18,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/status" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" orchestratorforwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator" haagent "github.com/DataDog/datadog-agent/comp/haagent/def" compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" diff --git a/comp/aggregator/demultiplexer/demultiplexerimpl/demultiplexer_fake_sampler_mock.go b/comp/aggregator/demultiplexer/demultiplexerimpl/demultiplexer_fake_sampler_mock.go index e74314cf03f41..53e3beb5f77d6 100644 --- a/comp/aggregator/demultiplexer/demultiplexerimpl/demultiplexer_fake_sampler_mock.go +++ b/comp/aggregator/demultiplexer/demultiplexerimpl/demultiplexer_fake_sampler_mock.go @@ -14,6 +14,7 @@ import ( "go.uber.org/fx" demultiplexerComp "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" + "github.com/DataDog/datadog-agent/comp/core/hostname" log "github.com/DataDog/datadog-agent/comp/core/log/def" compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" "github.com/DataDog/datadog-agent/pkg/aggregator" @@ -34,6 +35,7 @@ type fakeSamplerMockDependencies struct { fx.In Lc fx.Lifecycle Log log.Component + Hostname hostname.Component Compressor compression.Component } @@ -54,7 +56,7 @@ func (f *fakeSamplerMock) Stop(flush bool) { } func newFakeSamplerMock(deps fakeSamplerMockDependencies) demultiplexerComp.FakeSamplerMock { - demux := initTestAgentDemultiplexerWithFlushInterval(deps.Log, deps.Compressor, time.Hour) + demux := initTestAgentDemultiplexerWithFlushInterval(deps.Log, deps.Hostname, deps.Compressor, time.Hour) mock := &fakeSamplerMock{ TestAgentDemultiplexer: demux, } diff --git a/comp/aggregator/demultiplexer/demultiplexerimpl/status_test.go b/comp/aggregator/demultiplexer/demultiplexerimpl/status_test.go index c22c827126590..0e60ca002a79e 100644 --- a/comp/aggregator/demultiplexer/demultiplexerimpl/status_test.go +++ b/comp/aggregator/demultiplexer/demultiplexerimpl/status_test.go @@ -18,7 +18,7 @@ import ( tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" taggerMock "github.com/DataDog/datadog-agent/comp/core/tagger/mock" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" @@ -64,7 +64,7 @@ func TestStatusOutPut(t *testing.T) { defaultforwarder.MockModule(), haagentmock.Module(), orchestratorimpl.MockModule(), - eventplatformmock.MockModule(), + eventplatformimpl.MockModule(), fx.Provide(func() tagger.Component { return mockTagger }), diff --git a/comp/aggregator/demultiplexer/demultiplexerimpl/test_agent_demultiplexer.go b/comp/aggregator/demultiplexer/demultiplexerimpl/test_agent_demultiplexer.go index f33ab36b0bf08..431bcdb8c06e2 100644 --- a/comp/aggregator/demultiplexer/demultiplexerimpl/test_agent_demultiplexer.go +++ b/comp/aggregator/demultiplexer/demultiplexerimpl/test_agent_demultiplexer.go @@ -12,11 +12,12 @@ import ( "sync" "time" + "github.com/DataDog/datadog-agent/comp/core/hostname" log "github.com/DataDog/datadog-agent/comp/core/log/def" noopimpl "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" - eventplatformock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" "github.com/DataDog/datadog-agent/pkg/aggregator" @@ -67,7 +68,7 @@ func (a *TestAgentDemultiplexer) AggregateSample(sample metrics.MetricSample) { } // GetEventPlatformForwarder returns a event platform forwarder -func (a *TestAgentDemultiplexer) GetEventPlatformForwarder() eventplatform.Component { +func (a *TestAgentDemultiplexer) GetEventPlatformForwarder() (eventplatform.Forwarder, error) { return a.AgentDemultiplexer.GetEventPlatformForwarder() } @@ -175,7 +176,7 @@ func (a *TestAgentDemultiplexer) Reset() { } // initTestAgentDemultiplexerWithFlushInterval inits a TestAgentDemultiplexer with the given flush interval. -func initTestAgentDemultiplexerWithFlushInterval(log log.Component, compressor compression.Component, flushInterval time.Duration) *TestAgentDemultiplexer { +func initTestAgentDemultiplexerWithFlushInterval(log log.Component, hostname hostname.Component, compressor compression.Component, flushInterval time.Duration) *TestAgentDemultiplexer { opts := aggregator.DefaultAgentDemultiplexerOptions() opts.FlushInterval = flushInterval opts.DontStartForwarders = true @@ -184,7 +185,7 @@ func initTestAgentDemultiplexerWithFlushInterval(log log.Component, compressor c sharedForwarderOptions := defaultforwarder.NewOptions(pkgconfigsetup.Datadog(), log, nil) sharedForwarder := defaultforwarder.NewDefaultForwarder(pkgconfigsetup.Datadog(), log, sharedForwarderOptions) orchestratorForwarder := optional.NewOption[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{}) - eventPlatformForwarder := eventplatformock.NewMock() + eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(hostname)) demux := aggregator.InitAndStartAgentDemultiplexer(log, sharedForwarder, &orchestratorForwarder, opts, eventPlatformForwarder, haagentmock.NewMockHaAgent(), compressor, noopimpl.NewComponent(), "hostname") return NewTestAgentDemultiplexer(demux) } diff --git a/comp/aggregator/diagnosesendermanager/diagnosesendermanagerimpl/sendermanager.go b/comp/aggregator/diagnosesendermanager/diagnosesendermanagerimpl/sendermanager.go index afb0a6c869105..9e3c058314c79 100644 --- a/comp/aggregator/diagnosesendermanager/diagnosesendermanagerimpl/sendermanager.go +++ b/comp/aggregator/diagnosesendermanager/diagnosesendermanagerimpl/sendermanager.go @@ -17,7 +17,8 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformnoop "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/impl-noop" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" haagent "github.com/DataDog/datadog-agent/comp/haagent/def" compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" "github.com/DataDog/datadog-agent/pkg/aggregator" @@ -73,7 +74,7 @@ func (sender *diagnoseSenderManager) LazyGetSenderManager() (sender.SenderManage haAgent := sender.deps.HaAgent forwarder := defaultforwarder.NewDefaultForwarder(config, log, defaultforwarder.NewOptions(config, log, nil)) orchestratorForwarder := optional.NewOptionPtr[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{}) - eventPlatformForwarder := eventplatformnoop.NewComponent() + eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(sender.deps.Hostname)) senderManager = aggregator.InitAndStartAgentDemultiplexer( log, forwarder, diff --git a/comp/collector/collector/collectorimpl/collector_demux_test.go b/comp/collector/collector/collectorimpl/collector_demux_test.go index b68f7a91e546a..ed91be6ef1ade 100644 --- a/comp/collector/collector/collectorimpl/collector_demux_test.go +++ b/comp/collector/collector/collectorimpl/collector_demux_test.go @@ -27,6 +27,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" + "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" "github.com/DataDog/datadog-agent/pkg/collector/check/stub" "github.com/DataDog/datadog-agent/pkg/metrics" @@ -81,7 +82,7 @@ func (s *SenderManagerProxy) GetDefaultSender() (sender.Sender, error) { } func (suite *CollectorDemuxTestSuite) SetupTest() { - suite.demux = fxutil.Test[demultiplexer.FakeSamplerMock](suite.T(), fx.Provide(func() log.Component { return logmock.New(suite.T()) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule()) + suite.demux = fxutil.Test[demultiplexer.FakeSamplerMock](suite.T(), fx.Provide(func() log.Component { return logmock.New(suite.T()) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule(), hostnameimpl.MockModule()) suite.SenderManagerMock = NewSenderManagerMock(suite.demux) suite.c = newCollector(fxutil.Test[dependencies](suite.T(), core.MockBundle(), diff --git a/comp/forwarder/eventplatform/def/component.go b/comp/forwarder/eventplatform/component.go similarity index 91% rename from comp/forwarder/eventplatform/def/component.go rename to comp/forwarder/eventplatform/component.go index 1132f6afed912..65bb1c26d4b21 100644 --- a/comp/forwarder/eventplatform/def/component.go +++ b/comp/forwarder/eventplatform/component.go @@ -36,10 +36,14 @@ const ( EventTypeServiceDiscovery = "service-discovery" ) -//go:generate mockgen -source=../def/$GOFILE -package=mock -destination=../mock/epforwarder_mockgen.go - // Component is the interface of the event platform forwarder component. type Component interface { + // Get the forwarder instance if it exists. + Get() (Forwarder, bool) +} + +// Forwarder is the interface of the event platform forwarder. +type Forwarder interface { SendEventPlatformEvent(e *message.Message, eventType string) error SendEventPlatformEventBlocking(e *message.Message, eventType string) error Purge() map[string][]*message.Message diff --git a/comp/forwarder/eventplatform/mock/component_mock.go b/comp/forwarder/eventplatform/component_mock.go similarity index 60% rename from comp/forwarder/eventplatform/mock/component_mock.go rename to comp/forwarder/eventplatform/component_mock.go index e662cec2c630b..c8cf64fe4d5e3 100644 --- a/comp/forwarder/eventplatform/mock/component_mock.go +++ b/comp/forwarder/eventplatform/component_mock.go @@ -3,12 +3,11 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2023-present Datadog, Inc. -// Package mock provides the mock interafce for the event platform component. -package mock +//go:build test -import eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" +package eventplatform // Mock implements mock-specific methods. type Mock interface { - eventplatform.Component + Component } diff --git a/comp/forwarder/eventplatform/impl/epforwarder.go b/comp/forwarder/eventplatform/eventplatformimpl/epforwarder.go similarity index 90% rename from comp/forwarder/eventplatform/impl/epforwarder.go rename to comp/forwarder/eventplatform/eventplatformimpl/epforwarder.go index 18042c15df4aa..9c4fb0d451ed5 100644 --- a/comp/forwarder/eventplatform/impl/epforwarder.go +++ b/comp/forwarder/eventplatform/eventplatformimpl/epforwarder.go @@ -13,11 +13,13 @@ import ( "strings" "sync" + "go.uber.org/fx" + configcomp "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface" - compdef "github.com/DataDog/datadog-agent/comp/def" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" "github.com/DataDog/datadog-agent/comp/logs/agent/config" "github.com/DataDog/datadog-agent/pkg/config/model" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" @@ -28,10 +30,19 @@ import ( "github.com/DataDog/datadog-agent/pkg/logs/message" "github.com/DataDog/datadog-agent/pkg/logs/metrics" "github.com/DataDog/datadog-agent/pkg/logs/sender" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/DataDog/datadog-agent/pkg/util/optional" "github.com/DataDog/datadog-agent/pkg/util/startstop" ) +//go:generate mockgen -source=$GOFILE -package=$GOPACKAGE -destination=epforwarder_mockgen.go + +// Module defines the fx options for this component. +func Module(params Params) fxutil.Module { + return fxutil.Component(fx.Provide(newEventPlatformForwarder), fx.Supply(params)) +} + const ( eventTypeDBMSamples = "dbm-samples" eventTypeDBMMetrics = "dbm-metrics" @@ -319,14 +330,14 @@ func (s *defaultEventPlatformForwarder) Purge() map[string][]*message.Message { return result } -func (s *defaultEventPlatformForwarder) start() { +func (s *defaultEventPlatformForwarder) Start() { s.destinationsCtx.Start() for _, p := range s.pipelines { p.Start() } } -func (s *defaultEventPlatformForwarder) stop() { +func (s *defaultEventPlatformForwarder) Stop() { log.Debugf("shutting down event platform forwarder") stopper := startstop.NewParallelStopper() for _, p := range s.pipelines { @@ -478,28 +489,51 @@ func newDefaultEventPlatformForwarder(config model.Reader, eventPlatformReceiver } } -// Requires defined the eventplatform requirements -type Requires struct { - compdef.In +type dependencies struct { + fx.In + Params Params Config configcomp.Component - Lc compdef.Lifecycle + Lc fx.Lifecycle EventPlatformReceiver eventplatformreceiver.Component Hostname hostnameinterface.Component } -// NewComponent creates a new EventPlatformForwarder -func NewComponent(reqs Requires) eventplatform.Component { - forwarder := newDefaultEventPlatformForwarder(reqs.Config, reqs.EventPlatformReceiver) +// newEventPlatformForwarder creates a new EventPlatformForwarder +func newEventPlatformForwarder(deps dependencies) eventplatform.Component { + var forwarder *defaultEventPlatformForwarder - reqs.Lc.Append(compdef.Hook{ + if deps.Params.UseNoopEventPlatformForwarder { + forwarder = newNoopEventPlatformForwarder(deps.Hostname) + } else if deps.Params.UseEventPlatformForwarder { + forwarder = newDefaultEventPlatformForwarder(deps.Config, deps.EventPlatformReceiver) + } + if forwarder == nil { + return optional.NewNoneOptionPtr[eventplatform.Forwarder]() + } + deps.Lc.Append(fx.Hook{ OnStart: func(context.Context) error { - forwarder.start() + forwarder.Start() return nil }, OnStop: func(context.Context) error { - forwarder.stop() + forwarder.Stop() return nil }, }) - return forwarder + return optional.NewOptionPtr[eventplatform.Forwarder](forwarder) +} + +// NewNoopEventPlatformForwarder returns the standard event platform forwarder with sending disabled, meaning events +// will build up in each pipeline channel without being forwarded to the intake +func NewNoopEventPlatformForwarder(hostname hostnameinterface.Component) eventplatform.Forwarder { + return newNoopEventPlatformForwarder(hostname) +} + +func newNoopEventPlatformForwarder(hostname hostnameinterface.Component) *defaultEventPlatformForwarder { + f := newDefaultEventPlatformForwarder(pkgconfigsetup.Datadog(), eventplatformreceiverimpl.NewReceiver(hostname).Comp) + // remove the senders + for _, p := range f.pipelines { + p.strategy = nil + } + return f } diff --git a/comp/forwarder/eventplatform/eventplatformimpl/epforwarder_mock.go b/comp/forwarder/eventplatform/eventplatformimpl/epforwarder_mock.go new file mode 100644 index 0000000000000..2d4d6d296ca7e --- /dev/null +++ b/comp/forwarder/eventplatform/eventplatformimpl/epforwarder_mock.go @@ -0,0 +1,27 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +//go:build test + +package eventplatformimpl + +import ( + "github.com/DataDog/datadog-agent/comp/core/hostname" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" + "github.com/DataDog/datadog-agent/pkg/util/optional" + "go.uber.org/fx" +) + +// MockModule defines the fx options for the mock component. +func MockModule() fxutil.Module { + return fxutil.Component( + fx.Provide(newMockComponent), + ) +} + +func newMockComponent(hostname hostname.Component) eventplatform.Component { + return optional.NewOptionPtr[eventplatform.Forwarder](NewNoopEventPlatformForwarder(hostname)) +} diff --git a/comp/forwarder/eventplatform/eventplatformimpl/epforwarder_mockgen.go b/comp/forwarder/eventplatform/eventplatformimpl/epforwarder_mockgen.go new file mode 100644 index 0000000000000..2c196bdad5aa5 --- /dev/null +++ b/comp/forwarder/eventplatform/eventplatformimpl/epforwarder_mockgen.go @@ -0,0 +1,101 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: epforwarder.go + +// Package eventplatformimpl is a generated GoMock package. +package eventplatformimpl + +import ( + reflect "reflect" + + message "github.com/DataDog/datadog-agent/pkg/logs/message" + gomock "github.com/golang/mock/gomock" +) + +// MockEventPlatformForwarder is a mock of EventPlatformForwarder interface. +type MockEventPlatformForwarder struct { + ctrl *gomock.Controller + recorder *MockEventPlatformForwarderMockRecorder +} + +// MockEventPlatformForwarderMockRecorder is the mock recorder for MockEventPlatformForwarder. +type MockEventPlatformForwarderMockRecorder struct { + mock *MockEventPlatformForwarder +} + +// NewMockEventPlatformForwarder creates a new mock instance. +func NewMockEventPlatformForwarder(ctrl *gomock.Controller) *MockEventPlatformForwarder { + mock := &MockEventPlatformForwarder{ctrl: ctrl} + mock.recorder = &MockEventPlatformForwarderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockEventPlatformForwarder) EXPECT() *MockEventPlatformForwarderMockRecorder { + return m.recorder +} + +// Purge mocks base method. +func (m *MockEventPlatformForwarder) Purge() map[string][]*message.Message { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Purge") + ret0, _ := ret[0].(map[string][]*message.Message) + return ret0 +} + +// Purge indicates an expected call of Purge. +func (mr *MockEventPlatformForwarderMockRecorder) Purge() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Purge", reflect.TypeOf((*MockEventPlatformForwarder)(nil).Purge)) +} + +// SendEventPlatformEvent mocks base method. +func (m *MockEventPlatformForwarder) SendEventPlatformEvent(e *message.Message, eventType string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendEventPlatformEvent", e, eventType) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendEventPlatformEvent indicates an expected call of SendEventPlatformEvent. +func (mr *MockEventPlatformForwarderMockRecorder) SendEventPlatformEvent(e, eventType interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendEventPlatformEvent", reflect.TypeOf((*MockEventPlatformForwarder)(nil).SendEventPlatformEvent), e, eventType) +} + +// SendEventPlatformEventBlocking mocks base method. +func (m *MockEventPlatformForwarder) SendEventPlatformEventBlocking(e *message.Message, eventType string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendEventPlatformEventBlocking", e, eventType) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendEventPlatformEventBlocking indicates an expected call of SendEventPlatformEventBlocking. +func (mr *MockEventPlatformForwarderMockRecorder) SendEventPlatformEventBlocking(e, eventType interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendEventPlatformEventBlocking", reflect.TypeOf((*MockEventPlatformForwarder)(nil).SendEventPlatformEventBlocking), e, eventType) +} + +// Start mocks base method. +func (m *MockEventPlatformForwarder) Start() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Start") +} + +// Start indicates an expected call of Start. +func (mr *MockEventPlatformForwarderMockRecorder) Start() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockEventPlatformForwarder)(nil).Start)) +} + +// Stop mocks base method. +func (m *MockEventPlatformForwarder) Stop() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Stop") +} + +// Stop indicates an expected call of Stop. +func (mr *MockEventPlatformForwarderMockRecorder) Stop() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockEventPlatformForwarder)(nil).Stop)) +} diff --git a/comp/forwarder/eventplatform/eventplatformimpl/params.go b/comp/forwarder/eventplatform/eventplatformimpl/params.go new file mode 100644 index 0000000000000..108f9e4b228d7 --- /dev/null +++ b/comp/forwarder/eventplatform/eventplatformimpl/params.go @@ -0,0 +1,22 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2023-present Datadog, Inc. + +package eventplatformimpl + +// Params defines the parameters for the event platform forwarder. +type Params struct { + UseNoopEventPlatformForwarder bool + UseEventPlatformForwarder bool +} + +// NewDefaultParams returns the default parameters for the event platform forwarder. +func NewDefaultParams() Params { + return Params{UseEventPlatformForwarder: true, UseNoopEventPlatformForwarder: false} +} + +// NewDisabledParams returns the disabled parameters for the event platform forwarder. +func NewDisabledParams() Params { + return Params{UseEventPlatformForwarder: false, UseNoopEventPlatformForwarder: false} +} diff --git a/comp/forwarder/eventplatform/fx-mock/fx.go b/comp/forwarder/eventplatform/fx-mock/fx.go deleted file mode 100644 index eb837f131e500..0000000000000 --- a/comp/forwarder/eventplatform/fx-mock/fx.go +++ /dev/null @@ -1,21 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2024-present Datadog, Inc. - -// Package fx provides the fxmock module for the rdnsquerier component -package fx - -import ( - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" - "github.com/DataDog/datadog-agent/pkg/util/fxutil" -) - -// MockModule defines the fx options for the mock component. -func MockModule() fxutil.Module { - return fxutil.Component( - fxutil.ProvideComponentConstructor( - eventplatformmock.NewMock, - ), - ) -} diff --git a/comp/forwarder/eventplatform/fx-noop/fx.go b/comp/forwarder/eventplatform/fx-noop/fx.go deleted file mode 100644 index 76e656b46ef53..0000000000000 --- a/comp/forwarder/eventplatform/fx-noop/fx.go +++ /dev/null @@ -1,21 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2024-present Datadog, Inc. - -// Package fx provides the fxnoop module for the rdnsquerier component -package fx - -import ( - eventplatformnoop "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/impl-noop" - "github.com/DataDog/datadog-agent/pkg/util/fxutil" -) - -// Module defines the fx options for the mock component. -func Module() fxutil.Module { - return fxutil.Component( - fxutil.ProvideComponentConstructor( - eventplatformnoop.NewComponent, - ), - ) -} diff --git a/comp/forwarder/eventplatform/fx/fx.go b/comp/forwarder/eventplatform/fx/fx.go deleted file mode 100644 index 74e287dbb79cb..0000000000000 --- a/comp/forwarder/eventplatform/fx/fx.go +++ /dev/null @@ -1,17 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -// Package fx provides the fx module for the event platform component. -package fx - -import ( - eventplatformimpl "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/impl" - "github.com/DataDog/datadog-agent/pkg/util/fxutil" -) - -// Module defines the fx options for this component. -func Module() fxutil.Module { - return fxutil.Component(fxutil.ProvideComponentConstructor(eventplatformimpl.NewComponent)) -} diff --git a/comp/forwarder/eventplatform/impl-noop/noop.go b/comp/forwarder/eventplatform/impl-noop/noop.go deleted file mode 100644 index 7d6ed39c04940..0000000000000 --- a/comp/forwarder/eventplatform/impl-noop/noop.go +++ /dev/null @@ -1,39 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -// Package eventplatformimpl contains the logic for the noop forwarding component -package eventplatformimpl - -import ( - "errors" - - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" - "github.com/DataDog/datadog-agent/pkg/logs/message" -) - -type noopForwarder struct { -} - -// SendEventPlatformEvent sends messages to the event platform intake. -// SendEventPlatformEvent will drop messages and return an error if the input channel is already full. -func (s *noopForwarder) SendEventPlatformEvent(*message.Message, string) error { - return errors.New("noop forwarder does not support SendEventPlatformEvent") -} - -// SendEventPlatformEventBlocking sends messages to the event platform intake. -// SendEventPlatformEventBlocking will block if the input channel is already full. -func (s *noopForwarder) SendEventPlatformEventBlocking(*message.Message, string) error { - return errors.New("noop forwarder does not support SendEventPlatformEventBlocking") -} - -// Purge clears out all pipeline channels, returning a map of eventType to list of messages in that were removed from each channel -func (s *noopForwarder) Purge() map[string][]*message.Message { - return map[string][]*message.Message{} -} - -// NewComponent creates a new EventPlatformForwarder -func NewComponent() eventplatform.Component { - return &noopForwarder{} -} diff --git a/comp/forwarder/eventplatform/mock/epforwarder_mock.go b/comp/forwarder/eventplatform/mock/epforwarder_mock.go deleted file mode 100644 index 659a458a61a00..0000000000000 --- a/comp/forwarder/eventplatform/mock/epforwarder_mock.go +++ /dev/null @@ -1,36 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -package mock - -import ( - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" - message "github.com/DataDog/datadog-agent/pkg/logs/message" -) - -type mock struct { -} - -// SendEventPlatformEvent sends messages to the event platform intake. -// SendEventPlatformEvent will drop messages and return an error if the input channel is already full. -func (s *mock) SendEventPlatformEvent(*message.Message, string) error { - return nil -} - -// SendEventPlatformEventBlocking sends messages to the event platform intake. -// SendEventPlatformEventBlocking will block if the input channel is already full. -func (s *mock) SendEventPlatformEventBlocking(*message.Message, string) error { - return nil -} - -// Purge clears out all pipeline channels, returning a map of eventType to list of messages in that were removed from each channel -func (s *mock) Purge() map[string][]*message.Message { - return map[string][]*message.Message{} -} - -// NewMock returns a new mock component. -func NewMock() eventplatform.Component { - return &mock{} -} diff --git a/comp/forwarder/eventplatform/mock/epforwarder_mockgen.go b/comp/forwarder/eventplatform/mock/epforwarder_mockgen.go deleted file mode 100644 index e1dabb87b6592..0000000000000 --- a/comp/forwarder/eventplatform/mock/epforwarder_mockgen.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: ../def/component.go - -// Package mock is a generated GoMock package. -package mock - -import ( - reflect "reflect" - - message "github.com/DataDog/datadog-agent/pkg/logs/message" - gomock "github.com/golang/mock/gomock" -) - -// MockComponent is a mock of Component interface. -type MockComponent struct { - ctrl *gomock.Controller - recorder *MockComponentMockRecorder -} - -// MockComponentMockRecorder is the mock recorder for MockComponent. -type MockComponentMockRecorder struct { - mock *MockComponent -} - -// NewMockComponent creates a new mock instance. -func NewMockComponent(ctrl *gomock.Controller) *MockComponent { - mock := &MockComponent{ctrl: ctrl} - mock.recorder = &MockComponentMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockComponent) EXPECT() *MockComponentMockRecorder { - return m.recorder -} - -// Purge mocks base method. -func (m *MockComponent) Purge() map[string][]*message.Message { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Purge") - ret0, _ := ret[0].(map[string][]*message.Message) - return ret0 -} - -// Purge indicates an expected call of Purge. -func (mr *MockComponentMockRecorder) Purge() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Purge", reflect.TypeOf((*MockComponent)(nil).Purge)) -} - -// SendEventPlatformEvent mocks base method. -func (m *MockComponent) SendEventPlatformEvent(e *message.Message, eventType string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendEventPlatformEvent", e, eventType) - ret0, _ := ret[0].(error) - return ret0 -} - -// SendEventPlatformEvent indicates an expected call of SendEventPlatformEvent. -func (mr *MockComponentMockRecorder) SendEventPlatformEvent(e, eventType interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendEventPlatformEvent", reflect.TypeOf((*MockComponent)(nil).SendEventPlatformEvent), e, eventType) -} - -// SendEventPlatformEventBlocking mocks base method. -func (m *MockComponent) SendEventPlatformEventBlocking(e *message.Message, eventType string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendEventPlatformEventBlocking", e, eventType) - ret0, _ := ret[0].(error) - return ret0 -} - -// SendEventPlatformEventBlocking indicates an expected call of SendEventPlatformEventBlocking. -func (mr *MockComponentMockRecorder) SendEventPlatformEventBlocking(e, eventType interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendEventPlatformEventBlocking", reflect.TypeOf((*MockComponent)(nil).SendEventPlatformEventBlocking), e, eventType) -} diff --git a/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl/format.go b/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl/format.go index e3529345a94ad..940757de88d16 100644 --- a/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl/format.go +++ b/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl/format.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/agent-payload/v5/sbom" "google.golang.org/protobuf/proto" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/logs/message" ) diff --git a/comp/ndmtmp/bundle_test.go b/comp/ndmtmp/bundle_test.go index 57d0999b2d2a1..c0bd689899558 100644 --- a/comp/ndmtmp/bundle_test.go +++ b/comp/ndmtmp/bundle_test.go @@ -8,15 +8,14 @@ package ndmtmp import ( "testing" - "go.uber.org/fx" - "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" "github.com/DataDog/datadog-agent/comp/core" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" ddagg "github.com/DataDog/datadog-agent/pkg/aggregator" "github.com/DataDog/datadog-agent/pkg/util/fxutil" + "go.uber.org/fx" ) func TestBundleDependencies(t *testing.T) { @@ -24,7 +23,7 @@ func TestBundleDependencies(t *testing.T) { demultiplexerimpl.MockModule(), orchestratorForwarderImpl.MockModule(), defaultforwarder.MockModule(), - eventplatformmock.MockModule(), + eventplatformimpl.MockModule(), core.MockBundle(), ) } diff --git a/comp/ndmtmp/forwarder/component.go b/comp/ndmtmp/forwarder/component.go index fe0dbcdfe9d2e..e8f535198e85b 100644 --- a/comp/ndmtmp/forwarder/component.go +++ b/comp/ndmtmp/forwarder/component.go @@ -7,12 +7,12 @@ package forwarder import ( - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" ) // team: ndm-core // Component is the component type. type Component interface { - eventplatform.Component + eventplatform.Forwarder } diff --git a/comp/ndmtmp/forwarder/component_mock.go b/comp/ndmtmp/forwarder/component_mock.go index 9043d58474584..5df873226a3f1 100644 --- a/comp/ndmtmp/forwarder/component_mock.go +++ b/comp/ndmtmp/forwarder/component_mock.go @@ -6,11 +6,11 @@ // Package forwarder exposes the event platform forwarder for netflow. package forwarder -import "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" +import "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" // MockComponent is the type for mock components. // It is a gomock-generated mock of EventPlatformForwarder. type MockComponent interface { Component - EXPECT() *mock.MockComponentMockRecorder + EXPECT() *eventplatformimpl.MockEventPlatformForwarderMockRecorder } diff --git a/comp/ndmtmp/forwarder/forwarderimpl/forwarder.go b/comp/ndmtmp/forwarder/forwarderimpl/forwarder.go index 2652a75a1a413..a34fe908b1222 100644 --- a/comp/ndmtmp/forwarder/forwarderimpl/forwarder.go +++ b/comp/ndmtmp/forwarder/forwarderimpl/forwarder.go @@ -7,11 +7,10 @@ package forwarderimpl import ( - "go.uber.org/fx" - "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/ndmtmp/forwarder" "github.com/DataDog/datadog-agent/pkg/util/fxutil" + "go.uber.org/fx" ) // Module defines the fx options for this component. @@ -20,6 +19,6 @@ func Module() fxutil.Module { fx.Provide(getForwarder)) } -func getForwarder(agg demultiplexer.Component) forwarder.Component { +func getForwarder(agg demultiplexer.Component) (forwarder.Component, error) { return agg.GetEventPlatformForwarder() } diff --git a/comp/ndmtmp/forwarder/forwarderimpl/forwarder_mock.go b/comp/ndmtmp/forwarder/forwarderimpl/forwarder_mock.go index d6e2be374edc3..a7efc1b2f8d2f 100644 --- a/comp/ndmtmp/forwarder/forwarderimpl/forwarder_mock.go +++ b/comp/ndmtmp/forwarder/forwarderimpl/forwarder_mock.go @@ -10,17 +10,16 @@ package forwarderimpl import ( "testing" - "github.com/golang/mock/gomock" - "go.uber.org/fx" - - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/ndmtmp/forwarder" "github.com/DataDog/datadog-agent/pkg/util/fxutil" + "github.com/golang/mock/gomock" + "go.uber.org/fx" ) func getMockForwarder(t testing.TB) forwarder.MockComponent { ctrl := gomock.NewController(t) - return eventplatformmock.NewMockComponent(ctrl) + return eventplatformimpl.NewMockEventPlatformForwarder(ctrl) } // MockModule defines a component with a mock forwarder diff --git a/comp/netflow/flowaggregator/aggregator.go b/comp/netflow/flowaggregator/aggregator.go index 8c64ab30a3cc8..93afc304748b8 100644 --- a/comp/netflow/flowaggregator/aggregator.go +++ b/comp/netflow/flowaggregator/aggregator.go @@ -17,7 +17,7 @@ import ( "go.uber.org/atomic" log "github.com/DataDog/datadog-agent/comp/core/log/def" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/comp/netflow/format" rdnsquerier "github.com/DataDog/datadog-agent/comp/rdnsquerier/def" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" @@ -41,7 +41,7 @@ type FlowAggregator struct { rollupTrackerRefreshInterval time.Duration flowAcc *flowAccumulator sender sender.Sender - epForwarder eventplatform.Component + epForwarder eventplatform.Forwarder stopChan chan struct{} flushLoopDone chan struct{} runDone chan struct{} @@ -78,7 +78,7 @@ var maxNegativeSequenceDiffToReset = map[common.FlowType]int{ } // NewFlowAggregator returns a new FlowAggregator -func NewFlowAggregator(sender sender.Sender, epForwarder eventplatform.Component, config *config.NetflowConfig, hostname string, logger log.Component, rdnsQuerier rdnsquerier.Component) *FlowAggregator { +func NewFlowAggregator(sender sender.Sender, epForwarder eventplatform.Forwarder, config *config.NetflowConfig, hostname string, logger log.Component, rdnsQuerier rdnsquerier.Component) *FlowAggregator { flushInterval := time.Duration(config.AggregatorFlushInterval) * time.Second flowContextTTL := time.Duration(config.AggregatorFlowContextTTL) * time.Second rollupTrackerRefreshInterval := time.Duration(config.AggregatorRollupTrackerRefreshInterval) * time.Second diff --git a/comp/netflow/flowaggregator/aggregator_test.go b/comp/netflow/flowaggregator/aggregator_test.go index 25a233880264b..181915ab3f628 100644 --- a/comp/netflow/flowaggregator/aggregator_test.go +++ b/comp/netflow/flowaggregator/aggregator_test.go @@ -30,7 +30,7 @@ import ( "github.com/stretchr/testify/require" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" "github.com/DataDog/datadog-agent/pkg/logs/message" "github.com/DataDog/datadog-agent/pkg/util/fxutil" @@ -87,7 +87,7 @@ func TestAggregator(t *testing.T) { TCPFlags: 19, EtherType: uint32(0x0800), } - epForwarder := eventplatformmock.NewMockComponent(gomock.NewController(t)) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(gomock.NewController(t)) // language=json event := []byte(` @@ -246,7 +246,7 @@ func TestAggregator_withMockPayload(t *testing.T) { }, } ctrl := gomock.NewController(t) - epForwarder := eventplatformmock.NewMockComponent(ctrl) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(ctrl) testutil.ExpectNetflow5Payloads(t, epForwarder) @@ -363,7 +363,7 @@ func TestFlowAggregator_flush_submitCollectorMetrics_error(t *testing.T) { } ctrl := gomock.NewController(t) - epForwarder := eventplatformmock.NewMockComponent(ctrl) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(ctrl) aggregator := NewFlowAggregator(sender, epForwarder, &conf, "my-hostname", logger, rdnsQuerier) aggregator.goflowPrometheusGatherer = prometheus.GathererFunc(func() ([]*promClient.MetricFamily, error) { @@ -402,7 +402,7 @@ func TestFlowAggregator_submitCollectorMetrics(t *testing.T) { } ctrl := gomock.NewController(t) - epForwarder := eventplatformmock.NewMockComponent(ctrl) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(ctrl) logger := logmock.New(t) rdnsQuerier := fxutil.Test[rdnsquerier.Component](t, rdnsquerierfxmock.MockModule()) @@ -479,7 +479,7 @@ func TestFlowAggregator_submitCollectorMetrics_error(t *testing.T) { } ctrl := gomock.NewController(t) - epForwarder := eventplatformmock.NewMockComponent(ctrl) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(ctrl) logger := logmock.New(t) rdnsQuerier := fxutil.Test[rdnsquerier.Component](t, rdnsquerierfxmock.MockModule()) @@ -514,7 +514,7 @@ func TestFlowAggregator_sendExporterMetadata_multiplePayloads(t *testing.T) { } ctrl := gomock.NewController(t) - epForwarder := eventplatformmock.NewMockComponent(ctrl) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(ctrl) logger := logmock.New(t) rdnsQuerier := fxutil.Test[rdnsquerier.Component](t, rdnsquerierfxmock.MockModule()) @@ -599,7 +599,7 @@ func TestFlowAggregator_sendExporterMetadata_noPayloads(t *testing.T) { } ctrl := gomock.NewController(t) - epForwarder := eventplatformmock.NewMockComponent(ctrl) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(ctrl) logger := logmock.New(t) rdnsQuerier := fxutil.Test[rdnsquerier.Component](t, rdnsquerierfxmock.MockModule()) @@ -632,7 +632,7 @@ func TestFlowAggregator_sendExporterMetadata_invalidIPIgnored(t *testing.T) { } ctrl := gomock.NewController(t) - epForwarder := eventplatformmock.NewMockComponent(ctrl) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(ctrl) logger := logmock.New(t) rdnsQuerier := fxutil.Test[rdnsquerier.Component](t, rdnsquerierfxmock.MockModule()) @@ -717,7 +717,7 @@ func TestFlowAggregator_sendExporterMetadata_multipleNamespaces(t *testing.T) { } ctrl := gomock.NewController(t) - epForwarder := eventplatformmock.NewMockComponent(ctrl) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(ctrl) logger := logmock.New(t) rdnsQuerier := fxutil.Test[rdnsquerier.Component](t, rdnsquerierfxmock.MockModule()) @@ -821,7 +821,7 @@ func TestFlowAggregator_sendExporterMetadata_singleExporterIpWithMultipleFlowTyp } ctrl := gomock.NewController(t) - epForwarder := eventplatformmock.NewMockComponent(ctrl) + epForwarder := eventplatformimpl.NewMockEventPlatformForwarder(ctrl) logger := logmock.New(t) rdnsQuerier := fxutil.Test[rdnsquerier.Component](t, rdnsquerierfxmock.MockModule()) diff --git a/comp/netflow/server/integration_test.go b/comp/netflow/server/integration_test.go index 8fc5a8e9aed36..5945207807db6 100644 --- a/comp/netflow/server/integration_test.go +++ b/comp/netflow/server/integration_test.go @@ -13,15 +13,14 @@ import ( "testing" "time" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/netflow/goflowlib" + "github.com/DataDog/datadog-agent/comp/netflow/goflowlib/netflowstate" "github.com/netsampler/goflow2/decoders/netflow/templates" "github.com/netsampler/goflow2/utils" "github.com/sirupsen/logrus" "go.uber.org/atomic" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" - "github.com/DataDog/datadog-agent/comp/netflow/goflowlib" - "github.com/DataDog/datadog-agent/comp/netflow/goflowlib/netflowstate" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/comp/netflow/testutil/testutil.go b/comp/netflow/testutil/testutil.go index 1bc3ad9242331..dedee4f79f427 100644 --- a/comp/netflow/testutil/testutil.go +++ b/comp/netflow/testutil/testutil.go @@ -25,7 +25,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/logs/message" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/comp/ndmtmp/forwarder" "github.com/DataDog/datadog-agent/comp/netflow/payload" ) diff --git a/comp/networkpath/bundle_test.go b/comp/networkpath/bundle_test.go index 49e160d2b5ef4..6eb6868e8acba 100644 --- a/comp/networkpath/bundle_test.go +++ b/comp/networkpath/bundle_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/DataDog/datadog-agent/comp/core" - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" rdnsquerier "github.com/DataDog/datadog-agent/comp/rdnsquerier/fx-mock" "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) @@ -17,7 +17,7 @@ import ( func TestBundleDependencies(t *testing.T) { fxutil.TestBundle(t, Bundle(), core.MockBundle(), - eventplatformmock.MockModule(), + eventplatformimpl.MockModule(), rdnsquerier.MockModule(), ) } diff --git a/comp/networkpath/npcollector/npcollectorimpl/npcollector.go b/comp/networkpath/npcollector/npcollectorimpl/npcollector.go index eb4ded2939a94..4ee787e567320 100644 --- a/comp/networkpath/npcollector/npcollectorimpl/npcollector.go +++ b/comp/networkpath/npcollector/npcollectorimpl/npcollector.go @@ -19,7 +19,7 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" telemetryComp "github.com/DataDog/datadog-agent/comp/core/telemetry" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/comp/networkpath/npcollector/npcollectorimpl/common" "github.com/DataDog/datadog-agent/comp/networkpath/npcollector/npcollectorimpl/pathteststore" rdnsquerier "github.com/DataDog/datadog-agent/comp/rdnsquerier/def" @@ -43,7 +43,7 @@ type npCollectorImpl struct { collectorConfigs *collectorConfigs // Deps - epForwarder eventplatform.Component + epForwarder eventplatform.Forwarder logger log.Component metricSender metricsender.MetricSender statsdClient ddgostatsd.ClientInterface @@ -84,7 +84,7 @@ func newNoopNpCollectorImpl() *npCollectorImpl { } } -func newNpCollectorImpl(epForwarder eventplatform.Component, collectorConfigs *collectorConfigs, logger log.Component, telemetrycomp telemetryComp.Component, rdnsquerier rdnsquerier.Component) *npCollectorImpl { +func newNpCollectorImpl(epForwarder eventplatform.Forwarder, collectorConfigs *collectorConfigs, logger log.Component, telemetrycomp telemetryComp.Component, rdnsquerier rdnsquerier.Component) *npCollectorImpl { logger.Infof("New NpCollector (workers=%d timeout=%d max_ttl=%d input_chan_size=%d processing_chan_size=%d pathtest_contexts_limit=%d pathtest_ttl=%s pathtest_interval=%s flush_interval=%s reverse_dns_enabled=%t reverse_dns_timeout=%d)", collectorConfigs.workers, collectorConfigs.timeout, diff --git a/comp/networkpath/npcollector/npcollectorimpl/npcollector_test.go b/comp/networkpath/npcollector/npcollectorimpl/npcollector_test.go index b774c71b84f5a..390ce1c8684f4 100644 --- a/comp/networkpath/npcollector/npcollectorimpl/npcollector_test.go +++ b/comp/networkpath/npcollector/npcollectorimpl/npcollector_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/comp/core/telemetry" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/networkpath/npcollector/npcollectorimpl/common" "github.com/DataDog/datadog-agent/comp/networkpath/npcollector/npcollectorimpl/pathteststore" rdnsquerier "github.com/DataDog/datadog-agent/comp/rdnsquerier/def" @@ -91,7 +91,7 @@ func Test_NpCollector_runningAndProcessing(t *testing.T) { stats := &teststatsd.Client{} - mockEpForwarder := eventplatformmock.NewMockComponent(gomock.NewController(t)) + mockEpForwarder := eventplatformimpl.NewMockEventPlatformForwarder(gomock.NewController(t)) npCollector.epForwarder = mockEpForwarder app.RequireStart() diff --git a/comp/networkpath/npcollector/npcollectorimpl/npcollector_testutils.go b/comp/networkpath/npcollector/npcollectorimpl/npcollector_testutils.go index 3075c06bc75ce..16d777c11fd79 100644 --- a/comp/networkpath/npcollector/npcollectorimpl/npcollector_testutils.go +++ b/comp/networkpath/npcollector/npcollectorimpl/npcollector_testutils.go @@ -15,18 +15,17 @@ import ( "time" model "github.com/DataDog/agent-payload/v5/process" - "github.com/stretchr/testify/require" - "go.uber.org/fx" - "go.uber.org/fx/fxtest" - "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" "github.com/DataDog/datadog-agent/comp/core" "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/ndmtmp/forwarder/forwarderimpl" "github.com/DataDog/datadog-agent/comp/networkpath/npcollector" rdnsqueriermock "github.com/DataDog/datadog-agent/comp/rdnsquerier/fx-mock" + "github.com/stretchr/testify/require" + "go.uber.org/fx" + "go.uber.org/fx/fxtest" ) // MockTimeNow mocks time.Now @@ -44,7 +43,7 @@ var testOptions = fx.Options( demultiplexerimpl.MockModule(), defaultforwarder.MockModule(), core.MockBundle(), - eventplatformmock.MockModule(), + eventplatformimpl.MockModule(), rdnsqueriermock.MockModule(), ) diff --git a/comp/networkpath/npcollector/npcollectorimpl/npcollectorcomp.go b/comp/networkpath/npcollector/npcollectorimpl/npcollectorcomp.go index 31fa00d16ad86..01c0a42691ed9 100644 --- a/comp/networkpath/npcollector/npcollectorimpl/npcollectorcomp.go +++ b/comp/networkpath/npcollector/npcollectorimpl/npcollectorcomp.go @@ -13,7 +13,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" "github.com/DataDog/datadog-agent/comp/core/telemetry" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/comp/networkpath/npcollector" rdnsquerier "github.com/DataDog/datadog-agent/comp/rdnsquerier/def" nooprdnsquerier "github.com/DataDog/datadog-agent/comp/rdnsquerier/impl-none" @@ -61,17 +61,23 @@ func newNpCollector(deps dependencies) provides { rdnsQuerier = nooprdnsquerier.NewNone().Comp } - collector = newNpCollectorImpl(deps.EpForwarder, configs, deps.Logger, deps.Telemetry, rdnsQuerier) - deps.Lc.Append(fx.Hook{ - // No need for OnStart hook since NpCollector.Init() will be called by clients when needed. - OnStart: func(context.Context) error { - return collector.start() - }, - OnStop: func(context.Context) error { - collector.stop() - return nil - }, - }) + epForwarder, ok := deps.EpForwarder.Get() + if !ok { + deps.Logger.Errorf("Error getting EpForwarder") + collector = newNoopNpCollectorImpl() + } else { + collector = newNpCollectorImpl(epForwarder, configs, deps.Logger, deps.Telemetry, rdnsQuerier) + deps.Lc.Append(fx.Hook{ + // No need for OnStart hook since NpCollector.Init() will be called by clients when needed. + OnStart: func(context.Context) error { + return collector.start() + }, + OnStop: func(context.Context) error { + collector.stop() + return nil + }, + }) + } } else { deps.Logger.Debugf("Network Path Collector disabled") collector = newNoopNpCollectorImpl() diff --git a/comp/process/bundle_test.go b/comp/process/bundle_test.go index 8ebfe77be895f..591dce9f63cfb 100644 --- a/comp/process/bundle_test.go +++ b/comp/process/bundle_test.go @@ -23,7 +23,7 @@ import ( workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" "github.com/DataDog/datadog-agent/comp/dogstatsd/statsd" - eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" "github.com/DataDog/datadog-agent/comp/networkpath/npcollector/npcollectorimpl" "github.com/DataDog/datadog-agent/comp/process/runner" @@ -96,7 +96,7 @@ func TestBundleOneShot(t *testing.T) { core.MockBundle(), workloadmetafx.Module(workloadmeta.NewParams()), eventplatformreceiverimpl.Module(), - eventplatformfx.Module(), + eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()), rdnsquerier.MockModule(), npcollectorimpl.Module(), statsd.MockModule(), diff --git a/comp/snmpscan/impl/devicescan.go b/comp/snmpscan/impl/devicescan.go index cb0505108a848..cef73d6aee845 100644 --- a/comp/snmpscan/impl/devicescan.go +++ b/comp/snmpscan/impl/devicescan.go @@ -9,12 +9,11 @@ import ( "encoding/json" "time" - "github.com/gosnmp/gosnmp" - - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/logs/message" "github.com/DataDog/datadog-agent/pkg/networkdevice/metadata" "github.com/DataDog/datadog-agent/pkg/snmp/gosnmplib" + "github.com/gosnmp/gosnmp" ) func (s snmpScannerImpl) RunDeviceScan(snmpConnection *gosnmp.GoSNMP, deviceNamespace string, deviceIPAddress string) error { diff --git a/comp/snmpscan/impl/snmpscan.go b/comp/snmpscan/impl/snmpscan.go index 835866508cae1..1beb572ac27c0 100644 --- a/comp/snmpscan/impl/snmpscan.go +++ b/comp/snmpscan/impl/snmpscan.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" log "github.com/DataDog/datadog-agent/comp/core/log/def" compdef "github.com/DataDog/datadog-agent/comp/def" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" rcclienttypes "github.com/DataDog/datadog-agent/comp/remote-config/rcclient/types" snmpscan "github.com/DataDog/datadog-agent/comp/snmpscan/def" ) @@ -30,7 +30,10 @@ type Provides struct { // NewComponent creates a new snmpscan component func NewComponent(reqs Requires) (Provides, error) { - forwarder := reqs.Demultiplexer.GetEventPlatformForwarder() + forwarder, err := reqs.Demultiplexer.GetEventPlatformForwarder() + if err != nil { + return Provides{}, err + } scanner := snmpScannerImpl{ log: reqs.Logger, epforwarder: forwarder, @@ -43,5 +46,5 @@ func NewComponent(reqs Requires) (Provides, error) { type snmpScannerImpl struct { log log.Component - epforwarder eventplatform.Component + epforwarder eventplatform.Forwarder } diff --git a/comp/snmptraps/forwarder/forwarderimpl/forwarder.go b/comp/snmptraps/forwarder/forwarderimpl/forwarder.go index c34d5809eaac4..52f0c5113078a 100644 --- a/comp/snmptraps/forwarder/forwarderimpl/forwarder.go +++ b/comp/snmptraps/forwarder/forwarderimpl/forwarder.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" log "github.com/DataDog/datadog-agent/comp/core/log/def" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/comp/snmptraps/config" "github.com/DataDog/datadog-agent/comp/snmptraps/formatter" "github.com/DataDog/datadog-agent/comp/snmptraps/forwarder" diff --git a/comp/snmptraps/forwarder/forwarderimpl/forwarder_test.go b/comp/snmptraps/forwarder/forwarderimpl/forwarder_test.go index 1aa47f244e21b..8bf5df680100b 100644 --- a/comp/snmptraps/forwarder/forwarderimpl/forwarder_test.go +++ b/comp/snmptraps/forwarder/forwarderimpl/forwarder_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/fx" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl" "github.com/DataDog/datadog-agent/comp/snmptraps/formatter" "github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl" diff --git a/comp/snmptraps/status/statusimpl/status.go b/comp/snmptraps/status/statusimpl/status.go index 01649bd2be17c..0fd411f2615ae 100644 --- a/comp/snmptraps/status/statusimpl/status.go +++ b/comp/snmptraps/status/statusimpl/status.go @@ -15,7 +15,7 @@ import ( "go.uber.org/fx" "github.com/DataDog/datadog-agent/comp/core/status" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" trapsStatus "github.com/DataDog/datadog-agent/comp/snmptraps/status" "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) diff --git a/comp/snmptraps/status/statusimpl/status_test.go b/comp/snmptraps/status/statusimpl/status_test.go index 342512a463097..ffa1fac2c5469 100644 --- a/comp/snmptraps/status/statusimpl/status_test.go +++ b/comp/snmptraps/status/statusimpl/status_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" _ "github.com/DataDog/datadog-agent/pkg/aggregator" ) diff --git a/pkg/aggregator/aggregator.go b/pkg/aggregator/aggregator.go index 96225d1fed599..e8ac4fd425d13 100644 --- a/pkg/aggregator/aggregator.go +++ b/pkg/aggregator/aggregator.go @@ -7,6 +7,7 @@ package aggregator import ( + "errors" "expvar" "fmt" "sync" @@ -14,7 +15,7 @@ import ( tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" "github.com/DataDog/datadog-agent/comp/core/tagger/types" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" haagent "github.com/DataDog/datadog-agent/comp/haagent/def" "github.com/DataDog/datadog-agent/pkg/aggregator/internal/tags" checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id" @@ -409,8 +410,12 @@ func (agg *BufferedAggregator) GetBufferedChannels() (chan []*event.Event, chan } // GetEventPlatformForwarder returns a event platform forwarder -func (agg *BufferedAggregator) GetEventPlatformForwarder() eventplatform.Component { - return agg.eventPlatformForwarder +func (agg *BufferedAggregator) GetEventPlatformForwarder() (eventplatform.Forwarder, error) { + forwarder, found := agg.eventPlatformForwarder.Get() + if !found { + return nil, errors.New("event platform forwarder not initialized") + } + return forwarder, nil } func (agg *BufferedAggregator) registerSender(id checkid.ID) error { @@ -459,9 +464,13 @@ func (agg *BufferedAggregator) handleSenderBucket(checkBucket senderHistogramBuc } func (agg *BufferedAggregator) handleEventPlatformEvent(event senderEventPlatformEvent) error { + forwarder, found := agg.eventPlatformForwarder.Get() + if !found { + return errors.New("event platform forwarder not initialized") + } m := message.NewMessage(event.rawEvent, nil, "", 0) // eventPlatformForwarder is threadsafe so no locking needed here - return agg.eventPlatformForwarder.SendEventPlatformEvent(m, event.eventType) + return forwarder.SendEventPlatformEvent(m, event.eventType) } // addServiceCheck adds the service check to the slice of current service checks @@ -680,7 +689,11 @@ func (agg *BufferedAggregator) GetEvents() event.Events { // GetEventPlatformEvents grabs the event platform events from the queue and clears them. // Note that this works only if using the 'noop' event platform forwarder func (agg *BufferedAggregator) GetEventPlatformEvents() map[string][]*message.Message { - return agg.eventPlatformForwarder.Purge() + forwarder, found := agg.eventPlatformForwarder.Get() + if !found { + return nil + } + return forwarder.Purge() } func (agg *BufferedAggregator) sendEvents(start time.Time, events event.Events) { diff --git a/pkg/aggregator/aggregator_test.go b/pkg/aggregator/aggregator_test.go index 2e3f5dddc2682..a60e3055f2206 100644 --- a/pkg/aggregator/aggregator_test.go +++ b/pkg/aggregator/aggregator_test.go @@ -25,7 +25,7 @@ import ( taggerMock "github.com/DataDog/datadog-agent/comp/core/tagger/mock" "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" orchestratorforwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator" haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" diff --git a/pkg/aggregator/check_sampler_bench_test.go b/pkg/aggregator/check_sampler_bench_test.go index 9a562434c955b..1e3f5eae3fd8f 100644 --- a/pkg/aggregator/check_sampler_bench_test.go +++ b/pkg/aggregator/check_sampler_bench_test.go @@ -15,7 +15,8 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" "github.com/DataDog/datadog-agent/comp/core/tagger/mock" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" //nolint:revive // TODO(AML) Fix revive linter @@ -51,8 +52,9 @@ func benchmarkAddBucket(bucketValue int64, b *testing.B) { options.DontStartForwarders = true sharedForwarder := forwarder.NewDefaultForwarder(pkgconfigsetup.Datadog(), deps.Log, forwarderOpts) orchestratorForwarder := optional.NewOption[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{}) + eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(deps.Hostname)) haAgent := haagentmock.NewMockHaAgent() - demux := InitAndStartAgentDemultiplexer(deps.Log, sharedForwarder, &orchestratorForwarder, options, eventplatformock.NewMock(), haAgent, deps.Compressor, taggerComponent, "hostname") + demux := InitAndStartAgentDemultiplexer(deps.Log, sharedForwarder, &orchestratorForwarder, options, eventPlatformForwarder, haAgent, deps.Compressor, taggerComponent, "hostname") defer demux.Stop(true) checkSampler := newCheckSampler(1, true, true, 1000, tags.NewStore(true, "bench"), checkid.ID("hello:world:1234"), taggerComponent) diff --git a/pkg/aggregator/demultiplexer_agent.go b/pkg/aggregator/demultiplexer_agent.go index de52762a92294..a519383eea73e 100644 --- a/pkg/aggregator/demultiplexer_agent.go +++ b/pkg/aggregator/demultiplexer_agent.go @@ -15,7 +15,7 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" forwarder "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" orchestratorforwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator" haagent "github.com/DataDog/datadog-agent/comp/haagent/def" compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" @@ -39,7 +39,7 @@ type DemultiplexerWithAggregator interface { // AggregateCheckSample adds check sample sent by a check from one of the collectors into a check sampler pipeline. AggregateCheckSample(sample metrics.MetricSample) Options() AgentDemultiplexerOptions - GetEventPlatformForwarder() eventplatform.Component + GetEventPlatformForwarder() (eventplatform.Forwarder, error) GetEventsAndServiceChecksChannels() (chan []*event.Event, chan []*servicecheck.ServiceCheck) DumpDogstatsdContexts(io.Writer) error } @@ -471,7 +471,7 @@ func (d *AgentDemultiplexer) GetEventsAndServiceChecksChannels() (chan []*event. } // GetEventPlatformForwarder returns underlying events and service checks channels. -func (d *AgentDemultiplexer) GetEventPlatformForwarder() eventplatform.Component { +func (d *AgentDemultiplexer) GetEventPlatformForwarder() (eventplatform.Forwarder, error) { return d.aggregator.GetEventPlatformForwarder() } diff --git a/pkg/aggregator/demultiplexer_agent_test.go b/pkg/aggregator/demultiplexer_agent_test.go index 079c80c2e2ebd..ce59d5ea8943f 100644 --- a/pkg/aggregator/demultiplexer_agent_test.go +++ b/pkg/aggregator/demultiplexer_agent_test.go @@ -19,8 +19,8 @@ import ( tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" "github.com/DataDog/datadog-agent/comp/core/tagger/mock" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" - eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" orchestratorforwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator" "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" haagent "github.com/DataDog/datadog-agent/comp/haagent/def" @@ -170,7 +170,7 @@ func createDemultiplexerAgentTestDeps(t *testing.T) DemultiplexerAgentTestDeps { defaultforwarder.MockModule(), core.MockBundle(), orchestratorimpl.MockModule(), - eventplatformmock.MockModule(), + eventplatformimpl.MockModule(), haagentmock.Module(), compressionmock.MockModule(), fx.Provide(func() tagger.Component { return taggerComponent }), diff --git a/pkg/aggregator/demultiplexer_mock.go b/pkg/aggregator/demultiplexer_mock.go index 84108c6cd9b92..6d79e009338b3 100644 --- a/pkg/aggregator/demultiplexer_mock.go +++ b/pkg/aggregator/demultiplexer_mock.go @@ -14,7 +14,8 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" haagent "github.com/DataDog/datadog-agent/comp/haagent/def" compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" "github.com/DataDog/datadog-agent/pkg/util/optional" @@ -33,5 +34,6 @@ type TestDeps struct { // InitAndStartAgentDemultiplexerForTest initializes an aggregator for tests. func InitAndStartAgentDemultiplexerForTest(deps TestDeps, options AgentDemultiplexerOptions, hostname string) *AgentDemultiplexer { orchestratorForwarder := optional.NewOption[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{}) - return InitAndStartAgentDemultiplexer(deps.Log, deps.SharedForwarder, &orchestratorForwarder, options, eventplatformock.NewMock(), deps.HaAgent, deps.Compressor, nooptagger.NewComponent(), hostname) + eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(deps.Hostname)) + return InitAndStartAgentDemultiplexer(deps.Log, deps.SharedForwarder, &orchestratorForwarder, options, eventPlatformForwarder, deps.HaAgent, deps.Compressor, nooptagger.NewComponent(), hostname) } diff --git a/pkg/aggregator/demultiplexer_test.go b/pkg/aggregator/demultiplexer_test.go index 5173b61f3ef15..72ed3464eb346 100644 --- a/pkg/aggregator/demultiplexer_test.go +++ b/pkg/aggregator/demultiplexer_test.go @@ -16,8 +16,8 @@ import ( "github.com/DataDog/datadog-agent/comp/core" nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" - eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" orchestratorForwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator" orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" @@ -43,7 +43,7 @@ func TestDemuxIsSetAsGlobalInstance(t *testing.T) { require := require.New(t) opts := demuxTestOptions() - deps := createDemuxDeps(t, opts) + deps := createDemuxDeps(t, opts, eventplatformimpl.NewDefaultParams()) demux := deps.Demultiplexer require.NotNil(demux) @@ -59,12 +59,39 @@ func TestDemuxForwardersCreated(t *testing.T) { opts := demuxTestOptions() - deps := createDemuxDeps(t, opts) + deps := createDemuxDeps(t, opts, eventplatformimpl.NewDefaultParams()) demux := deps.Demultiplexer require.NotNil(demux) - require.NotNil(deps.EventPlatformFwd) - _, found := deps.OrchestratorFwd.Get() + _, found := deps.EventPlatformFwd.Get() + require.True(found) + _, found = deps.OrchestratorFwd.Get() + require.Equal(orchestratorForwarderSupport, found) + require.NotNil(deps.SharedForwarder) + demux.Stop(false) + + // options no event platform forwarder + + opts = demuxTestOptions() + deps = createDemuxDeps(t, opts, eventplatformimpl.Params{UseEventPlatformForwarder: false}) + demux = deps.Demultiplexer + require.NotNil(demux) + _, found = deps.EventPlatformFwd.Get() + require.False(found) + _, found = deps.OrchestratorFwd.Get() + require.Equal(orchestratorForwarderSupport, found) + require.NotNil(deps.SharedForwarder) + demux.Stop(false) + + // options noop event platform forwarder + + opts = demuxTestOptions() + deps = createDemuxDeps(t, opts, eventplatformimpl.Params{UseNoopEventPlatformForwarder: true}) + demux = deps.Demultiplexer + require.NotNil(demux) + _, found = deps.EventPlatformFwd.Get() + require.True(found) + _, found = deps.OrchestratorFwd.Get() require.Equal(orchestratorForwarderSupport, found) require.NotNil(deps.SharedForwarder) demux.Stop(false) @@ -87,10 +114,11 @@ func TestDemuxForwardersCreated(t *testing.T) { // needed feature above, we should have an orchestrator forwarder instantiated now opts = demuxTestOptions() - deps = createDemuxDeps(t, opts) + deps = createDemuxDeps(t, opts, eventplatformimpl.NewDefaultParams()) demux = deps.Demultiplexer require.NotNil(demux) - require.NotNil(deps.EventPlatformFwd) + _, found = deps.EventPlatformFwd.Get() + require.True(found) require.NotNil(deps.SharedForwarder) demux.Stop(false) @@ -98,10 +126,11 @@ func TestDemuxForwardersCreated(t *testing.T) { opts = demuxTestOptions() params := orchestratorForwarderImpl.NewDisabledParams() - deps = createDemuxDepsWithOrchestratorFwd(t, opts, params) + deps = createDemuxDepsWithOrchestratorFwd(t, opts, params, eventplatformimpl.NewDefaultParams()) demux = deps.Demultiplexer require.NotNil(demux) - require.NotNil(deps.EventPlatformFwd) + _, found = deps.EventPlatformFwd.Get() + require.True(found) _, found = deps.OrchestratorFwd.Get() require.False(found) require.NotNil(deps.SharedForwarder) @@ -111,10 +140,11 @@ func TestDemuxForwardersCreated(t *testing.T) { opts = demuxTestOptions() params = orchestratorForwarderImpl.NewNoopParams() - deps = createDemuxDepsWithOrchestratorFwd(t, opts, params) + deps = createDemuxDepsWithOrchestratorFwd(t, opts, params, eventplatformimpl.NewDefaultParams()) demux = deps.Demultiplexer require.NotNil(demux) - require.NotNil(deps.EventPlatformFwd) + _, found = deps.EventPlatformFwd.Get() + require.True(found) _, found = deps.OrchestratorFwd.Get() require.True(found) require.NotNil(deps.SharedForwarder) @@ -127,7 +157,7 @@ func TestDemuxSerializerCreated(t *testing.T) { // default options should have created all forwarders opts := demuxTestOptions() - deps := createDemuxDeps(t, opts) + deps := createDemuxDeps(t, opts, eventplatformimpl.NewDefaultParams()) demux := deps.Demultiplexer require.NotNil(demux) @@ -143,7 +173,7 @@ func TestDemuxFlushAggregatorToSerializer(t *testing.T) { opts := demuxTestOptions() opts.FlushInterval = time.Hour - deps := createDemuxDeps(t, opts) + deps := createDemuxDeps(t, opts, eventplatformimpl.NewDefaultParams()) demux := initAgentDemultiplexer(deps.Log, deps.SharedForwarder, deps.OrchestratorFwd, opts, deps.EventPlatformFwd, deps.HaAgent, deps.Compressor, nooptagger.NewComponent(), "") demux.Aggregator().tlmContainerTagsEnabled = false require.NotNil(demux) @@ -243,8 +273,8 @@ func TestGetDogStatsDWorkerAndPipelineCount(t *testing.T) { assert.Equal(4, pipelines) } -func createDemuxDeps(t *testing.T, opts AgentDemultiplexerOptions) aggregatorDeps { - return createDemuxDepsWithOrchestratorFwd(t, opts, orchestratorForwarderImpl.NewDefaultParams()) +func createDemuxDeps(t *testing.T, opts AgentDemultiplexerOptions, eventPlatformParams eventplatformimpl.Params) aggregatorDeps { + return createDemuxDepsWithOrchestratorFwd(t, opts, orchestratorForwarderImpl.NewDefaultParams(), eventPlatformParams) } type internalDemutiplexerDeps struct { @@ -258,12 +288,12 @@ func createDemuxDepsWithOrchestratorFwd( t *testing.T, opts AgentDemultiplexerOptions, orchestratorParams orchestratorForwarderImpl.Params, -) aggregatorDeps { + eventPlatformParams eventplatformimpl.Params) aggregatorDeps { modules := fx.Options( defaultforwarder.MockModule(), core.MockBundle(), orchestratorForwarderImpl.Module(orchestratorParams), - eventplatformfx.Module(), + eventplatformimpl.Module(eventPlatformParams), eventplatformreceiverimpl.Module(), compressionmock.MockModule(), haagentmock.Module(), diff --git a/pkg/aggregator/mocksender/mocksender.go b/pkg/aggregator/mocksender/mocksender.go index 340298442247f..d20e0a3d19081 100644 --- a/pkg/aggregator/mocksender/mocksender.go +++ b/pkg/aggregator/mocksender/mocksender.go @@ -12,10 +12,13 @@ import ( "github.com/stretchr/testify/mock" + "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl" logimpl "github.com/DataDog/datadog-agent/comp/core/log/impl" - nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" + + nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop" haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" "github.com/DataDog/datadog-agent/pkg/aggregator" @@ -39,8 +42,9 @@ func CreateDefaultDemultiplexer() *aggregator.AgentDemultiplexer { log := logimpl.NewTemporaryLoggerWithoutInit() sharedForwarder := defaultforwarder.NewDefaultForwarder(pkgconfigsetup.Datadog(), log, defaultforwarder.NewOptions(pkgconfigsetup.Datadog(), log, nil)) orchestratorForwarder := optional.NewOption[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{}) + eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(hostnameimpl.NewHostnameService())) taggerComponent := nooptagger.NewComponent() - return aggregator.InitAndStartAgentDemultiplexer(log, sharedForwarder, &orchestratorForwarder, opts, eventplatformock.NewMock(), haagentmock.NewMockHaAgent(), compressionmock.NewMockCompressor(), taggerComponent, "") + return aggregator.InitAndStartAgentDemultiplexer(log, sharedForwarder, &orchestratorForwarder, opts, eventPlatformForwarder, haagentmock.NewMockHaAgent(), compressionmock.NewMockCompressor(), taggerComponent, "") } // NewMockSenderWithSenderManager returns a functional mocked Sender for testing diff --git a/pkg/aggregator/sender_test.go b/pkg/aggregator/sender_test.go index ae791c41b02d1..994cc96969d1c 100644 --- a/pkg/aggregator/sender_test.go +++ b/pkg/aggregator/sender_test.go @@ -21,7 +21,8 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id" @@ -53,11 +54,12 @@ func initSender(id checkid.ID, defaultHostname string) (s senderWithChans) { return s } -func testDemux(log log.Component) *AgentDemultiplexer { +func testDemux(log log.Component, hostname hostname.Component) *AgentDemultiplexer { opts := DefaultAgentDemultiplexerOptions() opts.DontStartForwarders = true orchestratorForwarder := optional.NewOption[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{}) - demux := initAgentDemultiplexer(log, NewForwarderTest(log), &orchestratorForwarder, opts, eventplatformock.NewMock(), haagentmock.NewMockHaAgent(), compressionmock.NewMockCompressor(), nooptagger.NewComponent(), defaultHostname) + eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(hostname)) + demux := initAgentDemultiplexer(log, NewForwarderTest(log), &orchestratorForwarder, opts, eventPlatformForwarder, haagentmock.NewMockHaAgent(), compressionmock.NewMockCompressor(), nooptagger.NewComponent(), defaultHostname) return demux } @@ -84,7 +86,7 @@ func TestGetDefaultSenderReturnsSameSender(t *testing.T) { // this test not using anything global // - deps := fxutil.Test[SenderTestDeps](t, core.MockBundle()) - demux := testDemux(deps.Log) + demux := testDemux(deps.Log, deps.Hostname) aggregatorInstance := demux.Aggregator() go aggregatorInstance.run() defer aggregatorInstance.Stop() @@ -104,7 +106,7 @@ func TestGetSenderWithDifferentIDsReturnsDifferentCheckSamplers(t *testing.T) { // this test not using anything global // - deps := fxutil.Test[SenderTestDeps](t, core.MockBundle()) - demux := testDemux(deps.Log) + demux := testDemux(deps.Log, deps.Hostname) aggregatorInstance := demux.Aggregator() go aggregatorInstance.run() @@ -134,7 +136,7 @@ func TestGetSenderWithSameIDsReturnsSameSender(t *testing.T) { // - deps := fxutil.Test[SenderTestDeps](t, core.MockBundle()) - demux := testDemux(deps.Log) + demux := testDemux(deps.Log, deps.Hostname) aggregatorInstance := demux.Aggregator() go aggregatorInstance.run() defer aggregatorInstance.Stop() @@ -157,7 +159,7 @@ func TestDestroySender(t *testing.T) { // - deps := fxutil.Test[SenderTestDeps](t, core.MockBundle()) - demux := testDemux(deps.Log) + demux := testDemux(deps.Log, deps.Hostname) aggregatorInstance := demux.Aggregator() go aggregatorInstance.run() defer aggregatorInstance.Stop() @@ -187,7 +189,7 @@ func TestGetAndSetSender(t *testing.T) { // - deps := fxutil.Test[SenderTestDeps](t, core.MockBundle()) - demux := testDemux(deps.Log) + demux := testDemux(deps.Log, deps.Hostname) itemChan := make(chan senderItem, 10) serviceCheckChan := make(chan servicecheck.ServiceCheck, 10) @@ -210,7 +212,7 @@ func TestGetSenderDefaultHostname(t *testing.T) { // - deps := fxutil.Test[SenderTestDeps](t, core.MockBundle()) - demux := testDemux(deps.Log) + demux := testDemux(deps.Log, deps.Hostname) aggregatorInstance := demux.Aggregator() go aggregatorInstance.run() diff --git a/pkg/cli/subcommands/check/command.go b/pkg/cli/subcommands/check/command.go index 8c98dcd853086..d914682340504 100644 --- a/pkg/cli/subcommands/check/command.go +++ b/pkg/cli/subcommands/check/command.go @@ -58,7 +58,7 @@ import ( "github.com/DataDog/datadog-agent/comp/dogstatsd/server" "github.com/DataDog/datadog-agent/comp/forwarder" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" - eventplatformnoopfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-noop" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" "github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl" orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl" haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx" @@ -155,6 +155,9 @@ func MakeCommand(globalParamsGetter func() GlobalParams) *cobra.Command { cliParams.cmd = cmd cliParams.args = args + eventplatforParams := eventplatformimpl.NewDefaultParams() + eventplatforParams.UseNoopEventPlatformForwarder = true + disableCmdPort() return fxutil.OneShot(run, fx.Supply(cliParams), @@ -184,7 +187,7 @@ func MakeCommand(globalParamsGetter func() GlobalParams) *cobra.Command { // Initializing the aggregator with a flush interval of 0 (to disable the flush goroutines) demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams(demultiplexerimpl.WithFlushInterval(0))), orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewNoopParams()), - eventplatformnoopfx.Module(), + eventplatformimpl.Module(eventplatforParams), eventplatformreceiverimpl.Module(), fx.Supply( status.Params{ diff --git a/pkg/collector/corechecks/containerimage/processor.go b/pkg/collector/corechecks/containerimage/processor.go index d1f9161975fd9..d34bd492b1cb1 100644 --- a/pkg/collector/corechecks/containerimage/processor.go +++ b/pkg/collector/corechecks/containerimage/processor.go @@ -13,7 +13,7 @@ import ( tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" "github.com/DataDog/datadog-agent/comp/core/tagger/types" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" queue "github.com/DataDog/datadog-agent/pkg/util/aggregatingqueue" "github.com/DataDog/datadog-agent/pkg/util/hostname" diff --git a/pkg/collector/corechecks/containerimage/processor_test.go b/pkg/collector/corechecks/containerimage/processor_test.go index ec4ac078d8a26..b6c89960d30fc 100644 --- a/pkg/collector/corechecks/containerimage/processor_test.go +++ b/pkg/collector/corechecks/containerimage/processor_test.go @@ -20,7 +20,7 @@ import ( taggerMock "github.com/DataDog/datadog-agent/comp/core/tagger/mock" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" "github.com/DataDog/datadog-agent/pkg/util/hostname" "github.com/DataDog/datadog-agent/pkg/util/pointer" diff --git a/pkg/collector/corechecks/containerlifecycle/processor.go b/pkg/collector/corechecks/containerlifecycle/processor.go index 113819babbf2d..2f514329c091c 100644 --- a/pkg/collector/corechecks/containerlifecycle/processor.go +++ b/pkg/collector/corechecks/containerlifecycle/processor.go @@ -13,7 +13,7 @@ import ( "github.com/DataDog/agent-payload/v5/contlcycle" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" types "github.com/DataDog/datadog-agent/pkg/containerlifecycle" "github.com/DataDog/datadog-agent/pkg/util/log" diff --git a/pkg/collector/corechecks/network-devices/cisco-sdwan/report/metadata.go b/pkg/collector/corechecks/network-devices/cisco-sdwan/report/metadata.go index bb86c815ff918..4de17c9626f00 100644 --- a/pkg/collector/corechecks/network-devices/cisco-sdwan/report/metadata.go +++ b/pkg/collector/corechecks/network-devices/cisco-sdwan/report/metadata.go @@ -9,7 +9,7 @@ import ( "encoding/json" "time" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" devicemetadata "github.com/DataDog/datadog-agent/pkg/networkdevice/metadata" "github.com/DataDog/datadog-agent/pkg/util/log" ) diff --git a/pkg/collector/corechecks/networkpath/networkpath.go b/pkg/collector/corechecks/networkpath/networkpath.go index 3b48ef65235e0..28bef69f2bbca 100644 --- a/pkg/collector/corechecks/networkpath/networkpath.go +++ b/pkg/collector/corechecks/networkpath/networkpath.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" telemetryComp "github.com/DataDog/datadog-agent/comp/core/telemetry" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" "github.com/DataDog/datadog-agent/pkg/collector/check" core "github.com/DataDog/datadog-agent/pkg/collector/corechecks" diff --git a/pkg/collector/corechecks/sbom/processor.go b/pkg/collector/corechecks/sbom/processor.go index b612aebbc6d52..77c1e54a796e4 100644 --- a/pkg/collector/corechecks/sbom/processor.go +++ b/pkg/collector/corechecks/sbom/processor.go @@ -16,7 +16,7 @@ import ( tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" "github.com/DataDog/datadog-agent/comp/core/tagger/types" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" diff --git a/pkg/collector/corechecks/sbom/processor_test.go b/pkg/collector/corechecks/sbom/processor_test.go index bea2b359d42c4..4fcc1c3ba770e 100644 --- a/pkg/collector/corechecks/sbom/processor_test.go +++ b/pkg/collector/corechecks/sbom/processor_test.go @@ -31,7 +31,7 @@ import ( workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" workloadmetafxmock "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx-mock" workloadmetamock "github.com/DataDog/datadog-agent/comp/core/workloadmeta/mock" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" configmock "github.com/DataDog/datadog-agent/pkg/config/mock" sbomscanner "github.com/DataDog/datadog-agent/pkg/sbom/scanner" diff --git a/pkg/collector/corechecks/servicediscovery/events.go b/pkg/collector/corechecks/servicediscovery/events.go index b5e136f8cf23a..5cba3f89243ac 100644 --- a/pkg/collector/corechecks/servicediscovery/events.go +++ b/pkg/collector/corechecks/servicediscovery/events.go @@ -11,7 +11,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/hostname" "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/util/log" diff --git a/pkg/collector/corechecks/snmp/internal/report/report_device_metadata.go b/pkg/collector/corechecks/snmp/internal/report/report_device_metadata.go index 76d6f55117c26..ff8d90912efb3 100644 --- a/pkg/collector/corechecks/snmp/internal/report/report_device_metadata.go +++ b/pkg/collector/corechecks/snmp/internal/report/report_device_metadata.go @@ -13,7 +13,7 @@ import ( "strings" "time" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" "github.com/DataDog/datadog-agent/pkg/util" "github.com/DataDog/datadog-agent/pkg/util/log" diff --git a/pkg/diagnose/runner.go b/pkg/diagnose/runner.go index 303a520ddde4b..5d7f2ee88d1db 100644 --- a/pkg/diagnose/runner.go +++ b/pkg/diagnose/runner.go @@ -20,7 +20,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/secrets" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" - eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/impl" + "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl" integrations "github.com/DataDog/datadog-agent/comp/logs/integrations/def" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" "github.com/DataDog/datadog-agent/pkg/api/util" @@ -524,7 +524,7 @@ func RegisterConnectivityAutodiscovery(catalog *diagnosis.Catalog) { // RegisterConnectivityDatadogEventPlatform registers the connectivity-datadog-event-platform diagnose suite. func RegisterConnectivityDatadogEventPlatform(catalog *diagnosis.Catalog) { - catalog.Register("connectivity-datadog-event-platform", eventplatform.Diagnose) + catalog.Register("connectivity-datadog-event-platform", eventplatformimpl.Diagnose) } // RegisterPortConflict registers the port-conflict diagnose suite. diff --git a/pkg/serverless/invocationlifecycle/lifecycle_test.go b/pkg/serverless/invocationlifecycle/lifecycle_test.go index 7c4e90a02a7ab..3eefd8dc51bbd 100644 --- a/pkg/serverless/invocationlifecycle/lifecycle_test.go +++ b/pkg/serverless/invocationlifecycle/lifecycle_test.go @@ -15,6 +15,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" + "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl" log "github.com/DataDog/datadog-agent/comp/core/log/def" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" @@ -1382,5 +1383,5 @@ func getEventFromFile(filename string) []byte { } func createDemultiplexer(t *testing.T) demultiplexer.FakeSamplerMock { - return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule()) + return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule(), hostnameimpl.MockModule()) } diff --git a/pkg/serverless/logs/logs_test.go b/pkg/serverless/logs/logs_test.go index 95b14e1f8d271..6a8f0d30d3cb0 100644 --- a/pkg/serverless/logs/logs_test.go +++ b/pkg/serverless/logs/logs_test.go @@ -22,6 +22,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" + "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl" log "github.com/DataDog/datadog-agent/comp/core/log/def" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" "github.com/DataDog/datadog-agent/comp/logs/agent/config" @@ -1472,5 +1473,5 @@ func TestMultipleStartLogCollection(t *testing.T) { } func createDemultiplexer(t *testing.T) demultiplexer.FakeSamplerMock { - return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule()) + return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule(), hostnameimpl.MockModule()) } diff --git a/pkg/serverless/metrics/enhanced_metrics_test.go b/pkg/serverless/metrics/enhanced_metrics_test.go index 4de32deeef01d..ea6619861f726 100644 --- a/pkg/serverless/metrics/enhanced_metrics_test.go +++ b/pkg/serverless/metrics/enhanced_metrics_test.go @@ -17,6 +17,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" + "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl" log "github.com/DataDog/datadog-agent/comp/core/log/def" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" "github.com/DataDog/datadog-agent/pkg/metrics" @@ -833,5 +834,5 @@ func TestSendFailoverReasonMetric(t *testing.T) { } func createDemultiplexer(t *testing.T) demultiplexer.FakeSamplerMock { - return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule()) + return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule(), hostnameimpl.MockModule()) } diff --git a/tasks/components.py b/tasks/components.py index f80c62b00573a..c534d63c56b83 100644 --- a/tasks/components.py +++ b/tasks/components.py @@ -109,6 +109,7 @@ def has_type_component(content) -> bool: 'comp/dogstatsd/serverDebug/serverdebugimpl', 'comp/dogstatsd/status/statusimpl', 'comp/etw/impl', + 'comp/forwarder/eventplatform/eventplatformimpl', 'comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl', 'comp/forwarder/orchestrator/orchestratorimpl', 'comp/languagedetection/client/clientimpl', From 83246bddb980c18a7889cf12ebcd520085a55c70 Mon Sep 17 00:00:00 2001 From: Marethyu <45374460+Pythyu@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:00:25 +0100 Subject: [PATCH 04/59] Clean useless python 2 home paths (#31486) Co-authored-by: Alex Lopez --- README.md | 4 +--- omnibus/config/software/datadog-agent.rb | 8 ++------ tasks/agent.py | 2 -- tasks/gotest.py | 2 -- tasks/libs/common/utils.py | 3 --- tasks/winbuildscripts/unittests.ps1 | 2 +- 6 files changed, 4 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ab137bbe48339..8e93e1988c48e 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,7 @@ To build the Agent you need: **Note:** you may want to use a python virtual environment to avoid polluting your system-wide python environment with the agent build/dev dependencies. You can create a virtual environment using `virtualenv` and then use the `invoke agent.build` - parameters `--python-home-2=` and/or `--python-home-3=` - (depending on the python versions you are using) to use the virtual environment's + parameters `--python-home-3=` to use the virtual environment's interpreter and libraries. By default, this environment is only used for dev dependencies listed in `requirements.txt`. @@ -55,7 +54,6 @@ To start working on the Agent, you can build the `main` branch: virtualenvs): invoke agent.build \ - --python-home-2=$GOPATH/src/github.com/DataDog/datadog-agent/venv2 \ --python-home-3=$GOPATH/src/github.com/DataDog/datadog-agent/venv3 Running `invoke agent.build`: diff --git a/omnibus/config/software/datadog-agent.rb b/omnibus/config/software/datadog-agent.rb index bfd08c4dd9a20..cabf4557c735c 100644 --- a/omnibus/config/software/datadog-agent.rb +++ b/omnibus/config/software/datadog-agent.rb @@ -66,10 +66,6 @@ env["GOROOT"] = msgoroot env["PATH"] = "#{msgoroot}/bin:#{env['PATH']}" end - default_install_dir = "/opt/datadog-agent" - if Omnibus::Config.host_distribution == "ociru" - default_install_dir = "#{install_dir}" - end # we assume the go deps are already installed before running omnibus if windows_target? @@ -92,10 +88,10 @@ if linux_target? include_sds = "--include-sds" # we only support SDS on Linux targets for now end - command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{default_install_dir}/embedded --python-home-2=#{default_install_dir}/embedded --python-home-3=#{default_install_dir}/embedded --flavor #{flavor_arg}", env: env + command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg}", env: env if heroku_target? - command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --python-home-2=#{install_dir}/embedded --python-home-3=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent", env: env + command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent", env: env end end diff --git a/tasks/agent.py b/tasks/agent.py index 50d88463e274e..190c7b04c0916 100644 --- a/tasks/agent.py +++ b/tasks/agent.py @@ -127,7 +127,6 @@ def build( install_path=None, embedded_path=None, rtloader_root=None, - python_home_2=None, python_home_3=None, major_version='7', exclude_rtloader=False, @@ -164,7 +163,6 @@ def build( install_path=install_path, embedded_path=embedded_path, rtloader_root=rtloader_root, - python_home_2=python_home_2, python_home_3=python_home_3, major_version=major_version, ) diff --git a/tasks/gotest.py b/tasks/gotest.py index 3ef5ebc9de905..e9403679ea40a 100644 --- a/tasks/gotest.py +++ b/tasks/gotest.py @@ -255,7 +255,6 @@ def test( race=False, profile=False, rtloader_root=None, - python_home_2=None, python_home_3=None, cpus=None, major_version='7', @@ -303,7 +302,6 @@ def test( ldflags, gcflags, env = get_build_flags( ctx, rtloader_root=rtloader_root, - python_home_2=python_home_2, python_home_3=python_home_3, major_version=major_version, ) diff --git a/tasks/libs/common/utils.py b/tasks/libs/common/utils.py index 44758ae35b543..c6a024b60c0ae 100644 --- a/tasks/libs/common/utils.py +++ b/tasks/libs/common/utils.py @@ -203,7 +203,6 @@ def get_build_flags( run_path=None, embedded_path=None, rtloader_root=None, - python_home_2=None, python_home_3=None, major_version='7', headless_mode=False, @@ -243,8 +242,6 @@ def get_build_flags( ldflags += f"-X {REPO_PATH}/pkg/config/setup.defaultRunPath={run_path} " # setting python homes in the code - if python_home_2: - ldflags += f"-X {REPO_PATH}/pkg/collector/python.pythonHome2={python_home_2} " if python_home_3: ldflags += f"-X {REPO_PATH}/pkg/collector/python.pythonHome3={python_home_3} " diff --git a/tasks/winbuildscripts/unittests.ps1 b/tasks/winbuildscripts/unittests.ps1 index 5464db3dc228c..1b0f5e18ed438 100644 --- a/tasks/winbuildscripts/unittests.ps1 +++ b/tasks/winbuildscripts/unittests.ps1 @@ -54,7 +54,7 @@ if($err -ne 0){ Write-Host -ForegroundColor Red "Agent build failed $err" [Environment]::Exit($err) } -& inv -e test --junit-tar="$Env:JUNIT_TAR" --race --profile --rerun-fails=2 --coverage --cpus 8 --python-home-2=$Env:Python2_ROOT_DIR --python-home-3=$Env:Python3_ROOT_DIR --save-result-json C:\mnt\$test_output_file $Env:EXTRA_OPTS --build-stdlib $TEST_WASHER_FLAG +& inv -e test --junit-tar="$Env:JUNIT_TAR" --race --profile --rerun-fails=2 --coverage --cpus 8 --python-home-3=$Env:Python3_ROOT_DIR --save-result-json C:\mnt\$test_output_file $Env:EXTRA_OPTS --build-stdlib $TEST_WASHER_FLAG If ($LASTEXITCODE -ne "0") { exit $LASTEXITCODE } From a16fd6918eca7775376c9f951d89a735db9de207 Mon Sep 17 00:00:00 2001 From: Guillaume Pagnoux Date: Thu, 28 Nov 2024 15:29:46 +0100 Subject: [PATCH 05/59] USM: enable Go TLS monitoring by default (#31064) --- cmd/system-probe/config/adjust_usm.go | 1 + .../inventoryagentimpl/inventoryagent_test.go | 2 +- pkg/network/config/config_test.go | 37 +++++++++++-------- pkg/network/usm/kafka_monitor_test.go | 7 ++-- pkg/network/usm/monitor_test.go | 1 + pkg/network/usm/monitor_tls_test.go | 4 ++ .../usm/tests/tracer_usm_linux_test.go | 1 + pkg/network/usm/usm_http2_monitor_test.go | 1 + ...ble-gotls-by-default-f9c4fe517d075bcc.yaml | 6 +++ 9 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 releasenotes/notes/enable-gotls-by-default-f9c4fe517d075bcc.yaml diff --git a/cmd/system-probe/config/adjust_usm.go b/cmd/system-probe/config/adjust_usm.go index 4241fa6ccbab9..b3c1bcf93f415 100644 --- a/cmd/system-probe/config/adjust_usm.go +++ b/cmd/system-probe/config/adjust_usm.go @@ -30,6 +30,7 @@ func adjustUSM(cfg model.Config) { deprecateBool(cfg, netNS("enable_http_monitoring"), smNS("enable_http_monitoring")) deprecateBool(cfg, netNS("enable_https_monitoring"), smNS("tls", "native", "enabled")) deprecateBool(cfg, smNS("enable_go_tls_support"), smNS("tls", "go", "enabled")) + applyDefault(cfg, smNS("tls", "go", "enabled"), true) deprecateGeneric(cfg, netNS("http_replace_rules"), smNS("http_replace_rules")) deprecateInt64(cfg, netNS("max_tracked_http_connections"), smNS("max_tracked_http_connections")) applyDefault(cfg, smNS("max_tracked_http_connections"), 1024) diff --git a/comp/metadata/inventoryagent/inventoryagentimpl/inventoryagent_test.go b/comp/metadata/inventoryagent/inventoryagentimpl/inventoryagent_test.go index 10eb7430cf3bd..281e87baba7e5 100644 --- a/comp/metadata/inventoryagent/inventoryagentimpl/inventoryagent_test.go +++ b/comp/metadata/inventoryagent/inventoryagentimpl/inventoryagent_test.go @@ -491,7 +491,7 @@ func TestFetchSystemProbeAgent(t *testing.T) { assert.False(t, ia.data["feature_usm_redis_enabled"].(bool)) assert.False(t, ia.data["feature_usm_http2_enabled"].(bool)) assert.True(t, ia.data["feature_usm_istio_enabled"].(bool)) - assert.False(t, ia.data["feature_usm_go_tls_enabled"].(bool)) + assert.True(t, ia.data["feature_usm_go_tls_enabled"].(bool)) assert.False(t, ia.data["feature_discovery_enabled"].(bool)) assert.False(t, ia.data["feature_tcp_queue_length_enabled"].(bool)) assert.False(t, ia.data["feature_oom_kill_enabled"].(bool)) diff --git a/pkg/network/config/config_test.go b/pkg/network/config/config_test.go index f325986082851..791cd0f872d63 100644 --- a/pkg/network/config/config_test.go +++ b/pkg/network/config/config_test.go @@ -1464,34 +1464,34 @@ func TestUSMTLSNativeEnabled(t *testing.T) { func TestUSMTLSGoEnabled(t *testing.T) { t.Run("via deprecated YAML", func(t *testing.T) { mockSystemProbe := mock.NewSystemProbe(t) - mockSystemProbe.SetWithoutSource("service_monitoring_config.enable_go_tls_support", true) + mockSystemProbe.SetWithoutSource("service_monitoring_config.enable_go_tls_support", false) cfg := New() - require.True(t, cfg.EnableGoTLSSupport) + require.False(t, cfg.EnableGoTLSSupport) }) t.Run("via deprecated ENV variable", func(t *testing.T) { mock.NewSystemProbe(t) - t.Setenv("DD_SERVICE_MONITORING_CONFIG_ENABLE_GO_TLS_SUPPORT", "true") + t.Setenv("DD_SERVICE_MONITORING_CONFIG_ENABLE_GO_TLS_SUPPORT", "false") cfg := New() - require.True(t, cfg.EnableGoTLSSupport) + require.False(t, cfg.EnableGoTLSSupport) }) t.Run("via YAML", func(t *testing.T) { mockSystemProbe := mock.NewSystemProbe(t) - mockSystemProbe.SetWithoutSource("service_monitoring_config.tls.go.enabled", true) + mockSystemProbe.SetWithoutSource("service_monitoring_config.tls.go.enabled", false) cfg := New() - require.True(t, cfg.EnableGoTLSSupport) + require.False(t, cfg.EnableGoTLSSupport) }) t.Run("via ENV variable", func(t *testing.T) { mock.NewSystemProbe(t) - t.Setenv("DD_SERVICE_MONITORING_CONFIG_TLS_GO_ENABLED", "true") + t.Setenv("DD_SERVICE_MONITORING_CONFIG_TLS_GO_ENABLED", "false") cfg := New() - require.True(t, cfg.EnableGoTLSSupport) + require.False(t, cfg.EnableGoTLSSupport) }) t.Run("Deprecated is enabled, new is disabled", func(t *testing.T) { @@ -1512,22 +1512,29 @@ func TestUSMTLSGoEnabled(t *testing.T) { require.True(t, cfg.EnableGoTLSSupport) }) - t.Run("Both enabled", func(t *testing.T) { + t.Run("Both disabled", func(t *testing.T) { mock.NewSystemProbe(t) - t.Setenv("DD_SERVICE_MONITORING_CONFIG_ENABLE_GO_TLS_SUPPORT", "true") - t.Setenv("DD_SERVICE_MONITORING_CONFIG_TLS_GO_ENABLED", "true") + t.Setenv("DD_SERVICE_MONITORING_CONFIG_ENABLE_GO_TLS_SUPPORT", "false") + t.Setenv("DD_SERVICE_MONITORING_CONFIG_TLS_GO_ENABLED", "false") cfg := New() - require.True(t, cfg.EnableGoTLSSupport) + require.False(t, cfg.EnableGoTLSSupport) }) - t.Run("Not enabled", func(t *testing.T) { - mock.NewSystemProbe(t) + t.Run("Deprecated is disabled takes precedence over default", func(t *testing.T) { + mockSystemProbe := mock.NewSystemProbe(t) + mockSystemProbe.SetWithoutSource("service_monitoring_config.enable_go_tls_support", false) cfg := New() - // Default value. require.False(t, cfg.EnableGoTLSSupport) }) + + t.Run("Enabled by default", func(t *testing.T) { + mock.NewSystemProbe(t) + cfg := New() + + require.True(t, cfg.EnableGoTLSSupport) + }) } func TestUSMTLSGoExcludeSelf(t *testing.T) { diff --git a/pkg/network/usm/kafka_monitor_test.go b/pkg/network/usm/kafka_monitor_test.go index c9fd9f5ca3776..52177ad873c24 100644 --- a/pkg/network/usm/kafka_monitor_test.go +++ b/pkg/network/usm/kafka_monitor_test.go @@ -1622,10 +1622,8 @@ func getDefaultTestConfiguration(tls bool) *config.Config { cfg := config.New() cfg.EnableKafkaMonitoring = true cfg.MaxTrackedConnections = 1000 - if tls { - cfg.EnableGoTLSSupport = true - cfg.GoTLSExcludeSelf = true - } + cfg.EnableGoTLSSupport = tls + cfg.GoTLSExcludeSelf = tls return cfg } @@ -1727,6 +1725,7 @@ func TestLoadKafkaBinary(t *testing.T) { func loadKafkaBinary(t *testing.T, debug bool) { cfg := config.New() // We don't have a way of enabling kafka without http at the moment + cfg.EnableGoTLSSupport = false cfg.EnableKafkaMonitoring = true cfg.MaxTrackedConnections = 1000 cfg.BPFDebug = debug diff --git a/pkg/network/usm/monitor_test.go b/pkg/network/usm/monitor_test.go index f78913db23d6b..014511d786ad6 100644 --- a/pkg/network/usm/monitor_test.go +++ b/pkg/network/usm/monitor_test.go @@ -81,6 +81,7 @@ func TestMonitorProtocolFail(t *testing.T) { patchProtocolMock(t, tt.spec) cfg := config.New() + cfg.EnableGoTLSSupport = false cfg.EnableHTTPMonitoring = true cfg.EnableIstioMonitoring = false diff --git a/pkg/network/usm/monitor_tls_test.go b/pkg/network/usm/monitor_tls_test.go index daadd6ca3e3a2..4a609e0ac9a30 100644 --- a/pkg/network/usm/monitor_tls_test.go +++ b/pkg/network/usm/monitor_tls_test.go @@ -69,6 +69,7 @@ func (s *tlsSuite) TestHTTPSViaLibraryIntegration() { t := s.T() cfg := config.New() + cfg.EnableGoTLSSupport = false cfg.EnableHTTPMonitoring = true cfg.EnableNativeTLSMonitoring = true /* enable protocol classification : TLS */ @@ -284,6 +285,7 @@ func (s *tlsSuite) TestOpenSSLVersions() { t := s.T() cfg := config.New() + cfg.EnableGoTLSSupport = false cfg.EnableNativeTLSMonitoring = true cfg.EnableHTTPMonitoring = true usmMonitor := setupUSMTLSMonitor(t, cfg) @@ -343,6 +345,7 @@ func (s *tlsSuite) TestOpenSSLVersionsSlowStart() { t := s.T() cfg := config.New() + cfg.EnableGoTLSSupport = false cfg.EnableNativeTLSMonitoring = true cfg.EnableHTTPMonitoring = true @@ -902,6 +905,7 @@ func (s *tlsSuite) TestNodeJSTLS() { require.NoError(t, err) cfg := config.New() + cfg.EnableGoTLSSupport = false cfg.EnableHTTPMonitoring = true cfg.EnableNodeJSMonitoring = true diff --git a/pkg/network/usm/tests/tracer_usm_linux_test.go b/pkg/network/usm/tests/tracer_usm_linux_test.go index a3186d6a8d883..551bf8e9650a7 100644 --- a/pkg/network/usm/tests/tracer_usm_linux_test.go +++ b/pkg/network/usm/tests/tracer_usm_linux_test.go @@ -299,6 +299,7 @@ func (s *USMSuite) TestIgnoreTLSClassificationIfApplicationProtocolWasDetected() t := s.T() cfg := tracertestutil.Config() cfg.ServiceMonitoringEnabled = true + cfg.EnableGoTLSSupport = false // USM cannot be enabled without a protocol. cfg.EnableHTTPMonitoring = true cfg.ProtocolClassificationEnabled = true diff --git a/pkg/network/usm/usm_http2_monitor_test.go b/pkg/network/usm/usm_http2_monitor_test.go index 17b7b29afbb51..2e92c2647989b 100644 --- a/pkg/network/usm/usm_http2_monitor_test.go +++ b/pkg/network/usm/usm_http2_monitor_test.go @@ -1511,6 +1511,7 @@ func (s *usmHTTP2Suite) TestRawHuffmanEncoding() { func TestHTTP2InFlightMapCleaner(t *testing.T) { skipIfKernelNotSupported(t) cfg := config.New() + cfg.EnableGoTLSSupport = false cfg.EnableIstioMonitoring = false cfg.EnableHTTP2Monitoring = true cfg.HTTP2DynamicTableMapCleanerInterval = 5 * time.Second diff --git a/releasenotes/notes/enable-gotls-by-default-f9c4fe517d075bcc.yaml b/releasenotes/notes/enable-gotls-by-default-f9c4fe517d075bcc.yaml new file mode 100644 index 0000000000000..87c5929483ed0 --- /dev/null +++ b/releasenotes/notes/enable-gotls-by-default-f9c4fe517d075bcc.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + USM now monitors TLS traffic encrypted with Go TLS by default. + To disable this feature, set the `service_monitoring_config.tls.go.enabled` + configuration option to false. From 4e201c03ae3e335843f7d575d97b7d2a42fb2d07 Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Thu, 28 Nov 2024 15:30:51 +0100 Subject: [PATCH 06/59] Do not validate signatures when an integration is manually installed in the E2E tests (#31530) --- test/new-e2e/tests/agent-platform/common/agent_integration.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new-e2e/tests/agent-platform/common/agent_integration.go b/test/new-e2e/tests/agent-platform/common/agent_integration.go index ac36d0ce7e64f..dda703b8d7f90 100644 --- a/test/new-e2e/tests/agent-platform/common/agent_integration.go +++ b/test/new-e2e/tests/agent-platform/common/agent_integration.go @@ -80,7 +80,7 @@ func installIntegration(t *testing.T, client *TestClient, integration string) { maxRetries := 6 err := backoff.Retry(func() error { - _, err := client.AgentClient.IntegrationWithError(agentclient.WithArgs([]string{"install", "-r", integration})) + _, err := client.AgentClient.IntegrationWithError(agentclient.WithArgs([]string{"install", "--unsafe-disable-verification", "-r", integration})) return err }, backoff.WithMaxRetries(backoff.NewConstantBackOff(interval), uint64(maxRetries))) From 4cfa2daa0dc3ba2a349acfe883e2b266b33bbab8 Mon Sep 17 00:00:00 2001 From: Alexandre Yang Date: Thu, 28 Nov 2024 15:44:47 +0100 Subject: [PATCH 07/59] [ha-agent] Support more ndm integrations (#31522) Co-authored-by: Jen Gilbert --- comp/haagent/impl/config.go | 7 ++++++- comp/haagent/impl/haagent_test.go | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/comp/haagent/impl/config.go b/comp/haagent/impl/config.go index 4fea0af76d0fd..dc55f791264fc 100644 --- a/comp/haagent/impl/config.go +++ b/comp/haagent/impl/config.go @@ -14,7 +14,12 @@ import ( // At the moment, the list of HA Integrations is hardcoded here, but we might provide // more dynamic way to configure which integration should be considered HA Integration. var validHaIntegrations = map[string]bool{ - "snmp": true, + // NDM integrations + "snmp": true, + "cisco_aci": true, + "cisco_sdwan": true, + + // Other integrations "network_path": true, } diff --git a/comp/haagent/impl/haagent_test.go b/comp/haagent/impl/haagent_test.go index c427220404696..8821843e21c73 100644 --- a/comp/haagent/impl/haagent_test.go +++ b/comp/haagent/impl/haagent_test.go @@ -190,6 +190,8 @@ func Test_haAgentImpl_ShouldRunIntegration(t *testing.T) { leader: testAgentHostname, expectShouldRunIntegration: map[string]bool{ "snmp": true, + "cisco_aci": true, + "cisco_sdwan": true, "network_path": true, "unknown_integration": true, "cpu": true, @@ -207,6 +209,8 @@ func Test_haAgentImpl_ShouldRunIntegration(t *testing.T) { leader: "another-agent-is-leader", expectShouldRunIntegration: map[string]bool{ "snmp": false, + "cisco_aci": false, + "cisco_sdwan": false, "network_path": false, "unknown_integration": true, "cpu": true, @@ -223,6 +227,8 @@ func Test_haAgentImpl_ShouldRunIntegration(t *testing.T) { leader: testAgentHostname, expectShouldRunIntegration: map[string]bool{ "snmp": true, + "cisco_aci": true, + "cisco_sdwan": true, "network_path": true, "unknown_integration": true, "cpu": true, From 23ae050253ed47ac7dacbce6f4b1113ae545226b Mon Sep 17 00:00:00 2001 From: Guillaume Fournier <36961134+Gui774ume@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:09:55 +0100 Subject: [PATCH 08/59] [CWS] Fix NetworkDeviceSerializer (#31568) --- pkg/security/serializers/serializers_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/security/serializers/serializers_linux.go b/pkg/security/serializers/serializers_linux.go index 07d102105713f..f60785c997a09 100644 --- a/pkg/security/serializers/serializers_linux.go +++ b/pkg/security/serializers/serializers_linux.go @@ -1011,7 +1011,7 @@ func newNetworkDeviceSerializer(deviceCtx *model.NetworkDeviceContext, e *model. return &NetworkDeviceSerializer{ NetNS: deviceCtx.NetNS, IfIndex: deviceCtx.IfIndex, - IfName: e.FieldHandlers.ResolveNetworkDeviceIfName(e, &e.NetworkContext.Device), + IfName: e.FieldHandlers.ResolveNetworkDeviceIfName(e, deviceCtx), } } From 625691cd5141af77271eec671a0dc17df16c4c1a Mon Sep 17 00:00:00 2001 From: Yoann Ghigoff Date: Thu, 28 Nov 2024 16:18:06 +0100 Subject: [PATCH 09/59] [CWS] Bump security agent policies to v0.61.0 (#31569) --- release.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release.json b/release.json index 6ba0cdd4d879f..ee50fc47b964e 100644 --- a/release.json +++ b/release.json @@ -49,7 +49,7 @@ "OMNIBUS_RUBY_VERSION": "7.56.0-rc.1", "JMXFETCH_VERSION": "0.49.6", "JMXFETCH_HASH": "f06bdac1f8ec41daf9b9839ac883f1865a068b04810ea82197b8a6afb9369cb9", - "SECURITY_AGENT_POLICIES_VERSION": "v0.60.0", + "SECURITY_AGENT_POLICIES_VERSION": "v0.61.0", "MACOS_BUILD_VERSION": "6.56.0-rc.3", "WINDOWS_DDNPM_DRIVER": "release-signed", "WINDOWS_DDNPM_VERSION": "2.7.1", @@ -64,7 +64,7 @@ "OMNIBUS_RUBY_VERSION": "7.56.0-rc.1", "JMXFETCH_VERSION": "0.49.6", "JMXFETCH_HASH": "f06bdac1f8ec41daf9b9839ac883f1865a068b04810ea82197b8a6afb9369cb9", - "SECURITY_AGENT_POLICIES_VERSION": "v0.60.0", + "SECURITY_AGENT_POLICIES_VERSION": "v0.61.0", "MACOS_BUILD_VERSION": "7.56.0-rc.3", "WINDOWS_DDNPM_DRIVER": "release-signed", "WINDOWS_DDNPM_VERSION": "2.7.1", From 1ade87da53a066b1fba5924c04a97769ccc3559e Mon Sep 17 00:00:00 2001 From: Vincent Whitchurch Date: Thu, 28 Nov 2024 16:26:59 +0100 Subject: [PATCH 10/59] usm: go-tls: Add periodic process check (#31529) --- pkg/network/usm/ebpf_gotls.go | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/pkg/network/usm/ebpf_gotls.go b/pkg/network/usm/ebpf_gotls.go index 5fcbec13f047e..e12871aa619bf 100644 --- a/pkg/network/usm/ebpf_gotls.go +++ b/pkg/network/usm/ebpf_gotls.go @@ -37,6 +37,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/network/usm/consts" "github.com/DataDog/datadog-agent/pkg/network/usm/utils" "github.com/DataDog/datadog-agent/pkg/process/monitor" + "github.com/DataDog/datadog-agent/pkg/util/kernel" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/util/safeelf" ) @@ -243,11 +244,8 @@ func (p *goTLSProgram) PreStart(m *manager.Manager) error { case <-p.done: return case <-processSync.C: - processSet := p.registry.GetRegisteredProcesses() - deletedPids := monitor.FindDeletedProcesses(processSet) - for deletedPid := range deletedPids { - _ = p.registry.Unregister(deletedPid) - } + p.sync() + p.registry.Log() } } }() @@ -255,6 +253,29 @@ func (p *goTLSProgram) PreStart(m *manager.Manager) error { return nil } +func (p *goTLSProgram) sync() { + deletionCandidates := p.registry.GetRegisteredProcesses() + + _ = kernel.WithAllProcs(p.procRoot, func(pid int) error { + if _, ok := deletionCandidates[uint32(pid)]; ok { + // We have previously hooked into this process and it remains active, + // so we remove it from the deletionCandidates list, and move on to the next PID + delete(deletionCandidates, uint32(pid)) + return nil + } + + // This is a new PID so we attempt to attach SSL probes to it + _ = p.AttachPID(uint32(pid)) + return nil + }) + + // At this point all entries from deletionCandidates are no longer alive, so + // we should detach our SSL probes from them + for pid := range deletionCandidates { + p.handleProcessExit(pid) + } +} + // PostStart registers the goTLS program to the attacher list. func (p *goTLSProgram) PostStart(*manager.Manager) error { utils.AddAttacher(consts.USMModuleName, p.Name(), p) From 7bf22e719d1c279bd066ea85274de88e204a23f1 Mon Sep 17 00:00:00 2001 From: Vincent Whitchurch Date: Thu, 28 Nov 2024 16:44:37 +0100 Subject: [PATCH 11/59] discovery: Tweak Python name heuristics (#31562) --- .../corechecks/servicediscovery/usm/python.go | 13 ++++++-- .../servicediscovery/usm/python_test.go | 32 +++++++++++++++++-- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/pkg/collector/corechecks/servicediscovery/usm/python.go b/pkg/collector/corechecks/servicediscovery/usm/python.go index 16d774c191e01..44b2c02309463 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/python.go +++ b/pkg/collector/corechecks/servicediscovery/usm/python.go @@ -78,14 +78,23 @@ func (p pythonDetector) detect(args []string) (ServiceMetadata, bool) { if value, ok := p.deducePackageName(path.Clean(stripped), filename); ok { return NewServiceMetadata(value), true } - return NewServiceMetadata(p.findNearestTopLevel(stripped)), true + + name := p.findNearestTopLevel(stripped) + // If we have generic/useless directory names, fallback to the filename. + if name == "." || name == "/" || name == "bin" || name == "sbin" { + name = p.findNearestTopLevel(filename) + } + + return NewServiceMetadata(name), true } if hasFlagPrefix && a == "-m" { moduleFlag = true } - prevArgIsFlag = hasFlagPrefix + // The -u (unbuffered) option doesn't take an argument so we should + // consider the next arg even though this one is a flag. + prevArgIsFlag = hasFlagPrefix && a != "-u" } return ServiceMetadata{}, false diff --git a/pkg/collector/corechecks/servicediscovery/usm/python_test.go b/pkg/collector/corechecks/servicediscovery/usm/python_test.go index cfa80ae32413a..631c843e8a9d7 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/python_test.go +++ b/pkg/collector/corechecks/servicediscovery/usm/python_test.go @@ -3,6 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. +//go:build !windows + package usm import ( @@ -16,8 +18,9 @@ import ( ) func TestPythonDetect(t *testing.T) { - //prepare the in mem fs - memFs := fstest.MapFS{ + // Wrap the MapFS in a SubDirFS since we want to test absolute paths and the + // former doesn't allow them in calls to Open(). + memFs := SubDirFS{FS: fstest.MapFS{ "modules/m1/first/nice/package/__init__.py": &fstest.MapFile{}, "modules/m1/first/nice/__init__.py": &fstest.MapFile{}, "modules/m1/first/nice/something.py": &fstest.MapFile{}, @@ -28,7 +31,9 @@ func TestPythonDetect(t *testing.T) { "apps/app2/cmd/run.py": &fstest.MapFile{}, "apps/app2/setup.py": &fstest.MapFile{}, "example.py": &fstest.MapFile{}, - } + "usr/bin/pytest": &fstest.MapFile{}, + "bin/WALinuxAgent.egg": &fstest.MapFile{}, + }} tests := []struct { name string cmd string @@ -79,6 +84,27 @@ func TestPythonDetect(t *testing.T) { cmd: "python example.py", expected: "example", }, + { + name: "root level script", + cmd: "python /example.py", + expected: "example", + }, + { + name: "root level script with ..", + // This results in a path of "." after findNearestTopLevel is called on the split path. + cmd: "python /../example.py", + expected: "example", + }, + { + name: "script in bin", + cmd: "python /usr/bin/pytest", + expected: "pytest", + }, + { + name: "script in bin with -u", + cmd: "python3 -u bin/WALinuxAgent.egg", + expected: "WALinuxAgent", + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From ac6ee2a4d0abe667fdcc233e87a679da8dbb736a Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Thu, 28 Nov 2024 17:21:49 +0100 Subject: [PATCH 12/59] [CWS] Allow Windows cross-compilation using mingw (#31272) --- comp/etw/impl/session.c | 6 ++-- .../system/wincrashdetect/probe/crashdump.h | 4 +-- .../winutil/eventlog/api/windows/render.go | 17 +++++++---- pkg/windowsdriver/procmon/procmon.go | 2 +- tasks/agent.py | 20 ++++++++----- tasks/build_tags.py | 3 +- tasks/libs/common/utils.py | 6 +++- tasks/windows_resources.py | 29 ++++++++++++++----- 8 files changed, 58 insertions(+), 29 deletions(-) diff --git a/comp/etw/impl/session.c b/comp/etw/impl/session.c index 6fe7fa5e4ef73..ba59f3289e119 100644 --- a/comp/etw/impl/session.c +++ b/comp/etw/impl/session.c @@ -50,7 +50,7 @@ ULONG DDEnableTrace( PEVENT_FILTER_EVENT_ID disabledFilters = NULL; if (PIDCount > 0) { - eventFilterDescriptors[eventFilterDescriptorIndex].Ptr = (ULONGLONG)PIDs; + eventFilterDescriptors[eventFilterDescriptorIndex].Ptr = (LONG_PTR)PIDs; eventFilterDescriptors[eventFilterDescriptorIndex].Size = (ULONG)(sizeof(PIDs[0]) * PIDCount); eventFilterDescriptors[eventFilterDescriptorIndex].Type = EVENT_FILTER_TYPE_PID; @@ -69,7 +69,7 @@ ULONG DDEnableTrace( { enabledFilters->Events[i] = enableFilterIDs[i]; } - eventFilterDescriptors[eventFilterDescriptorIndex].Ptr = (ULONGLONG)enabledFilters; + eventFilterDescriptors[eventFilterDescriptorIndex].Ptr = (LONG_PTR)enabledFilters; eventFilterDescriptors[eventFilterDescriptorIndex].Size = size; eventFilterDescriptors[eventFilterDescriptorIndex].Type = EVENT_FILTER_TYPE_EVENT_ID; @@ -88,7 +88,7 @@ ULONG DDEnableTrace( { disabledFilters->Events[i] = disableFilterIDs[i]; } - eventFilterDescriptors[eventFilterDescriptorIndex].Ptr = (ULONGLONG)disabledFilters; + eventFilterDescriptors[eventFilterDescriptorIndex].Ptr = (LONG_PTR)disabledFilters; eventFilterDescriptors[eventFilterDescriptorIndex].Size = size; eventFilterDescriptors[eventFilterDescriptorIndex].Type = EVENT_FILTER_TYPE_EVENT_ID; diff --git a/pkg/collector/corechecks/system/wincrashdetect/probe/crashdump.h b/pkg/collector/corechecks/system/wincrashdetect/probe/crashdump.h index 373357e600482..e426b8fbb844f 100644 --- a/pkg/collector/corechecks/system/wincrashdetect/probe/crashdump.h +++ b/pkg/collector/corechecks/system/wincrashdetect/probe/crashdump.h @@ -4,8 +4,8 @@ #include #include -#include -#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/pkg/util/winutil/eventlog/api/windows/render.go b/pkg/util/winutil/eventlog/api/windows/render.go index 8b8386ce57fa7..937d3b414411c 100644 --- a/pkg/util/winutil/eventlog/api/windows/render.go +++ b/pkg/util/winutil/eventlog/api/windows/render.go @@ -12,7 +12,7 @@ import ( "unsafe" "github.com/DataDog/datadog-agent/pkg/util/winutil" - "github.com/DataDog/datadog-agent/pkg/util/winutil/eventlog/api" + evtapi "github.com/DataDog/datadog-agent/pkg/util/winutil/eventlog/api" "golang.org/x/sys/windows" ) @@ -21,6 +21,8 @@ import ( // #include // #include // +// #include +// // /* Helper to get a pointer value from the union in EVT_VARIANT without abusing // * unsafe.Pointer+uintptr and triggering warnings that are not relevant because // * this pointer value is in C memory not Go memory. @@ -31,6 +33,11 @@ import ( import "C" // implements EvtVariantValues + +const ( + EvtVariantTypeMask = 0x7f // EvtVariantTypeMask is not exposed on all buildchains +) + type evtVariantValues struct { // C memory, filled by the EvtRender call buf unsafe.Pointer @@ -45,7 +52,7 @@ func (v *evtVariantValues) String(index uint) (string, error) { if err != nil { return "", err } - t := C.EVT_VARIANT_TYPE_MASK & value.Type + t := EvtVariantTypeMask & value.Type if t == evtapi.EvtVarTypeString { return windows.UTF16PtrToString((*uint16)(C.dataptr(value))), nil } @@ -57,7 +64,7 @@ func (v *evtVariantValues) UInt(index uint) (uint64, error) { if err != nil { return 0, err } - t := C.EVT_VARIANT_TYPE_MASK & value.Type + t := EvtVariantTypeMask & value.Type if t == evtapi.EvtVarTypeByte { return uint64(*(*uint8)(unsafe.Pointer(value))), nil } else if t == evtapi.EvtVarTypeUInt16 { @@ -74,7 +81,7 @@ func (v *evtVariantValues) Time(index uint) (int64, error) { if err != nil { return 0, err } - t := C.EVT_VARIANT_TYPE_MASK & value.Type + t := EvtVariantTypeMask & value.Type if t == evtapi.EvtVarTypeFileTime { ft := (*C.FILETIME)(unsafe.Pointer(value)) nsec := (uint64(ft.dwHighDateTime) << 32) | uint64(ft.dwLowDateTime) @@ -89,7 +96,7 @@ func (v *evtVariantValues) SID(index uint) (*windows.SID, error) { if err != nil { return nil, err } - t := C.EVT_VARIANT_TYPE_MASK & value.Type + t := EvtVariantTypeMask & value.Type if t == evtapi.EvtVarTypeSid { origSid := (*windows.SID)(C.dataptr(value)) s, err := origSid.Copy() diff --git a/pkg/windowsdriver/procmon/procmon.go b/pkg/windowsdriver/procmon/procmon.go index d6f4765e79501..ba9e49ef51e74 100644 --- a/pkg/windowsdriver/procmon/procmon.go +++ b/pkg/windowsdriver/procmon/procmon.go @@ -63,7 +63,7 @@ const ( var ( // signature - procmonSignature = ProcmonSignature + procmonSignature int64 = ProcmonSignature ) // NewWinProcMon creates a new WinProcmon diff --git a/tasks/agent.py b/tasks/agent.py index 190c7b04c0916..90fb9d2a831b1 100644 --- a/tasks/agent.py +++ b/tasks/agent.py @@ -167,18 +167,22 @@ def build( major_version=major_version, ) - if sys.platform == 'win32': + if sys.platform == 'win32' or os.getenv("GOOS") == "windows": # Important for x-compiling env["CGO_ENABLED"] = "1" build_messagetable(ctx) - vars = versioninfo_vars(ctx, major_version=major_version) - build_rc( - ctx, - "cmd/agent/windows_resources/agent.rc", - vars=vars, - out="cmd/agent/rsrc.syso", - ) + + # Do not call build_rc when cross-compiling on Linux as the intend is more + # to streamline the development process that producing a working executable / installer + if sys.platform == 'win32': + vars = versioninfo_vars(ctx, major_version=major_version) + build_rc( + ctx, + "cmd/agent/windows_resources/agent.rc", + vars=vars, + out="cmd/agent/rsrc.syso", + ) if flavor.is_iot(): # Iot mode overrides whatever passed through `--build-exclude` and `--build-include` diff --git a/tasks/build_tags.py b/tasks/build_tags.py index caa73601e65b6..81b0564285c3e 100644 --- a/tasks/build_tags.py +++ b/tasks/build_tags.py @@ -7,6 +7,7 @@ # so we only need to check that we don't run this code with old Python versions. from __future__ import annotations +import os import sys from invoke import task @@ -323,7 +324,7 @@ def filter_incompatible_tags(include, platform=sys.platform): if not platform.startswith("linux"): exclude = exclude.union(LINUX_ONLY_TAGS) - if platform == "win32": + if platform == "win32" or os.getenv("GOOS") == "windows": include = include.union(["wmi"]) exclude = exclude.union(WINDOWS_EXCLUDE_TAGS) diff --git a/tasks/libs/common/utils.py b/tasks/libs/common/utils.py index c6a024b60c0ae..1bbd88910a8e5 100644 --- a/tasks/libs/common/utils.py +++ b/tasks/libs/common/utils.py @@ -268,6 +268,10 @@ def get_build_flags( extra_cgo_flags += f" -I{rtloader_common_headers}" env['CGO_CFLAGS'] = os.environ.get('CGO_CFLAGS', '') + extra_cgo_flags + if sys.platform == 'linux' and os.getenv('GOOS') == "windows": + # fake the minimum windows version + env['CGO_CFLAGS'] = env['CGO_CFLAGS'] + " -D_WIN32_WINNT=0x0A00" + # if `static` was passed ignore setting rpath, even if `embedded_path` was passed as well if static: ldflags += "-s -w -linkmode=external " @@ -319,7 +323,7 @@ def get_build_flags( if os.getenv('DD_CXX'): env['CXX'] = os.getenv('DD_CXX') - if sys.platform == 'linux': + if sys.platform == 'linux' and os.getenv('GOOS') != "windows": # Enable lazy binding, which seems to be overridden when loading containerd # Required to fix go-nvml compilation (see https://github.com/NVIDIA/go-nvml/issues/18) extldflags += "-Wl,-z,lazy " diff --git a/tasks/windows_resources.py b/tasks/windows_resources.py index 3e4493a222b73..6dc3db43a5e57 100644 --- a/tasks/windows_resources.py +++ b/tasks/windows_resources.py @@ -1,4 +1,5 @@ import os +import sys from invoke import task @@ -10,36 +11,48 @@ @task def build_messagetable( ctx, + target='pe-x86-64', + host_target='', # prefix of the toolchain used to cross-compile, for instance x86_64-w64-mingw32 ): """ Build the header and resource for the MESSAGETABLE shared between agent binaries. """ - windres_target = 'pe-x86-64' - messagefile = MESSAGESTRINGS_MC_PATH root = os.path.dirname(messagefile) # Generate the message header and resource file - command = f"windmc --target {windres_target} -r {root} -h {root} {messagefile}" + windmc = "windmc" + if not host_target and sys.platform.startswith('linux'): + host_target = "x86_64-w64-mingw32" + + if host_target: + windmc = host_target + "-" + windmc + + command = f"{windmc} --target {target} -r {root} -h {root} {messagefile}" ctx.run(command) - build_rc(ctx, f'{root}/messagestrings.rc') + build_rc(ctx, f'{root}/messagestrings.rc', target=target, host_target=host_target) -def build_rc(ctx, rc_file, vars=None, out=None): +def build_rc(ctx, rc_file, vars=None, out=None, target='pe-x86-64', host_target=''): if vars is None: vars = {} - windres_target = 'pe-x86-64' - if out is None: root = os.path.dirname(rc_file) out = f'{root}/rsrc.syso' # Build the binary resource # go automatically detects+includes .syso files - command = f"windres --target {windres_target} -i {rc_file} -O coff -o {out}" + windres = "windres" + if not host_target and sys.platform.startswith('linux'): + host_target = "x86_64-w64-mingw32" + + if host_target: + windres = host_target + "-" + windres + + command = f"{windres} --target {target} -i {rc_file} -O coff -o {out}" for key, value in vars.items(): command += f" --define {key}={value}" From 4cc5e2bf0ca322489d6aa3d9a568085678a13c40 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Thu, 28 Nov 2024 17:29:18 +0100 Subject: [PATCH 13/59] [CWS] Use containerutils.ContainerID in mount resolver (#31566) --- pkg/security/probe/field_handlers_ebpf.go | 8 +++---- pkg/security/probe/probe_ebpf.go | 4 ++-- pkg/security/resolvers/mount/interface.go | 9 ++++---- .../resolvers/mount/no_op_resolver.go | 9 ++++---- pkg/security/resolvers/mount/resolver.go | 21 ++++++++++--------- pkg/security/resolvers/path/resolver.go | 4 ++-- .../resolvers/process/resolver_ebpf.go | 4 ++-- 7 files changed, 31 insertions(+), 28 deletions(-) diff --git a/pkg/security/probe/field_handlers_ebpf.go b/pkg/security/probe/field_handlers_ebpf.go index 12749266a8a56..e52a47b453d2f 100644 --- a/pkg/security/probe/field_handlers_ebpf.go +++ b/pkg/security/probe/field_handlers_ebpf.go @@ -99,7 +99,7 @@ func (fh *EBPFFieldHandlers) ResolveFileFilesystem(ev *model.Event, f *model.Fil if f.IsFileless() { f.Filesystem = model.TmpFS } else { - fs, err := fh.resolvers.MountResolver.ResolveFilesystem(f.FileFields.MountID, f.FileFields.Device, ev.PIDContext.Pid, string(ev.ContainerContext.ContainerID)) + fs, err := fh.resolvers.MountResolver.ResolveFilesystem(f.FileFields.MountID, f.FileFields.Device, ev.PIDContext.Pid, ev.ContainerContext.ContainerID) if err != nil { ev.SetPathResolutionError(f, err) } @@ -146,7 +146,7 @@ func (fh *EBPFFieldHandlers) ResolveXAttrNamespace(ev *model.Event, e *model.Set // ResolveMountPointPath resolves a mount point path func (fh *EBPFFieldHandlers) ResolveMountPointPath(ev *model.Event, e *model.MountEvent) string { if len(e.MountPointPath) == 0 { - mountPointPath, _, _, err := fh.resolvers.MountResolver.ResolveMountPath(e.MountID, 0, ev.PIDContext.Pid, string(ev.ContainerContext.ContainerID)) + mountPointPath, _, _, err := fh.resolvers.MountResolver.ResolveMountPath(e.MountID, 0, ev.PIDContext.Pid, ev.ContainerContext.ContainerID) if err != nil { e.MountPointPathResolutionError = err return "" @@ -159,7 +159,7 @@ func (fh *EBPFFieldHandlers) ResolveMountPointPath(ev *model.Event, e *model.Mou // ResolveMountSourcePath resolves a mount source path func (fh *EBPFFieldHandlers) ResolveMountSourcePath(ev *model.Event, e *model.MountEvent) string { if e.BindSrcMountID != 0 && len(e.MountSourcePath) == 0 { - bindSourceMountPath, _, _, err := fh.resolvers.MountResolver.ResolveMountPath(e.BindSrcMountID, 0, ev.PIDContext.Pid, string(ev.ContainerContext.ContainerID)) + bindSourceMountPath, _, _, err := fh.resolvers.MountResolver.ResolveMountPath(e.BindSrcMountID, 0, ev.PIDContext.Pid, ev.ContainerContext.ContainerID) if err != nil { e.MountSourcePathResolutionError = err return "" @@ -177,7 +177,7 @@ func (fh *EBPFFieldHandlers) ResolveMountSourcePath(ev *model.Event, e *model.Mo // ResolveMountRootPath resolves a mount root path func (fh *EBPFFieldHandlers) ResolveMountRootPath(ev *model.Event, e *model.MountEvent) string { if len(e.MountRootPath) == 0 { - mountRootPath, _, _, err := fh.resolvers.MountResolver.ResolveMountRoot(e.MountID, 0, ev.PIDContext.Pid, string(ev.ContainerContext.ContainerID)) + mountRootPath, _, _, err := fh.resolvers.MountResolver.ResolveMountRoot(e.MountID, 0, ev.PIDContext.Pid, ev.ContainerContext.ContainerID) if err != nil { e.MountRootPathResolutionError = err return "" diff --git a/pkg/security/probe/probe_ebpf.go b/pkg/security/probe/probe_ebpf.go index 6db379021bbc7..82a65cb2aa83f 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -907,7 +907,7 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { // TODO: this should be moved in the resolver itself in order to handle the fallbacks if event.Mount.GetFSType() == "nsfs" { nsid := uint32(event.Mount.RootPathKey.Inode) - mountPath, _, _, err := p.Resolvers.MountResolver.ResolveMountPath(event.Mount.MountID, event.Mount.Device, event.PIDContext.Pid, string(event.ContainerContext.ContainerID)) + mountPath, _, _, err := p.Resolvers.MountResolver.ResolveMountPath(event.Mount.MountID, event.Mount.Device, event.PIDContext.Pid, event.ContainerContext.ContainerID) if err != nil { seclog.Debugf("failed to get mount path: %v", err) } else { @@ -923,7 +923,7 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { } // we can skip this error as this is for the umount only and there is no impact on the filepath resolution - mount, _, _, _ := p.Resolvers.MountResolver.ResolveMount(event.Umount.MountID, 0, event.PIDContext.Pid, string(event.ContainerContext.ContainerID)) + mount, _, _, _ := p.Resolvers.MountResolver.ResolveMount(event.Umount.MountID, 0, event.PIDContext.Pid, event.ContainerContext.ContainerID) if mount != nil && mount.GetFSType() == "nsfs" { nsid := uint32(mount.RootPathKey.Inode) if namespace := p.Resolvers.NamespaceResolver.ResolveNetworkNamespace(nsid); namespace != nil { diff --git a/pkg/security/resolvers/mount/interface.go b/pkg/security/resolvers/mount/interface.go index 80230e45065c8..818f6be74d2fe 100644 --- a/pkg/security/resolvers/mount/interface.go +++ b/pkg/security/resolvers/mount/interface.go @@ -9,6 +9,7 @@ package mount import ( + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" ) @@ -17,12 +18,12 @@ type ResolverInterface interface { IsMountIDValid(mountID uint32) (bool, error) SyncCache(pid uint32) error Delete(mountID uint32) error - ResolveFilesystem(mountID uint32, device uint32, pid uint32, containerID string) (string, error) + ResolveFilesystem(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (string, error) Insert(m model.Mount, pid uint32) error DelPid(pid uint32) - ResolveMountRoot(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error) - ResolveMountPath(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error) - ResolveMount(mountID uint32, device uint32, pid uint32, containerID string) (*model.Mount, model.MountSource, model.MountOrigin, error) + ResolveMountRoot(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (string, model.MountSource, model.MountOrigin, error) + ResolveMountPath(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (string, model.MountSource, model.MountOrigin, error) + ResolveMount(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (*model.Mount, model.MountSource, model.MountOrigin, error) SendStats() error ToJSON() ([]byte, error) } diff --git a/pkg/security/resolvers/mount/no_op_resolver.go b/pkg/security/resolvers/mount/no_op_resolver.go index 94548b334fb8f..db185a4fbf584 100644 --- a/pkg/security/resolvers/mount/no_op_resolver.go +++ b/pkg/security/resolvers/mount/no_op_resolver.go @@ -11,6 +11,7 @@ package mount import ( "errors" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" ) @@ -34,7 +35,7 @@ func (mr *NoOpResolver) Delete(_ uint32) error { } // ResolveFilesystem returns the name of the filesystem -func (mr *NoOpResolver) ResolveFilesystem(_ uint32, _ uint32, _ uint32, _ string) (string, error) { +func (mr *NoOpResolver) ResolveFilesystem(_ uint32, _ uint32, _ uint32, _ containerutils.ContainerID) (string, error) { return "", nil } @@ -47,17 +48,17 @@ func (mr *NoOpResolver) Insert(_ model.Mount, _ uint32) error { func (mr *NoOpResolver) DelPid(_ uint32) {} // ResolveMountRoot returns the root of a mount identified by its mount ID. -func (mr *NoOpResolver) ResolveMountRoot(_ uint32, _ uint32, _ uint32, _ string) (string, model.MountSource, model.MountOrigin, error) { +func (mr *NoOpResolver) ResolveMountRoot(_ uint32, _ uint32, _ uint32, _ containerutils.ContainerID) (string, model.MountSource, model.MountOrigin, error) { return "", model.MountSourceUnknown, model.MountOriginUnknown, nil } // ResolveMountPath returns the path of a mount identified by its mount ID. -func (mr *NoOpResolver) ResolveMountPath(_ uint32, _ uint32, _ uint32, _ string) (string, model.MountSource, model.MountOrigin, error) { +func (mr *NoOpResolver) ResolveMountPath(_ uint32, _ uint32, _ uint32, _ containerutils.ContainerID) (string, model.MountSource, model.MountOrigin, error) { return "", model.MountSourceUnknown, model.MountOriginUnknown, nil } // ResolveMount returns the mount -func (mr *NoOpResolver) ResolveMount(_ uint32, _ uint32, _ uint32, _ string) (*model.Mount, model.MountSource, model.MountOrigin, error) { +func (mr *NoOpResolver) ResolveMount(_ uint32, _ uint32, _ uint32, _ containerutils.ContainerID) (*model.Mount, model.MountSource, model.MountOrigin, error) { return nil, model.MountSourceUnknown, model.MountOriginUnknown, errors.New("not available") } diff --git a/pkg/security/resolvers/mount/resolver.go b/pkg/security/resolvers/mount/resolver.go index a996fbef721d9..9a112d818546e 100644 --- a/pkg/security/resolvers/mount/resolver.go +++ b/pkg/security/resolvers/mount/resolver.go @@ -26,6 +26,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/metrics" "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup" cmodel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/utils" "github.com/DataDog/datadog-agent/pkg/util/kernel" @@ -221,7 +222,7 @@ func (mr *Resolver) Delete(mountID uint32) error { } // ResolveFilesystem returns the name of the filesystem -func (mr *Resolver) ResolveFilesystem(mountID uint32, device uint32, pid uint32, containerID string) (string, error) { +func (mr *Resolver) ResolveFilesystem(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (string, error) { mr.lock.Lock() defer mr.lock.Unlock() @@ -404,14 +405,14 @@ func (mr *Resolver) getMountPath(mountID uint32, device uint32, pid uint32) (str } // ResolveMountRoot returns the root of a mount identified by its mount ID. -func (mr *Resolver) ResolveMountRoot(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error) { +func (mr *Resolver) ResolveMountRoot(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (string, model.MountSource, model.MountOrigin, error) { mr.lock.Lock() defer mr.lock.Unlock() return mr.resolveMountRoot(mountID, device, pid, containerID) } -func (mr *Resolver) resolveMountRoot(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error) { +func (mr *Resolver) resolveMountRoot(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (string, model.MountSource, model.MountOrigin, error) { mount, source, origin, err := mr.resolveMount(mountID, device, pid, containerID) if err != nil { return "", source, origin, err @@ -420,7 +421,7 @@ func (mr *Resolver) resolveMountRoot(mountID uint32, device uint32, pid uint32, } // ResolveMountPath returns the path of a mount identified by its mount ID. -func (mr *Resolver) ResolveMountPath(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error) { +func (mr *Resolver) ResolveMountPath(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (string, model.MountSource, model.MountOrigin, error) { mr.lock.Lock() defer mr.lock.Unlock() @@ -431,7 +432,7 @@ func (mr *Resolver) syncCacheMiss() { mr.procMissStats.Inc() } -func (mr *Resolver) reSyncCache(mountID uint32, pids []uint32, containerID string, workload *cmodel.CacheEntry) error { +func (mr *Resolver) reSyncCache(mountID uint32, pids []uint32, containerID containerutils.ContainerID, workload *cmodel.CacheEntry) error { if workload != nil { pids = append(pids, workload.GetPIDs()...) } else if len(containerID) == 0 && !slices.Contains(pids, 1) { @@ -446,13 +447,13 @@ func (mr *Resolver) reSyncCache(mountID uint32, pids []uint32, containerID strin return nil } -func (mr *Resolver) resolveMountPath(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error) { +func (mr *Resolver) resolveMountPath(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (string, model.MountSource, model.MountOrigin, error) { if _, err := mr.IsMountIDValid(mountID); err != nil { return "", model.MountSourceUnknown, model.MountOriginUnknown, err } // force a resolution here to make sure the LRU keeps doing its job and doesn't evict important entries - workload, _ := mr.cgroupsResolver.GetWorkload(containerID) + workload, _ := mr.cgroupsResolver.GetWorkload(string(containerID)) path, source, origin, err := mr.getMountPath(mountID, device, pid) if err == nil { @@ -480,20 +481,20 @@ func (mr *Resolver) resolveMountPath(mountID uint32, device uint32, pid uint32, } // ResolveMount returns the mount -func (mr *Resolver) ResolveMount(mountID uint32, device uint32, pid uint32, containerID string) (*model.Mount, model.MountSource, model.MountOrigin, error) { +func (mr *Resolver) ResolveMount(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (*model.Mount, model.MountSource, model.MountOrigin, error) { mr.lock.Lock() defer mr.lock.Unlock() return mr.resolveMount(mountID, device, pid, containerID) } -func (mr *Resolver) resolveMount(mountID uint32, device uint32, pid uint32, containerID string) (*model.Mount, model.MountSource, model.MountOrigin, error) { +func (mr *Resolver) resolveMount(mountID uint32, device uint32, pid uint32, containerID containerutils.ContainerID) (*model.Mount, model.MountSource, model.MountOrigin, error) { if _, err := mr.IsMountIDValid(mountID); err != nil { return nil, model.MountSourceUnknown, model.MountOriginUnknown, err } // force a resolution here to make sure the LRU keeps doing its job and doesn't evict important entries - workload, _ := mr.cgroupsResolver.GetWorkload(containerID) + workload, _ := mr.cgroupsResolver.GetWorkload(string(containerID)) mount, source, origin := mr.lookupMount(mountID, device, pid) if mount != nil { diff --git a/pkg/security/resolvers/path/resolver.go b/pkg/security/resolvers/path/resolver.go index c5eb914bc1d1c..4e8773e594c7e 100644 --- a/pkg/security/resolvers/path/resolver.go +++ b/pkg/security/resolvers/path/resolver.go @@ -58,7 +58,7 @@ func (r *Resolver) ResolveFileFieldsPath(e *model.FileFields, pidCtx *model.PIDC return pathStr, "", model.MountSourceMountID, model.MountOriginEvent, nil } - mountPath, source, origin, err := r.mountResolver.ResolveMountPath(e.MountID, e.Device, pidCtx.Pid, string(ctrCtx.ContainerID)) + mountPath, source, origin, err := r.mountResolver.ResolveMountPath(e.MountID, e.Device, pidCtx.Pid, ctrCtx.ContainerID) if err != nil { if _, err := r.mountResolver.IsMountIDValid(e.MountID); errors.Is(err, mount.ErrMountKernelID) { return pathStr, "", origin, source, &ErrPathResolutionNotCritical{Err: fmt.Errorf("mount ID(%d) invalid: %w", e.MountID, err)} @@ -66,7 +66,7 @@ func (r *Resolver) ResolveFileFieldsPath(e *model.FileFields, pidCtx *model.PIDC return pathStr, "", source, origin, &ErrPathResolution{Err: err} } - rootPath, source, origin, err := r.mountResolver.ResolveMountRoot(e.MountID, e.Device, pidCtx.Pid, string(ctrCtx.ContainerID)) + rootPath, source, origin, err := r.mountResolver.ResolveMountRoot(e.MountID, e.Device, pidCtx.Pid, ctrCtx.ContainerID) if err != nil { if _, err := r.mountResolver.IsMountIDValid(e.MountID); errors.Is(err, mount.ErrMountKernelID) { return pathStr, "", source, origin, &ErrPathResolutionNotCritical{Err: fmt.Errorf("mount ID(%d) invalid: %w", e.MountID, err)} diff --git a/pkg/security/resolvers/process/resolver_ebpf.go b/pkg/security/resolvers/process/resolver_ebpf.go index ef06b13cbefd8..d74425a724d37 100644 --- a/pkg/security/resolvers/process/resolver_ebpf.go +++ b/pkg/security/resolvers/process/resolver_ebpf.go @@ -390,7 +390,7 @@ func (p *EBPFResolver) enrichEventFromProc(entry *model.ProcessCacheEntry, proc entry.FileEvent.Filesystem = model.TmpFS } else { // resolve container path with the MountEBPFResolver - entry.FileEvent.Filesystem, err = p.mountResolver.ResolveFilesystem(entry.Process.FileEvent.MountID, entry.Process.FileEvent.Device, entry.Process.Pid, string(containerID)) + entry.FileEvent.Filesystem, err = p.mountResolver.ResolveFilesystem(entry.Process.FileEvent.MountID, entry.Process.FileEvent.Device, entry.Process.Pid, containerID) if err != nil { seclog.Debugf("snapshot failed for mount %d with pid %d : couldn't get the filesystem: %s", entry.Process.FileEvent.MountID, proc.Pid, err) } @@ -736,7 +736,7 @@ func (p *EBPFResolver) SetProcessSymlink(entry *model.ProcessCacheEntry) { // SetProcessFilesystem resolves process file system func (p *EBPFResolver) SetProcessFilesystem(entry *model.ProcessCacheEntry) (string, error) { if entry.FileEvent.MountID != 0 { - fs, err := p.mountResolver.ResolveFilesystem(entry.FileEvent.MountID, entry.FileEvent.Device, entry.Pid, string(entry.ContainerID)) + fs, err := p.mountResolver.ResolveFilesystem(entry.FileEvent.MountID, entry.FileEvent.Device, entry.Pid, entry.ContainerID) if err != nil { return "", err } From 654e2943da6d56ec2776905d1e7adbc8c4632998 Mon Sep 17 00:00:00 2001 From: maxime mouial Date: Thu, 28 Nov 2024 17:38:24 +0100 Subject: [PATCH 14/59] Refreshing trace secrets from the CLI (#31521) --- cmd/agent/subcommands/secret/command.go | 34 +++++++++++++++++++++++ cmd/otel-agent/subcommands/run/command.go | 2 ++ comp/trace/agent/impl/agent.go | 5 ++++ comp/trace/agent/impl/run.go | 21 ++++++++++++++ comp/trace/bundle_test.go | 2 ++ pkg/util/fxutil/provide_optional.go | 7 +++++ 6 files changed, 71 insertions(+) diff --git a/cmd/agent/subcommands/secret/command.go b/cmd/agent/subcommands/secret/command.go index 1f1ae9b0a6de5..e24f95ca6d693 100644 --- a/cmd/agent/subcommands/secret/command.go +++ b/cmd/agent/subcommands/secret/command.go @@ -8,6 +8,7 @@ package secret import ( "fmt" + "time" "github.com/spf13/cobra" "go.uber.org/fx" @@ -68,14 +69,47 @@ func showSecretInfo(config config.Component, _ log.Component) error { } func secretRefresh(config config.Component, _ log.Component) error { + fmt.Println("Agent refresh:") res, err := callIPCEndpoint(config, "agent/secret/refresh") if err != nil { return err } fmt.Println(string(res)) + + if config.GetBool("apm_config.enabled") { + fmt.Println("APM agent refresh:") + res, err = traceAgentSecretRefresh(config) + if err != nil { + return err + } + fmt.Println(string(res)) + } return nil } +func traceAgentSecretRefresh(conf config.Component) ([]byte, error) { + err := apiutil.SetAuthToken(conf) + if err != nil { + return nil, err + } + + port := conf.GetInt("apm_config.debug.port") + if port <= 0 { + return nil, fmt.Errorf("invalid apm_config.debug.port -- %d", port) + } + + c := apiutil.GetClient(false) + c.Timeout = conf.GetDuration("server_timeout") * time.Second + + url := fmt.Sprintf("http://127.0.0.1:%d/secret/refresh", port) + res, err := apiutil.DoGet(c, url, apiutil.CloseConnection) + if err != nil { + return nil, fmt.Errorf("could not contact trace-agent: %s", err) + } + + return res, nil +} + func callIPCEndpoint(config config.Component, endpointURL string) ([]byte, error) { endpoint, err := apiutil.NewIPCEndpoint(config, endpointURL) if err != nil { diff --git a/cmd/otel-agent/subcommands/run/command.go b/cmd/otel-agent/subcommands/run/command.go index 99106cc0b573d..a414674620e44 100644 --- a/cmd/otel-agent/subcommands/run/command.go +++ b/cmd/otel-agent/subcommands/run/command.go @@ -26,6 +26,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/hostname/remotehostnameimpl" log "github.com/DataDog/datadog-agent/comp/core/log/def" logtracefx "github.com/DataDog/datadog-agent/comp/core/log/fx-trace" + "github.com/DataDog/datadog-agent/comp/core/secrets" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" remoteTaggerFx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-remote" taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types" @@ -137,6 +138,7 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams, return acfg, nil }), fxutil.ProvideOptional[coreconfig.Component](), + fxutil.ProvideNoneOptional[secrets.Component](), workloadmetafx.Module(workloadmeta.Params{ AgentType: workloadmeta.NodeAgent, InitHelper: common.GetWorkloadmetaInit(), diff --git a/comp/trace/agent/impl/agent.go b/comp/trace/agent/impl/agent.go index 8ca8cf62d5140..b3d783288ceb6 100644 --- a/comp/trace/agent/impl/agent.go +++ b/comp/trace/agent/impl/agent.go @@ -24,6 +24,7 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/fx" + "github.com/DataDog/datadog-agent/comp/core/secrets" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" "github.com/DataDog/datadog-agent/comp/dogstatsd/statsd" traceagent "github.com/DataDog/datadog-agent/comp/trace/agent/def" @@ -38,6 +39,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/trace/telemetry" "github.com/DataDog/datadog-agent/pkg/trace/watchdog" "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/DataDog/datadog-agent/pkg/util/optional" "github.com/DataDog/datadog-agent/pkg/version" ddgostatsd "github.com/DataDog/datadog-go/v5/statsd" @@ -59,6 +61,7 @@ type dependencies struct { Shutdowner fx.Shutdowner Config config.Component + Secrets optional.Option[secrets.Component] Context context.Context Params *Params TelemetryCollector telemetry.TelemetryCollector @@ -86,6 +89,7 @@ type component struct { cancel context.CancelFunc config config.Component + secrets optional.Option[secrets.Component] params *Params tagger tagger.Component telemetryCollector telemetry.TelemetryCollector @@ -107,6 +111,7 @@ func NewAgent(deps dependencies) (traceagent.Component, error) { c = component{ cancel: cancel, config: deps.Config, + secrets: deps.Secrets, params: deps.Params, telemetryCollector: deps.TelemetryCollector, tagger: deps.Tagger, diff --git a/comp/trace/agent/impl/run.go b/comp/trace/agent/impl/run.go index bea05f8916f2c..d42d90b41fbff 100644 --- a/comp/trace/agent/impl/run.go +++ b/comp/trace/agent/impl/run.go @@ -6,6 +6,7 @@ package agentimpl import ( + "encoding/json" "fmt" "math/rand" "net/http" @@ -70,6 +71,26 @@ func runAgentSidekicks(ag component) error { } else { ag.Agent.DebugServer.AddRoute("/config", ag.config.GetConfigHandler()) } + if secrets, ok := ag.secrets.Get(); ok { + // Adding a route to trigger a secrets refresh from the CLI. + // TODO - components: the secrets comp already export a route but it requires the API component which is not + // used by the trace agent. This should be removed once the trace-agent is fully componentize. + ag.Agent.DebugServer.AddRoute("/secret/refresh", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + if apiutil.Validate(w, req) != nil { + return + } + + res, err := secrets.Refresh() + if err != nil { + log.Errorf("error while refresing secrets: %s", err) + w.Header().Set("Content-Type", "application/json") + body, _ := json.Marshal(map[string]string{"error": err.Error()}) + http.Error(w, string(body), http.StatusInternalServerError) + return + } + w.Write([]byte(res)) + })) + } api.AttachEndpoint(api.Endpoint{ Pattern: "/config/set", diff --git a/comp/trace/bundle_test.go b/comp/trace/bundle_test.go index a42de7e5a93ca..e9874a4b40077 100644 --- a/comp/trace/bundle_test.go +++ b/comp/trace/bundle_test.go @@ -17,6 +17,7 @@ import ( coreconfig "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" + "github.com/DataDog/datadog-agent/comp/core/secrets" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" taggerfx "github.com/DataDog/datadog-agent/comp/core/tagger/fx" "github.com/DataDog/datadog-agent/comp/core/telemetry/telemetryimpl" @@ -62,6 +63,7 @@ func TestMockBundleDependencies(t *testing.T) { fx.Provide(func() context.Context { return context.TODO() }), // fx.Supply(ctx) fails with a missing type error. fx.Supply(core.BundleParams{}), coreconfig.MockModule(), + fxutil.ProvideNoneOptional[secrets.Component](), telemetryimpl.MockModule(), fx.Provide(func() log.Component { return logmock.New(t) }), workloadmetafx.Module(workloadmeta.NewParams()), diff --git a/pkg/util/fxutil/provide_optional.go b/pkg/util/fxutil/provide_optional.go index 9733cb8b20065..f8b4ff23aa5bb 100644 --- a/pkg/util/fxutil/provide_optional.go +++ b/pkg/util/fxutil/provide_optional.go @@ -16,3 +16,10 @@ func ProvideOptional[T any]() fx.Option { return optional.NewOption[T](actualType) }) } + +// ProvideNoneOptional provide a none optional for the type +func ProvideNoneOptional[T any]() fx.Option { + return fx.Provide(func() optional.Option[T] { + return optional.NewNoneOption[T]() + }) +} From 4aa3121204b8311436292d411d4d7b3afa5307b6 Mon Sep 17 00:00:00 2001 From: maxime mouial Date: Thu, 28 Nov 2024 17:38:31 +0100 Subject: [PATCH 15/59] Implement teeconfig (#31478) --- pkg/config/model/viper.go | 4 +- pkg/config/nodetreemodel/config.go | 23 ++- pkg/config/teeconfig/go.mod | 2 +- pkg/config/teeconfig/teeconfig.go | 247 ++++++++++++++++++++++------- 4 files changed, 212 insertions(+), 64 deletions(-) diff --git a/pkg/config/model/viper.go b/pkg/config/model/viper.go index 4bac624a9270b..eeb4b65492e70 100644 --- a/pkg/config/model/viper.go +++ b/pkg/config/model/viper.go @@ -312,7 +312,9 @@ func (c *safeConfig) IsSet(key string) bool { func (c *safeConfig) AllKeysLowercased() []string { c.Lock() defer c.Unlock() - return c.Viper.AllKeys() + res := c.Viper.AllKeys() + slices.Sort(res) + return res } // Get wraps Viper for concurrent access diff --git a/pkg/config/nodetreemodel/config.go b/pkg/config/nodetreemodel/config.go index 14f727b6086a1..57d8ee8244c48 100644 --- a/pkg/config/nodetreemodel/config.go +++ b/pkg/config/nodetreemodel/config.go @@ -87,6 +87,8 @@ type ntmConfig struct { configName string configFile string configType string + // configPaths is the set of path to look for the configuration file + configPaths []string // configEnvVars is the set of env vars that are consulted for // any given configuration key. Multiple env vars can be associated with one key @@ -395,7 +397,9 @@ func (c *ntmConfig) AllKeysLowercased() []string { c.RLock() defer c.RUnlock() - return maps.Keys(c.knownKeys) + res := maps.Keys(c.knownKeys) + slices.Sort(res) + return res } func (c *ntmConfig) leafAtPath(key string) LeafNode { @@ -578,10 +582,23 @@ func (c *ntmConfig) AllSettingsBySource() map[model.Source]interface{} { } // AddConfigPath adds another config for the given path -func (c *ntmConfig) AddConfigPath(_in string) { +func (c *ntmConfig) AddConfigPath(in string) { c.Lock() defer c.Unlock() - c.logErrorNotImplemented("AddConfigPath") + + if !filepath.IsAbs(in) { + var err error + in, err = filepath.Abs(in) + if err != nil { + log.Errorf("could not get absolute path for configuration %q: %s", in, err) + return + } + } + + in = filepath.Clean(in) + if !slices.Contains(c.configPaths, in) { + c.configPaths = append(c.configPaths, in) + } } // AddExtraConfigPaths allows adding additional configuration files diff --git a/pkg/config/teeconfig/go.mod b/pkg/config/teeconfig/go.mod index 2e32352de592a..374d91579280a 100644 --- a/pkg/config/teeconfig/go.mod +++ b/pkg/config/teeconfig/go.mod @@ -10,11 +10,11 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/config/model v0.0.0-00010101000000-000000000000 + github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 github.com/DataDog/viper v1.13.5 ) require ( - github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/fsnotify/fsnotify v1.4.7 // indirect diff --git a/pkg/config/teeconfig/teeconfig.go b/pkg/config/teeconfig/teeconfig.go index f56190eca175b..efbc1c44b8e82 100644 --- a/pkg/config/teeconfig/teeconfig.go +++ b/pkg/config/teeconfig/teeconfig.go @@ -8,12 +8,15 @@ package teeconfig import ( "io" + "reflect" + "runtime" "strings" "time" "github.com/DataDog/viper" "github.com/DataDog/datadog-agent/pkg/config/model" + "github.com/DataDog/datadog-agent/pkg/util/log" ) // teeConfig is a combination of two configs, both get written to but only baseline is read @@ -67,14 +70,22 @@ func (t *teeConfig) SetKnown(key string) { // IsKnown returns whether a key is known func (t *teeConfig) IsKnown(key string) bool { - return t.baseline.IsKnown(key) + base := t.baseline.IsKnown(key) + compare := t.compare.IsKnown(key) + if base != compare { + log.Warnf("difference in config: IsKnown(%s) -> base: %v | compare %v", key, base, compare) + } + return base } // GetKnownKeysLowercased returns all the keys that meet at least one of these criteria: // 1) have a default, 2) have an environment variable binded or 3) have been SetKnown() // Note that it returns the keys lowercased. func (t *teeConfig) GetKnownKeysLowercased() map[string]interface{} { - return t.baseline.GetKnownKeysLowercased() + base := t.baseline.GetKnownKeysLowercased() + compare := t.compare.GetKnownKeysLowercased() + compareResult("", "GetKnownKeysLowercased", base, compare) + return base } // BuildSchema constructs the default schema and marks the config as ready for use @@ -111,91 +122,188 @@ func (t *teeConfig) ParseEnvAsSlice(key string, fn func(string) []interface{}) { // IsSet wraps Viper for concurrent access func (t *teeConfig) IsSet(key string) bool { - return t.baseline.IsSet(key) + base := t.baseline.IsSet(key) + compare := t.compare.IsSet(key) + if base != compare { + log.Warnf("difference in config: IsSet(%s) -> base: %v | compare %v", key, base, compare) + } + return base } func (t *teeConfig) AllKeysLowercased() []string { - return t.baseline.AllKeysLowercased() + base := t.baseline.AllKeysLowercased() + compare := t.compare.AllKeysLowercased() + if !reflect.DeepEqual(base, compare) { + log.Warnf("difference in config: allkeyslowercased() -> base len: %d | compare len: %d", len(base), len(compare)) + + i := 0 + j := 0 + for i < len(base) && j < len(compare) { + if base[i] != compare[j] { + i++ + j++ + continue + } + + log.Warnf("difference in config: allkeyslowercased() -> base[%d]: %v | compare[%d]: %v", i, base[i], j, compare[j]) + if strings.Compare(base[i], compare[j]) == -1 { + i++ + } else { + j++ + } + } + } + return base +} + +func compareResult(key, method string, base, compare interface{}) interface{} { + if !reflect.DeepEqual(base, compare) { + _, file, line, _ := runtime.Caller(2) + fileParts := strings.Split(file, "DataDog/datadog-agent/") + log.Warnf("difference in config: %s(%s) -> base: %v | compare %v from %s:%d", method, key, base, compare, fileParts[len(fileParts)-1], line) + } + return compare } // Get wraps Viper for concurrent access func (t *teeConfig) Get(key string) interface{} { - return t.baseline.Get(key) + base := t.baseline.Get(key) + compare := t.compare.Get(key) + return compareResult(key, "Get", base, compare) } // GetAllSources returns the value of a key for each source func (t *teeConfig) GetAllSources(key string) []model.ValueWithSource { - return t.baseline.GetAllSources(key) + base := t.baseline.GetAllSources(key) + compare := t.compare.GetAllSources(key) + compareResult(key, "GetAllSources", base, compare) + return base } // GetString wraps Viper for concurrent access func (t *teeConfig) GetString(key string) string { - return t.baseline.GetString(key) + base := t.baseline.GetString(key) + compare := t.compare.GetString(key) + compareResult(key, "GetString", base, compare) + return base + } // GetBool wraps Viper for concurrent access func (t *teeConfig) GetBool(key string) bool { - return t.baseline.GetBool(key) + base := t.baseline.GetBool(key) + compare := t.compare.GetBool(key) + compareResult(key, "GetBool", base, compare) + return base + } // GetInt wraps Viper for concurrent access func (t *teeConfig) GetInt(key string) int { - return t.baseline.GetInt(key) + base := t.baseline.GetInt(key) + compare := t.compare.GetInt(key) + compareResult(key, "GetInt", base, compare) + return base + } // GetInt32 wraps Viper for concurrent access func (t *teeConfig) GetInt32(key string) int32 { - return t.baseline.GetInt32(key) + base := t.baseline.GetInt32(key) + compare := t.compare.GetInt32(key) + compareResult(key, "GetInt32", base, compare) + return base + } // GetInt64 wraps Viper for concurrent access func (t *teeConfig) GetInt64(key string) int64 { - return t.baseline.GetInt64(key) + base := t.baseline.GetInt64(key) + compare := t.compare.GetInt64(key) + compareResult(key, "GetInt64", base, compare) + return base + } // GetFloat64 wraps Viper for concurrent access func (t *teeConfig) GetFloat64(key string) float64 { - return t.baseline.GetFloat64(key) + base := t.baseline.GetFloat64(key) + compare := t.compare.GetFloat64(key) + compareResult(key, "GetFloat64", base, compare) + return base + } // GetDuration wraps Viper for concurrent access func (t *teeConfig) GetDuration(key string) time.Duration { - return t.baseline.GetDuration(key) + base := t.baseline.GetDuration(key) + compare := t.compare.GetDuration(key) + compareResult(key, "GetDuration", base, compare) + return base + } // GetStringSlice wraps Viper for concurrent access func (t *teeConfig) GetStringSlice(key string) []string { - return t.baseline.GetStringSlice(key) + base := t.baseline.GetStringSlice(key) + compare := t.compare.GetStringSlice(key) + compareResult(key, "GetStringSlice", base, compare) + return base + } // GetFloat64Slice wraps Viper for concurrent access func (t *teeConfig) GetFloat64Slice(key string) []float64 { - return t.baseline.GetFloat64Slice(key) + base := t.baseline.GetFloat64Slice(key) + compare := t.compare.GetFloat64Slice(key) + compareResult(key, "GetFloat64Slice", base, compare) + return base + } // GetStringMap wraps Viper for concurrent access func (t *teeConfig) GetStringMap(key string) map[string]interface{} { - return t.baseline.GetStringMap(key) + base := t.baseline.GetStringMap(key) + compare := t.compare.GetStringMap(key) + compareResult(key, "GetStringMap", base, compare) + return base + } // GetStringMapString wraps Viper for concurrent access func (t *teeConfig) GetStringMapString(key string) map[string]string { - return t.baseline.GetStringMapString(key) + base := t.baseline.GetStringMapString(key) + compare := t.compare.GetStringMapString(key) + compareResult(key, "GetStringMapString", base, compare) + return base + } // GetStringMapStringSlice wraps Viper for concurrent access func (t *teeConfig) GetStringMapStringSlice(key string) map[string][]string { - return t.baseline.GetStringMapStringSlice(key) + base := t.baseline.GetStringMapStringSlice(key) + compare := t.compare.GetStringMapStringSlice(key) + compareResult(key, "GetStringMapStringSlice", base, compare) + return base + } // GetSizeInBytes wraps Viper for concurrent access func (t *teeConfig) GetSizeInBytes(key string) uint { - return t.baseline.GetSizeInBytes(key) + base := t.baseline.GetSizeInBytes(key) + compare := t.compare.GetSizeInBytes(key) + compareResult(key, "GetSizeInBytes", base, compare) + return base + } // GetSource wraps Viper for concurrent access func (t *teeConfig) GetSource(key string) model.Source { - return t.baseline.GetSource(key) + base := t.baseline.GetSource(key) + compare := t.compare.GetSource(key) + compareResult(key, "GetSource", base, compare) + return base + } // SetEnvPrefix wraps Viper for concurrent access, and keeps the envPrefix for @@ -226,41 +334,30 @@ func (t *teeConfig) UnmarshalKey(key string, rawVal interface{}, opts ...viper.D func (t *teeConfig) ReadInConfig() error { err1 := t.baseline.ReadInConfig() err2 := t.compare.ReadInConfig() - if err1 != nil { - return err1 - } - if err2 != nil { - return err2 + if (err1 == nil) != (err2 == nil) { + log.Warnf("difference in config: ReadInConfig() -> base error: %v | compare error: %v", err1, err2) } - return nil + return err1 } // ReadConfig wraps Viper for concurrent access func (t *teeConfig) ReadConfig(in io.Reader) error { err1 := t.baseline.ReadConfig(in) err2 := t.compare.ReadConfig(in) - if err1 != nil { - return err1 + if (err1 != nil && err2 == nil) || (err1 == nil && err2 != nil) { + log.Warnf("difference in config: ReadConfig() -> base error: %v | compare error: %v", err1, err2) } - if err2 != nil { - return err2 - } - return nil - + return err1 } // MergeConfig wraps Viper for concurrent access func (t *teeConfig) MergeConfig(in io.Reader) error { err1 := t.baseline.MergeConfig(in) err2 := t.compare.MergeConfig(in) - if err1 != nil { - return err1 - } - if err2 != nil { - return err2 + if (err1 != nil && err2 == nil) || (err1 == nil && err2 != nil) { + log.Warnf("difference in config: MergeConfig() -> base error: %v | compare error: %v", err1, err2) } - return nil - + return err1 } // MergeFleetPolicy merges the configuration from the reader given with an existing config @@ -271,28 +368,49 @@ func (t *teeConfig) MergeConfig(in io.Reader) error { func (t *teeConfig) MergeFleetPolicy(configPath string) error { err1 := t.baseline.MergeFleetPolicy(configPath) err2 := t.compare.MergeFleetPolicy(configPath) - if err1 != nil { - return err1 - } - if err2 != nil { - return err2 + if (err1 != nil && err2 == nil) || (err1 == nil && err2 != nil) { + log.Warnf("difference in config: MergeFleetPolicy(%s) -> base error: %v | compare error: %v", configPath, err1, err2) } - return nil + return err1 } // AllSettings wraps Viper for concurrent access func (t *teeConfig) AllSettings() map[string]interface{} { - return t.baseline.AllSettings() + base := t.baseline.AllSettings() + compare := t.compare.AllSettings() + if !reflect.DeepEqual(base, compare) { + log.Warnf("difference in config: AllSettings() -> base len: %v | compare len: %v", len(base), len(compare)) + for key := range base { + if _, ok := compare[key]; !ok { + log.Warnf("\titem %s missing from compare", key) + continue + } + if !reflect.DeepEqual(base[key], compare[key]) { + log.Warnf("\titem %s: %v | %v", key, base[key], compare[key]) + } + log.Flush() + } + } + return base + } // AllSettingsWithoutDefault returns a copy of the all the settings in the configuration without defaults func (t *teeConfig) AllSettingsWithoutDefault() map[string]interface{} { - return t.baseline.AllSettingsWithoutDefault() + base := t.baseline.AllSettingsWithoutDefault() + compare := t.compare.AllSettingsWithoutDefault() + compareResult("", "AllSettingsWithoutDefault", base, compare) + return base + } // AllSettingsBySource returns the settings from each source (file, env vars, ...) func (t *teeConfig) AllSettingsBySource() map[model.Source]interface{} { - return t.baseline.AllSettingsBySource() + base := t.baseline.AllSettingsBySource() + compare := t.compare.AllSettingsBySource() + compareResult("", "AllSettingsBySource", base, compare) + return base + } // AddConfigPath wraps Viper for concurrent access @@ -308,13 +426,10 @@ func (t *teeConfig) AddConfigPath(in string) { func (t *teeConfig) AddExtraConfigPaths(ins []string) error { err1 := t.baseline.AddExtraConfigPaths(ins) err2 := t.compare.AddExtraConfigPaths(ins) - if err1 != nil { - return err1 + if (err1 != nil && err2 == nil) || (err1 == nil && err2 != nil) { + log.Warnf("difference in config: AddExtraConfigPaths(%s) -> base error: %v | compare error: %v", ins, err1, err2) } - if err2 != nil { - return err2 - } - return nil + return err1 } // SetConfigName wraps Viper for concurrent access @@ -337,7 +452,11 @@ func (t *teeConfig) SetConfigType(in string) { // ConfigFileUsed wraps Viper for concurrent access func (t *teeConfig) ConfigFileUsed() string { - return t.baseline.ConfigFileUsed() + base := t.baseline.ConfigFileUsed() + compare := t.compare.ConfigFileUsed() + compareResult("", "ConfigFileUsed", base, compare) + return base + } //func (t *teeConfig) SetTypeByDefaultValue(in bool) { @@ -347,7 +466,11 @@ func (t *teeConfig) ConfigFileUsed() string { // GetEnvVars implements the Config interface func (t *teeConfig) GetEnvVars() []string { - return t.baseline.GetEnvVars() + base := t.baseline.GetEnvVars() + compare := t.compare.GetEnvVars() + compareResult("", "GetEnvVars", base, compare) + return base + } // BindEnvAndSetDefault implements the Config interface @@ -370,9 +493,15 @@ func (t *teeConfig) Stringify(source model.Source) string { } func (t *teeConfig) GetProxies() *model.Proxy { - return t.baseline.GetProxies() + base := t.baseline.GetProxies() + compare := t.compare.GetProxies() + compareResult("", "GetProxies", base, compare) + return base } func (t *teeConfig) ExtraConfigFilesUsed() []string { - return t.baseline.ExtraConfigFilesUsed() + base := t.baseline.ExtraConfigFilesUsed() + compare := t.compare.ExtraConfigFilesUsed() + compareResult("", "ExtraConfigFilesUsed", base, compare) + return base } From 57b1ae5e622e6877f995a40c53be75602fd5ca72 Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Thu, 28 Nov 2024 18:09:16 +0100 Subject: [PATCH 16/59] Update the codeowners file (#31575) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e5db92be230da..547304d1cbca5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -36,7 +36,7 @@ /Makefile.trace @DataDog/agent-delivery /mkdocs.yml @DataDog/agent-devx-infra -/release.json @DataDog/agent-delivery @DataDog/agent-metrics-logs @DataDog/windows-kernel-integrations @DataDog/agent-release-management @DataDog/agent-security +/release.json @DataDog/agent-delivery @DataDog/agent-metrics-logs @DataDog/windows-kernel-integrations @DataDog/agent-security /requirements.txt @DataDog/agent-devx-infra /pyproject.toml @DataDog/agent-devx-infra @DataDog/agent-devx-loops /repository.datadog.yml @DataDog/agent-devx-infra From b5f2511bdc394396901a1398bfb50f5f8ab32028 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Thu, 28 Nov 2024 19:31:44 +0100 Subject: [PATCH 17/59] [CWS] Use containerutils.ContainerID in user and group resolver (#31579) --- pkg/security/probe/field_handlers_ebpf.go | 20 +++++++------- pkg/security/probe/probe_ebpf.go | 4 +-- pkg/security/probe/probe_others.go | 3 ++- .../resolvers/process/resolver_ebpf.go | 12 ++++----- .../resolvers/usergroup/resolver_linux.go | 27 ++++++++++--------- 5 files changed, 34 insertions(+), 32 deletions(-) diff --git a/pkg/security/probe/field_handlers_ebpf.go b/pkg/security/probe/field_handlers_ebpf.go index e52a47b453d2f..bc68736d3caa6 100644 --- a/pkg/security/probe/field_handlers_ebpf.go +++ b/pkg/security/probe/field_handlers_ebpf.go @@ -234,7 +234,7 @@ func (fh *EBPFFieldHandlers) ResolveRights(_ *model.Event, e *model.FileFields) // ResolveChownUID resolves the ResolveProcessCacheEntry id of a chown event to a username func (fh *EBPFFieldHandlers) ResolveChownUID(ev *model.Event, e *model.ChownEvent) string { if len(e.User) == 0 { - e.User, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.UID), string(ev.ContainerContext.ContainerID)) + e.User, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.UID), ev.ContainerContext.ContainerID) } return e.User } @@ -242,7 +242,7 @@ func (fh *EBPFFieldHandlers) ResolveChownUID(ev *model.Event, e *model.ChownEven // ResolveChownGID resolves the group id of a chown event to a group name func (fh *EBPFFieldHandlers) ResolveChownGID(ev *model.Event, e *model.ChownEvent) string { if len(e.Group) == 0 { - e.Group, _ = fh.resolvers.UserGroupResolver.ResolveGroup(int(e.GID), string(ev.ContainerContext.ContainerID)) + e.Group, _ = fh.resolvers.UserGroupResolver.ResolveGroup(int(e.GID), ev.ContainerContext.ContainerID) } return e.Group } @@ -313,7 +313,7 @@ func (fh *EBPFFieldHandlers) ResolveProcessIsThread(_ *model.Event, process *mod // ResolveSetuidUser resolves the user of the Setuid event func (fh *EBPFFieldHandlers) ResolveSetuidUser(ev *model.Event, e *model.SetuidEvent) string { if len(e.User) == 0 { - e.User, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.UID), string(ev.ContainerContext.ContainerID)) + e.User, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.UID), ev.ContainerContext.ContainerID) } return e.User } @@ -321,7 +321,7 @@ func (fh *EBPFFieldHandlers) ResolveSetuidUser(ev *model.Event, e *model.SetuidE // ResolveSetuidEUser resolves the effective user of the Setuid event func (fh *EBPFFieldHandlers) ResolveSetuidEUser(ev *model.Event, e *model.SetuidEvent) string { if len(e.EUser) == 0 { - e.EUser, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.EUID), string(ev.ContainerContext.ContainerID)) + e.EUser, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.EUID), ev.ContainerContext.ContainerID) } return e.EUser } @@ -329,7 +329,7 @@ func (fh *EBPFFieldHandlers) ResolveSetuidEUser(ev *model.Event, e *model.Setuid // ResolveSetuidFSUser resolves the file-system user of the Setuid event func (fh *EBPFFieldHandlers) ResolveSetuidFSUser(ev *model.Event, e *model.SetuidEvent) string { if len(e.FSUser) == 0 { - e.FSUser, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.FSUID), string(ev.ContainerContext.ContainerID)) + e.FSUser, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.FSUID), ev.ContainerContext.ContainerID) } return e.FSUser } @@ -337,7 +337,7 @@ func (fh *EBPFFieldHandlers) ResolveSetuidFSUser(ev *model.Event, e *model.Setui // ResolveSetgidGroup resolves the group of the Setgid event func (fh *EBPFFieldHandlers) ResolveSetgidGroup(ev *model.Event, e *model.SetgidEvent) string { if len(e.Group) == 0 { - e.Group, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.GID), string(ev.ContainerContext.ContainerID)) + e.Group, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.GID), ev.ContainerContext.ContainerID) } return e.Group } @@ -345,7 +345,7 @@ func (fh *EBPFFieldHandlers) ResolveSetgidGroup(ev *model.Event, e *model.Setgid // ResolveSetgidEGroup resolves the effective group of the Setgid event func (fh *EBPFFieldHandlers) ResolveSetgidEGroup(ev *model.Event, e *model.SetgidEvent) string { if len(e.EGroup) == 0 { - e.EGroup, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.EGID), string(ev.ContainerContext.ContainerID)) + e.EGroup, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.EGID), ev.ContainerContext.ContainerID) } return e.EGroup } @@ -353,7 +353,7 @@ func (fh *EBPFFieldHandlers) ResolveSetgidEGroup(ev *model.Event, e *model.Setgi // ResolveSetgidFSGroup resolves the file-system group of the Setgid event func (fh *EBPFFieldHandlers) ResolveSetgidFSGroup(ev *model.Event, e *model.SetgidEvent) string { if len(e.FSGroup) == 0 { - e.FSGroup, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.FSGID), string(ev.ContainerContext.ContainerID)) + e.FSGroup, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.FSGID), ev.ContainerContext.ContainerID) } return e.FSGroup } @@ -383,7 +383,7 @@ func (fh *EBPFFieldHandlers) GetProcessCacheEntry(ev *model.Event, newEntryCb fu // ResolveFileFieldsGroup resolves the group id of the file to a group name func (fh *EBPFFieldHandlers) ResolveFileFieldsGroup(ev *model.Event, e *model.FileFields) string { if len(e.Group) == 0 { - e.Group, _ = fh.resolvers.UserGroupResolver.ResolveGroup(int(e.GID), string(ev.ContainerContext.ContainerID)) + e.Group, _ = fh.resolvers.UserGroupResolver.ResolveGroup(int(e.GID), ev.ContainerContext.ContainerID) } return e.Group } @@ -403,7 +403,7 @@ func (fh *EBPFFieldHandlers) ResolveNetworkDeviceIfName(_ *model.Event, device * // ResolveFileFieldsUser resolves the user id of the file to a username func (fh *EBPFFieldHandlers) ResolveFileFieldsUser(ev *model.Event, e *model.FileFields) string { if len(e.User) == 0 { - e.User, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.UID), string(ev.ContainerContext.ContainerID)) + e.User, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.UID), ev.ContainerContext.ContainerID) } return e.User } diff --git a/pkg/security/probe/probe_ebpf.go b/pkg/security/probe/probe_ebpf.go index 82a65cb2aa83f..ba861572e8314 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -1632,7 +1632,7 @@ func (p *EBPFProbe) FlushDiscarders() error { } // RefreshUserCache refreshes the user cache -func (p *EBPFProbe) RefreshUserCache(containerID string) error { +func (p *EBPFProbe) RefreshUserCache(containerID containerutils.ContainerID) error { return p.Resolvers.UserGroupResolver.RefreshCache(containerID) } @@ -2508,7 +2508,7 @@ func (p *EBPFProbe) HandleActions(ctx *eval.Context, rule *rules.Rule) { switch { case action.InternalCallback != nil && rule.ID == bundled.RefreshUserCacheRuleID: - _ = p.RefreshUserCache(string(ev.ContainerContext.ContainerID)) + _ = p.RefreshUserCache(ev.ContainerContext.ContainerID) case action.InternalCallback != nil && rule.ID == bundled.RefreshSBOMRuleID && p.Resolvers.SBOMResolver != nil && len(ev.ContainerContext.ContainerID) > 0: if err := p.Resolvers.SBOMResolver.RefreshSBOM(string(ev.ContainerContext.ContainerID)); err != nil { diff --git a/pkg/security/probe/probe_others.go b/pkg/security/probe/probe_others.go index ab2fcc2999ec6..b9dc61a9ae2e4 100644 --- a/pkg/security/probe/probe_others.go +++ b/pkg/security/probe/probe_others.go @@ -14,6 +14,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/events" "github.com/DataDog/datadog-agent/pkg/security/probe/kfilters" "github.com/DataDog/datadog-agent/pkg/security/secl/compiler/eval" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/secl/rules" ) @@ -97,7 +98,7 @@ func (p *Probe) FlushDiscarders() error { } // RefreshUserCache refreshes the user cache -func (p *Probe) RefreshUserCache(_ string) error { +func (p *Probe) RefreshUserCache(_ containerutils.ContainerID) error { return nil } diff --git a/pkg/security/resolvers/process/resolver_ebpf.go b/pkg/security/resolvers/process/resolver_ebpf.go index d74425a724d37..89aaac120ca4e 100644 --- a/pkg/security/resolvers/process/resolver_ebpf.go +++ b/pkg/security/resolvers/process/resolver_ebpf.go @@ -1039,13 +1039,13 @@ func (p *EBPFResolver) SetProcessTTY(pce *model.ProcessCacheEntry) string { // SetProcessUsersGroups resolves and set users and groups func (p *EBPFResolver) SetProcessUsersGroups(pce *model.ProcessCacheEntry) { - pce.User, _ = p.userGroupResolver.ResolveUser(int(pce.Credentials.UID), string(pce.ContainerID)) - pce.EUser, _ = p.userGroupResolver.ResolveUser(int(pce.Credentials.EUID), string(pce.ContainerID)) - pce.FSUser, _ = p.userGroupResolver.ResolveUser(int(pce.Credentials.FSUID), string(pce.ContainerID)) + pce.User, _ = p.userGroupResolver.ResolveUser(int(pce.Credentials.UID), pce.ContainerID) + pce.EUser, _ = p.userGroupResolver.ResolveUser(int(pce.Credentials.EUID), pce.ContainerID) + pce.FSUser, _ = p.userGroupResolver.ResolveUser(int(pce.Credentials.FSUID), pce.ContainerID) - pce.Group, _ = p.userGroupResolver.ResolveGroup(int(pce.Credentials.GID), string(pce.ContainerID)) - pce.EGroup, _ = p.userGroupResolver.ResolveGroup(int(pce.Credentials.EGID), string(pce.ContainerID)) - pce.FSGroup, _ = p.userGroupResolver.ResolveGroup(int(pce.Credentials.FSGID), string(pce.ContainerID)) + pce.Group, _ = p.userGroupResolver.ResolveGroup(int(pce.Credentials.GID), pce.ContainerID) + pce.EGroup, _ = p.userGroupResolver.ResolveGroup(int(pce.Credentials.EGID), pce.ContainerID) + pce.FSGroup, _ = p.userGroupResolver.ResolveGroup(int(pce.Credentials.FSGID), pce.ContainerID) } // Get returns the cache entry for a specified pid diff --git a/pkg/security/resolvers/usergroup/resolver_linux.go b/pkg/security/resolvers/usergroup/resolver_linux.go index 88b375e161c1d..39d54b8b670ed 100644 --- a/pkg/security/resolvers/usergroup/resolver_linux.go +++ b/pkg/security/resolvers/usergroup/resolver_linux.go @@ -16,6 +16,7 @@ import ( usergrouputils "github.com/DataDog/datadog-agent/pkg/security/common/usergrouputils" "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/seclog" "github.com/DataDog/datadog-agent/pkg/security/utils" "golang.org/x/time/rate" @@ -38,8 +39,8 @@ type EntryCache struct { // Resolver resolves user and group ids to names type Resolver struct { cgroupResolver *cgroup.Resolver - nsUserCache *lru.Cache[string, *EntryCache] - nsGroupCache *lru.Cache[string, *EntryCache] + nsUserCache *lru.Cache[containerutils.ContainerID, *EntryCache] + nsGroupCache *lru.Cache[containerutils.ContainerID, *EntryCache] } type containerFS struct { @@ -75,11 +76,11 @@ func (fs *hostFS) Open(path string) (fs.File, error) { return os.Open(path) } -func (r *Resolver) getFilesystem(containerID string) (fs.FS, error) { +func (r *Resolver) getFilesystem(containerID containerutils.ContainerID) (fs.FS, error) { var fsys fs.FS if containerID != "" { - cgroupEntry, found := r.cgroupResolver.GetWorkload(containerID) + cgroupEntry, found := r.cgroupResolver.GetWorkload(string(containerID)) if !found { return nil, fmt.Errorf("failed to resolve container %s", containerID) } @@ -92,7 +93,7 @@ func (r *Resolver) getFilesystem(containerID string) (fs.FS, error) { } // RefreshCache refresh the user and group caches with data from files -func (r *Resolver) RefreshCache(containerID string) error { +func (r *Resolver) RefreshCache(containerID containerutils.ContainerID) error { fsys, err := r.getFilesystem(containerID) if err != nil { return err @@ -109,7 +110,7 @@ func (r *Resolver) RefreshCache(containerID string) error { return nil } -func (r *Resolver) refreshUserCache(containerID string, fsys fs.FS) (map[int]string, error) { +func (r *Resolver) refreshUserCache(containerID containerutils.ContainerID, fsys fs.FS) (map[int]string, error) { entryCache, found := r.nsUserCache.Get(containerID) if !found { // add the entry cache before we parse the fill so that we also @@ -131,7 +132,7 @@ func (r *Resolver) refreshUserCache(containerID string, fsys fs.FS) (map[int]str return entries, nil } -func (r *Resolver) refreshGroupCache(containerID string, fsys fs.FS) (map[int]string, error) { +func (r *Resolver) refreshGroupCache(containerID containerutils.ContainerID, fsys fs.FS) (map[int]string, error) { entryCache, found := r.nsGroupCache.Get(containerID) if !found { entryCache = &EntryCache{rateLimiter: rate.NewLimiter(rate.Limit(refreshCacheRateLimit), refreshCacheRateBurst)} @@ -152,7 +153,7 @@ func (r *Resolver) refreshGroupCache(containerID string, fsys fs.FS) (map[int]st } // ResolveUser resolves a user id to a username -func (r *Resolver) ResolveUser(uid int, containerID string) (string, error) { +func (r *Resolver) ResolveUser(uid int, containerID containerutils.ContainerID) (string, error) { userCache, found := r.nsUserCache.Get(containerID) if found { cachedEntry, found := userCache.entries[uid] @@ -181,7 +182,7 @@ func (r *Resolver) ResolveUser(uid int, containerID string) (string, error) { } // ResolveGroup resolves a group id to a group name -func (r *Resolver) ResolveGroup(gid int, containerID string) (string, error) { +func (r *Resolver) ResolveGroup(gid int, containerID containerutils.ContainerID) (string, error) { groupCache, found := r.nsGroupCache.Get(containerID) if found { cachedEntry, found := groupCache.entries[gid] @@ -211,18 +212,18 @@ func (r *Resolver) ResolveGroup(gid int, containerID string) (string, error) { // OnCGroupDeletedEvent is used to handle a CGroupDeleted event func (r *Resolver) OnCGroupDeletedEvent(sbom *cgroupModel.CacheEntry) { - r.nsGroupCache.Remove(string(sbom.CGroupID)) - r.nsUserCache.Remove(string(sbom.CGroupID)) + r.nsGroupCache.Remove(sbom.ContainerID) + r.nsUserCache.Remove(sbom.ContainerID) } // NewResolver instantiates a new user and group resolver func NewResolver(cgroupResolver *cgroup.Resolver) (*Resolver, error) { - nsUserCache, err := lru.New[string, *EntryCache](64) + nsUserCache, err := lru.New[containerutils.ContainerID, *EntryCache](64) if err != nil { return nil, err } - nsGroupCache, err := lru.New[string, *EntryCache](64) + nsGroupCache, err := lru.New[containerutils.ContainerID, *EntryCache](64) if err != nil { return nil, err } From bd7c058e79aebbf3acb74cf49690f4fdb2cf0d59 Mon Sep 17 00:00:00 2001 From: Guillaume Pagnoux Date: Thu, 28 Nov 2024 19:37:22 +0100 Subject: [PATCH 18/59] discovery: update legacy name field when using container tags (#31574) --- pkg/collector/corechecks/servicediscovery/impl_linux.go | 4 ++++ pkg/collector/corechecks/servicediscovery/impl_linux_test.go | 1 + .../corechecks/servicediscovery/module/impl_linux.go | 4 ++++ .../corechecks/servicediscovery/module/impl_linux_test.go | 1 + 4 files changed, 10 insertions(+) diff --git a/pkg/collector/corechecks/servicediscovery/impl_linux.go b/pkg/collector/corechecks/servicediscovery/impl_linux.go index c85e66d380a1a..c9d4e66bd0406 100644 --- a/pkg/collector/corechecks/servicediscovery/impl_linux.go +++ b/pkg/collector/corechecks/servicediscovery/impl_linux.go @@ -106,6 +106,8 @@ func (li *linuxImpl) DiscoverServices() (*discoveredServices, error) { svc.service.CPUCores = service.CPUCores svc.service.ContainerID = service.ContainerID svc.service.GeneratedName = service.GeneratedName + svc.service.Name = service.Name + svc.meta.Name = service.Name events.heartbeat = append(events.heartbeat, *svc) } } @@ -143,6 +145,8 @@ func (li *linuxImpl) handlePotentialServices(events *serviceEvents, now time.Tim svc.service.CPUCores = service.CPUCores svc.service.ContainerID = service.ContainerID svc.service.GeneratedName = service.GeneratedName + svc.service.Name = service.Name + svc.meta.Name = service.Name li.aliveServices[pid] = svc events.start = append(events.start, *svc) diff --git a/pkg/collector/corechecks/servicediscovery/impl_linux_test.go b/pkg/collector/corechecks/servicediscovery/impl_linux_test.go index 07c7810d7230f..b2ae5d1d4f962 100644 --- a/pkg/collector/corechecks/servicediscovery/impl_linux_test.go +++ b/pkg/collector/corechecks/servicediscovery/impl_linux_test.go @@ -87,6 +87,7 @@ var ( } portTCP8080UpdatedRSS = model.Service{ PID: procTestService1.pid, + Name: "test-service-1", GeneratedName: "test-service-1-generated", DDService: "test-service-1", DDServiceInjected: true, diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux.go index dd02e8a13c2f4..181c22b662aaa 100644 --- a/pkg/collector/corechecks/servicediscovery/module/impl_linux.go +++ b/pkg/collector/corechecks/servicediscovery/module/impl_linux.go @@ -685,6 +685,10 @@ func (s *discovery) enrichContainerData(service *model.Service, containers map[s if serviceName != "" { service.GeneratedName = serviceName + // Update the legacy name field as well + if service.DDService == "" { + service.Name = serviceName + } } service.CheckedContainerData = true diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go index a8154ea1b7925..81c5bdb6a9f3a 100644 --- a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go +++ b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go @@ -840,6 +840,7 @@ func TestDocker(t *testing.T) { require.Contains(t, portMap, pid1111) require.Contains(t, portMap[pid1111].Ports, uint16(1234)) require.Contains(t, portMap[pid1111].ContainerID, "dummyCID") + require.Contains(t, portMap[pid1111].Name, "foo_from_app_tag") require.Contains(t, portMap[pid1111].GeneratedName, "foo_from_app_tag") } From dba148ca30f9218d6ad566f1bdf423df8fd47461 Mon Sep 17 00:00:00 2001 From: Maxime Riaud <65339037+misteriaud@users.noreply.github.com> Date: Thu, 28 Nov 2024 19:51:16 +0100 Subject: [PATCH 19/59] [ASCII-2547] Make the GUI serve static files from FS + e2e test (#31187) --- comp/core/gui/guiimpl/gui.go | 21 ++- comp/core/gui/guiimpl/render.go | 2 +- .../views/private/fonts/FontAwesome.otf | Bin 134808 -> 0 bytes tasks/agent.py | 2 +- test/new-e2e/go.mod | 2 +- .../agent-shared-components/gui/gui_common.go | 174 ++++++++++++++++++ .../gui/gui_nix_test.go | 69 +++++++ .../gui/gui_win_test.go | 72 ++++++++ 8 files changed, 334 insertions(+), 8 deletions(-) delete mode 100644 comp/core/gui/guiimpl/views/private/fonts/FontAwesome.otf create mode 100644 test/new-e2e/tests/agent-shared-components/gui/gui_common.go create mode 100644 test/new-e2e/tests/agent-shared-components/gui/gui_nix_test.go create mode 100644 test/new-e2e/tests/agent-shared-components/gui/gui_win_test.go diff --git a/comp/core/gui/guiimpl/gui.go b/comp/core/gui/guiimpl/gui.go index f05b6d45e32e4..94be94e231c1f 100644 --- a/comp/core/gui/guiimpl/gui.go +++ b/comp/core/gui/guiimpl/gui.go @@ -17,6 +17,7 @@ import ( "net/http" "os" "path" + "path/filepath" "strconv" "time" @@ -26,6 +27,8 @@ import ( "github.com/dvsekhvalnov/jose2go/base64url" "github.com/gorilla/mux" + securejoin "github.com/cyphar/filepath-securejoin" + api "github.com/DataDog/datadog-agent/comp/api/api/def" "github.com/DataDog/datadog-agent/comp/collector/collector" "github.com/DataDog/datadog-agent/comp/core/autodiscovery" @@ -36,6 +39,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/status" "github.com/DataDog/datadog-agent/pkg/api/security" + "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/DataDog/datadog-agent/pkg/util/optional" "github.com/DataDog/datadog-agent/pkg/util/system" @@ -62,8 +66,8 @@ type gui struct { startTimestamp int64 } -//go:embed views -var viewsFS embed.FS +//go:embed views/templates +var templatesFS embed.FS // Payload struct is for the JSON messages received from a client POST request type Payload struct { @@ -198,7 +202,7 @@ func (g *gui) getIntentToken(w http.ResponseWriter, _ *http.Request) { } func renderIndexPage(w http.ResponseWriter, _ *http.Request) { - data, err := viewsFS.ReadFile("views/templates/index.tmpl") + data, err := templatesFS.ReadFile("views/templates/index.tmpl") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return @@ -229,8 +233,15 @@ func renderIndexPage(w http.ResponseWriter, _ *http.Request) { } func serveAssets(w http.ResponseWriter, req *http.Request) { - path := path.Join("views", "private", req.URL.Path) - data, err := viewsFS.ReadFile(path) + staticFilePath := path.Join(setup.InstallPath, "bin", "agent", "dist", "views") + + // checking against path traversal + path, err := securejoin.SecureJoin(staticFilePath, req.URL.Path) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } + + data, err := os.ReadFile(path) if err != nil { if os.IsNotExist(err) { http.Error(w, err.Error(), http.StatusNotFound) diff --git a/comp/core/gui/guiimpl/render.go b/comp/core/gui/guiimpl/render.go index b22cd883a7dbe..7ec8ff3a88d17 100644 --- a/comp/core/gui/guiimpl/render.go +++ b/comp/core/gui/guiimpl/render.go @@ -76,7 +76,7 @@ func renderError(name string) (string, error) { func fillTemplate(w io.Writer, data Data, request string) error { t := template.New(request + ".tmpl") t.Funcs(fmap) - tmpl, err := viewsFS.ReadFile("views/templates/" + request + ".tmpl") + tmpl, err := templatesFS.ReadFile("views/templates/" + request + ".tmpl") if err != nil { return err } diff --git a/comp/core/gui/guiimpl/views/private/fonts/FontAwesome.otf b/comp/core/gui/guiimpl/views/private/fonts/FontAwesome.otf deleted file mode 100644 index 401ec0f36e4f73b8efa40bd6f604fe80d286db70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 134808 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 diff --git a/tasks/agent.py b/tasks/agent.py index 90fb9d2a831b1..a3eee098dd2a9 100644 --- a/tasks/agent.py +++ b/tasks/agent.py @@ -307,7 +307,7 @@ def refresh_assets(_, build_tags, development=True, flavor=AgentFlavor.base.name os.path.join(dist_folder, "conf.d/process_agent.yaml.default"), ) - shutil.copytree("./comp/core/gui/guiimpl/views", os.path.join(dist_folder, "views"), dirs_exist_ok=True) + shutil.copytree("./comp/core/gui/guiimpl/views/private", os.path.join(dist_folder, "views"), dirs_exist_ok=True) if development: shutil.copytree("./dev/dist/", dist_folder, dirs_exist_ok=True) diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index ad07f9d5683ec..1fbadfd55daff 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -261,7 +261,7 @@ require ( go.uber.org/atomic v1.11.0 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.31.0 // indirect + golang.org/x/net v0.31.0 golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.9.0 // indirect golang.org/x/text v0.20.0 diff --git a/test/new-e2e/tests/agent-shared-components/gui/gui_common.go b/test/new-e2e/tests/agent-shared-components/gui/gui_common.go new file mode 100644 index 0000000000000..1f5491037edd8 --- /dev/null +++ b/test/new-e2e/tests/agent-shared-components/gui/gui_common.go @@ -0,0 +1,174 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +package gui + +import ( + "fmt" + "io" + "net" + "net/http" + "net/url" + "path" + "strconv" + "strings" + "testing" + + "net/http/cookiejar" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "golang.org/x/net/html" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" +) + +const ( + agentAPIPort = 5001 + guiPort = 5002 + guiAPIEndpoint = "/agent/gui/intent" +) + +// assertAgentsUseKey checks that all agents are using the given key. +func getGUIIntentToken(t *assert.CollectT, host *components.RemoteHost, authtoken string) string { + hostHTTPClient := host.NewHTTPClient() + + apiEndpoint := &url.URL{ + Scheme: "https", + Host: net.JoinHostPort("localhost", strconv.Itoa(agentAPIPort)), + Path: guiAPIEndpoint, + } + + req, err := http.NewRequest(http.MethodGet, apiEndpoint.String(), nil) + require.NoErrorf(t, err, "failed to fetch API from %s", apiEndpoint.String()) + + req.Header.Set("Authorization", "Bearer "+authtoken) + + resp, err := hostHTTPClient.Do(req) + require.NoErrorf(t, err, "failed to fetch intent token from %s", apiEndpoint.String()) + defer resp.Body.Close() + + require.Equalf(t, http.StatusOK, resp.StatusCode, "unexpected status code for %s", apiEndpoint.String()) + + url, err := io.ReadAll(resp.Body) + require.NoErrorf(t, err, "failed to read response body from %s", apiEndpoint.String()) + + return string(url) +} + +// assertGuiIsAvailable checks that the Agent GUI server is up and running. +func getGUIClient(t *assert.CollectT, host *components.RemoteHost, authtoken string) *http.Client { + intentToken := getGUIIntentToken(t, host, authtoken) + + guiURL := url.URL{ + Scheme: "http", + Host: net.JoinHostPort("localhost", strconv.Itoa(guiPort)), + Path: "/auth", + RawQuery: url.Values{ + "intent": {intentToken}, + }.Encode(), + } + + jar, err := cookiejar.New(&cookiejar.Options{}) + require.NoError(t, err) + + guiClient := host.NewHTTPClient() + guiClient.Jar = jar + + // Make the GET request + resp, err := guiClient.Get(guiURL.String()) + require.NoErrorf(t, err, "failed to reach GUI at address %s", guiURL.String()) + require.Equalf(t, http.StatusOK, resp.StatusCode, "unexpected status code for %s", guiURL.String()) + defer resp.Body.Close() + + cookies := guiClient.Jar.Cookies(&guiURL) + assert.NotEmpty(t, cookies) + assert.Equal(t, cookies[0].Name, "accessToken", "GUI server didn't the accessToken cookie") + + // Assert redirection to "/" + assert.Equal(t, fmt.Sprintf("http://%v", net.JoinHostPort("localhost", strconv.Itoa(guiPort)))+"/", resp.Request.URL.String(), "GUI auth endpoint didn't redirect to root endpoint") + + return guiClient +} + +func checkStaticFiles(t *testing.T, client *http.Client, host *components.RemoteHost, installPath string) { + + var links []string + var traverse func(*html.Node) + + guiURL := url.URL{ + Scheme: "http", + Host: net.JoinHostPort("localhost", strconv.Itoa(guiPort)), + Path: "/", + } + + // Make the GET request + resp, err := client.Get(guiURL.String()) + require.NoErrorf(t, err, "failed to reach GUI at address %s", guiURL.String()) + require.Equalf(t, http.StatusOK, resp.StatusCode, "unexpected status code for %s", guiURL.String()) + defer resp.Body.Close() + + doc, err := html.Parse(resp.Body) + require.NoErrorf(t, err, "failed to parse HTML response from GUI at address %s", guiURL.String()) + + traverse = func(n *html.Node) { + if n.Type == html.ElementNode { + switch n.Data { + case "link": + for _, attr := range n.Attr { + if attr.Key == "href" { + links = append(links, attr.Val) + } + } + case "script": + for _, attr := range n.Attr { + if attr.Key == "src" { + links = append(links, attr.Val) + } + } + } + } + for c := n.FirstChild; c != nil; c = c.NextSibling { + traverse(c) + } + } + + traverse(doc) + for _, link := range links { + t.Logf("trying to reach asset %v", link) + fullLink := fmt.Sprintf("http://%v/%v", net.JoinHostPort("localhost", strconv.Itoa(guiPort)), link) + resp, err := client.Get(fullLink) + assert.NoErrorf(t, err, "failed to reach GUI asset at address %s", fullLink) + defer resp.Body.Close() + assert.Equalf(t, http.StatusOK, resp.StatusCode, "unexpected status code for %s", fullLink) + + body, err := io.ReadAll(resp.Body) + // We replace windows line break by linux so the tests pass on every OS + bodyContent := strings.Replace(string(body), "\r\n", "\n", -1) + assert.NoErrorf(t, err, "failed to read content of GUI asset at address %s", fullLink) + + // retrieving the served file in the Agent insallation director, removing the "view/" prefix + expectedBody, err := host.ReadFile(path.Join(installPath, "bin", "agent", "dist", "views", strings.TrimLeft(link, "view/"))) + // We replace windows line break by linux so the tests pass on every OS + expectedBodyContent := strings.Replace(string(expectedBody), "\r\n", "\n", -1) + assert.NoErrorf(t, err, "unable to retrieve file %v in the expected served files", link) + + assert.Equalf(t, expectedBodyContent, bodyContent, "content of the file %v is not the same as expected", link) + } +} + +func checkPingEndpoint(t *testing.T, client *http.Client) { + guiURL := url.URL{ + Scheme: "http", + Host: net.JoinHostPort("localhost", strconv.Itoa(guiPort)), + Path: "/agent/ping", + } + + // Make the GET request + resp, err := client.Post(guiURL.String(), "", nil) + require.NoErrorf(t, err, "failed to reach GUI at address %s", guiURL.String()) + require.Equalf(t, http.StatusOK, resp.StatusCode, "unexpected status code for %s", guiURL.String()) + defer resp.Body.Close() +} diff --git a/test/new-e2e/tests/agent-shared-components/gui/gui_nix_test.go b/test/new-e2e/tests/agent-shared-components/gui/gui_nix_test.go new file mode 100644 index 0000000000000..c0396429d896d --- /dev/null +++ b/test/new-e2e/tests/agent-shared-components/gui/gui_nix_test.go @@ -0,0 +1,69 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +package gui + +import ( + "fmt" + "net/http" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" +) + +type guiLinuxSuite struct { + e2e.BaseSuite[environments.Host] +} + +func TestGUILinuxSuite(t *testing.T) { + t.Parallel() + e2e.Run(t, &guiLinuxSuite{}, e2e.WithProvisioner(awshost.ProvisionerNoFakeIntake())) +} + +func (v *guiLinuxSuite) TestGUI() { + authTokenFilePath := "/etc/datadog-agent/auth_token" + + config := fmt.Sprintf(`auth_token_file_path: %v +cmd_port: %d +GUI_port: %d`, authTokenFilePath, agentAPIPort, guiPort) + // start the agent with that configuration + v.UpdateEnv(awshost.Provisioner( + awshost.WithAgentOptions( + agentparams.WithAgentConfig(config), + ), + awshost.WithAgentClientOptions( + agentclientparams.WithAuthTokenPath(authTokenFilePath), + ), + )) + + // get auth token + v.T().Log("Getting the authentication token") + authtokenContent := v.Env().RemoteHost.MustExecute("sudo cat " + authTokenFilePath) + authtoken := strings.TrimSpace(authtokenContent) + + v.T().Log("Testing GUI authentication flow") + + var guiClient *http.Client + // and check that the agents are using the new key + require.EventuallyWithT(v.T(), func(t *assert.CollectT) { + guiClient = getGUIClient(t, v.Env().RemoteHost, authtoken) + }, 30*time.Second, 5*time.Second) + + v.T().Log("Testing GUI static file server") + checkStaticFiles(v.T(), guiClient, v.Env().RemoteHost, "/opt/datadog-agent") + + v.T().Log("Testing GUI ping endpoint") + checkPingEndpoint(v.T(), guiClient) +} diff --git a/test/new-e2e/tests/agent-shared-components/gui/gui_win_test.go b/test/new-e2e/tests/agent-shared-components/gui/gui_win_test.go new file mode 100644 index 0000000000000..b20b3fb5ce01e --- /dev/null +++ b/test/new-e2e/tests/agent-shared-components/gui/gui_win_test.go @@ -0,0 +1,72 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. +package gui + +import ( + "fmt" + "net/http" + "strings" + "testing" + "time" + + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + "github.com/DataDog/test-infra-definitions/components/os" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" +) + +type guiWindowsSuite struct { + e2e.BaseSuite[environments.Host] +} + +func TestGUIWindowsSuite(t *testing.T) { + t.Parallel() + e2e.Run(t, &guiWindowsSuite{}, e2e.WithProvisioner(awshost.ProvisionerNoFakeIntake(awshost.WithEC2InstanceOptions(ec2.WithOS(os.WindowsDefault))))) +} + +func (v *guiWindowsSuite) TestGUI() { + authTokenFilePath := `C:\ProgramData\Datadog\auth_token` + + config := fmt.Sprintf(`auth_token_file_path: %v +cmd_port: %d +GUI_port: %d`, authTokenFilePath, agentAPIPort, guiPort) + // start the agent with that configuration + v.UpdateEnv(awshost.Provisioner( + awshost.WithEC2InstanceOptions(ec2.WithOS(os.WindowsDefault)), + awshost.WithAgentOptions( + agentparams.WithAgentConfig(config), + ), + awshost.WithAgentClientOptions( + agentclientparams.WithAuthTokenPath(authTokenFilePath), + ), + )) + + // get auth token + v.T().Log("Getting the authentication token") + authtokenContent, err := v.Env().RemoteHost.ReadFile(authTokenFilePath) + require.NoError(v.T(), err) + + authtoken := strings.TrimSpace(string(authtokenContent)) + + v.T().Log("Trying to connect to GUI server") + + var guiClient *http.Client + // and check that the agents are using the new key + require.EventuallyWithT(v.T(), func(t *assert.CollectT) { + guiClient = getGUIClient(t, v.Env().RemoteHost, authtoken) + }, 1*time.Minute, 10*time.Second) + + v.T().Log("Testing GUI static file server") + checkStaticFiles(v.T(), guiClient, v.Env().RemoteHost, "c:/Program Files/Datadog/Datadog Agent") + + v.T().Log("Testing GUI ping endpoint") + checkPingEndpoint(v.T(), guiClient) +} From 9d960d3fdceba7a28aa4bbec53177c20c308b10e Mon Sep 17 00:00:00 2001 From: maxime mouial Date: Thu, 28 Nov 2024 20:07:45 +0100 Subject: [PATCH 20/59] Implement AllKeyLowercase to be compatible with Viper (#31480) --- pkg/config/nodetreemodel/config.go | 31 +++++++++++++++++++++++------ pkg/config/nodetreemodel/helpers.go | 11 ++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/pkg/config/nodetreemodel/config.go b/pkg/config/nodetreemodel/config.go index 57d8ee8244c48..9e293bb9a7592 100644 --- a/pkg/config/nodetreemodel/config.go +++ b/pkg/config/nodetreemodel/config.go @@ -19,7 +19,6 @@ import ( "github.com/DataDog/viper" "go.uber.org/atomic" - "golang.org/x/exp/maps" "golang.org/x/exp/slices" "github.com/DataDog/datadog-agent/pkg/config/model" @@ -100,6 +99,8 @@ type ntmConfig struct { // keys that have been used but are unknown // used to warn (a single time) on use unknownKeys map[string]struct{} + // allSettings contains all settings that we have a value for in the default tree + allSettings []string // extraConfigFilePaths represents additional configuration file paths that will be merged into the main configuration when ReadInConfig() is called. extraConfigFilePaths []string @@ -238,9 +239,9 @@ func (c *ntmConfig) SetKnown(key string) { if c.isReady() { panic("cannot SetKnown() once the config has been marked as ready for use") } + key = strings.ToLower(key) c.knownKeys[key] = struct{}{} - c.setDefault(key, nil) } // IsKnown returns whether a key is known @@ -296,6 +297,24 @@ func (c *ntmConfig) mergeAllLayers() error { return nil } +func computeAllSettings(node InnerNode, path string) []string { + knownKeys := []string{} + for _, name := range node.ChildrenKeys() { + newPath := joinKey(path, name) + + child, _ := node.GetChild(name) + if _, ok := child.(LeafNode); ok { + knownKeys = append(knownKeys, newPath) + } else if inner, ok := child.(InnerNode); ok { + knownKeys = append(knownKeys, computeAllSettings(inner, newPath)...) + } else { + log.Errorf("unknown node type in the tree: %T", child) + } + } + slices.Sort(knownKeys) + return knownKeys +} + // BuildSchema is called when Setup is complete, and the config is ready to be used func (c *ntmConfig) BuildSchema() { c.Lock() @@ -305,6 +324,7 @@ func (c *ntmConfig) BuildSchema() { if err := c.mergeAllLayers(); err != nil { c.warnings = append(c.warnings, err.Error()) } + c.allSettings = computeAllSettings(c.defaults, "") } // Stringify stringifies the config, but only with the test build tag @@ -392,14 +412,12 @@ func (c *ntmConfig) IsSet(key string) bool { return c.IsKnown(key) } -// AllKeysLowercased returns all keys lower-cased +// AllKeysLowercased returns all keys lower-cased from the default tree, but not keys that are merely marked as known func (c *ntmConfig) AllKeysLowercased() []string { c.RLock() defer c.RUnlock() - res := maps.Keys(c.knownKeys) - slices.Sort(res) - return res + return slices.Clone(c.allSettings) } func (c *ntmConfig) leafAtPath(key string) LeafNode { @@ -686,6 +704,7 @@ func NewConfig(name string, envPrefix string, envKeyReplacer *strings.Replacer) ready: atomic.NewBool(false), configEnvVars: map[string]string{}, knownKeys: map[string]struct{}{}, + allSettings: []string{}, unknownKeys: map[string]struct{}{}, defaults: newInnerNode(nil), file: newInnerNode(nil), diff --git a/pkg/config/nodetreemodel/helpers.go b/pkg/config/nodetreemodel/helpers.go index 33f96491b583a..9cbb3beb8e2d1 100644 --- a/pkg/config/nodetreemodel/helpers.go +++ b/pkg/config/nodetreemodel/helpers.go @@ -16,6 +16,17 @@ func splitKey(key string) []string { return strings.Split(strings.ToLower(key), ".") } +func joinKey(parts ...string) string { + nonEmptyParts := make([]string, 0, len(parts)) + for idx := range parts { + if parts[idx] == "" { + continue + } + nonEmptyParts = append(nonEmptyParts, parts[idx]) + } + return strings.Join(nonEmptyParts, ".") +} + func safeMul(a, b uint) uint { c := a * b // detect multiplication overflows From 08b90d29ba48063bf260d06f8f0fdd309ef6f1bc Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Thu, 28 Nov 2024 20:20:30 +0100 Subject: [PATCH 21/59] [CWS] Use containerutils.ContainerID in SBOM resolver (#31581) --- pkg/security/probe/field_handlers_ebpf.go | 2 +- pkg/security/probe/probe_ebpf.go | 2 +- pkg/security/resolvers/sbom/resolver.go | 27 ++++++++++--------- .../resolvers/sbom/resolver_unsupported.go | 5 ++-- pkg/security/tests/sbom_test.go | 3 ++- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/pkg/security/probe/field_handlers_ebpf.go b/pkg/security/probe/field_handlers_ebpf.go index bc68736d3caa6..9437a258b4dff 100644 --- a/pkg/security/probe/field_handlers_ebpf.go +++ b/pkg/security/probe/field_handlers_ebpf.go @@ -442,7 +442,7 @@ func (fh *EBPFFieldHandlers) resolveSBOMFields(ev *model.Event, f *model.FileEve return } - if pkg := fh.resolvers.SBOMResolver.ResolvePackage(string(ev.ContainerContext.ContainerID), f); pkg != nil { + if pkg := fh.resolvers.SBOMResolver.ResolvePackage(ev.ContainerContext.ContainerID, f); pkg != nil { f.PkgName = pkg.Name f.PkgVersion = pkg.Version f.PkgSrcVersion = pkg.SrcVersion diff --git a/pkg/security/probe/probe_ebpf.go b/pkg/security/probe/probe_ebpf.go index ba861572e8314..679547e0ee055 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -2511,7 +2511,7 @@ func (p *EBPFProbe) HandleActions(ctx *eval.Context, rule *rules.Rule) { _ = p.RefreshUserCache(ev.ContainerContext.ContainerID) case action.InternalCallback != nil && rule.ID == bundled.RefreshSBOMRuleID && p.Resolvers.SBOMResolver != nil && len(ev.ContainerContext.ContainerID) > 0: - if err := p.Resolvers.SBOMResolver.RefreshSBOM(string(ev.ContainerContext.ContainerID)); err != nil { + if err := p.Resolvers.SBOMResolver.RefreshSBOM(ev.ContainerContext.ContainerID); err != nil { seclog.Warnf("failed to refresh SBOM for container %s, triggered by %s: %s", ev.ContainerContext.ContainerID, ev.ProcessContext.Comm, err) } diff --git a/pkg/security/resolvers/sbom/resolver.go b/pkg/security/resolvers/sbom/resolver.go index 13c308c67016d..d0a290975d6df 100644 --- a/pkg/security/resolvers/sbom/resolver.go +++ b/pkg/security/resolvers/sbom/resolver.go @@ -33,6 +33,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/config" "github.com/DataDog/datadog-agent/pkg/security/metrics" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/seclog" "github.com/DataDog/datadog-agent/pkg/security/utils" @@ -57,7 +58,7 @@ type SBOM struct { Host string Source string Service string - ContainerID string + ContainerID containerutils.ContainerID workloadKey string deleted *atomic.Bool @@ -98,7 +99,7 @@ func (s *SBOM) reset() { } // NewSBOM returns a new empty instance of SBOM -func NewSBOM(host string, source string, id string, cgroup *cgroupModel.CacheEntry, workloadKey string) (*SBOM, error) { +func NewSBOM(host string, source string, id containerutils.ContainerID, cgroup *cgroupModel.CacheEntry, workloadKey string) (*SBOM, error) { sbom := &SBOM{ files: fileQuerier{}, Host: host, @@ -117,7 +118,7 @@ func NewSBOM(host string, source string, id string, cgroup *cgroupModel.CacheEnt type Resolver struct { cfg *config.RuntimeSecurityConfig sbomsLock sync.RWMutex - sboms map[string]*SBOM + sboms map[containerutils.ContainerID]*SBOM sbomsCacheLock sync.RWMutex sbomsCache *simplelru.LRU[string, *SBOM] scannerChan chan *SBOM @@ -165,7 +166,7 @@ func NewSBOMResolver(c *config.RuntimeSecurityConfig, statsdClient statsd.Client resolver := &Resolver{ cfg: c, statsdClient: statsdClient, - sboms: make(map[string]*SBOM), + sboms: make(map[containerutils.ContainerID]*SBOM), sbomsCache: sbomsCache, scannerChan: make(chan *SBOM, 100), sbomScanner: sbomScanner, @@ -258,7 +259,7 @@ func (r *Resolver) Start(ctx context.Context) error { } // RefreshSBOM regenerates a SBOM for a container -func (r *Resolver) RefreshSBOM(containerID string) error { +func (r *Resolver) RefreshSBOM(containerID containerutils.ContainerID) error { if sbom := r.getSBOM(containerID); sbom != nil { seclog.Debugf("Refreshing SBOM for container %s", containerID) sbom.refresh.Call() @@ -318,7 +319,7 @@ func (r *Resolver) doScan(sbom *SBOM) (*trivy.Report, error) { sbom.cgroup.RemovePID(rootCandidatePID) continue } - if string(computedID) != sbom.ContainerID { + if computedID != sbom.ContainerID { sbom.cgroup.RemovePID(rootCandidatePID) continue } @@ -403,7 +404,7 @@ func (r *Resolver) analyzeWorkload(sbom *SBOM) error { return nil } -func (r *Resolver) getSBOM(containerID string) *SBOM { +func (r *Resolver) getSBOM(containerID containerutils.ContainerID) *SBOM { r.sbomsLock.RLock() defer r.sbomsLock.RUnlock() @@ -416,7 +417,7 @@ func (r *Resolver) getSBOM(containerID string) *SBOM { // ResolvePackage returns the Package that owns the provided file. Make sure the internal fields of "file" are properly // resolved. -func (r *Resolver) ResolvePackage(containerID string, file *model.FileEvent) *Package { +func (r *Resolver) ResolvePackage(containerID containerutils.ContainerID, file *model.FileEvent) *Package { sbom := r.getSBOM(containerID) if sbom == nil { return nil @@ -430,7 +431,7 @@ func (r *Resolver) ResolvePackage(containerID string, file *model.FileEvent) *Pa // newWorkloadEntry (thread unsafe) creates a new SBOM entry for the sbom designated by the provided process cache // entry -func (r *Resolver) newWorkloadEntry(id string, cgroup *cgroupModel.CacheEntry, workloadKey string) (*SBOM, error) { +func (r *Resolver) newWorkloadEntry(id containerutils.ContainerID, cgroup *cgroupModel.CacheEntry, workloadKey string) (*SBOM, error) { sbom, err := NewSBOM(r.hostname, r.source, id, cgroup, workloadKey) if err != nil { return nil, err @@ -493,7 +494,7 @@ func (r *Resolver) OnWorkloadSelectorResolvedEvent(cgroup *cgroupModel.CacheEntr return } - id := string(cgroup.ContainerID) + id := cgroup.ContainerID // We don't scan hosts for now if len(id) == 0 { return @@ -511,7 +512,7 @@ func (r *Resolver) OnWorkloadSelectorResolvedEvent(cgroup *cgroupModel.CacheEntr } // GetWorkload returns the sbom of a provided ID -func (r *Resolver) GetWorkload(id string) *SBOM { +func (r *Resolver) GetWorkload(id containerutils.ContainerID) *SBOM { r.sbomsLock.RLock() defer r.sbomsLock.RUnlock() @@ -524,11 +525,11 @@ func (r *Resolver) GetWorkload(id string) *SBOM { // OnCGroupDeletedEvent is used to handle a CGroupDeleted event func (r *Resolver) OnCGroupDeletedEvent(cgroup *cgroupModel.CacheEntry) { - r.Delete(string(cgroup.CGroupID)) + r.Delete(cgroup.ContainerID) } // Delete removes the SBOM of the provided cgroup id -func (r *Resolver) Delete(id string) { +func (r *Resolver) Delete(id containerutils.ContainerID) { sbom := r.GetWorkload(id) if sbom == nil { return diff --git a/pkg/security/resolvers/sbom/resolver_unsupported.go b/pkg/security/resolvers/sbom/resolver_unsupported.go index a9b05d167589a..9e073e03e552c 100644 --- a/pkg/security/resolvers/sbom/resolver_unsupported.go +++ b/pkg/security/resolvers/sbom/resolver_unsupported.go @@ -15,6 +15,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/config" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" ) @@ -36,7 +37,7 @@ func (r *Resolver) OnWorkloadSelectorResolvedEvent(_ *cgroupModel.CacheEntry) { } // ResolvePackage returns the Package that owns the provided file -func (r *Resolver) ResolvePackage(_ string, _ *model.FileEvent) *Package { +func (r *Resolver) ResolvePackage(_ containerutils.ContainerID, _ *model.FileEvent) *Package { return nil } @@ -51,6 +52,6 @@ func (r *Resolver) Start(_ context.Context) error { } // RefreshSBOM regenerates a SBOM for a container -func (r *Resolver) RefreshSBOM(_ string) error { +func (r *Resolver) RefreshSBOM(_ containerutils.ContainerID) error { return nil } diff --git a/pkg/security/tests/sbom_test.go b/pkg/security/tests/sbom_test.go index fd014c5777495..3a0588aba3861 100644 --- a/pkg/security/tests/sbom_test.go +++ b/pkg/security/tests/sbom_test.go @@ -15,6 +15,7 @@ import ( "testing" sprobe "github.com/DataDog/datadog-agent/pkg/security/probe" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/secl/rules" "github.com/DataDog/datadog-agent/pkg/util/flavor" @@ -69,7 +70,7 @@ func TestSBOM(t *testing.T) { dockerWrapper.Run(t, "package-rule", func(t *testing.T, _ wrapperType, cmdFunc func(bin string, args, env []string) *exec.Cmd) { test.WaitSignal(t, func() error { retry.Do(func() error { - sbom := p.Resolvers.SBOMResolver.GetWorkload(dockerWrapper.containerID) + sbom := p.Resolvers.SBOMResolver.GetWorkload(containerutils.ContainerID(dockerWrapper.containerID)) if sbom == nil { return fmt.Errorf("failed to find SBOM for '%s'", dockerWrapper.containerID) } From cdc6007f16ba7f6f68b7b24bb50fa33cc4592f09 Mon Sep 17 00:00:00 2001 From: Vincent Whitchurch Date: Thu, 28 Nov 2024 21:09:16 +0100 Subject: [PATCH 22/59] discovery: Report origin of generated service name (#31226) --- .../corechecks/servicediscovery/events.go | 78 +-- .../servicediscovery/events_test.go | 250 ++++----- .../servicediscovery/impl_linux_test.go | 497 +++++++++--------- .../servicediscovery/model/model.go | 1 + .../servicediscovery/module/impl_linux.go | 44 +- .../module/impl_linux_test.go | 5 + .../corechecks/servicediscovery/usm/java.go | 32 +- .../corechecks/servicediscovery/usm/jee.go | 17 +- .../servicediscovery/usm/jee_test.go | 3 +- .../corechecks/servicediscovery/usm/nodejs.go | 4 +- .../corechecks/servicediscovery/usm/php.go | 2 +- .../corechecks/servicediscovery/usm/python.go | 16 +- .../corechecks/servicediscovery/usm/ruby.go | 2 +- .../servicediscovery/usm/service.go | 44 +- .../servicediscovery/usm/service_test.go | 358 +++++++------ 15 files changed, 749 insertions(+), 604 deletions(-) diff --git a/pkg/collector/corechecks/servicediscovery/events.go b/pkg/collector/corechecks/servicediscovery/events.go index 5cba3f89243ac..fba57253ad552 100644 --- a/pkg/collector/corechecks/servicediscovery/events.go +++ b/pkg/collector/corechecks/servicediscovery/events.go @@ -26,25 +26,26 @@ const ( ) type eventPayload struct { - NamingSchemaVersion string `json:"naming_schema_version"` - ServiceName string `json:"service_name"` - GeneratedServiceName string `json:"generated_service_name"` - DDService string `json:"dd_service,omitempty"` - HostName string `json:"host_name"` - Env string `json:"env"` - ServiceLanguage string `json:"service_language"` - ServiceType string `json:"service_type"` - StartTime int64 `json:"start_time"` - StartTimeMilli int64 `json:"start_time_milli"` - LastSeen int64 `json:"last_seen"` - APMInstrumentation string `json:"apm_instrumentation"` - ServiceNameSource string `json:"service_name_source,omitempty"` - Ports []uint16 `json:"ports"` - PID int `json:"pid"` - CommandLine []string `json:"command_line"` - RSSMemory uint64 `json:"rss_memory"` - CPUCores float64 `json:"cpu_cores"` - ContainerID string `json:"container_id"` + NamingSchemaVersion string `json:"naming_schema_version"` + ServiceName string `json:"service_name"` + GeneratedServiceName string `json:"generated_service_name"` + GeneratedServiceNameSource string `json:"generated_service_name_source,omitempty"` + DDService string `json:"dd_service,omitempty"` + HostName string `json:"host_name"` + Env string `json:"env"` + ServiceLanguage string `json:"service_language"` + ServiceType string `json:"service_type"` + StartTime int64 `json:"start_time"` + StartTimeMilli int64 `json:"start_time_milli"` + LastSeen int64 `json:"last_seen"` + APMInstrumentation string `json:"apm_instrumentation"` + ServiceNameSource string `json:"service_name_source,omitempty"` + Ports []uint16 `json:"ports"` + PID int `json:"pid"` + CommandLine []string `json:"command_line"` + RSSMemory uint64 `json:"rss_memory"` + CPUCores float64 `json:"cpu_cores"` + ContainerID string `json:"container_id"` } type event struct { @@ -74,25 +75,26 @@ func (ts *telemetrySender) newEvent(t eventType, svc serviceInfo) *event { RequestType: t, APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: svc.meta.Name, - GeneratedServiceName: svc.service.GeneratedName, - DDService: svc.service.DDService, - HostName: host, - Env: env, - ServiceLanguage: svc.meta.Language, - ServiceType: svc.meta.Type, - StartTime: int64(svc.service.StartTimeMilli / 1000), - StartTimeMilli: int64(svc.service.StartTimeMilli), - LastSeen: svc.LastHeartbeat.Unix(), - APMInstrumentation: svc.meta.APMInstrumentation, - ServiceNameSource: nameSource, - Ports: svc.service.Ports, - PID: svc.service.PID, - CommandLine: svc.service.CommandLine, - RSSMemory: svc.service.RSS, - CPUCores: svc.service.CPUCores, - ContainerID: svc.service.ContainerID, + NamingSchemaVersion: "1", + ServiceName: svc.meta.Name, + GeneratedServiceName: svc.service.GeneratedName, + GeneratedServiceNameSource: svc.service.GeneratedNameSource, + DDService: svc.service.DDService, + HostName: host, + Env: env, + ServiceLanguage: svc.meta.Language, + ServiceType: svc.meta.Type, + StartTime: int64(svc.service.StartTimeMilli / 1000), + StartTimeMilli: int64(svc.service.StartTimeMilli), + LastSeen: svc.LastHeartbeat.Unix(), + APMInstrumentation: svc.meta.APMInstrumentation, + ServiceNameSource: nameSource, + Ports: svc.service.Ports, + PID: svc.service.PID, + CommandLine: svc.service.CommandLine, + RSSMemory: svc.service.RSS, + CPUCores: svc.service.CPUCores, + ContainerID: svc.service.ContainerID, }, } } diff --git a/pkg/collector/corechecks/servicediscovery/events_test.go b/pkg/collector/corechecks/servicediscovery/events_test.go index 6974ae4c138a8..f8b7fc92bcfb3 100644 --- a/pkg/collector/corechecks/servicediscovery/events_test.go +++ b/pkg/collector/corechecks/servicediscovery/events_test.go @@ -56,16 +56,17 @@ func Test_telemetrySender(t *testing.T) { svc := serviceInfo{ service: model.Service{ - PID: 99, - CommandLine: []string{"test-service", "--args"}, - Ports: []uint16{80, 8080}, - StartTimeMilli: uint64(now.Add(-20 * time.Minute).UnixMilli()), - RSS: 500 * 1024 * 1024, - GeneratedName: "generated-name", - DDService: "dd-service", - DDServiceInjected: true, - CPUCores: 1.5, - ContainerID: "abcd", + PID: 99, + CommandLine: []string{"test-service", "--args"}, + Ports: []uint16{80, 8080}, + StartTimeMilli: uint64(now.Add(-20 * time.Minute).UnixMilli()), + RSS: 500 * 1024 * 1024, + GeneratedName: "generated-name", + GeneratedNameSource: "generated-name-source", + DDService: "dd-service", + DDServiceInjected: true, + CPUCores: 1.5, + ContainerID: "abcd", }, meta: ServiceMetadata{ Name: "test-service", @@ -85,75 +86,78 @@ func Test_telemetrySender(t *testing.T) { RequestType: "start-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service", - GeneratedServiceName: "generated-name", - DDService: "dd-service", - ServiceNameSource: "injected", - HostName: "test-host", - Env: "", - ServiceLanguage: "jvm", - ServiceType: "web_service", - StartTime: 1715557200, - StartTimeMilli: 1715557200 * 1000, - LastSeen: 1715558400, - APMInstrumentation: "injected", - Ports: []uint16{80, 8080}, - PID: 99, - CommandLine: []string{"test-service", "--args"}, - RSSMemory: 500 * 1024 * 1024, - CPUCores: 1.5, - ContainerID: "abcd", + NamingSchemaVersion: "1", + ServiceName: "test-service", + GeneratedServiceName: "generated-name", + GeneratedServiceNameSource: "generated-name-source", + DDService: "dd-service", + ServiceNameSource: "injected", + HostName: "test-host", + Env: "", + ServiceLanguage: "jvm", + ServiceType: "web_service", + StartTime: 1715557200, + StartTimeMilli: 1715557200 * 1000, + LastSeen: 1715558400, + APMInstrumentation: "injected", + Ports: []uint16{80, 8080}, + PID: 99, + CommandLine: []string{"test-service", "--args"}, + RSSMemory: 500 * 1024 * 1024, + CPUCores: 1.5, + ContainerID: "abcd", }, }, { RequestType: "heartbeat-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service", - GeneratedServiceName: "generated-name", - DDService: "dd-service", - ServiceNameSource: "injected", - HostName: "test-host", - Env: "", - ServiceLanguage: "jvm", - ServiceType: "web_service", - StartTime: 1715557200, - StartTimeMilli: 1715557200 * 1000, - LastSeen: 1715558400, - APMInstrumentation: "injected", - Ports: []uint16{80, 8080}, - PID: 99, - CommandLine: []string{"test-service", "--args"}, - RSSMemory: 500 * 1024 * 1024, - CPUCores: 1.5, - ContainerID: "abcd", + NamingSchemaVersion: "1", + ServiceName: "test-service", + GeneratedServiceName: "generated-name", + GeneratedServiceNameSource: "generated-name-source", + DDService: "dd-service", + ServiceNameSource: "injected", + HostName: "test-host", + Env: "", + ServiceLanguage: "jvm", + ServiceType: "web_service", + StartTime: 1715557200, + StartTimeMilli: 1715557200 * 1000, + LastSeen: 1715558400, + APMInstrumentation: "injected", + Ports: []uint16{80, 8080}, + PID: 99, + CommandLine: []string{"test-service", "--args"}, + RSSMemory: 500 * 1024 * 1024, + CPUCores: 1.5, + ContainerID: "abcd", }, }, { RequestType: "end-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service", - GeneratedServiceName: "generated-name", - DDService: "dd-service", - ServiceNameSource: "injected", - HostName: "test-host", - Env: "", - ServiceLanguage: "jvm", - ServiceType: "web_service", - StartTime: 1715557200, - StartTimeMilli: 1715557200 * 1000, - LastSeen: 1715558400, - APMInstrumentation: "injected", - Ports: []uint16{80, 8080}, - PID: 99, - CommandLine: []string{"test-service", "--args"}, - RSSMemory: 500 * 1024 * 1024, - CPUCores: 1.5, - ContainerID: "abcd", + NamingSchemaVersion: "1", + ServiceName: "test-service", + GeneratedServiceName: "generated-name", + GeneratedServiceNameSource: "generated-name-source", + DDService: "dd-service", + ServiceNameSource: "injected", + HostName: "test-host", + Env: "", + ServiceLanguage: "jvm", + ServiceType: "web_service", + StartTime: 1715557200, + StartTimeMilli: 1715557200 * 1000, + LastSeen: 1715558400, + APMInstrumentation: "injected", + Ports: []uint16{80, 8080}, + PID: 99, + CommandLine: []string{"test-service", "--args"}, + RSSMemory: 500 * 1024 * 1024, + CPUCores: 1.5, + ContainerID: "abcd", }, }, } @@ -184,12 +188,13 @@ func Test_telemetrySender_name_provided(t *testing.T) { svc := serviceInfo{ service: model.Service{ - PID: 55, - CommandLine: []string{"foo", "--option"}, - StartTimeMilli: uint64(now.Add(-20 * time.Minute).UnixMilli()), - GeneratedName: "generated-name2", - DDService: "dd-service-provided", - ContainerID: "abcd", + PID: 55, + CommandLine: []string{"foo", "--option"}, + StartTimeMilli: uint64(now.Add(-20 * time.Minute).UnixMilli()), + GeneratedName: "generated-name2", + GeneratedNameSource: "generated-name-source2", + DDService: "dd-service-provided", + ContainerID: "abcd", }, meta: ServiceMetadata{ Name: "test-service", @@ -209,66 +214,69 @@ func Test_telemetrySender_name_provided(t *testing.T) { RequestType: "start-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service", - GeneratedServiceName: "generated-name2", - DDService: "dd-service-provided", - ServiceNameSource: "provided", - HostName: "test-host", - Env: "", - ServiceLanguage: "jvm", - ServiceType: "web_service", - StartTime: 1715557200, - StartTimeMilli: 1715557200 * 1000, - LastSeen: 1715558400, - APMInstrumentation: "injected", - PID: 55, - CommandLine: []string{"foo", "--option"}, - ContainerID: "abcd", + NamingSchemaVersion: "1", + ServiceName: "test-service", + GeneratedServiceName: "generated-name2", + GeneratedServiceNameSource: "generated-name-source2", + DDService: "dd-service-provided", + ServiceNameSource: "provided", + HostName: "test-host", + Env: "", + ServiceLanguage: "jvm", + ServiceType: "web_service", + StartTime: 1715557200, + StartTimeMilli: 1715557200 * 1000, + LastSeen: 1715558400, + APMInstrumentation: "injected", + PID: 55, + CommandLine: []string{"foo", "--option"}, + ContainerID: "abcd", }, }, { RequestType: "heartbeat-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service", - GeneratedServiceName: "generated-name2", - DDService: "dd-service-provided", - ServiceNameSource: "provided", - HostName: "test-host", - Env: "", - ServiceLanguage: "jvm", - ServiceType: "web_service", - StartTime: 1715557200, - StartTimeMilli: 1715557200 * 1000, - LastSeen: 1715558400, - APMInstrumentation: "injected", - PID: 55, - CommandLine: []string{"foo", "--option"}, - ContainerID: "abcd", + NamingSchemaVersion: "1", + ServiceName: "test-service", + GeneratedServiceName: "generated-name2", + GeneratedServiceNameSource: "generated-name-source2", + DDService: "dd-service-provided", + ServiceNameSource: "provided", + HostName: "test-host", + Env: "", + ServiceLanguage: "jvm", + ServiceType: "web_service", + StartTime: 1715557200, + StartTimeMilli: 1715557200 * 1000, + LastSeen: 1715558400, + APMInstrumentation: "injected", + PID: 55, + CommandLine: []string{"foo", "--option"}, + ContainerID: "abcd", }, }, { RequestType: "end-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service", - GeneratedServiceName: "generated-name2", - DDService: "dd-service-provided", - ServiceNameSource: "provided", - HostName: "test-host", - Env: "", - ServiceLanguage: "jvm", - ServiceType: "web_service", - StartTime: 1715557200, - StartTimeMilli: 1715557200 * 1000, - LastSeen: 1715558400, - APMInstrumentation: "injected", - PID: 55, - CommandLine: []string{"foo", "--option"}, - ContainerID: "abcd", + NamingSchemaVersion: "1", + ServiceName: "test-service", + GeneratedServiceName: "generated-name2", + GeneratedServiceNameSource: "generated-name-source2", + DDService: "dd-service-provided", + ServiceNameSource: "provided", + HostName: "test-host", + Env: "", + ServiceLanguage: "jvm", + ServiceType: "web_service", + StartTime: 1715557200, + StartTimeMilli: 1715557200 * 1000, + LastSeen: 1715558400, + APMInstrumentation: "injected", + PID: 55, + CommandLine: []string{"foo", "--option"}, + ContainerID: "abcd", }, }, } diff --git a/pkg/collector/corechecks/servicediscovery/impl_linux_test.go b/pkg/collector/corechecks/servicediscovery/impl_linux_test.go index b2ae5d1d4f962..f3f7d4baaeb66 100644 --- a/pkg/collector/corechecks/servicediscovery/impl_linux_test.go +++ b/pkg/collector/corechecks/servicediscovery/impl_linux_test.go @@ -72,44 +72,47 @@ var ( var ( portTCP8080 = model.Service{ - PID: procTestService1.pid, - Name: "test-service-1", - GeneratedName: "test-service-1-generated", - DDService: "test-service-1", - DDServiceInjected: true, - Ports: []uint16{8080}, - APMInstrumentation: string(apm.None), - RSS: 100 * 1024 * 1024, - CPUCores: 1.5, - CommandLine: []string{"test-service-1"}, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procTestService1.pid, + Name: "test-service-1", + GeneratedName: "test-service-1-generated", + GeneratedNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + DDServiceInjected: true, + Ports: []uint16{8080}, + APMInstrumentation: string(apm.None), + RSS: 100 * 1024 * 1024, + CPUCores: 1.5, + CommandLine: []string{"test-service-1"}, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } portTCP8080UpdatedRSS = model.Service{ - PID: procTestService1.pid, - Name: "test-service-1", - GeneratedName: "test-service-1-generated", - DDService: "test-service-1", - DDServiceInjected: true, - Ports: []uint16{8080}, - APMInstrumentation: string(apm.None), - RSS: 200 * 1024 * 1024, - CPUCores: 1.5, - CommandLine: []string{"test-service-1"}, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procTestService1.pid, + Name: "test-service-1", + GeneratedName: "test-service-1-generated", + GeneratedNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + DDServiceInjected: true, + Ports: []uint16{8080}, + APMInstrumentation: string(apm.None), + RSS: 200 * 1024 * 1024, + CPUCores: 1.5, + CommandLine: []string{"test-service-1"}, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } portTCP8080DifferentPID = model.Service{ - PID: procTestService1DifferentPID.pid, - Name: "test-service-1", - GeneratedName: "test-service-1-generated", - DDService: "test-service-1", - DDServiceInjected: true, - Ports: []uint16{8080}, - APMInstrumentation: string(apm.Injected), - CommandLine: []string{"test-service-1"}, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procTestService1DifferentPID.pid, + Name: "test-service-1", + GeneratedName: "test-service-1-generated", + GeneratedNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + DDServiceInjected: true, + Ports: []uint16{8080}, + APMInstrumentation: string(apm.Injected), + CommandLine: []string{"test-service-1"}, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } portTCP8081 = model.Service{ PID: procIgnoreService1.pid, @@ -120,23 +123,25 @@ var ( ContainerID: dummyContainerID, } portTCP5000 = model.Service{ - PID: procPythonService.pid, - Name: "python-service", - GeneratedName: "python-service", - Language: "python", - Ports: []uint16{5000}, - CommandLine: pythonCommandLine, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procPythonService.pid, + Name: "python-service", + GeneratedName: "python-service", + GeneratedNameSource: "python-service-source", + Language: "python", + Ports: []uint16{5000}, + CommandLine: pythonCommandLine, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } portTCP5432 = model.Service{ - PID: procTestService1Repeat.pid, - Name: "test-service-1", - GeneratedName: "test-service-1", - Ports: []uint16{5432}, - CommandLine: []string{"test-service-1"}, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procTestService1Repeat.pid, + Name: "test-service-1", + GeneratedName: "test-service-1", + GeneratedNameSource: "test-service-1-generated-source", + Ports: []uint16{5432}, + CommandLine: []string{"test-service-1"}, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } ) @@ -227,112 +232,117 @@ func Test_linuxImpl(t *testing.T) { RequestType: "start-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1-generated", - DDService: "test-service-1", - ServiceNameSource: "injected", - ServiceType: "web_service", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(1 * time.Minute).Unix(), - Ports: []uint16{8080}, - PID: 99, - CommandLine: []string{"test-service-1"}, - APMInstrumentation: "none", - RSSMemory: 100 * 1024 * 1024, - CPUCores: 1.5, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1-generated", + GeneratedServiceNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + ServiceNameSource: "injected", + ServiceType: "web_service", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(1 * time.Minute).Unix(), + Ports: []uint16{8080}, + PID: 99, + CommandLine: []string{"test-service-1"}, + APMInstrumentation: "none", + RSSMemory: 100 * 1024 * 1024, + CPUCores: 1.5, + ContainerID: dummyContainerID, }, }, { RequestType: "heartbeat-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1-generated", - DDService: "test-service-1", - ServiceNameSource: "injected", - ServiceType: "web_service", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(20 * time.Minute).Unix(), - Ports: []uint16{8080}, - PID: 99, - CommandLine: []string{"test-service-1"}, - APMInstrumentation: "none", - RSSMemory: 200 * 1024 * 1024, - CPUCores: 1.5, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1-generated", + GeneratedServiceNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + ServiceNameSource: "injected", + ServiceType: "web_service", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(20 * time.Minute).Unix(), + Ports: []uint16{8080}, + PID: 99, + CommandLine: []string{"test-service-1"}, + APMInstrumentation: "none", + RSSMemory: 200 * 1024 * 1024, + CPUCores: 1.5, + ContainerID: dummyContainerID, }, }, { RequestType: "end-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1-generated", - DDService: "test-service-1", - ServiceNameSource: "injected", - ServiceType: "web_service", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(20 * time.Minute).Unix(), - Ports: []uint16{8080}, - PID: 99, - CommandLine: []string{"test-service-1"}, - APMInstrumentation: "none", - RSSMemory: 200 * 1024 * 1024, - CPUCores: 1.5, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1-generated", + GeneratedServiceNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + ServiceNameSource: "injected", + ServiceType: "web_service", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(20 * time.Minute).Unix(), + Ports: []uint16{8080}, + PID: 99, + CommandLine: []string{"test-service-1"}, + APMInstrumentation: "none", + RSSMemory: 200 * 1024 * 1024, + CPUCores: 1.5, + ContainerID: dummyContainerID, }, }, { RequestType: "start-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "python-service", - GeneratedServiceName: "python-service", - ServiceType: "web_service", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(1 * time.Minute).Unix(), - Ports: []uint16{5000}, - PID: 500, - ServiceLanguage: "python", - CommandLine: pythonCommandLine, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "python-service", + GeneratedServiceName: "python-service", + GeneratedServiceNameSource: "python-service-source", + ServiceType: "web_service", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(1 * time.Minute).Unix(), + Ports: []uint16{5000}, + PID: 500, + ServiceLanguage: "python", + CommandLine: pythonCommandLine, + ContainerID: dummyContainerID, }, }, { RequestType: "heartbeat-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "python-service", - GeneratedServiceName: "python-service", - ServiceType: "web_service", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(20 * time.Minute).Unix(), - Ports: []uint16{5000}, - PID: 500, - ServiceLanguage: "python", - CommandLine: pythonCommandLine, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "python-service", + GeneratedServiceName: "python-service", + GeneratedServiceNameSource: "python-service-source", + ServiceType: "web_service", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(20 * time.Minute).Unix(), + Ports: []uint16{5000}, + PID: 500, + ServiceLanguage: "python", + CommandLine: pythonCommandLine, + ContainerID: dummyContainerID, }, }, }, @@ -376,105 +386,110 @@ func Test_linuxImpl(t *testing.T) { RequestType: "start-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1", - ServiceType: "db", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(1 * time.Minute).Unix(), - Ports: []uint16{5432}, - PID: 101, - CommandLine: []string{"test-service-1"}, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1", + GeneratedServiceNameSource: "test-service-1-generated-source", + ServiceType: "db", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(1 * time.Minute).Unix(), + Ports: []uint16{5432}, + PID: 101, + CommandLine: []string{"test-service-1"}, + ContainerID: dummyContainerID, }, }, { RequestType: "start-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1-generated", - DDService: "test-service-1", - ServiceNameSource: "injected", - ServiceType: "web_service", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(1 * time.Minute).Unix(), - Ports: []uint16{8080}, - PID: 99, - CommandLine: []string{"test-service-1"}, - APMInstrumentation: "none", - RSSMemory: 100 * 1024 * 1024, - CPUCores: 1.5, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1-generated", + GeneratedServiceNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + ServiceNameSource: "injected", + ServiceType: "web_service", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(1 * time.Minute).Unix(), + Ports: []uint16{8080}, + PID: 99, + CommandLine: []string{"test-service-1"}, + APMInstrumentation: "none", + RSSMemory: 100 * 1024 * 1024, + CPUCores: 1.5, + ContainerID: dummyContainerID, }, }, { RequestType: "heartbeat-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1", - ServiceType: "db", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(20 * time.Minute).Unix(), - Ports: []uint16{5432}, - PID: 101, - CommandLine: []string{"test-service-1"}, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1", + GeneratedServiceNameSource: "test-service-1-generated-source", + ServiceType: "db", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(20 * time.Minute).Unix(), + Ports: []uint16{5432}, + PID: 101, + CommandLine: []string{"test-service-1"}, + ContainerID: dummyContainerID, }, }, { RequestType: "end-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1", - ServiceType: "db", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(20 * time.Minute).Unix(), - Ports: []uint16{5432}, - PID: 101, - CommandLine: []string{"test-service-1"}, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1", + GeneratedServiceNameSource: "test-service-1-generated-source", + ServiceType: "db", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(20 * time.Minute).Unix(), + Ports: []uint16{5432}, + PID: 101, + CommandLine: []string{"test-service-1"}, + ContainerID: dummyContainerID, }, }, { RequestType: "heartbeat-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1-generated", - DDService: "test-service-1", - ServiceNameSource: "injected", - ServiceType: "web_service", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(20 * time.Minute).Unix(), - Ports: []uint16{8080}, - PID: 99, - CommandLine: []string{"test-service-1"}, - APMInstrumentation: "none", - RSSMemory: 100 * 1024 * 1024, - CPUCores: 1.5, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1-generated", + GeneratedServiceNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + ServiceNameSource: "injected", + ServiceType: "web_service", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(20 * time.Minute).Unix(), + Ports: []uint16{8080}, + PID: 99, + CommandLine: []string{"test-service-1"}, + APMInstrumentation: "none", + RSSMemory: 100 * 1024 * 1024, + CPUCores: 1.5, + ContainerID: dummyContainerID, }, }, }, @@ -516,46 +531,48 @@ func Test_linuxImpl(t *testing.T) { RequestType: "start-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1-generated", - DDService: "test-service-1", - ServiceNameSource: "injected", - ServiceType: "web_service", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(1 * time.Minute).Unix(), - Ports: []uint16{8080}, - PID: 99, - CommandLine: []string{"test-service-1"}, - APMInstrumentation: "none", - RSSMemory: 100 * 1024 * 1024, - CPUCores: 1.5, - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1-generated", + GeneratedServiceNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + ServiceNameSource: "injected", + ServiceType: "web_service", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(1 * time.Minute).Unix(), + Ports: []uint16{8080}, + PID: 99, + CommandLine: []string{"test-service-1"}, + APMInstrumentation: "none", + RSSMemory: 100 * 1024 * 1024, + CPUCores: 1.5, + ContainerID: dummyContainerID, }, }, { RequestType: "start-service", APIVersion: "v2", Payload: &eventPayload{ - NamingSchemaVersion: "1", - ServiceName: "test-service-1", - GeneratedServiceName: "test-service-1-generated", - DDService: "test-service-1", - ServiceNameSource: "injected", - ServiceType: "web_service", - HostName: host, - Env: "", - StartTime: calcTime(0).Unix(), - StartTimeMilli: calcTime(0).UnixMilli(), - LastSeen: calcTime(22 * time.Minute).Unix(), - Ports: []uint16{8080}, - PID: 102, - CommandLine: []string{"test-service-1"}, - APMInstrumentation: "injected", - ContainerID: dummyContainerID, + NamingSchemaVersion: "1", + ServiceName: "test-service-1", + GeneratedServiceName: "test-service-1-generated", + GeneratedServiceNameSource: "test-service-1-generated-source", + DDService: "test-service-1", + ServiceNameSource: "injected", + ServiceType: "web_service", + HostName: host, + Env: "", + StartTime: calcTime(0).Unix(), + StartTimeMilli: calcTime(0).UnixMilli(), + LastSeen: calcTime(22 * time.Minute).Unix(), + Ports: []uint16{8080}, + PID: 102, + CommandLine: []string{"test-service-1"}, + APMInstrumentation: "injected", + ContainerID: dummyContainerID, }, }, }, diff --git a/pkg/collector/corechecks/servicediscovery/model/model.go b/pkg/collector/corechecks/servicediscovery/model/model.go index f45cbae150eb4..ccaa3fc2a961c 100644 --- a/pkg/collector/corechecks/servicediscovery/model/model.go +++ b/pkg/collector/corechecks/servicediscovery/model/model.go @@ -11,6 +11,7 @@ type Service struct { PID int `json:"pid"` Name string `json:"name"` GeneratedName string `json:"generated_name"` + GeneratedNameSource string `json:"generated_name_source"` DDService string `json:"dd_service"` DDServiceInjected bool `json:"dd_service_injected"` CheckedContainerData bool `json:"checked_container_data"` diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux.go index 181c22b662aaa..df021490fdd4c 100644 --- a/pkg/collector/corechecks/servicediscovery/module/impl_linux.go +++ b/pkg/collector/corechecks/servicediscovery/module/impl_linux.go @@ -50,6 +50,7 @@ var _ module.Module = &discovery{} // endpoint. type serviceInfo struct { generatedName string + generatedNameSource string ddServiceName string ddServiceInjected bool checkedContainerData bool @@ -420,13 +421,14 @@ func (s *discovery) getServiceInfo(proc *process.Process) (*serviceInfo, error) apmInstrumentation := apm.Detect(lang, ctx) return &serviceInfo{ - generatedName: nameMeta.Name, - ddServiceName: nameMeta.DDService, - language: lang, - apmInstrumentation: apmInstrumentation, - ddServiceInjected: nameMeta.DDServiceInjected, - cmdLine: sanitizeCmdLine(s.scrubber, cmdline), - startTimeMilli: uint64(createTime), + generatedName: nameMeta.Name, + generatedNameSource: string(nameMeta.Source), + ddServiceName: nameMeta.DDService, + language: lang, + apmInstrumentation: apmInstrumentation, + ddServiceInjected: nameMeta.DDServiceInjected, + cmdLine: sanitizeCmdLine(s.scrubber, cmdline), + startTimeMilli: uint64(createTime), }, nil } @@ -553,19 +555,19 @@ func (s *discovery) getService(context parsingContext, pid int32) *model.Service } return &model.Service{ - PID: int(pid), - Name: name, - GeneratedName: info.generatedName, - DDService: info.ddServiceName, - DDServiceInjected: info.ddServiceInjected, - CheckedContainerData: info.checkedContainerData, - Ports: ports, - APMInstrumentation: string(info.apmInstrumentation), - Language: string(info.language), - RSS: rss, - CommandLine: info.cmdLine, - StartTimeMilli: info.startTimeMilli, - CPUCores: info.cpuUsage, + PID: int(pid), + Name: name, + GeneratedName: info.generatedName, + GeneratedNameSource: info.generatedNameSource, + DDService: info.ddServiceName, + DDServiceInjected: info.ddServiceInjected, + Ports: ports, + APMInstrumentation: string(info.apmInstrumentation), + Language: string(info.language), + RSS: rss, + CommandLine: info.cmdLine, + StartTimeMilli: info.startTimeMilli, + CPUCores: info.cpuUsage, } } @@ -689,6 +691,7 @@ func (s *discovery) enrichContainerData(service *model.Service, containers map[s if service.DDService == "" { service.Name = serviceName } + service.GeneratedNameSource = string(usm.Container) } service.CheckedContainerData = true @@ -697,6 +700,7 @@ func (s *discovery) enrichContainerData(service *model.Service, containers map[s if ok { if serviceName != "" { serviceInfo.generatedName = serviceName + serviceInfo.generatedNameSource = string(usm.Container) } serviceInfo.checkedContainerData = true } diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go index 81c5bdb6a9f3a..822e08866a0a1 100644 --- a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go +++ b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go @@ -47,6 +47,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/collector/corechecks/servicediscovery/apm" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/servicediscovery/language" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/servicediscovery/model" + "github.com/DataDog/datadog-agent/pkg/collector/corechecks/servicediscovery/usm" "github.com/DataDog/datadog-agent/pkg/network" "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" "github.com/DataDog/datadog-agent/pkg/network/protocols/tls/nodejs" @@ -367,6 +368,7 @@ func TestServiceName(t *testing.T) { assert.Equal(t, "foo_bar", portMap[pid].DDService) assert.Equal(t, portMap[pid].DDService, portMap[pid].Name) assert.Equal(t, "sleep", portMap[pid].GeneratedName) + assert.Equal(t, string(usm.CommandLine), portMap[pid].GeneratedNameSource) assert.False(t, portMap[pid].DDServiceInjected) assert.Equal(t, portMap[pid].ContainerID, "") }, 30*time.Second, 100*time.Millisecond) @@ -395,6 +397,7 @@ func TestInjectedServiceName(t *testing.T) { // The GeneratedName can vary depending on how the tests are run, so don't // assert for a specific value. require.NotEmpty(t, portMap[pid].GeneratedName) + require.NotEmpty(t, portMap[pid].GeneratedNameSource) require.NotEqual(t, portMap[pid].DDService, portMap[pid].GeneratedName) assert.True(t, portMap[pid].DDServiceInjected) } @@ -661,6 +664,7 @@ func TestNodeDocker(t *testing.T) { assert.Contains(collect, svcMap, pid) // test@... changed to test_... due to normalization. assert.Equal(collect, "test_nodejs-https-server", svcMap[pid].GeneratedName) + assert.Equal(collect, string(usm.Nodejs), svcMap[pid].GeneratedNameSource) assert.Equal(collect, svcMap[pid].GeneratedName, svcMap[pid].Name) assert.Equal(collect, "provided", svcMap[pid].APMInstrumentation) assertStat(collect, svcMap[pid]) @@ -842,6 +846,7 @@ func TestDocker(t *testing.T) { require.Contains(t, portMap[pid1111].ContainerID, "dummyCID") require.Contains(t, portMap[pid1111].Name, "foo_from_app_tag") require.Contains(t, portMap[pid1111].GeneratedName, "foo_from_app_tag") + require.Contains(t, portMap[pid1111].GeneratedNameSource, string(usm.Container)) } // Check that the cache is cleaned when procceses die. diff --git a/pkg/collector/corechecks/servicediscovery/usm/java.go b/pkg/collector/corechecks/servicediscovery/usm/java.go index 2102f8df7e720..bc8214bd3628f 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/java.go +++ b/pkg/collector/corechecks/servicediscovery/usm/java.go @@ -18,13 +18,19 @@ func newJavaDetector(ctx DetectionContext) detector { return &javaDetector{ctx: ctx} } +var vendorToSource = map[serverVendor]ServiceNameSource{ + tomcat: Tomcat, + weblogic: WebLogic, + websphere: WebSphere, + jboss: JBoss, +} + func (jd javaDetector) detect(args []string) (metadata ServiceMetadata, success bool) { // Look for dd.service if index := slices.IndexFunc(args, func(arg string) bool { return strings.HasPrefix(arg, "-Ddd.service=") }); index != -1 { metadata.DDService = strings.TrimPrefix(args[index], "-Ddd.service=") } prevArgIsFlag := false - var additionalNames []string for _, a := range args { hasFlagPrefix := strings.HasPrefix(a, "-") @@ -38,18 +44,30 @@ func (jd javaDetector) detect(args []string) (metadata ServiceMetadata, success if arg = trimColonRight(arg); isRuneLetterAt(arg, 0) { // do JEE detection to see if we can extract additional service names from context roots. - additionalNames = jeeExtractor(jd).extractServiceNamesForJEEServer() + vendor, additionalNames := jeeExtractor(jd).extractServiceNamesForJEEServer() + + source := CommandLine + if len(additionalNames) > 0 { + if vendorSource, ok := vendorToSource[vendor]; ok { + // The name gets joined to the AdditionalNames, so a part of + // the name still comes from the command line, but report + // the source as the web server since that is not easy to + // guess from looking at the command line. + source = vendorSource + } + } + if strings.HasSuffix(arg, javaJarExtension) || strings.HasSuffix(arg, javaWarExtension) { // try to see if the application is a spring boot archive and extract its application name if len(additionalNames) == 0 { if springAppName, ok := newSpringBootParser(jd.ctx).GetSpringBootAppName(a); ok { success = true - metadata.Name = springAppName + metadata.SetNames(springAppName, Spring) return } } success = true - metadata.SetNames(arg[:len(arg)-len(javaJarExtension)], additionalNames...) + metadata.SetNames(arg[:len(arg)-len(javaJarExtension)], source, additionalNames...) return } if strings.HasPrefix(arg, javaApachePrefix) { @@ -58,7 +76,7 @@ func (jd javaDetector) detect(args []string) (metadata ServiceMetadata, success arg = arg[len(javaApachePrefix):] if idx := strings.Index(arg, "."); idx != -1 { success = true - metadata.SetNames(arg[:idx], additionalNames...) + metadata.SetNames(arg[:idx], source, additionalNames...) return } } @@ -66,12 +84,12 @@ func (jd javaDetector) detect(args []string) (metadata ServiceMetadata, success if idx := strings.LastIndex(arg, "."); idx != -1 && idx+1 < len(arg) { // take just the class name without the package success = true - metadata.SetNames(arg[idx+1:], additionalNames...) + metadata.SetNames(arg[idx+1:], source, additionalNames...) return } success = true - metadata.SetNames(arg, additionalNames...) + metadata.SetNames(arg, source, additionalNames...) return } } diff --git a/pkg/collector/corechecks/servicediscovery/usm/jee.go b/pkg/collector/corechecks/servicediscovery/usm/jee.go index 8980a5ef42df1..62d5fe08a6c01 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/jee.go +++ b/pkg/collector/corechecks/servicediscovery/usm/jee.go @@ -297,19 +297,18 @@ func (je jeeExtractor) doExtractContextRoots(extractor vendorExtractor, app *jee return nil } -// extractServiceNamesForJEEServer takes args, cws and the fs (for testability reasons) and, after having determined the vendor, -// If the vendor can be determined, it returns the context roots if found, otherwise the server name. -// If the vendor is unknown, it returns a nil slice -func (je jeeExtractor) extractServiceNamesForJEEServer() []string { +// extractServiceNamesForJEEServer extracts the server vendor name and the +// service names from server-specific deployment files. +func (je jeeExtractor) extractServiceNamesForJEEServer() (serverVendor, []string) { vendor, domainHome := je.resolveAppServer() if vendor == unknown { - return nil + return vendor, nil } log.Debugf("running java enterprise service extraction - vendor %q", vendor) // check if able to find which applications are deployed extractorCreator, ok := extractors[vendor] if !ok { - return nil + return vendor, nil } extractor := extractorCreator(je.ctx) cwd, ok := workingDirFromEnvs(je.ctx.Envs) @@ -319,16 +318,16 @@ func (je jeeExtractor) extractServiceNamesForJEEServer() []string { apps, ok := extractor.findDeployedApps(domainHome) if !ok { - return nil + return vendor, nil } var contextRoots []string for _, app := range apps { contextRoots = append(contextRoots, normalizeContextRoot(je.doExtractContextRoots(extractor, &app)...)...) } if len(contextRoots) == 0 { - return nil + return vendor, nil } - return contextRoots + return vendor, contextRoots } func (s serverVendor) String() string { diff --git a/pkg/collector/corechecks/servicediscovery/usm/jee_test.go b/pkg/collector/corechecks/servicediscovery/usm/jee_test.go index 8da0f17ceea4c..792701947c459 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/jee_test.go +++ b/pkg/collector/corechecks/servicediscovery/usm/jee_test.go @@ -246,7 +246,8 @@ func TestWeblogicExtractServiceNamesForJEEServer(t *testing.T) { "PWD": "wls/domain", } extractor := jeeExtractor{ctx: NewDetectionContext(cmd, envs.NewVariables(envsMap), memfs)} - extractedContextRoots := extractor.extractServiceNamesForJEEServer() + vendor, extractedContextRoots := extractor.extractServiceNamesForJEEServer() + require.Equal(t, vendor, weblogic) require.Equal(t, []string{ "app1_context", // taken from ear application.xml "app2_context", // taken from war weblogic.xml diff --git a/pkg/collector/corechecks/servicediscovery/usm/nodejs.go b/pkg/collector/corechecks/servicediscovery/usm/nodejs.go index 5efb671327276..89e62bcf222e4 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/nodejs.go +++ b/pkg/collector/corechecks/servicediscovery/usm/nodejs.go @@ -62,14 +62,14 @@ func (n nodeDetector) detect(args []string) (ServiceMetadata, bool) { if _, err := fs.Stat(n.ctx.fs, absFile); err == nil { value, ok := n.findNameFromNearestPackageJSON(entryPoint) if ok { - return NewServiceMetadata(value), true + return NewServiceMetadata(value, Nodejs), true } // We couldn't find a package.json, fall back to the script/link // name since it should be better than just using "node". base := filepath.Base(absFile) name := strings.TrimSuffix(base, path.Ext(base)) - return NewServiceMetadata(name), true + return NewServiceMetadata(name, CommandLine), true } } } diff --git a/pkg/collector/corechecks/servicediscovery/usm/php.go b/pkg/collector/corechecks/servicediscovery/usm/php.go index e9e5c6b70f8de..c51d773034741 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/php.go +++ b/pkg/collector/corechecks/servicediscovery/usm/php.go @@ -40,7 +40,7 @@ func (p phpDetector) detect(args []string) (ServiceMetadata, bool) { if !prevArgIsFlag && !hasFlagPrefix { basePath := removeFilePath(arg) if isRuneLetterAt(basePath, 0) && basePath == artisanConsole { - metadata.SetNames(newLaravelParser(p.ctx).GetLaravelAppName(arg)) + metadata.SetNames(newLaravelParser(p.ctx).GetLaravelAppName(arg), Laravel) return metadata, true } } diff --git a/pkg/collector/corechecks/servicediscovery/usm/python.go b/pkg/collector/corechecks/servicediscovery/usm/python.go index 44b2c02309463..27dedaba9bf46 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/python.go +++ b/pkg/collector/corechecks/servicediscovery/usm/python.go @@ -56,7 +56,7 @@ func (p pythonDetector) detect(args []string) (ServiceMetadata, bool) { shouldSkipArg := prevArgIsFlag || hasFlagPrefix || isEnvVariable if moduleFlag { - return NewServiceMetadata(a), true + return NewServiceMetadata(a, CommandLine), true } if !shouldSkipArg { @@ -72,11 +72,11 @@ func (p pythonDetector) detect(args []string) (ServiceMetadata, bool) { stripped, filename = path.Split(stripped) // If the path is a root level file, return the filename if stripped == "" { - return NewServiceMetadata(p.findNearestTopLevel(filename)), true + return NewServiceMetadata(p.findNearestTopLevel(filename), CommandLine), true } } if value, ok := p.deducePackageName(path.Clean(stripped), filename); ok { - return NewServiceMetadata(value), true + return NewServiceMetadata(value, Python), true } name := p.findNearestTopLevel(stripped) @@ -85,7 +85,7 @@ func (p pythonDetector) detect(args []string) (ServiceMetadata, bool) { name = p.findNearestTopLevel(filename) } - return NewServiceMetadata(name), true + return NewServiceMetadata(name, CommandLine), true } if hasFlagPrefix && a == "-m" { @@ -142,20 +142,20 @@ func (g gunicornDetector) detect(args []string) (ServiceMetadata, bool) { if fromEnv, ok := extractEnvVar(g.ctx.Envs, gunicornEnvCmdArgs); ok { name, ok := extractGunicornNameFrom(strings.Split(fromEnv, " ")) if ok { - return NewServiceMetadata(name), true + return NewServiceMetadata(name, Gunicorn), true } } if wsgiApp, ok := extractEnvVar(g.ctx.Envs, wsgiAppEnv); ok && len(wsgiApp) > 0 { - return NewServiceMetadata(parseNameFromWsgiApp(wsgiApp)), true + return NewServiceMetadata(parseNameFromWsgiApp(wsgiApp), Gunicorn), true } if name, ok := extractGunicornNameFrom(args); ok { // gunicorn replaces the cmdline with something like "gunicorn: master // [package]", so strip out the square brackets. name = strings.Trim(name, "[]") - return NewServiceMetadata(name), true + return NewServiceMetadata(name, CommandLine), true } - return NewServiceMetadata("gunicorn"), true + return NewServiceMetadata("gunicorn", CommandLine), true } func extractGunicornNameFrom(args []string) (string, bool) { diff --git a/pkg/collector/corechecks/servicediscovery/usm/ruby.go b/pkg/collector/corechecks/servicediscovery/usm/ruby.go index 9c36d112ac99e..5404a1753d77d 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/ruby.go +++ b/pkg/collector/corechecks/servicediscovery/usm/ruby.go @@ -65,7 +65,7 @@ func (r railsDetector) detect(_ []string) (ServiceMetadata, bool) { return ServiceMetadata{}, false } - return NewServiceMetadata(string(name)), true + return NewServiceMetadata(string(name), Rails), true } // findRailsApplicationName scans the `config/application.rb` file to find the diff --git a/pkg/collector/corechecks/servicediscovery/usm/service.go b/pkg/collector/corechecks/servicediscovery/usm/service.go index da160aebada3f..407b77179dfb7 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/service.go +++ b/pkg/collector/corechecks/servicediscovery/usm/service.go @@ -51,19 +51,50 @@ const ( // ServiceMetadata holds information about a service. type ServiceMetadata struct { Name string + Source ServiceNameSource AdditionalNames []string DDService string DDServiceInjected bool // for future usage: we can detect also the type, vendor, frameworks, etc } +// ServiceNameSource is a string enum that represents the source of a generated service name +type ServiceNameSource string + +const ( + // CommandLine indicates that the name comes from the command line + CommandLine ServiceNameSource = "command-line" + // Container indicates the name comes from the container tags + Container ServiceNameSource = "container" + // Laravel indicates that the name comes from the Laravel application name + Laravel ServiceNameSource = "laravel" + // Python indicates that the name comes from the Python package name + Python ServiceNameSource = "python" + // Nodejs indicates that the name comes from the Node.js package name + Nodejs ServiceNameSource = "nodejs" + // Gunicorn indicates that the name comes from the Gunicorn application name + Gunicorn ServiceNameSource = "gunicorn" + // Rails indicates that the name comes from the Rails application name + Rails ServiceNameSource = "rails" + // Spring indicates that the name comes from the Spring application name + Spring ServiceNameSource = "spring" + // JBoss indicates that the name comes from the JBoss application name + JBoss ServiceNameSource = "jboss" + // Tomcat indicates that the name comes from the Tomcat application name + Tomcat ServiceNameSource = "tomcat" + // WebLogic indicates that the name comes from the WebLogic application name + WebLogic ServiceNameSource = "weblogic" + // WebSphere indicates that the name comes from the WebSphere application name + WebSphere ServiceNameSource = "websphere" +) + // NewServiceMetadata initializes ServiceMetadata. -func NewServiceMetadata(name string, additional ...string) ServiceMetadata { +func NewServiceMetadata(name string, source ServiceNameSource, additional ...string) ServiceMetadata { if len(additional) > 1 { // names are discovered in unpredictable order. We need to keep them sorted if we're going to join them slices.Sort(additional) } - return ServiceMetadata{Name: name, AdditionalNames: additional} + return ServiceMetadata{Name: name, Source: source, AdditionalNames: additional} } // SetAdditionalNames set additional names for the service @@ -76,8 +107,9 @@ func (s *ServiceMetadata) SetAdditionalNames(additional ...string) { } // SetNames sets generated names for the service. -func (s *ServiceMetadata) SetNames(name string, additional ...string) { +func (s *ServiceMetadata) SetNames(name string, source ServiceNameSource, additional ...string) { s.Name = name + s.Source = source s.SetAdditionalNames(additional...) } @@ -260,6 +292,7 @@ func ExtractServiceMetadata(lang language.Language, ctx DetectionContext) (metad if ok { metadata.Name = langMeta.Name + metadata.Source = langMeta.Source metadata.SetAdditionalNames(langMeta.AdditionalNames...) return } @@ -271,6 +304,7 @@ func ExtractServiceMetadata(lang language.Language, ctx DetectionContext) (metad } metadata.Name = exe + metadata.Source = CommandLine return } @@ -362,7 +396,7 @@ func (simpleDetector) detect(args []string) (ServiceMetadata, bool) { if !shouldSkipArg { if c := trimColonRight(removeFilePath(a)); isRuneLetterAt(c, 0) { - return NewServiceMetadata(c), true + return NewServiceMetadata(c, CommandLine), true } } @@ -381,7 +415,7 @@ func (dd dotnetDetector) detect(args []string) (ServiceMetadata, bool) { // https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-run#description if strings.HasSuffix(strings.ToLower(a), dllExtension) { file := removeFilePath(a) - return NewServiceMetadata(file[:len(file)-len(dllExtension)]), true + return NewServiceMetadata(file[:len(file)-len(dllExtension)], CommandLine), true } // dotnet cli syntax is something like `dotnet ` // if the first non arg (`-v, --something, ...) is not a dll file, exit early since nothing is matching a dll execute case diff --git a/pkg/collector/corechecks/servicediscovery/usm/service_test.go b/pkg/collector/corechecks/servicediscovery/usm/service_test.go index 9baa51f1780ff..8667662d64747 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/service_test.go +++ b/pkg/collector/corechecks/servicediscovery/usm/service_test.go @@ -49,16 +49,17 @@ func TestExtractServiceMetadata(t *testing.T) { require.NoError(t, err) subUsmTestData := NewSubDirFS(usmFull) tests := []struct { - name string - cmdline []string - envs map[string]string - lang language.Language - expectedGeneratedName string - expectedDDService string - expectedAdditionalServices []string - ddServiceInjected bool - fs *SubDirFS - skipOnWindows bool + name string + cmdline []string + envs map[string]string + lang language.Language + expectedGeneratedName string + expectedDDService string + expectedAdditionalServices []string + expectedGeneratedNameSource ServiceNameSource + ddServiceInjected bool + fs *SubDirFS + skipOnWindows bool }{ { name: "empty", @@ -75,116 +76,130 @@ func TestExtractServiceMetadata(t *testing.T) { cmdline: []string{ "./my-server.sh", }, - expectedGeneratedName: "my-server", + expectedGeneratedName: "my-server", + expectedGeneratedNameSource: CommandLine, }, { name: "single arg executable with DD_SERVICE", cmdline: []string{ "./my-server.sh", }, - envs: map[string]string{"DD_SERVICE": "my-service"}, - expectedDDService: "my-service", - expectedGeneratedName: "my-server", + envs: map[string]string{"DD_SERVICE": "my-service"}, + expectedDDService: "my-service", + expectedGeneratedName: "my-server", + expectedGeneratedNameSource: CommandLine, }, { name: "single arg executable with DD_TAGS", cmdline: []string{ "./my-server.sh", }, - envs: map[string]string{"DD_TAGS": "service:my-service"}, - expectedDDService: "my-service", - expectedGeneratedName: "my-server", + envs: map[string]string{"DD_TAGS": "service:my-service"}, + expectedDDService: "my-service", + expectedGeneratedName: "my-server", + expectedGeneratedNameSource: CommandLine, }, { name: "single arg executable with special chars", cmdline: []string{ "./-my-server.sh-", }, - expectedGeneratedName: "my-server", + expectedGeneratedName: "my-server", + expectedGeneratedNameSource: CommandLine, }, { name: "sudo", cmdline: []string{ "sudo", "-E", "-u", "dog", "/usr/local/bin/myApp", "-items=0,1,2,3", "-foo=bar", }, - expectedGeneratedName: "myApp", + expectedGeneratedName: "myApp", + expectedGeneratedNameSource: CommandLine, }, { name: "python flask argument", cmdline: []string{ "/opt/python/2.7.11/bin/python2.7", "flask", "run", "--host=0.0.0.0", }, - lang: language.Python, - expectedGeneratedName: "flask", - envs: map[string]string{"PWD": "testdata/python"}, - fs: &subUsmTestData, + lang: language.Python, + expectedGeneratedName: "flask", + expectedGeneratedNameSource: Python, + envs: map[string]string{"PWD": "testdata/python"}, + fs: &subUsmTestData, }, { name: "python - flask argument in path", cmdline: []string{ "/opt/python/2.7.11/bin/python2.7", "testdata/python/flask", "run", "--host=0.0.0.0", "--without-threads", }, - lang: language.Python, - expectedGeneratedName: "flask", - fs: &subUsmTestData, + lang: language.Python, + expectedGeneratedName: "flask", + expectedGeneratedNameSource: Python, + fs: &subUsmTestData, }, { name: "python flask in single argument", cmdline: []string{ "/opt/python/2.7.11/bin/python2.7 flask run --host=0.0.0.0", }, - lang: language.Python, - envs: map[string]string{"PWD": "testdata/python"}, - expectedGeneratedName: "flask", - fs: &subUsmTestData, + lang: language.Python, + envs: map[string]string{"PWD": "testdata/python"}, + expectedGeneratedName: "flask", + expectedGeneratedNameSource: Python, + fs: &subUsmTestData, }, { name: "python - module hello", cmdline: []string{ "python3", "-m", "hello", }, - lang: language.Python, - expectedGeneratedName: "hello", + lang: language.Python, + expectedGeneratedName: "hello", + expectedGeneratedNameSource: CommandLine, }, { name: "ruby - td-agent", cmdline: []string{ "ruby", "/usr/sbin/td-agent", "--log", "/var/log/td-agent/td-agent.log", "--daemon", "/var/run/td-agent/td-agent.pid", }, - lang: language.Ruby, - expectedGeneratedName: "td-agent", + lang: language.Ruby, + expectedGeneratedName: "td-agent", + expectedGeneratedNameSource: CommandLine, }, { name: "java using the -jar flag to define the service", cmdline: []string{ "java", "-Xmx4000m", "-Xms4000m", "-XX:ReservedCodeCacheSize=256m", "-jar", "/opt/sheepdog/bin/myservice.jar", }, - lang: language.Java, - expectedGeneratedName: "myservice", + lang: language.Java, + expectedGeneratedName: "myservice", + expectedGeneratedNameSource: CommandLine, }, { name: "java using the -jar flag to point to a .war", cmdline: []string{ "java", "-Duser.home=/var/jenkins_home", "-Dhudson.lifecycle=hudson.lifecycle.ExitLifecycle", "-jar", "/usr/share/jenkins/jenkins.war", "--httpPort=8000", }, - lang: language.Java, - expectedGeneratedName: "jenkins", + lang: language.Java, + expectedGeneratedName: "jenkins", + expectedGeneratedNameSource: CommandLine, }, { name: "java class name as service", cmdline: []string{ "java", "-Xmx4000m", "-Xms4000m", "-XX:ReservedCodeCacheSize=256m", "com.datadog.example.HelloWorld", }, - lang: language.Java, - expectedGeneratedName: "HelloWorld", + lang: language.Java, + expectedGeneratedName: "HelloWorld", + expectedGeneratedNameSource: CommandLine, }, { name: "java kafka", cmdline: []string{ "java", "-Xmx4000m", "-Xms4000m", "-XX:ReservedCodeCacheSize=256m", "kafka.Kafka", }, - lang: language.Java, - expectedGeneratedName: "Kafka", + lang: language.Java, + expectedGeneratedName: "Kafka", + expectedGeneratedNameSource: CommandLine, }, { name: "java parsing for org.apache projects with cassandra as the service", @@ -194,16 +209,18 @@ func TestExtractServiceMetadata(t *testing.T) { "-cp", "/etc/cassandra:/usr/share/cassandra/lib/HdrHistogram-2.1.9.jar:/usr/share/cassandra/lib/cassandra-driver-core-3.0.1-shaded.jar", "org.apache.cassandra.service.CassandraDaemon", }, - lang: language.Java, - expectedGeneratedName: "cassandra", + lang: language.Java, + expectedGeneratedName: "cassandra", + expectedGeneratedNameSource: CommandLine, }, { name: "java space in java executable path", cmdline: []string{ "/home/dd/my java dir/java", "com.dog.cat", }, - lang: language.Java, - expectedGeneratedName: "cat", + lang: language.Java, + expectedGeneratedName: "cat", + expectedGeneratedNameSource: CommandLine, }, { name: "node js with package.json not present", @@ -215,8 +232,9 @@ func TestExtractServiceMetadata(t *testing.T) { "--", "/somewhere/index.js", }, - lang: language.Node, - expectedGeneratedName: "node", + lang: language.Node, + expectedGeneratedName: "node", + expectedGeneratedNameSource: CommandLine, }, { name: "node js with a broken package.json", @@ -224,9 +242,10 @@ func TestExtractServiceMetadata(t *testing.T) { "/usr/bin/node", "./testdata/inner/app.js", }, - lang: language.Node, - expectedGeneratedName: "app", - fs: &subUsmTestData, + lang: language.Node, + expectedGeneratedName: "app", + expectedGeneratedNameSource: CommandLine, + fs: &subUsmTestData, }, { name: "node js with a broken package.json", @@ -234,9 +253,10 @@ func TestExtractServiceMetadata(t *testing.T) { "/usr/bin/node", "./testdata/inner/link", }, - lang: language.Node, - expectedGeneratedName: "link", - fs: &subUsmTestData, + lang: language.Node, + expectedGeneratedName: "link", + expectedGeneratedNameSource: CommandLine, + fs: &subUsmTestData, }, { name: "node js with a valid package.json", @@ -248,9 +268,10 @@ func TestExtractServiceMetadata(t *testing.T) { "--", "./testdata/index.js", }, - lang: language.Node, - expectedGeneratedName: "my-awesome-package", - fs: &subUsmTestData, + lang: language.Node, + expectedGeneratedName: "my-awesome-package", + fs: &subUsmTestData, + expectedGeneratedNameSource: Nodejs, }, { name: "nodejs .cjs with a valid package.json", @@ -258,9 +279,10 @@ func TestExtractServiceMetadata(t *testing.T) { "/usr/bin/node", "./testdata/foo.cjs", }, - lang: language.Node, - expectedGeneratedName: "my-awesome-package", - fs: &subUsmTestData, + lang: language.Node, + expectedGeneratedName: "my-awesome-package", + expectedGeneratedNameSource: Nodejs, + fs: &subUsmTestData, }, { name: "nodejs .mjs with a valid package.json", @@ -268,9 +290,10 @@ func TestExtractServiceMetadata(t *testing.T) { "/usr/bin/node", "./testdata/bar.mjs", }, - lang: language.Node, - expectedGeneratedName: "my-awesome-package", - fs: &subUsmTestData, + lang: language.Node, + expectedGeneratedName: "my-awesome-package", + expectedGeneratedNameSource: Nodejs, + fs: &subUsmTestData, }, { name: "node js with a symlink to a .js file and valid package.json", @@ -282,10 +305,11 @@ func TestExtractServiceMetadata(t *testing.T) { "./testdata/bins/broken", "./testdata/bins/json-server", }, - lang: language.Node, - expectedGeneratedName: "json-server-package", - skipOnWindows: true, - fs: &subUsmTestData, + lang: language.Node, + expectedGeneratedName: "json-server-package", + expectedGeneratedNameSource: Nodejs, + skipOnWindows: true, + fs: &subUsmTestData, }, { name: "node js with a valid nested package.json and cwd", @@ -297,10 +321,11 @@ func TestExtractServiceMetadata(t *testing.T) { "--", "index.js", }, - lang: language.Node, - envs: map[string]string{"PWD": "testdata/deep"}, // it's relative but it's ok for testing purposes - fs: &subUsmTestData, - expectedGeneratedName: "my-awesome-package", + lang: language.Node, + envs: map[string]string{"PWD": "testdata/deep"}, // it's relative but it's ok for testing purposes + fs: &subUsmTestData, + expectedGeneratedName: "my-awesome-package", + expectedGeneratedNameSource: Nodejs, }, { name: "spring boot default options", @@ -309,8 +334,9 @@ func TestExtractServiceMetadata(t *testing.T) { "-jar", springBootAppFullPath, }, - lang: language.Java, - expectedGeneratedName: "default-app", + lang: language.Java, + expectedGeneratedName: "default-app", + expectedGeneratedNameSource: Spring, }, { name: "wildfly 18 standalone", @@ -338,11 +364,12 @@ func TestExtractServiceMetadata(t *testing.T) { "-Djboss.home.dir=" + jbossTestAppRoot, "-Djboss.server.base.dir=" + jbossTestAppRoot + "/standalone", }, - lang: language.Java, - expectedGeneratedName: "jboss-modules", - expectedAdditionalServices: []string{"my-jboss-webapp", "some_context_root", "web3"}, - fs: &sub, - envs: map[string]string{"PWD": "/sibiling"}, + lang: language.Java, + expectedGeneratedName: "jboss-modules", + expectedAdditionalServices: []string{"my-jboss-webapp", "some_context_root", "web3"}, + fs: &sub, + envs: map[string]string{"PWD": "/sibiling"}, + expectedGeneratedNameSource: JBoss, }, { name: "wildfly 18 domain", @@ -373,11 +400,12 @@ func TestExtractServiceMetadata(t *testing.T) { "" + jbossTestAppRoot + "/modules", "org.jboss.as.server", }, - lang: language.Java, - expectedGeneratedName: "jboss-modules", - expectedAdditionalServices: []string{"web3", "web4"}, - fs: &sub, - envs: map[string]string{"PWD": "/sibiling"}, + lang: language.Java, + expectedGeneratedName: "jboss-modules", + expectedGeneratedNameSource: JBoss, + expectedAdditionalServices: []string{"web3", "web4"}, + fs: &sub, + envs: map[string]string{"PWD": "/sibiling"}, }, { name: "weblogic 12", @@ -397,19 +425,21 @@ func TestExtractServiceMetadata(t *testing.T) { "-Dweblogic.home=/u01/oracle/wlserver/server", "weblogic.Server", }, - lang: language.Java, - envs: map[string]string{"PWD": weblogicTestAppRootAbsolute}, - expectedGeneratedName: "Server", - expectedAdditionalServices: []string{"my_context", "sample4", "some_context_root"}, + lang: language.Java, + envs: map[string]string{"PWD": weblogicTestAppRootAbsolute}, + expectedGeneratedName: "Server", + expectedGeneratedNameSource: WebLogic, + expectedAdditionalServices: []string{"my_context", "sample4", "some_context_root"}, }, { name: "java with dd_service as system property", cmdline: []string{ "/usr/bin/java", "-Ddd.service=custom", "-jar", "app.jar", }, - lang: language.Java, - expectedDDService: "custom", - expectedGeneratedName: "app", + lang: language.Java, + expectedDDService: "custom", + expectedGeneratedName: "app", + expectedGeneratedNameSource: CommandLine, }, { // The system property takes priority over the environment variable, see @@ -418,10 +448,11 @@ func TestExtractServiceMetadata(t *testing.T) { cmdline: []string{ "/usr/bin/java", "-Ddd.service=dd-service-from-property", "-jar", "app.jar", }, - lang: language.Java, - envs: map[string]string{"DD_SERVICE": "dd-service-from-env"}, - expectedDDService: "dd-service-from-property", - expectedGeneratedName: "app", + lang: language.Java, + envs: map[string]string{"DD_SERVICE": "dd-service-from-env"}, + expectedDDService: "dd-service-from-property", + expectedGeneratedName: "app", + expectedGeneratedNameSource: CommandLine, }, { name: "Tomcat 10.X", @@ -445,34 +476,38 @@ func TestExtractServiceMetadata(t *testing.T) { "org.apache.catalina.startup.Bootstrap", "start", }, - lang: language.Java, - expectedGeneratedName: "catalina", - expectedAdditionalServices: []string{"app2", "custom"}, - fs: &subUsmTestData, + lang: language.Java, + expectedGeneratedName: "catalina", + expectedGeneratedNameSource: Tomcat, + expectedAdditionalServices: []string{"app2", "custom"}, + fs: &subUsmTestData, }, { name: "dotnet cmd with dll", cmdline: []string{ "/usr/bin/dotnet", "./myservice.dll", }, - lang: language.DotNet, - expectedGeneratedName: "myservice", + lang: language.DotNet, + expectedGeneratedName: "myservice", + expectedGeneratedNameSource: CommandLine, }, { name: "dotnet cmd with dll and options", cmdline: []string{ "/usr/bin/dotnet", "-v", "--", "/app/lib/myservice.dll", }, - lang: language.DotNet, - expectedGeneratedName: "myservice", + lang: language.DotNet, + expectedGeneratedName: "myservice", + expectedGeneratedNameSource: CommandLine, }, { name: "dotnet cmd with unrecognized options", cmdline: []string{ "/usr/bin/dotnet", "run", "--project", "./projects/proj1/proj1.csproj", }, - lang: language.DotNet, - expectedGeneratedName: "dotnet", + lang: language.DotNet, + expectedGeneratedName: "dotnet", + expectedGeneratedNameSource: CommandLine, }, { name: "PHP Laravel", @@ -481,8 +516,9 @@ func TestExtractServiceMetadata(t *testing.T) { "artisan", "serve", }, - lang: language.PHP, - expectedGeneratedName: "laravel", + lang: language.PHP, + expectedGeneratedName: "laravel", + expectedGeneratedNameSource: Laravel, }, { name: "Plain PHP with INI", @@ -491,9 +527,10 @@ func TestExtractServiceMetadata(t *testing.T) { "-ddatadog.service=foo", "swoole-server.php", }, - lang: language.PHP, - expectedDDService: "foo", - expectedGeneratedName: "php", + lang: language.PHP, + expectedDDService: "foo", + expectedGeneratedName: "php", + expectedGeneratedNameSource: CommandLine, }, { name: "PHP with version number", @@ -502,8 +539,9 @@ func TestExtractServiceMetadata(t *testing.T) { "artisan", "migrate:fresh", }, - lang: language.PHP, - expectedGeneratedName: "laravel", + lang: language.PHP, + expectedGeneratedName: "laravel", + expectedGeneratedNameSource: Laravel, }, { name: "PHP with two-digit version number", @@ -512,8 +550,9 @@ func TestExtractServiceMetadata(t *testing.T) { "artisan", "migrate:fresh", }, - lang: language.PHP, - expectedGeneratedName: "laravel", + lang: language.PHP, + expectedGeneratedName: "laravel", + expectedGeneratedNameSource: Laravel, }, { name: "PHP-FPM shouldn't trigger php parsing", @@ -521,7 +560,8 @@ func TestExtractServiceMetadata(t *testing.T) { "php-fpm", "artisan", }, - expectedGeneratedName: "php-fpm", + expectedGeneratedName: "php-fpm", + expectedGeneratedNameSource: CommandLine, }, { name: "PHP-FPM with version number shouldn't trigger php parsing", @@ -529,32 +569,36 @@ func TestExtractServiceMetadata(t *testing.T) { "php8.1-fpm", "artisan", }, - expectedGeneratedName: "php8", + expectedGeneratedName: "php8", + expectedGeneratedNameSource: CommandLine, }, { - name: "DD_SERVICE_set_manually", - cmdline: []string{"java", "-jar", "Foo.jar"}, - lang: language.Java, - envs: map[string]string{"DD_SERVICE": "howdy"}, - expectedDDService: "howdy", - expectedGeneratedName: "Foo", + name: "DD_SERVICE_set_manually", + cmdline: []string{"java", "-jar", "Foo.jar"}, + lang: language.Java, + envs: map[string]string{"DD_SERVICE": "howdy"}, + expectedDDService: "howdy", + expectedGeneratedName: "Foo", + expectedGeneratedNameSource: CommandLine, }, { - name: "DD_SERVICE_set_manually_tags", - cmdline: []string{"java", "-jar", "Foo.jar"}, - lang: language.Java, - envs: map[string]string{"DD_TAGS": "service:howdy"}, - expectedDDService: "howdy", - expectedGeneratedName: "Foo", + name: "DD_SERVICE_set_manually_tags", + cmdline: []string{"java", "-jar", "Foo.jar"}, + lang: language.Java, + envs: map[string]string{"DD_TAGS": "service:howdy"}, + expectedDDService: "howdy", + expectedGeneratedName: "Foo", + expectedGeneratedNameSource: CommandLine, }, { - name: "DD_SERVICE_set_manually_injection", - cmdline: []string{"java", "-jar", "Foo.jar"}, - lang: language.Java, - envs: map[string]string{"DD_SERVICE": "howdy", "DD_INJECTION_ENABLED": "tracer,service_name"}, - expectedDDService: "howdy", - expectedGeneratedName: "Foo", - ddServiceInjected: true, + name: "DD_SERVICE_set_manually_injection", + cmdline: []string{"java", "-jar", "Foo.jar"}, + lang: language.Java, + envs: map[string]string{"DD_SERVICE": "howdy", "DD_INJECTION_ENABLED": "tracer,service_name"}, + expectedDDService: "howdy", + expectedGeneratedName: "Foo", + expectedGeneratedNameSource: CommandLine, + ddServiceInjected: true, }, { name: "gunicorn simple", @@ -563,8 +607,9 @@ func TestExtractServiceMetadata(t *testing.T) { "--workers=2", "test:app", }, - lang: language.Python, - expectedGeneratedName: "test", + lang: language.Python, + expectedGeneratedName: "test", + expectedGeneratedNameSource: CommandLine, }, { name: "gunicorn simple with python", @@ -574,8 +619,9 @@ func TestExtractServiceMetadata(t *testing.T) { "--workers=2", "foo:create_app()", }, - lang: language.Python, - expectedGeneratedName: "foo", + lang: language.Python, + expectedGeneratedName: "foo", + expectedGeneratedNameSource: CommandLine, }, { name: "gunicorn from name", @@ -588,7 +634,8 @@ func TestExtractServiceMetadata(t *testing.T) { "dummy", "test:app", }, - expectedGeneratedName: "dummy", + expectedGeneratedName: "dummy", + expectedGeneratedNameSource: CommandLine, }, { name: "gunicorn from name (long arg)", @@ -600,7 +647,8 @@ func TestExtractServiceMetadata(t *testing.T) { "--name=dummy", "test:app", }, - expectedGeneratedName: "dummy", + expectedGeneratedName: "dummy", + expectedGeneratedNameSource: CommandLine, }, { name: "gunicorn from name in env", @@ -608,16 +656,18 @@ func TestExtractServiceMetadata(t *testing.T) { "gunicorn", "test:app", }, - envs: map[string]string{"GUNICORN_CMD_ARGS": "--bind=127.0.0.1:8080 --workers=3 -n dummy"}, - expectedGeneratedName: "dummy", + envs: map[string]string{"GUNICORN_CMD_ARGS": "--bind=127.0.0.1:8080 --workers=3 -n dummy"}, + expectedGeneratedName: "dummy", + expectedGeneratedNameSource: Gunicorn, }, { name: "gunicorn without app found", cmdline: []string{ "gunicorn", }, - envs: map[string]string{"GUNICORN_CMD_ARGS": "--bind=127.0.0.1:8080 --workers=3"}, - expectedGeneratedName: "gunicorn", + envs: map[string]string{"GUNICORN_CMD_ARGS": "--bind=127.0.0.1:8080 --workers=3"}, + expectedGeneratedName: "gunicorn", + expectedGeneratedNameSource: CommandLine, }, { name: "gunicorn with partial wsgi app", @@ -625,7 +675,8 @@ func TestExtractServiceMetadata(t *testing.T) { "gunicorn", "my.package", }, - expectedGeneratedName: "my.package", + expectedGeneratedName: "my.package", + expectedGeneratedNameSource: CommandLine, }, { name: "gunicorn with empty WSGI_APP env", @@ -633,16 +684,18 @@ func TestExtractServiceMetadata(t *testing.T) { "gunicorn", "my.package", }, - envs: map[string]string{"WSGI_APP": ""}, - expectedGeneratedName: "my.package", + envs: map[string]string{"WSGI_APP": ""}, + expectedGeneratedName: "my.package", + expectedGeneratedNameSource: CommandLine, }, { name: "gunicorn with WSGI_APP env", cmdline: []string{ "gunicorn", }, - envs: map[string]string{"WSGI_APP": "test:app"}, - expectedGeneratedName: "test", + envs: map[string]string{"WSGI_APP": "test:app"}, + expectedGeneratedName: "test", + expectedGeneratedNameSource: Gunicorn, }, { name: "gunicorn with replaced cmdline with colon", @@ -651,7 +704,8 @@ func TestExtractServiceMetadata(t *testing.T) { "master", "[domains.foo.apps.bar:create_server()]", }, - expectedGeneratedName: "domains.foo.apps.bar", + expectedGeneratedName: "domains.foo.apps.bar", + expectedGeneratedNameSource: CommandLine, }, { name: "gunicorn with replaced cmdline", @@ -660,7 +714,8 @@ func TestExtractServiceMetadata(t *testing.T) { "master", "[mcservice]", }, - expectedGeneratedName: "mcservice", + expectedGeneratedName: "mcservice", + expectedGeneratedNameSource: CommandLine, }, } @@ -686,6 +741,7 @@ func TestExtractServiceMetadata(t *testing.T) { require.Equal(t, tt.expectedGeneratedName, meta.Name) require.Equal(t, tt.expectedAdditionalServices, meta.AdditionalNames) require.Equal(t, tt.ddServiceInjected, meta.DDServiceInjected) + require.Equal(t, tt.expectedGeneratedNameSource, meta.Source) } }) } From 21056eb17c168391721177e56c64f02efd768e78 Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Fri, 29 Nov 2024 09:32:19 +0100 Subject: [PATCH 23/59] [release] Update current milestone to 7.62.0 (#31588) --- release.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.json b/release.json index ee50fc47b964e..6c42ba0c2fe30 100644 --- a/release.json +++ b/release.json @@ -1,6 +1,6 @@ { "base_branch": "main", - "current_milestone": "7.61.0", + "current_milestone": "7.62.0", "last_stable": { "6": "6.53.0", "7": "7.59.0" From 6f9432c28bf81cbd75057134653968371c1fd5f4 Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Fri, 29 Nov 2024 11:00:31 +0100 Subject: [PATCH 24/59] [CWS] switch arm64 fentry test to ubuntu 24.04 (#31585) --- .gitlab/kernel_matrix_testing/security_agent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/kernel_matrix_testing/security_agent.yml b/.gitlab/kernel_matrix_testing/security_agent.yml index 88a5628b851ee..26e9293844e9e 100644 --- a/.gitlab/kernel_matrix_testing/security_agent.yml +++ b/.gitlab/kernel_matrix_testing/security_agent.yml @@ -361,7 +361,7 @@ kmt_run_secagent_tests_arm64_fentry: parallel: matrix: - TAG: - - "amazon_2023" + - "ubuntu_24.04" TEST_SET: [cws_fentry] after_script: - !reference [.collect_outcomes_kmt] From 2e7ab54171a122e5298bba4ccce6082414d8f825 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Fri, 29 Nov 2024 11:00:38 +0100 Subject: [PATCH 25/59] [CWS] Use ContainerID type in tags resolver (#31582) --- pkg/security/probe/custom_events.go | 3 ++- pkg/security/probe/field_handlers_ebpf.go | 2 +- pkg/security/probe/field_handlers_ebpfless.go | 2 +- pkg/security/probe/probe.go | 5 +++-- pkg/security/probe/probe_ebpf.go | 4 ++-- pkg/security/probe/probe_ebpfless.go | 2 +- pkg/security/probe/probe_windows.go | 3 ++- pkg/security/resolvers/tags/resolver.go | 17 +++++++++-------- pkg/security/resolvers/tags/resolver_linux.go | 2 +- pkg/security/rules/engine.go | 2 +- .../security_profile/dump/activity_dump.go | 3 ++- 11 files changed, 25 insertions(+), 20 deletions(-) diff --git a/pkg/security/probe/custom_events.go b/pkg/security/probe/custom_events.go index 6d1d61bc83a93..b31d4ae688917 100644 --- a/pkg/security/probe/custom_events.go +++ b/pkg/security/probe/custom_events.go @@ -16,6 +16,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/events" "github.com/DataDog/datadog-agent/pkg/security/proto/ebpfless" "github.com/DataDog/datadog-agent/pkg/security/resolvers/tags" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/secl/rules" "github.com/DataDog/datadog-agent/pkg/security/seclog" @@ -86,7 +87,7 @@ func NewEBPFLessHelloMsgEvent(acc *events.AgentContainerContext, msg *ebpfless.H evt.Container.ID = msg.ContainerContext.ID if tagger != nil { - tags, err := tags.GetTagsOfContainer(tagger, msg.ContainerContext.ID) + tags, err := tags.GetTagsOfContainer(tagger, containerutils.ContainerID(msg.ContainerContext.ID)) if err != nil { seclog.Errorf("Failed to get tags for container %s: %v", msg.ContainerContext.ID, err) } else { diff --git a/pkg/security/probe/field_handlers_ebpf.go b/pkg/security/probe/field_handlers_ebpf.go index 9437a258b4dff..2f643304e1529 100644 --- a/pkg/security/probe/field_handlers_ebpf.go +++ b/pkg/security/probe/field_handlers_ebpf.go @@ -578,7 +578,7 @@ func (fh *EBPFFieldHandlers) ResolveContainerCreatedAt(ev *model.Event, e *model // ResolveContainerTags resolves the container tags of the event func (fh *EBPFFieldHandlers) ResolveContainerTags(_ *model.Event, e *model.ContainerContext) []string { if len(e.Tags) == 0 && e.ContainerID != "" { - e.Tags = fh.resolvers.TagsResolver.Resolve(string(e.ContainerID)) + e.Tags = fh.resolvers.TagsResolver.Resolve(e.ContainerID) } return e.Tags } diff --git a/pkg/security/probe/field_handlers_ebpfless.go b/pkg/security/probe/field_handlers_ebpfless.go index 1412808889772..13d10e972d287 100644 --- a/pkg/security/probe/field_handlers_ebpfless.go +++ b/pkg/security/probe/field_handlers_ebpfless.go @@ -198,7 +198,7 @@ func (fh *EBPFLessFieldHandlers) ResolveContainerCreatedAt(ev *model.Event, e *m // ResolveContainerTags resolves the container tags of the event func (fh *EBPFLessFieldHandlers) ResolveContainerTags(_ *model.Event, e *model.ContainerContext) []string { if len(e.Tags) == 0 && e.ContainerID != "" { - e.Tags = fh.resolvers.TagsResolver.Resolve(string(e.ContainerID)) + e.Tags = fh.resolvers.TagsResolver.Resolve(e.ContainerID) } return e.Tags } diff --git a/pkg/security/probe/probe.go b/pkg/security/probe/probe.go index 8956d953ce753..52fd27e3508c8 100644 --- a/pkg/security/probe/probe.go +++ b/pkg/security/probe/probe.go @@ -24,6 +24,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/metrics" "github.com/DataDog/datadog-agent/pkg/security/probe/kfilters" "github.com/DataDog/datadog-agent/pkg/security/secl/compiler/eval" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/secl/rules" "github.com/DataDog/datadog-agent/pkg/security/seclog" @@ -54,7 +55,7 @@ type PlatformProbe interface { GetFieldHandlers() model.FieldHandlers DumpProcessCache(_ bool) (string, error) AddDiscarderPushedCallback(_ DiscarderPushedCallback) - GetEventTags(_ string) []string + GetEventTags(_ containerutils.ContainerID) []string GetProfileManager() interface{} EnableEnforcement(bool) } @@ -367,7 +368,7 @@ func (p *Probe) StatsPollingInterval() time.Duration { } // GetEventTags returns the event tags -func (p *Probe) GetEventTags(containerID string) []string { +func (p *Probe) GetEventTags(containerID containerutils.ContainerID) []string { return p.PlatformProbe.GetEventTags(containerID) } diff --git a/pkg/security/probe/probe_ebpf.go b/pkg/security/probe/probe_ebpf.go index 679547e0ee055..84d38e34619e9 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -533,7 +533,7 @@ func (p *EBPFProbe) playSnapshot(notifyConsumers bool) { } func (p *EBPFProbe) sendAnomalyDetection(event *model.Event) { - tags := p.probe.GetEventTags(string(event.ContainerContext.ContainerID)) + tags := p.probe.GetEventTags(event.ContainerContext.ContainerID) if service := p.probe.GetService(event); service != "" { tags = append(tags, "service:"+service) } @@ -1267,7 +1267,7 @@ func (p *EBPFProbe) AddDiscarderPushedCallback(cb DiscarderPushedCallback) { } // GetEventTags returns the event tags -func (p *EBPFProbe) GetEventTags(containerID string) []string { +func (p *EBPFProbe) GetEventTags(containerID containerutils.ContainerID) []string { return p.Resolvers.TagsResolver.Resolve(containerID) } diff --git a/pkg/security/probe/probe_ebpfless.go b/pkg/security/probe/probe_ebpfless.go index aea829794c956..c7bfb2456e480 100644 --- a/pkg/security/probe/probe_ebpfless.go +++ b/pkg/security/probe/probe_ebpfless.go @@ -632,7 +632,7 @@ func (p *EBPFLessProbe) DumpProcessCache(withArgs bool) (string, error) { func (p *EBPFLessProbe) AddDiscarderPushedCallback(_ DiscarderPushedCallback) {} // GetEventTags returns the event tags -func (p *EBPFLessProbe) GetEventTags(containerID string) []string { +func (p *EBPFLessProbe) GetEventTags(containerID containerutils.ContainerID) []string { return p.Resolvers.TagsResolver.Resolve(containerID) } diff --git a/pkg/security/probe/probe_windows.go b/pkg/security/probe/probe_windows.go index a1aea80b06594..b4f954d7e96aa 100644 --- a/pkg/security/probe/probe_windows.go +++ b/pkg/security/probe/probe_windows.go @@ -26,6 +26,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/resolvers" "github.com/DataDog/datadog-agent/pkg/security/resolvers/process" "github.com/DataDog/datadog-agent/pkg/security/secl/compiler/eval" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/secl/rules" "github.com/DataDog/datadog-agent/pkg/security/seclog" @@ -1455,7 +1456,7 @@ func (p *WindowsProbe) HandleActions(ctx *eval.Context, rule *rules.Rule) { func (p *WindowsProbe) AddDiscarderPushedCallback(_ DiscarderPushedCallback) {} // GetEventTags returns the event tags -func (p *WindowsProbe) GetEventTags(_ string) []string { +func (p *WindowsProbe) GetEventTags(_ containerutils.ContainerID) []string { return nil } diff --git a/pkg/security/resolvers/tags/resolver.go b/pkg/security/resolvers/tags/resolver.go index 99800bcbe4554..180fcefd9f025 100644 --- a/pkg/security/resolvers/tags/resolver.go +++ b/pkg/security/resolvers/tags/resolver.go @@ -10,6 +10,7 @@ import ( "context" "github.com/DataDog/datadog-agent/comp/core/tagger/types" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/seclog" "github.com/DataDog/datadog-agent/pkg/security/utils" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -35,9 +36,9 @@ type Tagger interface { type Resolver interface { Start(ctx context.Context) error Stop() error - Resolve(id string) []string - ResolveWithErr(fid string) ([]string, error) - GetValue(id string, tag string) string + Resolve(id containerutils.ContainerID) []string + ResolveWithErr(fid containerutils.ContainerID) ([]string, error) + GetValue(id containerutils.ContainerID, tag string) string } // DefaultResolver represents a default resolver based directly on the underlying tagger @@ -46,29 +47,29 @@ type DefaultResolver struct { } // Resolve returns the tags for the given id -func (t *DefaultResolver) Resolve(id string) []string { +func (t *DefaultResolver) Resolve(id containerutils.ContainerID) []string { tags, _ := t.ResolveWithErr(id) return tags } // ResolveWithErr returns the tags for the given id -func (t *DefaultResolver) ResolveWithErr(id string) ([]string, error) { +func (t *DefaultResolver) ResolveWithErr(id containerutils.ContainerID) ([]string, error) { return GetTagsOfContainer(t.tagger, id) } // GetTagsOfContainer returns the tags for the given container id // exported to share the code with other non-resolver users of tagger -func GetTagsOfContainer(tagger Tagger, containerID string) ([]string, error) { +func GetTagsOfContainer(tagger Tagger, containerID containerutils.ContainerID) ([]string, error) { if tagger == nil { return nil, nil } - entityID := types.NewEntityID(types.ContainerID, containerID) + entityID := types.NewEntityID(types.ContainerID, string(containerID)) return tagger.Tag(entityID, types.OrchestratorCardinality) } // GetValue return the tag value for the given id and tag name -func (t *DefaultResolver) GetValue(id string, tag string) string { +func (t *DefaultResolver) GetValue(id containerutils.ContainerID, tag string) string { return utils.GetTagValue(tag, t.Resolve(id)) } diff --git a/pkg/security/resolvers/tags/resolver_linux.go b/pkg/security/resolvers/tags/resolver_linux.go index b56ad3b0438d1..40f368062eae4 100644 --- a/pkg/security/resolvers/tags/resolver_linux.go +++ b/pkg/security/resolvers/tags/resolver_linux.go @@ -79,7 +79,7 @@ func (t *LinuxResolver) checkTags(workload *cgroupModel.CacheEntry) { // fetchTags fetches tags for the provided workload func (t *LinuxResolver) fetchTags(container *cgroupModel.CacheEntry) error { - newTags, err := t.ResolveWithErr(string(container.ContainerID)) + newTags, err := t.ResolveWithErr(container.ContainerID) if err != nil { return fmt.Errorf("failed to resolve %s: %w", container.ContainerID, err) } diff --git a/pkg/security/rules/engine.go b/pkg/security/rules/engine.go index adcd1556c290e..6b0f98fd15666 100644 --- a/pkg/security/rules/engine.go +++ b/pkg/security/rules/engine.go @@ -446,7 +446,7 @@ func (e *RuleEngine) RuleMatch(rule *rules.Rule, event eval.Event) bool { // the container tags might not be resolved yet if time.Unix(0, int64(ev.ContainerContext.CreatedAt)).Add(TagMaxResolutionDelay).After(time.Now()) { extTagsCb = func() []string { - return e.probe.GetEventTags(string(containerID)) + return e.probe.GetEventTags(containerID) } } } diff --git a/pkg/security/security_profile/dump/activity_dump.go b/pkg/security/security_profile/dump/activity_dump.go index 256d37b509c47..80d1bb2ebe011 100644 --- a/pkg/security/security_profile/dump/activity_dump.go +++ b/pkg/security/security_profile/dump/activity_dump.go @@ -29,6 +29,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/config" "github.com/DataDog/datadog-agent/pkg/security/proto/api" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/secl/rules" "github.com/DataDog/datadog-agent/pkg/security/seclog" @@ -621,7 +622,7 @@ func (ad *ActivityDump) resolveTags() error { } var err error - ad.Tags, err = ad.adm.resolvers.TagsResolver.ResolveWithErr(ad.Metadata.ContainerID) + ad.Tags, err = ad.adm.resolvers.TagsResolver.ResolveWithErr(containerutils.ContainerID(ad.Metadata.ContainerID)) if err != nil { return fmt.Errorf("failed to resolve %s: %w", ad.Metadata.ContainerID, err) } From e79f4ad586d76084c0e740e1db493d2e4196ad8c Mon Sep 17 00:00:00 2001 From: Wassim Dhif Date: Fri, 29 Nov 2024 11:20:49 +0100 Subject: [PATCH 26/59] feat(kubernetes_admission_events): implement webhook (#30715) Signed-off-by: Wassim DHIF --- cmd/cluster-agent/admission/server.go | 27 +- .../subcommands/start/command.go | 1 + .../admission/controllers/webhook/config.go | 5 +- .../controllers/webhook/controller_base.go | 21 +- .../webhook/controller_base_test.go | 2 + .../controllers/webhook/controller_v1.go | 58 ++-- .../controllers/webhook/controller_v1_test.go | 136 +++++---- .../controllers/webhook/controller_v1beta1.go | 71 +++-- .../webhook/controller_v1beta1_test.go | 136 +++++---- .../mutate/agent_sidecar/agent_sidecar.go | 16 +- .../auto_instrumentation.go | 24 +- .../mutate/autoscaling/autoscaling.go | 36 ++- .../admission/mutate/config/config.go | 16 +- .../admission/mutate/config/config_test.go | 4 +- .../cwsinstrumentation/cws_instrumentation.go | 64 +++-- .../admission/mutate/tagsfromlabels/tags.go | 16 +- pkg/clusteragent/admission/start.go | 10 +- pkg/clusteragent/admission/util.go | 22 +- .../admission/validate/common/common.go | 21 +- .../kubernetesadmissionevents.go | 208 ++++++++++++++ .../kubernetesadmissionevents_test.go | 268 ++++++++++++++++++ pkg/config/setup/config.go | 1 + ...tes_admission_events-0a5f9edb3153df5e.yaml | 14 + 23 files changed, 924 insertions(+), 253 deletions(-) create mode 100644 pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents.go create mode 100644 pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents_test.go create mode 100644 releasenotes-dca/notes/kubernetes_admission_events-0a5f9edb3153df5e.yaml diff --git a/cmd/cluster-agent/admission/server.go b/cmd/cluster-agent/admission/server.go index 5af71864f65c1..ea53230e19a35 100644 --- a/cmd/cluster-agent/admission/server.go +++ b/cmd/cluster-agent/admission/server.go @@ -21,9 +21,12 @@ import ( "github.com/cihub/seelog" admiv1 "k8s.io/api/admission/v1" admiv1beta1 "k8s.io/api/admission/v1beta1" + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" authenticationv1 "k8s.io/api/authentication/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" @@ -40,14 +43,22 @@ const jsonContentType = "application/json" // Request contains the information of an admission request type Request struct { - // Raw is the raw request object - Raw []byte + // UID is the unique identifier of the AdmissionRequest + UID types.UID // Name is the name of the object Name string // Namespace is the namespace of the object Namespace string + // Kind is the kind of the object + Kind metav1.GroupVersionKind + // Operation is the operation of the request + Operation admissionregistrationv1.OperationType // UserInfo contains information about the requesting user UserInfo *authenticationv1.UserInfo + // Object is the new object being admitted. It is null for DELETE operations + Object []byte + // OldObject is the existing object. It is null for CREATE and CONNECT operations + OldObject []byte // DynamicClient holds a dynamic Kubernetes client DynamicClient dynamic.Interface // APIClient holds a Kubernetes client @@ -190,10 +201,14 @@ func (s *Server) handle(w http.ResponseWriter, r *http.Request, webhookName stri admissionReview := &admiv1.AdmissionReview{} admissionReview.SetGroupVersionKind(*gvk) admissionRequest := Request{ - Raw: admissionReviewReq.Request.Object.Raw, + UID: admissionReviewReq.Request.UID, + Kind: admissionReviewReq.Request.Kind, Name: admissionReviewReq.Request.Name, Namespace: admissionReviewReq.Request.Namespace, + Operation: admissionregistrationv1.OperationType(admissionReviewReq.Request.Operation), UserInfo: &admissionReviewReq.Request.UserInfo, + Object: admissionReviewReq.Request.Object.Raw, + OldObject: admissionReviewReq.Request.OldObject.Raw, DynamicClient: dc, APIClient: apiClient, } @@ -212,10 +227,14 @@ func (s *Server) handle(w http.ResponseWriter, r *http.Request, webhookName stri admissionReview := &admiv1beta1.AdmissionReview{} admissionReview.SetGroupVersionKind(*gvk) admissionRequest := Request{ - Raw: admissionReviewReq.Request.Object.Raw, + UID: admissionReviewReq.Request.UID, + Kind: admissionReviewReq.Request.Kind, Name: admissionReviewReq.Request.Name, Namespace: admissionReviewReq.Request.Namespace, + Operation: admissionregistrationv1.OperationType(admissionReviewReq.Request.Operation), UserInfo: &admissionReviewReq.Request.UserInfo, + Object: admissionReviewReq.Request.Object.Raw, + OldObject: admissionReviewReq.Request.OldObject.Raw, DynamicClient: dc, APIClient: apiClient, } diff --git a/cmd/cluster-agent/subcommands/start/command.go b/cmd/cluster-agent/subcommands/start/command.go index f85419780b657..f43ae03615401 100644 --- a/cmd/cluster-agent/subcommands/start/command.go +++ b/cmd/cluster-agent/subcommands/start/command.go @@ -479,6 +479,7 @@ func start(log log.Component, Client: apiCl.Cl, StopCh: stopCh, ValidatingStopCh: validatingStopCh, + Demultiplexer: demultiplexer, } webhooks, err := admissionpkg.StartControllers(admissionCtx, wmeta, pa, datadogConfig) diff --git a/pkg/clusteragent/admission/controllers/webhook/config.go b/pkg/clusteragent/admission/controllers/webhook/config.go index 03f29eaa19e5a..90cec93a8d8db 100644 --- a/pkg/clusteragent/admission/controllers/webhook/config.go +++ b/pkg/clusteragent/admission/controllers/webhook/config.go @@ -27,6 +27,7 @@ type Config struct { namespace string admissionV1Enabled bool namespaceSelectorEnabled bool + matchConditionsSupported bool svcName string svcPort int32 timeout int32 @@ -35,7 +36,7 @@ type Config struct { } // NewConfig creates a webhook controller configuration -func NewConfig(admissionV1Enabled, namespaceSelectorEnabled bool) Config { +func NewConfig(admissionV1Enabled, namespaceSelectorEnabled, matchConditionsSupported bool) Config { return Config{ webhookName: pkgconfigsetup.Datadog().GetString("admission_controller.webhook_name"), secretName: pkgconfigsetup.Datadog().GetString("admission_controller.certificate.secret_name"), @@ -44,6 +45,7 @@ func NewConfig(admissionV1Enabled, namespaceSelectorEnabled bool) Config { namespace: common.GetResourcesNamespace(), admissionV1Enabled: admissionV1Enabled, namespaceSelectorEnabled: namespaceSelectorEnabled, + matchConditionsSupported: matchConditionsSupported, svcName: pkgconfigsetup.Datadog().GetString("admission_controller.service_name"), svcPort: int32(443), timeout: pkgconfigsetup.Datadog().GetInt32("admission_controller.timeout_seconds"), @@ -59,6 +61,7 @@ func (w *Config) isMutationEnabled() bool { return w.mutationEnabled } func (w *Config) getSecretNs() string { return w.namespace } func (w *Config) useAdmissionV1() bool { return w.admissionV1Enabled } func (w *Config) useNamespaceSelector() bool { return w.namespaceSelectorEnabled } +func (w *Config) supportsMatchConditions() bool { return w.matchConditionsSupported } func (w *Config) getServiceNs() string { return w.namespace } func (w *Config) getServiceName() string { return w.svcName } func (w *Config) getServicePort() int32 { return w.svcPort } diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_base.go b/pkg/clusteragent/admission/controllers/webhook/controller_base.go index 5124704395ea3..79114dac7397f 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_base.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_base.go @@ -22,6 +22,7 @@ import ( "k8s.io/client-go/util/workqueue" "github.com/DataDog/datadog-agent/cmd/cluster-agent/admission" + "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/core/config" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/common" @@ -32,6 +33,7 @@ import ( configWebhook "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/mutate/config" "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/mutate/cwsinstrumentation" "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/mutate/tagsfromlabels" + "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/validate/kubernetesadmissionevents" "github.com/DataDog/datadog-agent/pkg/clusteragent/autoscaling/workload" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -55,11 +57,12 @@ func NewController( wmeta workloadmeta.Component, pa workload.PodPatcher, datadogConfig config.Component, + demultiplexer demultiplexer.Component, ) Controller { if config.useAdmissionV1() { - return NewControllerV1(client, secretInformer, validatingInformers.V1().ValidatingWebhookConfigurations(), mutatingInformers.V1().MutatingWebhookConfigurations(), isLeaderFunc, isLeaderNotif, config, wmeta, pa, datadogConfig) + return NewControllerV1(client, secretInformer, validatingInformers.V1().ValidatingWebhookConfigurations(), mutatingInformers.V1().MutatingWebhookConfigurations(), isLeaderFunc, isLeaderNotif, config, wmeta, pa, datadogConfig, demultiplexer) } - return NewControllerV1beta1(client, secretInformer, validatingInformers.V1beta1().ValidatingWebhookConfigurations(), mutatingInformers.V1beta1().MutatingWebhookConfigurations(), isLeaderFunc, isLeaderNotif, config, wmeta, pa, datadogConfig) + return NewControllerV1beta1(client, secretInformer, validatingInformers.V1beta1().ValidatingWebhookConfigurations(), mutatingInformers.V1beta1().MutatingWebhookConfigurations(), isLeaderFunc, isLeaderNotif, config, wmeta, pa, datadogConfig, demultiplexer) } // Webhook represents an admission webhook @@ -73,14 +76,18 @@ type Webhook interface { // Endpoint returns the endpoint of the webhook Endpoint() string // Resources returns the kubernetes resources for which the webhook should - // be invoked - Resources() []string + // be invoked. + // The key is the API group, and the value is a list of resources. + Resources() map[string][]string // Operations returns the operations on the resources specified for which // the webhook should be invoked Operations() []admiv1.OperationType // LabelSelectors returns the label selectors that specify when the webhook // should be invoked LabelSelectors(useNamespaceSelector bool) (namespaceSelector *metav1.LabelSelector, objectSelector *metav1.LabelSelector) + // MatchConditions returns the Match Conditions used for fine-grained + // request filtering + MatchConditions() []admiv1.MatchCondition // WebhookFunc runs the logic of the webhook and returns the admission response WebhookFunc() admission.WebhookFunc } @@ -91,7 +98,7 @@ type Webhook interface { // The reason is that the volume mount for the APM socket added by the configWebhook webhook // doesn't always work on Fargate (one of the envs where we use an agent sidecar), and // the agent sidecar webhook needs to remove it. -func (c *controllerBase) generateWebhooks(wmeta workloadmeta.Component, pa workload.PodPatcher, datadogConfig config.Component) []Webhook { +func (c *controllerBase) generateWebhooks(wmeta workloadmeta.Component, pa workload.PodPatcher, datadogConfig config.Component, demultiplexer demultiplexer.Component) []Webhook { // Note: the auto_instrumentation pod injection filter is used across // multiple mutating webhooks, so we add it as a hard dependency to each // of the components that use it via the injectionFilter parameter. @@ -106,7 +113,9 @@ func (c *controllerBase) generateWebhooks(wmeta workloadmeta.Component, pa workl // Add Validating webhooks. if c.config.isValidationEnabled() { // Future validating webhooks can be added here. - validatingWebhooks = []Webhook{} + validatingWebhooks = []Webhook{ + kubernetesadmissionevents.NewWebhook(datadogConfig, demultiplexer, c.config.supportsMatchConditions()), + } webhooks = append(webhooks, validatingWebhooks...) } diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_base_test.go b/pkg/clusteragent/admission/controllers/webhook/controller_base_test.go index bd26ed5f52bf5..c202f1ab38f25 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_base_test.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_base_test.go @@ -40,6 +40,7 @@ func TestNewController(t *testing.T) { wmeta, nil, datadogConfig, + nil, ) assert.IsType(t, &ControllerV1{}, controller) @@ -56,6 +57,7 @@ func TestNewController(t *testing.T) { wmeta, nil, datadogConfig, + nil, ) assert.IsType(t, &ControllerV1beta1{}, controller) diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_v1.go b/pkg/clusteragent/admission/controllers/webhook/controller_v1.go index 7724246423473..003ccbe10986a 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_v1.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_v1.go @@ -24,6 +24,7 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" + "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/core/config" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/common" @@ -57,6 +58,7 @@ func NewControllerV1( wmeta workloadmeta.Component, pa workload.PodPatcher, datadogConfig config.Component, + demultiplexer demultiplexer.Component, ) *ControllerV1 { controller := &ControllerV1{} controller.clientSet = client @@ -74,7 +76,7 @@ func NewControllerV1( ) controller.isLeaderFunc = isLeaderFunc controller.isLeaderNotif = isLeaderNotif - controller.webhooks = controller.generateWebhooks(wmeta, pa, datadogConfig) + controller.webhooks = controller.generateWebhooks(wmeta, pa, datadogConfig, demultiplexer) controller.generateTemplates() if _, err := secretInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ @@ -326,6 +328,7 @@ func (c *ControllerV1) generateTemplates() { webhook.Resources(), nsSelector, objSelector, + webhook.MatchConditions(), ), ) } @@ -347,13 +350,14 @@ func (c *ControllerV1) generateTemplates() { webhook.Resources(), nsSelector, objSelector, + webhook.MatchConditions(), ), ) } c.mutatingWebhookTemplates = mutatingWebhooks } -func (c *ControllerV1) getValidatingWebhookSkeleton(nameSuffix, path string, operations []admiv1.OperationType, resources []string, namespaceSelector, objectSelector *metav1.LabelSelector) admiv1.ValidatingWebhook { +func (c *ControllerV1) getValidatingWebhookSkeleton(nameSuffix, path string, operations []admiv1.OperationType, resourcesMap map[string][]string, namespaceSelector, objectSelector *metav1.LabelSelector, matchConditions []admiv1.MatchCondition) admiv1.ValidatingWebhook { matchPolicy := admiv1.Exact sideEffects := admiv1.SideEffectClassNone port := c.config.getServicePort() @@ -370,16 +374,6 @@ func (c *ControllerV1) getValidatingWebhookSkeleton(nameSuffix, path string, ope Path: &path, }, }, - Rules: []admiv1.RuleWithOperations{ - { - Operations: operations, - Rule: admiv1.Rule{ - APIGroups: []string{""}, - APIVersions: []string{"v1"}, - Resources: resources, - }, - }, - }, FailurePolicy: &failurePolicy, MatchPolicy: &matchPolicy, SideEffects: &sideEffects, @@ -387,12 +381,26 @@ func (c *ControllerV1) getValidatingWebhookSkeleton(nameSuffix, path string, ope AdmissionReviewVersions: []string{"v1", "v1beta1"}, NamespaceSelector: namespaceSelector, ObjectSelector: objectSelector, + MatchConditions: matchConditions, + } + + for group, resources := range resourcesMap { + for _, resource := range resources { + webhook.Rules = append(webhook.Rules, admiv1.RuleWithOperations{ + Operations: operations, + Rule: admiv1.Rule{ + APIGroups: []string{group}, + APIVersions: []string{"v1"}, + Resources: []string{resource}, + }, + }) + } } return webhook } -func (c *ControllerV1) getMutatingWebhookSkeleton(nameSuffix, path string, operations []admiv1.OperationType, resources []string, namespaceSelector, objectSelector *metav1.LabelSelector) admiv1.MutatingWebhook { +func (c *ControllerV1) getMutatingWebhookSkeleton(nameSuffix, path string, operations []admiv1.OperationType, resourcesMap map[string][]string, namespaceSelector, objectSelector *metav1.LabelSelector, matchConditions []admiv1.MatchCondition) admiv1.MutatingWebhook { matchPolicy := admiv1.Exact sideEffects := admiv1.SideEffectClassNone port := c.config.getServicePort() @@ -410,16 +418,6 @@ func (c *ControllerV1) getMutatingWebhookSkeleton(nameSuffix, path string, opera Path: &path, }, }, - Rules: []admiv1.RuleWithOperations{ - { - Operations: operations, - Rule: admiv1.Rule{ - APIGroups: []string{""}, - APIVersions: []string{"v1"}, - Resources: resources, - }, - }, - }, ReinvocationPolicy: &reinvocationPolicy, FailurePolicy: &failurePolicy, MatchPolicy: &matchPolicy, @@ -428,6 +426,20 @@ func (c *ControllerV1) getMutatingWebhookSkeleton(nameSuffix, path string, opera AdmissionReviewVersions: []string{"v1", "v1beta1"}, NamespaceSelector: namespaceSelector, ObjectSelector: objectSelector, + MatchConditions: matchConditions, + } + + for group, resources := range resourcesMap { + for _, resource := range resources { + webhook.Rules = append(webhook.Rules, admiv1.RuleWithOperations{ + Operations: operations, + Rule: admiv1.Rule{ + APIGroups: []string{group}, + APIVersions: []string{"v1"}, + Resources: []string{resource}, + }, + }) + } } return webhook diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_v1_test.go b/pkg/clusteragent/admission/controllers/webhook/controller_v1_test.go index 62ea3440551de..a20efbcdcf1e9 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_v1_test.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_v1_test.go @@ -42,7 +42,7 @@ const ( tick = 50 * time.Millisecond ) -var v1Cfg = NewConfig(true, false) +var v1Cfg = NewConfig(true, false, false) func TestSecretNotFoundV1(t *testing.T) { f := newFixtureV1(t) @@ -170,21 +170,21 @@ func TestAdmissionControllerFailureModeV1(t *testing.T) { for _, value := range []string{"Ignore", "ignore", "BadVal", ""} { mockConfig.SetWithoutSource("admission_controller.failure_policy", value) - c.config = NewConfig(true, false) + c.config = NewConfig(true, false, false) - validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, []string{"pods"}, nil, nil) + validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1.Ignore, *validatingWebhookSkeleton.FailurePolicy) - mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, []string{"pods"}, nil, nil) + mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1.Ignore, *mutatingWebhookSkeleton.FailurePolicy) } for _, value := range []string{"Fail", "fail"} { mockConfig.SetWithoutSource("admission_controller.failure_policy", value) - c.config = NewConfig(true, false) + c.config = NewConfig(true, false, false) - validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, []string{"pods"}, nil, nil) + validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1.Fail, *validatingWebhookSkeleton.FailurePolicy) - mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, []string{"pods"}, nil, nil) + mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1.Fail, *mutatingWebhookSkeleton.FailurePolicy) } } @@ -196,9 +196,9 @@ func TestAdmissionControllerReinvocationPolicyV1(t *testing.T) { for _, value := range []string{"IfNeeded", "ifneeded", "Never", "never", "wrong", ""} { mockConfig.SetWithoutSource("admission_controller.reinvocationpolicy", value) - c.config = NewConfig(true, false) + c.config = NewConfig(true, false, false) - mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, []string{"pods"}, nil, nil) + mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1.IfNeededReinvocationPolicy, *mutatingWebhookSkeleton.ReinvocationPolicy) } } @@ -210,7 +210,7 @@ func TestGenerateTemplatesV1(t *testing.T) { sideEffects := admiv1.SideEffectClassNone port := int32(443) timeout := pkgconfigsetup.Datadog().GetInt32("admission_controller.timeout_seconds") - webhook := func(name, path string, objSelector, nsSelector *metav1.LabelSelector, operations []admiv1.OperationType, resources []string) admiv1.MutatingWebhook { + webhook := func(name, path string, objSelector, nsSelector *metav1.LabelSelector, matchConditions []admiv1.MatchCondition, operations []admiv1.OperationType, resources []string) admiv1.MutatingWebhook { return admiv1.MutatingWebhook{ Name: name, ClientConfig: admiv1.WebhookClientConfig{ @@ -239,6 +239,7 @@ func TestGenerateTemplatesV1(t *testing.T) { AdmissionReviewVersions: []string{"v1", "v1beta1"}, ObjectSelector: objSelector, NamespaceSelector: nsSelector, + MatchConditions: matchConditions, } } tests := []struct { @@ -256,7 +257,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -266,7 +267,7 @@ func TestGenerateTemplatesV1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) return []admiv1.MutatingWebhook{webhook} }, }, @@ -279,13 +280,13 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) return []admiv1.MutatingWebhook{webhook} }, }, @@ -298,7 +299,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -308,7 +309,7 @@ func TestGenerateTemplatesV1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) return []admiv1.MutatingWebhook{webhook} }, }, @@ -321,13 +322,13 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) return []admiv1.MutatingWebhook{webhook} }, }, @@ -340,7 +341,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.lib.injection", "/injectlib", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -350,7 +351,7 @@ func TestGenerateTemplatesV1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) return []admiv1.MutatingWebhook{webhook} }, }, @@ -363,13 +364,13 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.lib.injection", "/injectlib", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) return []admiv1.MutatingWebhook{webhook} }, }, @@ -381,18 +382,18 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) webhookTags := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) return []admiv1.MutatingWebhook{webhookConfig, webhookTags} }, }, @@ -405,7 +406,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -415,7 +416,7 @@ func TestGenerateTemplatesV1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) webhookTags := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { @@ -424,7 +425,7 @@ func TestGenerateTemplatesV1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, nil, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) return []admiv1.MutatingWebhook{webhookConfig, webhookTags} }, }, @@ -438,18 +439,18 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.namespace_selector_fallback", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, true) }, + configFunc: func() Config { return NewConfig(false, true, false) }, want: func() []admiv1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", nil, &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) webhookTags := webhook("datadog.webhook.standard.tags", "/injecttags", nil, &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) + }, []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}) return []admiv1.MutatingWebhook{webhookConfig, webhookTags} }, }, @@ -464,7 +465,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.inject_tags.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1.MutatingWebhook { webhook := webhook( "datadog.webhook.agent.config", @@ -496,6 +497,7 @@ func TestGenerateTemplatesV1(t *testing.T) { }, }, }, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -513,7 +515,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, true) }, + configFunc: func() Config { return NewConfig(false, true, false) }, want: func() []admiv1.MutatingWebhook { webhook := webhook( "datadog.webhook.agent.config", @@ -542,6 +544,7 @@ func TestGenerateTemplatesV1(t *testing.T) { }, }, }, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -560,7 +563,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", true) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(true, false) }, + configFunc: func() Config { return NewConfig(true, false, false) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -575,6 +578,7 @@ func TestGenerateTemplatesV1(t *testing.T) { }, }, nil, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -583,6 +587,7 @@ func TestGenerateTemplatesV1(t *testing.T) { "/inject-command-cws", nil, nil, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Connect}, []string{"pods/exec"}, ) @@ -601,7 +606,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", false) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(true, false) }, + configFunc: func() Config { return NewConfig(true, false, false) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -612,6 +617,7 @@ func TestGenerateTemplatesV1(t *testing.T) { }, }, nil, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -620,6 +626,7 @@ func TestGenerateTemplatesV1(t *testing.T) { "/inject-command-cws", nil, nil, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Connect}, []string{"pods/exec"}, ) @@ -638,7 +645,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", true) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -653,6 +660,7 @@ func TestGenerateTemplatesV1(t *testing.T) { }, }, }, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -661,6 +669,7 @@ func TestGenerateTemplatesV1(t *testing.T) { "/inject-command-cws", nil, nil, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Connect}, []string{"pods/exec"}, ) @@ -679,7 +688,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", false) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -690,6 +699,7 @@ func TestGenerateTemplatesV1(t *testing.T) { cwsinstrumentation.PodLabelEnabled: "true", }, }, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -698,6 +708,7 @@ func TestGenerateTemplatesV1(t *testing.T) { "/inject-command-cws", nil, nil, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Connect}, []string{"pods/exec"}, ) @@ -719,7 +730,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "misconfigured") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -739,7 +750,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -750,6 +761,7 @@ func TestGenerateTemplatesV1(t *testing.T) { }, }, nil, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -771,7 +783,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -791,7 +803,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -811,7 +823,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"NamespaceSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -820,6 +832,7 @@ func TestGenerateTemplatesV1(t *testing.T) { &metav1.LabelSelector{ MatchLabels: map[string]string{"labelKey": "labelVal"}, }, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -841,7 +854,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -861,13 +874,14 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", "/agentsidecar", &metav1.LabelSelector{MatchLabels: map[string]string{"labelKey": "labelVal"}}, &metav1.LabelSelector{}, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -889,13 +903,14 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey1\": \"labelVal1\"}}, \"NamespaceSelector\": {\"MatchLabels\": {\"labelKey2\": \"labelVal2\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", "/agentsidecar", &metav1.LabelSelector{MatchLabels: map[string]string{"labelKey1": "labelVal1"}}, &metav1.LabelSelector{MatchLabels: map[string]string{"labelKey2": "labelVal2"}}, + []admiv1.MatchCondition{}, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, ) @@ -917,7 +932,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"NamespaceSelector\": {\"MatchLabels\":{\"labelKey1\": \"labelVal1\"}}} , {\"ObjectSelector\": {\"MatchLabels\": {\"labelKey2\": \"labelVal2\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -937,7 +952,7 @@ func TestGenerateTemplatesV1(t *testing.T) { c := &ControllerV1{} c.config = tt.configFunc() - c.webhooks = c.generateWebhooks(wmeta, nil, mockConfig) + c.webhooks = c.generateWebhooks(wmeta, nil, mockConfig, nil) c.generateTemplates() assert.EqualValues(t, tt.want(), c.mutatingWebhookTemplates) @@ -956,7 +971,7 @@ func TestGetValidatingWebhookSkeletonV1(t *testing.T) { customTimeout := int32(2) namespaceSelector, _ := common.DefaultLabelSelectors(true) _, objectSelector := common.DefaultLabelSelectors(false) - webhook := func(to *int32, objSelector, nsSelector *metav1.LabelSelector) admiv1.ValidatingWebhook { + webhook := func(to *int32, objSelector, nsSelector *metav1.LabelSelector, matchConditions []admiv1.MatchCondition) admiv1.ValidatingWebhook { return admiv1.ValidatingWebhook{ Name: "datadog.webhook.foo", ClientConfig: admiv1.WebhookClientConfig{ @@ -986,6 +1001,7 @@ func TestGetValidatingWebhookSkeletonV1(t *testing.T) { AdmissionReviewVersions: []string{"v1", "v1beta1"}, ObjectSelector: objSelector, NamespaceSelector: nsSelector, + MatchConditions: matchConditions, } } type args struct { @@ -1006,7 +1022,7 @@ func TestGetValidatingWebhookSkeletonV1(t *testing.T) { path: "/bar", }, namespaceSelector: false, - want: webhook(&defaultTimeout, objectSelector, nil), + want: webhook(&defaultTimeout, objectSelector, nil, nil), }, { name: "namespace selector", @@ -1015,7 +1031,7 @@ func TestGetValidatingWebhookSkeletonV1(t *testing.T) { path: "/bar", }, namespaceSelector: true, - want: webhook(&defaultTimeout, nil, namespaceSelector), + want: webhook(&defaultTimeout, nil, namespaceSelector, nil), }, { name: "custom timeout", @@ -1025,7 +1041,7 @@ func TestGetValidatingWebhookSkeletonV1(t *testing.T) { }, timeout: &customTimeout, namespaceSelector: false, - want: webhook(&customTimeout, objectSelector, nil), + want: webhook(&customTimeout, objectSelector, nil, nil), }, } @@ -1039,11 +1055,11 @@ func TestGetValidatingWebhookSkeletonV1(t *testing.T) { } c := &ControllerV1{} - c.config = NewConfig(false, tt.namespaceSelector) + c.config = NewConfig(false, tt.namespaceSelector, false) nsSelector, objSelector := common.DefaultLabelSelectors(tt.namespaceSelector) - assert.EqualValues(t, tt.want, c.getValidatingWebhookSkeleton(tt.args.nameSuffix, tt.args.path, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, nsSelector, objSelector)) + assert.EqualValues(t, tt.want, c.getValidatingWebhookSkeleton(tt.args.nameSuffix, tt.args.path, []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nsSelector, objSelector, nil)) }) } } @@ -1060,7 +1076,7 @@ func TestGetMutatingWebhookSkeletonV1(t *testing.T) { customTimeout := int32(2) namespaceSelector, _ := common.DefaultLabelSelectors(true) _, objectSelector := common.DefaultLabelSelectors(false) - webhook := func(to *int32, objSelector, nsSelector *metav1.LabelSelector) admiv1.MutatingWebhook { + webhook := func(to *int32, objSelector, nsSelector *metav1.LabelSelector, matchConditions []admiv1.MatchCondition) admiv1.MutatingWebhook { return admiv1.MutatingWebhook{ Name: "datadog.webhook.foo", ClientConfig: admiv1.WebhookClientConfig{ @@ -1091,6 +1107,7 @@ func TestGetMutatingWebhookSkeletonV1(t *testing.T) { AdmissionReviewVersions: []string{"v1", "v1beta1"}, ObjectSelector: objSelector, NamespaceSelector: nsSelector, + MatchConditions: matchConditions, } } type args struct { @@ -1111,7 +1128,7 @@ func TestGetMutatingWebhookSkeletonV1(t *testing.T) { path: "/bar", }, namespaceSelector: false, - want: webhook(&defaultTimeout, objectSelector, nil), + want: webhook(&defaultTimeout, objectSelector, nil, nil), }, { name: "namespace selector", @@ -1120,7 +1137,7 @@ func TestGetMutatingWebhookSkeletonV1(t *testing.T) { path: "/bar", }, namespaceSelector: true, - want: webhook(&defaultTimeout, nil, namespaceSelector), + want: webhook(&defaultTimeout, nil, namespaceSelector, nil), }, { name: "custom timeout", @@ -1130,7 +1147,7 @@ func TestGetMutatingWebhookSkeletonV1(t *testing.T) { }, timeout: &customTimeout, namespaceSelector: false, - want: webhook(&customTimeout, objectSelector, nil), + want: webhook(&customTimeout, objectSelector, nil, nil), }, } @@ -1144,11 +1161,11 @@ func TestGetMutatingWebhookSkeletonV1(t *testing.T) { } c := &ControllerV1{} - c.config = NewConfig(false, tt.namespaceSelector) + c.config = NewConfig(false, tt.namespaceSelector, false) nsSelector, objSelector := common.DefaultLabelSelectors(tt.namespaceSelector) - assert.EqualValues(t, tt.want, c.getMutatingWebhookSkeleton(tt.args.nameSuffix, tt.args.path, []admiv1.OperationType{admiv1.Create}, []string{"pods"}, nsSelector, objSelector)) + assert.EqualValues(t, tt.want, c.getMutatingWebhookSkeleton(tt.args.nameSuffix, tt.args.path, []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nsSelector, objSelector, nil)) }) } } @@ -1179,6 +1196,7 @@ func (f *fixtureV1) createController() (*ControllerV1, informers.SharedInformerF wmeta, nil, datadogConfig, + nil, ), factory } diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1.go b/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1.go index 3cb88b2c40526..dad86838eff33 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1.go @@ -12,6 +12,7 @@ import ( "strings" "time" + admiv1 "k8s.io/api/admissionregistration/v1" admiv1beta1 "k8s.io/api/admissionregistration/v1beta1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -24,6 +25,7 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" + "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/core/config" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/common" @@ -57,6 +59,7 @@ func NewControllerV1beta1( wmeta workloadmeta.Component, pa workload.PodPatcher, datadogConfig config.Component, + demultiplexer demultiplexer.Component, ) *ControllerV1beta1 { controller := &ControllerV1beta1{} controller.clientSet = client @@ -74,7 +77,7 @@ func NewControllerV1beta1( ) controller.isLeaderFunc = isLeaderFunc controller.isLeaderNotif = isLeaderNotif - controller.webhooks = controller.generateWebhooks(wmeta, pa, datadogConfig) + controller.webhooks = controller.generateWebhooks(wmeta, pa, datadogConfig, demultiplexer) controller.generateTemplates() if _, err := secretInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ @@ -327,6 +330,7 @@ func (c *ControllerV1beta1) generateTemplates() { webhook.Resources(), nsSelector, objSelector, + convertMatchConditions(webhook.MatchConditions()), ), ) } @@ -349,13 +353,14 @@ func (c *ControllerV1beta1) generateTemplates() { webhook.Resources(), nsSelector, objSelector, + convertMatchConditions(webhook.MatchConditions()), ), ) } c.mutatingWebhookTemplates = mutatingWebhooks } -func (c *ControllerV1beta1) getValidatingWebhookSkeleton(nameSuffix, path string, operations []admiv1beta1.OperationType, resources []string, namespaceSelector, objectSelector *metav1.LabelSelector) admiv1beta1.ValidatingWebhook { +func (c *ControllerV1beta1) getValidatingWebhookSkeleton(nameSuffix, path string, operations []admiv1beta1.OperationType, resourcesMap map[string][]string, namespaceSelector, objectSelector *metav1.LabelSelector, matchConditions []admiv1beta1.MatchCondition) admiv1beta1.ValidatingWebhook { matchPolicy := admiv1beta1.Exact sideEffects := admiv1beta1.SideEffectClassNone port := c.config.getServicePort() @@ -372,16 +377,6 @@ func (c *ControllerV1beta1) getValidatingWebhookSkeleton(nameSuffix, path string Path: &path, }, }, - Rules: []admiv1beta1.RuleWithOperations{ - { - Operations: operations, - Rule: admiv1beta1.Rule{ - APIGroups: []string{""}, - APIVersions: []string{"v1"}, - Resources: resources, - }, - }, - }, FailurePolicy: &failurePolicy, MatchPolicy: &matchPolicy, SideEffects: &sideEffects, @@ -389,12 +384,26 @@ func (c *ControllerV1beta1) getValidatingWebhookSkeleton(nameSuffix, path string AdmissionReviewVersions: []string{"v1beta1"}, NamespaceSelector: namespaceSelector, ObjectSelector: objectSelector, + MatchConditions: matchConditions, + } + + for group, resources := range resourcesMap { + for _, resource := range resources { + webhook.Rules = append(webhook.Rules, admiv1beta1.RuleWithOperations{ + Operations: operations, + Rule: admiv1beta1.Rule{ + APIGroups: []string{group}, + APIVersions: []string{"v1"}, + Resources: []string{resource}, + }, + }) + } } return webhook } -func (c *ControllerV1beta1) getMutatingWebhookSkeleton(nameSuffix, path string, operations []admiv1beta1.OperationType, resources []string, namespaceSelector, objectSelector *metav1.LabelSelector) admiv1beta1.MutatingWebhook { +func (c *ControllerV1beta1) getMutatingWebhookSkeleton(nameSuffix, path string, operations []admiv1beta1.OperationType, resourcesMap map[string][]string, namespaceSelector, objectSelector *metav1.LabelSelector, matchConditions []admiv1beta1.MatchCondition) admiv1beta1.MutatingWebhook { matchPolicy := admiv1beta1.Exact sideEffects := admiv1beta1.SideEffectClassNone port := c.config.getServicePort() @@ -412,16 +421,6 @@ func (c *ControllerV1beta1) getMutatingWebhookSkeleton(nameSuffix, path string, Path: &path, }, }, - Rules: []admiv1beta1.RuleWithOperations{ - { - Operations: operations, - Rule: admiv1beta1.Rule{ - APIGroups: []string{""}, - APIVersions: []string{"v1"}, - Resources: resources, - }, - }, - }, ReinvocationPolicy: &reinvocationPolicy, FailurePolicy: &failurePolicy, MatchPolicy: &matchPolicy, @@ -430,6 +429,20 @@ func (c *ControllerV1beta1) getMutatingWebhookSkeleton(nameSuffix, path string, AdmissionReviewVersions: []string{"v1beta1"}, NamespaceSelector: namespaceSelector, ObjectSelector: objectSelector, + MatchConditions: matchConditions, + } + + for group, resources := range resourcesMap { + for _, resource := range resources { + webhook.Rules = append(webhook.Rules, admiv1beta1.RuleWithOperations{ + Operations: operations, + Rule: admiv1beta1.Rule{ + APIGroups: []string{group}, + APIVersions: []string{"v1"}, + Resources: []string{resource}, + }, + }) + } } return webhook @@ -460,3 +473,15 @@ func (c *ControllerV1beta1) getReinvocationPolicy() admiv1beta1.ReinvocationPoli return admiv1beta1.IfNeededReinvocationPolicy } } + +// convertMatchConditions converts the match conditions from the v1 API to the v1beta1 API. +func convertMatchConditions(v1MatchConditions []admiv1.MatchCondition) []admiv1beta1.MatchCondition { + v1beta1MatchConditions := make([]admiv1beta1.MatchCondition, len(v1MatchConditions)) + for index, matchCondition := range v1MatchConditions { + v1beta1MatchConditions[index] = admiv1beta1.MatchCondition{ + Name: matchCondition.Name, + Expression: matchCondition.Expression, + } + } + return v1beta1MatchConditions +} diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1_test.go b/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1_test.go index f136568f3031f..3d84c3f515db0 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1_test.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1_test.go @@ -37,7 +37,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/kubernetes/certificate" ) -var v1beta1Cfg = NewConfig(false, false) +var v1beta1Cfg = NewConfig(false, false, false) func TestSecretNotFoundV1beta1(t *testing.T) { f := newFixtureV1beta1(t) @@ -165,21 +165,21 @@ func TestAdmissionControllerFailureModeV1beta1(t *testing.T) { for _, value := range []string{"Ignore", "ignore", "BadVal", ""} { mockConfig.SetWithoutSource("admission_controller.failure_policy", value) - c.config = NewConfig(true, false) + c.config = NewConfig(true, false, false) - validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, nil, nil) + validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1beta1.Ignore, *validatingWebhookSkeleton.FailurePolicy) - mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, nil, nil) + mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1beta1.Ignore, *mutatingWebhookSkeleton.FailurePolicy) } for _, value := range []string{"Fail", "fail"} { mockConfig.SetWithoutSource("admission_controller.failure_policy", value) - c.config = NewConfig(true, false) + c.config = NewConfig(true, false, false) - validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, nil, nil) + validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1beta1.Fail, *validatingWebhookSkeleton.FailurePolicy) - mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, nil, nil) + mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1beta1.Fail, *mutatingWebhookSkeleton.FailurePolicy) } } @@ -191,9 +191,9 @@ func TestAdmissionControllerReinvocationPolicyV1beta1(t *testing.T) { for _, value := range []string{"IfNeeded", "ifneeded", "Never", "never", "wrong", ""} { mockConfig.SetWithoutSource("admission_controller.reinvocationpolicy", value) - c.config = NewConfig(true, false) + c.config = NewConfig(true, false, false) - mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, nil, nil) + mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1beta1.IfNeededReinvocationPolicy, *mutatingWebhookSkeleton.ReinvocationPolicy) } } @@ -205,7 +205,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { sideEffects := admiv1beta1.SideEffectClassNone port := int32(443) timeout := pkgconfigsetup.Datadog().GetInt32("admission_controller.timeout_seconds") - webhook := func(name, path string, objSelector, nsSelector *metav1.LabelSelector, operations []admiv1beta1.OperationType, resources []string) admiv1beta1.MutatingWebhook { + webhook := func(name, path string, objSelector, nsSelector *metav1.LabelSelector, matchConditions []admiv1beta1.MatchCondition, operations []admiv1beta1.OperationType, resources []string) admiv1beta1.MutatingWebhook { return admiv1beta1.MutatingWebhook{ Name: name, ClientConfig: admiv1beta1.WebhookClientConfig{ @@ -234,6 +234,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { AdmissionReviewVersions: []string{"v1beta1"}, ObjectSelector: objSelector, NamespaceSelector: nsSelector, + MatchConditions: matchConditions, } } tests := []struct { @@ -251,7 +252,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -261,7 +262,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) return []admiv1beta1.MutatingWebhook{webhook} }, }, @@ -274,13 +275,13 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) return []admiv1beta1.MutatingWebhook{webhook} }, }, @@ -293,7 +294,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -303,7 +304,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) return []admiv1beta1.MutatingWebhook{webhook} }, }, @@ -316,13 +317,13 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) return []admiv1beta1.MutatingWebhook{webhook} }, }, @@ -335,7 +336,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.lib.injection", "/injectlib", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -345,7 +346,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) return []admiv1beta1.MutatingWebhook{webhook} }, }, @@ -358,13 +359,13 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.lib.injection", "/injectlib", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) return []admiv1beta1.MutatingWebhook{webhook} }, }, @@ -376,18 +377,18 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) webhookTags := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) return []admiv1beta1.MutatingWebhook{webhookConfig, webhookTags} }, }, @@ -400,7 +401,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -410,7 +411,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) webhookTags := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { @@ -419,7 +420,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { Values: []string{"false"}, }, }, - }, nil, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, nil, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) return []admiv1beta1.MutatingWebhook{webhookConfig, webhookTags} }, }, @@ -433,18 +434,18 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, true) }, + configFunc: func() Config { return NewConfig(false, true, false) }, want: func() []admiv1beta1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", nil, &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) webhookTags := webhook("datadog.webhook.standard.tags", "/injecttags", nil, &metav1.LabelSelector{ MatchLabels: map[string]string{ "admission.datadoghq.com/enabled": "true", }, - }, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) + }, []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}) return []admiv1beta1.MutatingWebhook{webhookConfig, webhookTags} }, }, @@ -459,7 +460,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook( "datadog.webhook.agent.config", @@ -491,6 +492,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { }, }, }, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) return []admiv1beta1.MutatingWebhook{webhook} @@ -507,7 +509,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, true) }, + configFunc: func() Config { return NewConfig(false, true, false) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook( "datadog.webhook.agent.config", @@ -536,6 +538,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { }, }, }, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) return []admiv1beta1.MutatingWebhook{webhook} @@ -553,7 +556,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", true) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -568,6 +571,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { }, }, nil, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) @@ -576,6 +580,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { "/inject-command-cws", nil, nil, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Connect}, []string{"pods/exec"}, ) @@ -594,7 +599,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", false) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(false, false) }, + configFunc: func() Config { return NewConfig(false, false, false) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -605,6 +610,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { }, }, nil, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) @@ -613,6 +619,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { "/inject-command-cws", nil, nil, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Connect}, []string{"pods/exec"}, ) @@ -631,7 +638,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", true) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(false, true) }, + configFunc: func() Config { return NewConfig(false, true, false) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -646,6 +653,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { }, }, }, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) @@ -654,6 +662,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { "/inject-command-cws", nil, nil, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Connect}, []string{"pods/exec"}, ) @@ -672,7 +681,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", false) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(false, true) }, + configFunc: func() Config { return NewConfig(false, true, false) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -683,6 +692,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { cwsinstrumentation.PodLabelEnabled: "true", }, }, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) @@ -691,6 +701,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { "/inject-command-cws", nil, nil, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Connect}, []string{"pods/exec"}, ) @@ -712,7 +723,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "misconfigured") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -732,7 +743,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -743,6 +754,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { }, }, nil, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) @@ -764,7 +776,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -784,7 +796,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -804,7 +816,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"NamespaceSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -813,6 +825,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { &metav1.LabelSelector{ MatchLabels: map[string]string{"labelKey": "labelVal"}, }, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) @@ -834,7 +847,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -854,13 +867,14 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", "/agentsidecar", &metav1.LabelSelector{MatchLabels: map[string]string{"labelKey": "labelVal"}}, &metav1.LabelSelector{}, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) @@ -882,13 +896,14 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey1\": \"labelVal1\"}}, \"NamespaceSelector\": {\"MatchLabels\": {\"labelKey2\": \"labelVal2\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", "/agentsidecar", &metav1.LabelSelector{MatchLabels: map[string]string{"labelKey1": "labelVal1"}}, &metav1.LabelSelector{MatchLabels: map[string]string{"labelKey2": "labelVal2"}}, + []admiv1beta1.MatchCondition{}, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, ) @@ -910,7 +925,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"NamespaceSelector\": {\"MatchLabels\":{\"labelKey1\": \"labelVal1\"}}} , {\"ObjectSelector\": {\"MatchLabels\": {\"labelKey2\": \"labelVal2\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true) }, + configFunc: func() Config { return NewConfig(true, true, false) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -930,7 +945,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { c := &ControllerV1beta1{} c.config = tt.configFunc() - c.webhooks = c.generateWebhooks(wmeta, nil, mockConfig) + c.webhooks = c.generateWebhooks(wmeta, nil, mockConfig, nil) c.generateTemplates() assert.EqualValues(t, tt.want(), c.mutatingWebhookTemplates) @@ -949,7 +964,7 @@ func TestGetValidatingWebhookSkeletonV1beta1(t *testing.T) { customTimeout := int32(2) namespaceSelector, _ := common.DefaultLabelSelectors(true) _, objectSelector := common.DefaultLabelSelectors(false) - webhook := func(to *int32, objSelector, nsSelector *metav1.LabelSelector) admiv1beta1.ValidatingWebhook { + webhook := func(to *int32, objSelector, nsSelector *metav1.LabelSelector, matchConditions []admiv1beta1.MatchCondition) admiv1beta1.ValidatingWebhook { return admiv1beta1.ValidatingWebhook{ Name: "datadog.webhook.foo", ClientConfig: admiv1beta1.WebhookClientConfig{ @@ -979,6 +994,7 @@ func TestGetValidatingWebhookSkeletonV1beta1(t *testing.T) { AdmissionReviewVersions: []string{"v1beta1"}, ObjectSelector: objSelector, NamespaceSelector: nsSelector, + MatchConditions: matchConditions, } } type args struct { @@ -999,7 +1015,7 @@ func TestGetValidatingWebhookSkeletonV1beta1(t *testing.T) { path: "/bar", }, namespaceSelector: false, - want: webhook(&defaultTimeout, objectSelector, nil), + want: webhook(&defaultTimeout, objectSelector, nil, nil), }, { name: "namespace selector", @@ -1008,7 +1024,7 @@ func TestGetValidatingWebhookSkeletonV1beta1(t *testing.T) { path: "/bar", }, namespaceSelector: true, - want: webhook(&defaultTimeout, nil, namespaceSelector), + want: webhook(&defaultTimeout, nil, namespaceSelector, nil), }, { name: "custom timeout", @@ -1018,7 +1034,7 @@ func TestGetValidatingWebhookSkeletonV1beta1(t *testing.T) { }, timeout: &customTimeout, namespaceSelector: false, - want: webhook(&customTimeout, objectSelector, nil), + want: webhook(&customTimeout, objectSelector, nil, nil), }, } @@ -1032,11 +1048,11 @@ func TestGetValidatingWebhookSkeletonV1beta1(t *testing.T) { } c := &ControllerV1beta1{} - c.config = NewConfig(false, tt.namespaceSelector) + c.config = NewConfig(false, tt.namespaceSelector, false) nsSelector, objSelector := common.DefaultLabelSelectors(tt.namespaceSelector) - assert.EqualValues(t, tt.want, c.getValidatingWebhookSkeleton(tt.args.nameSuffix, tt.args.path, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, nsSelector, objSelector)) + assert.EqualValues(t, tt.want, c.getValidatingWebhookSkeleton(tt.args.nameSuffix, tt.args.path, []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nsSelector, objSelector, nil)) }) } } @@ -1053,7 +1069,7 @@ func TestGetMutatingWebhookSkeletonV1beta1(t *testing.T) { customTimeout := int32(2) namespaceSelector, _ := common.DefaultLabelSelectors(true) _, objectSelector := common.DefaultLabelSelectors(false) - webhook := func(to *int32, objSelector, nsSelector *metav1.LabelSelector) admiv1beta1.MutatingWebhook { + webhook := func(to *int32, objSelector, nsSelector *metav1.LabelSelector, matchConditions []admiv1beta1.MatchCondition) admiv1beta1.MutatingWebhook { return admiv1beta1.MutatingWebhook{ Name: "datadog.webhook.foo", ClientConfig: admiv1beta1.WebhookClientConfig{ @@ -1084,6 +1100,7 @@ func TestGetMutatingWebhookSkeletonV1beta1(t *testing.T) { AdmissionReviewVersions: []string{"v1beta1"}, ObjectSelector: objSelector, NamespaceSelector: nsSelector, + MatchConditions: matchConditions, } } type args struct { @@ -1104,7 +1121,7 @@ func TestGetMutatingWebhookSkeletonV1beta1(t *testing.T) { path: "/bar", }, namespaceSelector: false, - want: webhook(&defaultTimeout, objectSelector, nil), + want: webhook(&defaultTimeout, objectSelector, nil, nil), }, { name: "namespace selector", @@ -1113,7 +1130,7 @@ func TestGetMutatingWebhookSkeletonV1beta1(t *testing.T) { path: "/bar", }, namespaceSelector: true, - want: webhook(&defaultTimeout, nil, namespaceSelector), + want: webhook(&defaultTimeout, nil, namespaceSelector, nil), }, { name: "custom timeout", @@ -1123,7 +1140,7 @@ func TestGetMutatingWebhookSkeletonV1beta1(t *testing.T) { }, timeout: &customTimeout, namespaceSelector: false, - want: webhook(&customTimeout, objectSelector, nil), + want: webhook(&customTimeout, objectSelector, nil, nil), }, } @@ -1137,11 +1154,11 @@ func TestGetMutatingWebhookSkeletonV1beta1(t *testing.T) { } c := &ControllerV1beta1{} - c.config = NewConfig(false, tt.namespaceSelector) + c.config = NewConfig(false, tt.namespaceSelector, false) nsSelector, objSelector := common.DefaultLabelSelectors(tt.namespaceSelector) - assert.EqualValues(t, tt.want, c.getMutatingWebhookSkeleton(tt.args.nameSuffix, tt.args.path, []admiv1beta1.OperationType{admiv1beta1.Create}, []string{"pods"}, nsSelector, objSelector)) + assert.EqualValues(t, tt.want, c.getMutatingWebhookSkeleton(tt.args.nameSuffix, tt.args.path, []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nsSelector, objSelector, nil)) }) } } @@ -1172,6 +1189,7 @@ func (f *fixtureV1beta1) createController() (*ControllerV1beta1, informers.Share wmeta, nil, datadogConfig, + nil, ), factory } diff --git a/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar.go b/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar.go index 783207a15d2c8..4314f1c911fa7 100644 --- a/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar.go +++ b/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar.go @@ -48,8 +48,9 @@ type Webhook struct { name string isEnabled bool endpoint string - resources []string + resources map[string][]string operations []admissionregistrationv1.OperationType + matchConditions []admissionregistrationv1.MatchCondition namespaceSelector *metav1.LabelSelector objectSelector *metav1.LabelSelector containerRegistry string @@ -78,8 +79,9 @@ func NewWebhook(datadogConfig config.Component) *Webhook { name: webhookName, isEnabled: datadogConfig.GetBool("admission_controller.agent_sidecar.enabled"), endpoint: datadogConfig.GetString("admission_controller.agent_sidecar.endpoint"), - resources: []string{"pods"}, + resources: map[string][]string{"": {"pods"}}, operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, + matchConditions: []admissionregistrationv1.MatchCondition{}, namespaceSelector: nsSelector, objectSelector: objSelector, containerRegistry: containerRegistry, @@ -118,7 +120,7 @@ func (w *Webhook) Endpoint() string { // Resources returns the kubernetes resources for which the webhook should // be invoked -func (w *Webhook) Resources() []string { +func (w *Webhook) Resources() map[string][]string { return w.resources } @@ -134,10 +136,16 @@ func (w *Webhook) LabelSelectors(_ bool) (namespaceSelector *metav1.LabelSelecto return w.namespaceSelector, w.objectSelector } +// MatchConditions returns the Match Conditions used for fine-grained +// request filtering +func (w *Webhook) MatchConditions() []admissionregistrationv1.MatchCondition { + return w.matchConditions +} + // WebhookFunc returns the function that mutates the resources func (w *Webhook) WebhookFunc() admission.WebhookFunc { return func(request *admission.Request) *admiv1.AdmissionResponse { - return common.MutationResponse(mutatecommon.Mutate(request.Raw, request.Namespace, w.Name(), w.injectAgentSidecar, request.DynamicClient)) + return common.MutationResponse(mutatecommon.Mutate(request.Object, request.Namespace, w.Name(), w.injectAgentSidecar, request.DynamicClient)) } } diff --git a/pkg/clusteragent/admission/mutate/autoinstrumentation/auto_instrumentation.go b/pkg/clusteragent/admission/mutate/autoinstrumentation/auto_instrumentation.go index 7fa407c3edeaa..b25289c3a1d31 100644 --- a/pkg/clusteragent/admission/mutate/autoinstrumentation/auto_instrumentation.go +++ b/pkg/clusteragent/admission/mutate/autoinstrumentation/auto_instrumentation.go @@ -46,9 +46,10 @@ const ( // Webhook is the auto instrumentation webhook type Webhook struct { - name string - resources []string - operations []admissionregistrationv1.OperationType + name string + resources map[string][]string + operations []admissionregistrationv1.OperationType + matchConditions []admissionregistrationv1.MatchCondition wmeta workloadmeta.Component @@ -79,9 +80,10 @@ func NewWebhook(wmeta workloadmeta.Component, datadogConfig config.Component, fi webhook := &Webhook{ name: webhookName, - resources: []string{"pods"}, - operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, - wmeta: wmeta, + resources: map[string][]string{"": {"pods"}}, + operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, + matchConditions: []admissionregistrationv1.MatchCondition{}, + wmeta: wmeta, config: config, } @@ -114,7 +116,7 @@ func (w *Webhook) Endpoint() string { // Resources returns the kubernetes resources for which the webhook should // be invoked -func (w *Webhook) Resources() []string { +func (w *Webhook) Resources() map[string][]string { return w.resources } @@ -130,10 +132,16 @@ func (w *Webhook) LabelSelectors(useNamespaceSelector bool) (namespaceSelector * return common.DefaultLabelSelectors(useNamespaceSelector) } +// MatchConditions returns the Match Conditions used for fine-grained +// request filtering +func (w *Webhook) MatchConditions() []admissionregistrationv1.MatchCondition { + return w.matchConditions +} + // WebhookFunc returns the function that mutates the resources func (w *Webhook) WebhookFunc() admission.WebhookFunc { return func(request *admission.Request) *admiv1.AdmissionResponse { - return common.MutationResponse(mutatecommon.Mutate(request.Raw, request.Namespace, w.Name(), w.inject, request.DynamicClient)) + return common.MutationResponse(mutatecommon.Mutate(request.Object, request.Namespace, w.Name(), w.inject, request.DynamicClient)) } } diff --git a/pkg/clusteragent/admission/mutate/autoscaling/autoscaling.go b/pkg/clusteragent/admission/mutate/autoscaling/autoscaling.go index e738079becb97..b4e7225ef710e 100644 --- a/pkg/clusteragent/admission/mutate/autoscaling/autoscaling.go +++ b/pkg/clusteragent/admission/mutate/autoscaling/autoscaling.go @@ -29,23 +29,25 @@ const ( // Webhook implements the MutatingWebhook interface type Webhook struct { - name string - isEnabled bool - endpoint string - resources []string - operations []admissionregistrationv1.OperationType - patcher workload.PodPatcher + name string + isEnabled bool + endpoint string + resources map[string][]string + operations []admissionregistrationv1.OperationType + matchConditions []admissionregistrationv1.MatchCondition + patcher workload.PodPatcher } // NewWebhook returns a new Webhook func NewWebhook(patcher workload.PodPatcher) *Webhook { return &Webhook{ - name: webhookName, - isEnabled: pkgconfigsetup.Datadog().GetBool("autoscaling.workload.enabled"), - endpoint: webhookEndpoint, - resources: []string{"pods"}, - operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, - patcher: patcher, + name: webhookName, + isEnabled: pkgconfigsetup.Datadog().GetBool("autoscaling.workload.enabled"), + endpoint: webhookEndpoint, + resources: map[string][]string{"": {"pods"}}, + operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, + matchConditions: []admissionregistrationv1.MatchCondition{}, + patcher: patcher, } } @@ -71,7 +73,7 @@ func (w *Webhook) Endpoint() string { // Resources returns the kubernetes resources for which the webhook should // be invoked -func (w *Webhook) Resources() []string { +func (w *Webhook) Resources() map[string][]string { return w.resources } @@ -89,10 +91,16 @@ func (w *Webhook) LabelSelectors(_ bool) (namespaceSelector *metav1.LabelSelecto return nil, nil } +// MatchConditions returns the Match Conditions used for fine-grained +// request filtering +func (w *Webhook) MatchConditions() []admissionregistrationv1.MatchCondition { + return w.matchConditions +} + // WebhookFunc returns the function that mutates the resources func (w *Webhook) WebhookFunc() admission.WebhookFunc { return func(request *admission.Request) *admiv1.AdmissionResponse { - return common.MutationResponse(mutatecommon.Mutate(request.Raw, request.Namespace, w.Name(), w.updateResources, request.DynamicClient)) + return common.MutationResponse(mutatecommon.Mutate(request.Object, request.Namespace, w.Name(), w.updateResources, request.DynamicClient)) } } diff --git a/pkg/clusteragent/admission/mutate/config/config.go b/pkg/clusteragent/admission/mutate/config/config.go index e0e54e03265b9..0b7683d838938 100644 --- a/pkg/clusteragent/admission/mutate/config/config.go +++ b/pkg/clusteragent/admission/mutate/config/config.go @@ -68,8 +68,9 @@ type Webhook struct { name string isEnabled bool endpoint string - resources []string + resources map[string][]string operations []admissionregistrationv1.OperationType + matchConditions []admissionregistrationv1.MatchCondition wmeta workloadmeta.Component injectionFilter mutatecommon.InjectionFilter @@ -90,8 +91,9 @@ func NewWebhook(wmeta workloadmeta.Component, injectionFilter mutatecommon.Injec name: webhookName, isEnabled: datadogConfig.GetBool("admission_controller.inject_config.enabled"), endpoint: datadogConfig.GetString("admission_controller.inject_config.endpoint"), - resources: []string{"pods"}, + resources: map[string][]string{"": {"pods"}}, operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, + matchConditions: []admissionregistrationv1.MatchCondition{}, wmeta: wmeta, injectionFilter: injectionFilter, @@ -126,7 +128,7 @@ func (w *Webhook) Endpoint() string { // Resources returns the kubernetes resources for which the webhook should // be invoked -func (w *Webhook) Resources() []string { +func (w *Webhook) Resources() map[string][]string { return w.resources } @@ -142,10 +144,16 @@ func (w *Webhook) LabelSelectors(useNamespaceSelector bool) (namespaceSelector * return common.DefaultLabelSelectors(useNamespaceSelector) } +// MatchConditions returns the Match Conditions used for fine-grained +// request filtering +func (w *Webhook) MatchConditions() []admissionregistrationv1.MatchCondition { + return w.matchConditions +} + // WebhookFunc returns the function that mutates the resources func (w *Webhook) WebhookFunc() admission.WebhookFunc { return func(request *admission.Request) *admiv1.AdmissionResponse { - return common.MutationResponse(mutatecommon.Mutate(request.Raw, request.Namespace, w.Name(), w.inject, request.DynamicClient)) + return common.MutationResponse(mutatecommon.Mutate(request.Object, request.Namespace, w.Name(), w.inject, request.DynamicClient)) } } diff --git a/pkg/clusteragent/admission/mutate/config/config_test.go b/pkg/clusteragent/admission/mutate/config/config_test.go index 4b481218151b1..f5f9f9a07c30e 100644 --- a/pkg/clusteragent/admission/mutate/config/config_test.go +++ b/pkg/clusteragent/admission/mutate/config/config_test.go @@ -482,7 +482,7 @@ func TestJSONPatchCorrectness(t *testing.T) { filter, _ := autoinstrumentation.NewInjectionFilter(datadogConfig) webhook := NewWebhook(wmeta, filter, datadogConfig) request := admission.Request{ - Raw: podJSON, + Object: podJSON, Namespace: "bar", } admissionResponse := webhook.WebhookFunc()(&request) @@ -518,7 +518,7 @@ func BenchmarkJSONPatch(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { request := admission.Request{ - Raw: podJSON, + Object: podJSON, Namespace: "bar", } admissionResponse := webhook.WebhookFunc()(&request) diff --git a/pkg/clusteragent/admission/mutate/cwsinstrumentation/cws_instrumentation.go b/pkg/clusteragent/admission/mutate/cwsinstrumentation/cws_instrumentation.go index e965cbe7ff376..e5da18c3b28dd 100644 --- a/pkg/clusteragent/admission/mutate/cwsinstrumentation/cws_instrumentation.go +++ b/pkg/clusteragent/admission/mutate/cwsinstrumentation/cws_instrumentation.go @@ -87,12 +87,13 @@ type mutatePodExecFunc func(*corev1.PodExecOptions, string, string, *authenticat // WebhookForPods is the webhook that injects CWS pod instrumentation type WebhookForPods struct { - name string - isEnabled bool - endpoint string - resources []string - operations []admissionregistrationv1.OperationType - admissionFunc admission.WebhookFunc + name string + isEnabled bool + endpoint string + resources map[string][]string + operations []admissionregistrationv1.OperationType + matchConditions []admissionregistrationv1.MatchCondition + admissionFunc admission.WebhookFunc } func newWebhookForPods(admissionFunc admission.WebhookFunc) *WebhookForPods { @@ -100,10 +101,11 @@ func newWebhookForPods(admissionFunc admission.WebhookFunc) *WebhookForPods { name: webhookForPodsName, isEnabled: pkgconfigsetup.Datadog().GetBool("admission_controller.cws_instrumentation.enabled") && len(pkgconfigsetup.Datadog().GetString("admission_controller.cws_instrumentation.image_name")) > 0, - endpoint: pkgconfigsetup.Datadog().GetString("admission_controller.cws_instrumentation.pod_endpoint"), - resources: []string{"pods"}, - operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, - admissionFunc: admissionFunc, + endpoint: pkgconfigsetup.Datadog().GetString("admission_controller.cws_instrumentation.pod_endpoint"), + resources: map[string][]string{"": {"pods"}}, + operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, + matchConditions: []admissionregistrationv1.MatchCondition{}, + admissionFunc: admissionFunc, } } @@ -129,7 +131,7 @@ func (w *WebhookForPods) Endpoint() string { // Resources returns the kubernetes resources for which the webhook should // be invoked -func (w *WebhookForPods) Resources() []string { +func (w *WebhookForPods) Resources() map[string][]string { return w.resources } @@ -145,6 +147,12 @@ func (w *WebhookForPods) LabelSelectors(useNamespaceSelector bool) (namespaceSel return labelSelectors(useNamespaceSelector) } +// MatchConditions returns the Match Conditions used for fine-grained +// request filtering +func (w *WebhookForPods) MatchConditions() []admissionregistrationv1.MatchCondition { + return w.matchConditions +} + // WebhookFunc returns the function that mutates the resources func (w *WebhookForPods) WebhookFunc() admission.WebhookFunc { return w.admissionFunc @@ -152,12 +160,13 @@ func (w *WebhookForPods) WebhookFunc() admission.WebhookFunc { // WebhookForCommands is the webhook that injects CWS pods/exec instrumentation type WebhookForCommands struct { - name string - isEnabled bool - endpoint string - resources []string - operations []admissionregistrationv1.OperationType - admissionFunc admission.WebhookFunc + name string + isEnabled bool + endpoint string + resources map[string][]string + operations []admissionregistrationv1.OperationType + matchConditions []admissionregistrationv1.MatchCondition + admissionFunc admission.WebhookFunc } func newWebhookForCommands(admissionFunc admission.WebhookFunc) *WebhookForCommands { @@ -165,10 +174,11 @@ func newWebhookForCommands(admissionFunc admission.WebhookFunc) *WebhookForComma name: webhookForCommandsName, isEnabled: pkgconfigsetup.Datadog().GetBool("admission_controller.cws_instrumentation.enabled") && len(pkgconfigsetup.Datadog().GetString("admission_controller.cws_instrumentation.image_name")) > 0, - endpoint: pkgconfigsetup.Datadog().GetString("admission_controller.cws_instrumentation.command_endpoint"), - resources: []string{"pods/exec"}, - operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Connect}, - admissionFunc: admissionFunc, + endpoint: pkgconfigsetup.Datadog().GetString("admission_controller.cws_instrumentation.command_endpoint"), + resources: map[string][]string{"": {"pods/exec"}}, + operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Connect}, + matchConditions: []admissionregistrationv1.MatchCondition{}, + admissionFunc: admissionFunc, } } @@ -194,7 +204,7 @@ func (w *WebhookForCommands) Endpoint() string { // Resources returns the kubernetes resources for which the webhook should // be invoked -func (w *WebhookForCommands) Resources() []string { +func (w *WebhookForCommands) Resources() map[string][]string { return w.resources } @@ -210,6 +220,12 @@ func (w *WebhookForCommands) LabelSelectors(_ bool) (namespaceSelector *metav1.L return nil, nil } +// MatchConditions returns the Match Conditions used for fine-grained +// request filtering +func (w *WebhookForCommands) MatchConditions() []admissionregistrationv1.MatchCondition { + return w.matchConditions +} + // WebhookFunc MutateFunc returns the function that mutates the resources func (w *WebhookForCommands) WebhookFunc() admission.WebhookFunc { return w.admissionFunc @@ -370,7 +386,7 @@ func (ci *CWSInstrumentation) WebhookForCommands() *WebhookForCommands { } func (ci *CWSInstrumentation) injectForCommand(request *admission.Request) *admiv1.AdmissionResponse { - return common.MutationResponse(mutatePodExecOptions(request.Raw, request.Name, request.Namespace, ci.webhookForCommands.Name(), request.UserInfo, ci.injectCWSCommandInstrumentation, request.DynamicClient, request.APIClient)) + return common.MutationResponse(mutatePodExecOptions(request.Object, request.Name, request.Namespace, ci.webhookForCommands.Name(), request.UserInfo, ci.injectCWSCommandInstrumentation, request.DynamicClient, request.APIClient)) } func (ci *CWSInstrumentation) resolveNodeArch(nodeName string, apiClient kubernetes.Interface) (string, error) { @@ -617,7 +633,7 @@ func (ci *CWSInstrumentation) injectCWSCommandInstrumentationRemoteCopy(pod *cor } func (ci *CWSInstrumentation) injectForPod(request *admission.Request) *admiv1.AdmissionResponse { - return common.MutationResponse(mutatecommon.Mutate(request.Raw, request.Namespace, ci.webhookForPods.Name(), ci.injectCWSPodInstrumentation, request.DynamicClient)) + return common.MutationResponse(mutatecommon.Mutate(request.Object, request.Namespace, ci.webhookForPods.Name(), ci.injectCWSPodInstrumentation, request.DynamicClient)) } func (ci *CWSInstrumentation) injectCWSPodInstrumentation(pod *corev1.Pod, ns string, _ dynamic.Interface) (bool, error) { diff --git a/pkg/clusteragent/admission/mutate/tagsfromlabels/tags.go b/pkg/clusteragent/admission/mutate/tagsfromlabels/tags.go index 355430d527c49..77f4d82e2cd70 100644 --- a/pkg/clusteragent/admission/mutate/tagsfromlabels/tags.go +++ b/pkg/clusteragent/admission/mutate/tagsfromlabels/tags.go @@ -47,8 +47,9 @@ type Webhook struct { name string isEnabled bool endpoint string - resources []string + resources map[string][]string operations []admissionregistrationv1.OperationType + matchConditions []admissionregistrationv1.MatchCondition ownerCacheTTL time.Duration wmeta workloadmeta.Component injectionFilter mutatecommon.InjectionFilter @@ -60,8 +61,9 @@ func NewWebhook(wmeta workloadmeta.Component, datadogConfig config.Component, in name: webhookName, isEnabled: datadogConfig.GetBool("admission_controller.inject_tags.enabled"), endpoint: datadogConfig.GetString("admission_controller.inject_tags.endpoint"), - resources: []string{"pods"}, + resources: map[string][]string{"": {"pods"}}, operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, + matchConditions: []admissionregistrationv1.MatchCondition{}, ownerCacheTTL: ownerCacheTTL(datadogConfig), wmeta: wmeta, injectionFilter: injectionFilter, @@ -90,7 +92,7 @@ func (w *Webhook) Endpoint() string { // Resources returns the kubernetes resources for which the webhook should // be invoked -func (w *Webhook) Resources() []string { +func (w *Webhook) Resources() map[string][]string { return w.resources } @@ -106,6 +108,12 @@ func (w *Webhook) LabelSelectors(useNamespaceSelector bool) (namespaceSelector * return common.DefaultLabelSelectors(useNamespaceSelector) } +// MatchConditions returns the Match Conditions used for fine-grained +// request filtering +func (w *Webhook) MatchConditions() []admissionregistrationv1.MatchCondition { + return w.matchConditions +} + type owner struct { name string namespace string @@ -128,7 +136,7 @@ func (o *ownerInfo) buildID(ns string) string { // WebhookFunc returns the function that mutates the resources func (w *Webhook) WebhookFunc() admission.WebhookFunc { return func(request *admission.Request) *admiv1.AdmissionResponse { - return common.MutationResponse(mutatecommon.Mutate(request.Raw, request.Namespace, w.Name(), func(pod *corev1.Pod, ns string, dc dynamic.Interface) (bool, error) { + return common.MutationResponse(mutatecommon.Mutate(request.Object, request.Namespace, w.Name(), func(pod *corev1.Pod, ns string, dc dynamic.Interface) (bool, error) { // Adds the DD_ENV, DD_VERSION, DD_SERVICE env vars to the pod template from pod and higher-level resource labels. return w.injectTags(pod, ns, dc) }, request.DynamicClient)) diff --git a/pkg/clusteragent/admission/start.go b/pkg/clusteragent/admission/start.go index 3bba12256f197..aee1183a3133d 100644 --- a/pkg/clusteragent/admission/start.go +++ b/pkg/clusteragent/admission/start.go @@ -11,6 +11,7 @@ package admission import ( "time" + "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" "github.com/DataDog/datadog-agent/comp/core/config" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/controllers/secret" @@ -35,6 +36,7 @@ type ControllerContext struct { Client kubernetes.Interface StopCh chan struct{} ValidatingStopCh chan struct{} + Demultiplexer demultiplexer.Component } // StartControllers starts the secret and webhook controllers @@ -67,12 +69,17 @@ func StartControllers(ctx ControllerContext, wmeta workloadmeta.Component, pa wo return webhooks, err } + matchConditionsSupported, err := supportsMatchConditions(ctx.Client.Discovery()) + if err != nil { + return webhooks, err + } + v1Enabled, err := UseAdmissionV1(ctx.Client.Discovery()) if err != nil { return webhooks, err } - webhookConfig := webhook.NewConfig(v1Enabled, nsSelectorEnabled) + webhookConfig := webhook.NewConfig(v1Enabled, nsSelectorEnabled, matchConditionsSupported) webhookController := webhook.NewController( ctx.Client, ctx.SecretInformers.Core().V1().Secrets(), @@ -84,6 +91,7 @@ func StartControllers(ctx ControllerContext, wmeta workloadmeta.Component, pa wo wmeta, pa, datadogConfig, + ctx.Demultiplexer, ) go secretController.Run(ctx.StopCh) diff --git a/pkg/clusteragent/admission/util.go b/pkg/clusteragent/admission/util.go index 90f0f893add60..9f13fc5488b3f 100644 --- a/pkg/clusteragent/admission/util.go +++ b/pkg/clusteragent/admission/util.go @@ -12,14 +12,30 @@ import ( "strconv" "time" + "golang.org/x/mod/semver" + "k8s.io/apimachinery/pkg/version" + "k8s.io/client-go/discovery" + pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver/common" "github.com/DataDog/datadog-agent/pkg/util/log" - - "k8s.io/apimachinery/pkg/version" - "k8s.io/client-go/discovery" ) +// supportsMatchConditions returns whether Kubernetes server version supports match conditions. +// Returns true if Kubernetes version is 1.28+. Otherwise, returns false. +// Match conditions are in alpha in 1.27 but require a feature gate to be enabled. They are not supported in 1.26. +func supportsMatchConditions(discoveryCl discovery.DiscoveryInterface) (bool, error) { + serverVersion, err := common.KubeServerVersion(discoveryCl, 10*time.Second) + if err != nil { + return false, fmt.Errorf("cannot get Kubernetes version: %w", err) + } + if semver.IsValid(serverVersion.String()) && semver.Compare(serverVersion.String(), "v1.28.0") >= 0 { + return true, nil + } + log.Debugf("Match conditions are not supported in Kubernetes version %s", serverVersion.String()) + return false, nil +} + // useNamespaceSelector returns whether we need to fallback to using namespace selector instead of object selector. // Returns true if `namespace_selector_fallback` is enabled and k8s version is between 1.10 and 1.14 (included). // Kubernetes 1.15+ supports object selectors. diff --git a/pkg/clusteragent/admission/validate/common/common.go b/pkg/clusteragent/admission/validate/common/common.go index 81802079c9e72..a602b8c25e9dd 100644 --- a/pkg/clusteragent/admission/validate/common/common.go +++ b/pkg/clusteragent/admission/validate/common/common.go @@ -9,31 +9,24 @@ package common import ( - "encoding/json" "fmt" "strconv" - corev1 "k8s.io/api/core/v1" "k8s.io/client-go/dynamic" + "github.com/DataDog/datadog-agent/cmd/cluster-agent/admission" "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/metrics" ) -// ValidationFunc is a function that validates a pod -type ValidationFunc func(pod *corev1.Pod, ns string, cl dynamic.Interface) (bool, error) +// ValidationFunc is a function that validates an admission request. +type ValidationFunc func(request *admission.Request, ns string, cl dynamic.Interface) (bool, error) -// Validate handles validating pods and encoding and decoding admission -// requests and responses for the public validate functions -func Validate(rawPod []byte, ns string, webhookName string, v ValidationFunc, dc dynamic.Interface) (bool, error) { - var pod corev1.Pod - if err := json.Unmarshal(rawPod, &pod); err != nil { - return false, fmt.Errorf("failed to decode raw object: %w", err) - } - - validated, err := v(&pod, ns, dc) +// Validate handles validating, encoding and decoding admission requests and responses for the public validate functions. +func Validate(request *admission.Request, webhookName string, v ValidationFunc, dc dynamic.Interface) (bool, error) { + validated, err := v(request, request.Namespace, dc) if err != nil { metrics.ValidationAttempts.Inc(webhookName, metrics.StatusError, strconv.FormatBool(false), err.Error()) - return false, fmt.Errorf("failed to validate pod: %w", err) + return false, fmt.Errorf("failed to validate admission request: %w", err) } metrics.ValidationAttempts.Inc(webhookName, metrics.StatusSuccess, strconv.FormatBool(validated), "") diff --git a/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents.go b/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents.go new file mode 100644 index 0000000000000..0fea27429afbf --- /dev/null +++ b/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents.go @@ -0,0 +1,208 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +//go:build kubeapiserver + +// Package kubernetesadmissionevents is a validation webhook that admit all requests and generate a Datadog Event. +package kubernetesadmissionevents + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + admiv1 "k8s.io/api/admission/v1" + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/client-go/dynamic" + + "github.com/DataDog/datadog-agent/cmd/cluster-agent/admission" + "github.com/DataDog/datadog-agent/comp/core/config" + "github.com/DataDog/datadog-agent/pkg/aggregator" + "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/common" + validatecommon "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/validate/common" + checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id" + "github.com/DataDog/datadog-agent/pkg/metrics/event" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +// Webhook is the KubernetesAdmissionEvents webhook. +type Webhook struct { + name string + isEnabled bool + endpoint string + resources map[string][]string + operations []admissionregistrationv1.OperationType + matchConditions []admissionregistrationv1.MatchCondition + demultiplexer aggregator.Demultiplexer + supportsMatchConditions bool + checkid checkid.ID +} + +// NewWebhook returns a new KubernetesAdmissionEvents webhook. +func NewWebhook(datadogConfig config.Component, demultiplexer aggregator.Demultiplexer, supportsMatchConditions bool) *Webhook { + return &Webhook{ + name: "kubernetes_admission_events", + isEnabled: datadogConfig.GetBool("admission_controller.kubernetes_admission_events.enabled"), + endpoint: "/kubernetes-admission-events", + // If we add more resources, we must rework the `kube_deployment` tag in the emitEvent() function. + resources: map[string][]string{ + "apps": { + "deployments", + }, + }, + operations: []admissionregistrationv1.OperationType{ + admissionregistrationv1.OperationAll, + }, + // Only supported by Kubernetes 1.28+. Otherwise, filtering is done in the emitEvent() function. + // This is to send events only for human users and not for system users as to avoid unneeded events. + matchConditions: []admissionregistrationv1.MatchCondition{ + { + Name: "exclude-system-users", + Expression: "!(request.userInfo.username.startsWith('system:'))", + }, + }, + demultiplexer: demultiplexer, + supportsMatchConditions: supportsMatchConditions, + checkid: "kubernetes_admission_events", + } +} + +// Name returns the name of the webhook +func (w *Webhook) Name() string { + return w.name +} + +// WebhookType returns the type of the webhook +func (w *Webhook) WebhookType() common.WebhookType { + return common.ValidatingWebhook +} + +// IsEnabled returns whether the webhook is enabled +func (w *Webhook) IsEnabled() bool { + return w.isEnabled +} + +// Endpoint returns the endpoint of the webhook +func (w *Webhook) Endpoint() string { + return w.endpoint +} + +// Resources returns the kubernetes resources for which the webhook should +// be invoked +func (w *Webhook) Resources() map[string][]string { + return w.resources +} + +// Operations returns the operations on the resources specified for which +// the webhook should be invoked +func (w *Webhook) Operations() []admissionregistrationv1.OperationType { + return w.operations +} + +// LabelSelectors returns the label selectors that specify when the webhook +// should be invoked +func (w *Webhook) LabelSelectors(useNamespaceSelector bool) (namespaceSelector *metav1.LabelSelector, objectSelector *metav1.LabelSelector) { + return common.DefaultLabelSelectors(useNamespaceSelector) +} + +// MatchConditions returns the Match Conditions used for fine-grained +// request filtering +func (w *Webhook) MatchConditions() []admissionregistrationv1.MatchCondition { + return w.matchConditions +} + +// WebhookFunc returns the function that generates a Datadog Event and admits the request. +func (w *Webhook) WebhookFunc() admission.WebhookFunc { + return func(request *admission.Request) *admiv1.AdmissionResponse { + return common.ValidationResponse(validatecommon.Validate(request, w.Name(), w.emitEvent, request.DynamicClient)) + } +} + +// emitEvent generates a Datadog Event, sends it to the kubernetes_admission_events sender and admits the request. +func (w *Webhook) emitEvent(request *admission.Request, _ string, _ dynamic.Interface) (bool, error) { + if !w.supportsMatchConditions { + // Manually filter out system users if match conditions are not supported. + // This is to send events only for human users and not for system users as to avoid unneeded events. + if strings.HasPrefix(request.UserInfo.Username, "system:") { + log.Debugf("Skipping system user: %s", request.UserInfo.Username) + return true, nil + } + } + + e, err := generateDatadogEvent(request, w.Name()) + if err != nil { + return true, fmt.Errorf("failed to generate event: %w", err) + } + + // Send the event to the sender. + s, err := w.demultiplexer.GetSender(w.checkid) + if err != nil { + _ = log.Errorf("Error getting the default sender: %s", err) + } else { + log.Debugf("Sending Kubernetes Audit Event: %v", e) + s.Event(e) + } + + // Validation must always validate incoming request. + return true, nil +} + +func generateDatadogEvent(request *admission.Request, webhookName string) (event.Event, error) { + // Decode object and oldObject. + var newResource unstructured.Unstructured + if request.Operation != admissionregistrationv1.Delete { + if err := json.Unmarshal(request.Object, &newResource); err != nil { + return event.Event{}, fmt.Errorf("failed to unmarshal object: %w", err) + } + } + var oldResource unstructured.Unstructured + if request.Operation != admissionregistrationv1.Create && request.Operation != admissionregistrationv1.Connect { + if err := json.Unmarshal(request.OldObject, &oldResource); err != nil { + return event.Event{}, fmt.Errorf("failed to unmarshal oldObject: %w", err) + } + } + + // Generate a Datadog Event. + title := fmt.Sprintf("%s Event for %s %s/%s by %s", request.Operation, request.Kind.Kind, request.Namespace, request.Name, request.UserInfo.Username) + text := "%%%" + + "**Kind:** " + request.Kind.Kind + "\\\n" + + "**Resource:** " + request.Namespace + "/" + request.Name + "\\\n" + + "**Username:** " + request.UserInfo.Username + "\\\n" + + "**Operation:** " + string(request.Operation) + "\\\n" + + "**Time:** " + time.Now().UTC().Format("January 02, 2006 at 03:04:05 PM MST") + "\\\n" + + "**Request UID:** " + string(request.UID) + + "%%%" + + tags := []string{ + "uid:" + string(request.UID), + "kube_username:" + request.UserInfo.Username, + "kube_kind:" + request.Kind.Kind, + "kube_namespace:" + request.Namespace, + "kube_deployment:" + request.Name, // Only if we are dealing with a deployment. If we add more resources, we should rework this. + "operation:" + string(request.Operation), + } + + // Add labels to the tags. + for key, value := range newResource.GetLabels() { + tags = append(tags, fmt.Sprintf("%s:%s", key, value)) + } + for key, value := range oldResource.GetLabels() { + tags = append(tags, fmt.Sprintf("%s:%s", key, value)) + } + + return event.Event{ + Title: title, + Text: text, + Ts: 0, + Priority: event.PriorityNormal, + Tags: tags, + AlertType: event.AlertTypeInfo, + SourceTypeName: "kubernetes admission", + EventType: webhookName, + }, nil +} diff --git a/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents_test.go b/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents_test.go new file mode 100644 index 0000000000000..954d338bae5e3 --- /dev/null +++ b/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents_test.go @@ -0,0 +1,268 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +//go:build kubeapiserver + +package kubernetesadmissionevents + +import ( + "encoding/json" + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "go.uber.org/fx" + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + authenticationv1 "k8s.io/api/authentication/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/DataDog/datadog-agent/cmd/cluster-agent/admission" + "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer" + "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" + "github.com/DataDog/datadog-agent/comp/core" + "github.com/DataDog/datadog-agent/comp/core/config" + "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl" + "github.com/DataDog/datadog-agent/comp/core/log/def" + logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" + compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" + "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" + "github.com/DataDog/datadog-agent/pkg/metrics/event" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" +) + +const ( + sourceTypeName = "kubernetes admission" + eventType = "kubernetes_admission_events" +) + +// TestKubernetesAdmissionEvents tests the KubernetesAdmissionEvents webhook. +func TestKubernetesAdmissionEvents(t *testing.T) { + // Mock demultiplexer and sender + demultiplexerMock := createDemultiplexer(t) + mockSender := mocksender.NewMockSenderWithSenderManager(eventType, demultiplexerMock) + err := demultiplexerMock.SetSender(mockSender, eventType) + assert.NoError(t, err) + + // Mock Datadog Config + datadogConfigMock := fxutil.Test[config.Component](t, core.MockBundle()) + datadogConfigMock.SetWithoutSource("admission_controller.kubernetes_admission_events.enabled", true) + + tests := []struct { + name string + supportsMatchConditions bool + expectedEmitted bool + request admission.Request + expectedEvent event.Event + }{ + { + name: "Pod creation", + supportsMatchConditions: true, + expectedEmitted: true, + request: admission.Request{ + UID: "000", + Name: "pod", + Namespace: "namespace", + Kind: metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Operation: admissionregistrationv1.Create, + UserInfo: &authenticationv1.UserInfo{Username: "username"}, + Object: func() []byte { + marshalledObject, _ := json.Marshal(&unstructured.Unstructured{Object: map[string]interface{}{"kind": "Pod"}}) + return marshalledObject + }(), + OldObject: func() []byte { + marshalledOldObject, _ := json.Marshal(&unstructured.Unstructured{Object: map[string]interface{}{"kind": "Pod"}}) + return marshalledOldObject + }(), + DynamicClient: nil, + APIClient: nil, + }, + expectedEvent: event.Event{ + Title: fmt.Sprintf("%s Event for %s %s/%s by %s", "CREATE", "Pod", "namespace", "pod", "username"), + Text: "%%%" + + "**Kind:** " + "Pod" + "\\\n" + + "**Resource:** " + "namespace" + "/" + "pod" + "\\\n" + + "**Username:** " + "username" + "\\\n" + + "**Operation:** " + "CREATE" + "\\\n" + + "**Time:** " + time.Now().UTC().Format("January 02, 2006 at 03:04:05 PM MST") + "\\\n" + + "**Request UID:** " + "000" + + "%%%", + Ts: 0, + Priority: event.PriorityNormal, + Tags: []string{ + "uid:" + "000", + "kube_username:" + "username", + "kube_kind:" + "Pod", + "kube_namespace:" + "namespace", + "kube_deployment:" + "pod", + "operation:" + "CREATE", + }, + AlertType: event.AlertTypeInfo, + SourceTypeName: sourceTypeName, + EventType: eventType, + }, + }, + { + name: "Pod update", + supportsMatchConditions: true, + expectedEmitted: true, + request: admission.Request{ + UID: "000", + Name: "pod", + Namespace: "namespace", + Kind: metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Operation: admissionregistrationv1.Update, + UserInfo: &authenticationv1.UserInfo{Username: "username"}, + Object: func() []byte { + marshalledObject, _ := json.Marshal(&unstructured.Unstructured{Object: map[string]interface{}{"kind": "Pod"}}) + return marshalledObject + }(), + OldObject: func() []byte { + marshalledOldObject, _ := json.Marshal(&unstructured.Unstructured{Object: map[string]interface{}{"kind": "Pod"}}) + return marshalledOldObject + }(), + DynamicClient: nil, + APIClient: nil, + }, + expectedEvent: event.Event{ + Title: fmt.Sprintf("%s Event for %s %s/%s by %s", "UPDATE", "Pod", "namespace", "pod", "username"), + Text: "%%%" + + "**Kind:** " + "Pod" + "\\\n" + + "**Resource:** " + "namespace" + "/" + "pod" + "\\\n" + + "**Username:** " + "username" + "\\\n" + + "**Operation:** " + "UPDATE" + "\\\n" + + "**Time:** " + time.Now().UTC().Format("January 02, 2006 at 03:04:05 PM MST") + "\\\n" + + "**Request UID:** " + "000" + + "%%%", + Ts: 0, + Priority: event.PriorityNormal, + Tags: []string{ + "uid:" + "000", + "kube_username:" + "username", + "kube_kind:" + "Pod", + "kube_namespace:" + "namespace", + "kube_deployment:" + "pod", + "operation:" + "UPDATE", + }, + AlertType: event.AlertTypeInfo, + SourceTypeName: sourceTypeName, + EventType: eventType, + }, + }, + { + name: "Pod deletion", + supportsMatchConditions: true, + expectedEmitted: true, + request: admission.Request{ + UID: "000", + Name: "pod", + Namespace: "namespace", + Kind: metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Operation: admissionregistrationv1.Delete, + UserInfo: &authenticationv1.UserInfo{Username: "username"}, + Object: func() []byte { + marshalledObject, _ := json.Marshal(&unstructured.Unstructured{Object: map[string]interface{}{"kind": "Pod"}}) + return marshalledObject + }(), + OldObject: func() []byte { + marshalledOldObject, _ := json.Marshal(&unstructured.Unstructured{Object: map[string]interface{}{"kind": "Pod"}}) + return marshalledOldObject + }(), + DynamicClient: nil, + APIClient: nil, + }, + expectedEvent: event.Event{ + Title: fmt.Sprintf("%s Event for %s %s/%s by %s", "DELETE", "Pod", "namespace", "pod", "username"), + Text: "%%%" + + "**Kind:** " + "Pod" + "\\\n" + + "**Resource:** " + "namespace" + "/" + "pod" + "\\\n" + + "**Username:** " + "username" + "\\\n" + + "**Operation:** " + "DELETE" + "\\\n" + + "**Time:** " + time.Now().UTC().Format("January 02, 2006 at 03:04:05 PM MST") + "\\\n" + + "**Request UID:** " + "000" + + "%%%", + Ts: 0, + Priority: event.PriorityNormal, + Tags: []string{ + "uid:" + "000", + "kube_username:" + "username", + "kube_kind:" + "Pod", + "kube_namespace:" + "namespace", + "kube_deployment:" + "pod", + "operation:" + "DELETE", + }, + AlertType: event.AlertTypeInfo, + SourceTypeName: sourceTypeName, + EventType: eventType, + }, + }, + { + name: "Pod creation by system user without match conditions", + supportsMatchConditions: false, + expectedEmitted: false, + request: admission.Request{ + UID: "000", + Name: "pod", + Namespace: "namespace", + Kind: metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Operation: admissionregistrationv1.Create, + UserInfo: &authenticationv1.UserInfo{Username: "system:serviceaccount"}, + Object: func() []byte { + marshalledObject, _ := json.Marshal(&unstructured.Unstructured{Object: map[string]interface{}{"kind": "Pod"}}) + return marshalledObject + }(), + OldObject: func() []byte { + marshalledOldObject, _ := json.Marshal(&unstructured.Unstructured{Object: map[string]interface{}{"kind": "Pod"}}) + return marshalledOldObject + }(), + DynamicClient: nil, + APIClient: nil, + }, + expectedEvent: event.Event{}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Create the webhook + kubernetesAuditWebhook := NewWebhook(datadogConfigMock, demultiplexerMock, tt.supportsMatchConditions) + assert.True(t, kubernetesAuditWebhook.IsEnabled()) + assert.Equal(t, eventType, kubernetesAuditWebhook.name) + + // Emit the event + mockSender.On("Event", mock.AnythingOfType("event.Event")).Return().Once() + validated, err := kubernetesAuditWebhook.emitEvent(&tt.request, "", nil) + assert.NoError(t, err) + assert.True(t, validated) + if tt.expectedEmitted { + mockSender.AssertCalled(t, "Event", tt.expectedEvent) + } else { + mockSender.AssertNotCalled(t, "Event") + } + }) + } +} + +// createDemultiplexer creates a demultiplexer for testing +func createDemultiplexer(t *testing.T) demultiplexer.FakeSamplerMock { + return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule(), hostnameimpl.MockModule()) +} diff --git a/pkg/config/setup/config.go b/pkg/config/setup/config.go index 53327bb3f2908..3544b3753e331 100644 --- a/pkg/config/setup/config.go +++ b/pkg/config/setup/config.go @@ -796,6 +796,7 @@ func InitConfig(config pkgconfigmodel.Setup) { config.BindEnvAndSetDefault("admission_controller.agent_sidecar.image_name", "agent") config.BindEnvAndSetDefault("admission_controller.agent_sidecar.image_tag", "latest") config.BindEnvAndSetDefault("admission_controller.agent_sidecar.cluster_agent.enabled", "true") + config.BindEnvAndSetDefault("admission_controller.kubernetes_admission_events.enabled", false) // Declare other keys that don't have a default/env var. // Mostly, keys we use IsSet() on, because IsSet always returns true if a key has a default. diff --git a/releasenotes-dca/notes/kubernetes_admission_events-0a5f9edb3153df5e.yaml b/releasenotes-dca/notes/kubernetes_admission_events-0a5f9edb3153df5e.yaml new file mode 100644 index 0000000000000..1f66b0585e46d --- /dev/null +++ b/releasenotes-dca/notes/kubernetes_admission_events-0a5f9edb3153df5e.yaml @@ -0,0 +1,14 @@ +# Each section from every release note are combined when the +# CHANGELOG-DCA.rst is rendered. So the text needs to be worded so that +# it does not depend on any information only available in another +# section. This may mean repeating some details, but each section +# must be readable independently of the other. +# +# Each section note must be formatted as reStructuredText. +--- +features: + - | + Implements the Kubernetes Admission Events webhooks. This new webhooks will emit Datadog Events + when receving Validation Admission requests. It will track deployments operations made by non-system + users. + The webhook is controlled by using the `admission_controller.kubernetes_admission_events.enabled` setting. From 53e4dedec6ba3c1369b447d4f68382d1bc97a5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Juli=C3=A1n?= Date: Fri, 29 Nov 2024 11:22:49 +0100 Subject: [PATCH 27/59] [EBPF] gpu: do not store symbols that aren't used for CUDA kernels (#31383) --- pkg/gpu/cuda/fatbin.go | 36 +++++++++++++++++++++++++++++------- pkg/gpu/cuda/fatbin_test.go | 4 ++-- pkg/gpu/cuda/symbols.go | 5 ++++- pkg/gpu/stream_test.go | 20 ++++++++++---------- 4 files changed, 45 insertions(+), 20 deletions(-) diff --git a/pkg/gpu/cuda/fatbin.go b/pkg/gpu/cuda/fatbin.go index 5000defcd3934..275e0978b5b25 100644 --- a/pkg/gpu/cuda/fatbin.go +++ b/pkg/gpu/cuda/fatbin.go @@ -40,16 +40,40 @@ const fatbinDataMaxKind = fatbinDataKindSm // Fatbin holds all CUDA binaries found in one fatbin package type Fatbin struct { - Kernels map[CubinKernelKey]*CubinKernel + // kernels is a map of kernel keys to the kernel data + kernels map[CubinKernelKey]*CubinKernel + + // kernelNames is a map of kernel names to make easy lookup for HasKernelWithName + kernelNames map[string]struct{} +} + +// NewFatbin creates a new Fatbin instance +func NewFatbin() *Fatbin { + return &Fatbin{ + kernels: make(map[CubinKernelKey]*CubinKernel), + kernelNames: make(map[string]struct{}), + } } // GetKernel returns the kernel with the given name and SM version from the fatbin func (fb *Fatbin) GetKernel(name string, smVersion uint32) *CubinKernel { key := CubinKernelKey{Name: name, SmVersion: smVersion} - if _, ok := fb.Kernels[key]; !ok { + if _, ok := fb.kernels[key]; !ok { return nil } - return fb.Kernels[key] + return fb.kernels[key] +} + +// HasKernelWithName returns true if the fatbin has a kernel with the given name +func (fb *Fatbin) HasKernelWithName(name string) bool { + _, ok := fb.kernelNames[name] + return ok +} + +// AddKernel adds a kernel to the fatbin and updates internal indexes +func (fb *Fatbin) AddKernel(key CubinKernelKey, kernel *CubinKernel) { + fb.kernels[key] = kernel + fb.kernelNames[kernel.Name] = struct{}{} } type fatbinHeader struct { @@ -121,9 +145,7 @@ func getBufferOffset(buf io.Seeker) int64 { // ParseFatbinFromELFFile parses the fatbin sections of the given ELF file and returns the information found in it func ParseFatbinFromELFFile(elfFile *safeelf.File) (*Fatbin, error) { - fatbin := &Fatbin{ - Kernels: make(map[CubinKernelKey]*CubinKernel), - } + fatbin := NewFatbin() for _, sect := range elfFile.Sections { // CUDA embeds the fatbin data in sections named .nv_fatbin or __nv_relfatbin @@ -255,7 +277,7 @@ func parseFatbinData(buffer io.ReadSeeker, fatbin *Fatbin) error { // the SM version they were compiled for which is only available in the fatbin data for _, kernel := range parser.kernels { key := CubinKernelKey{Name: kernel.Name, SmVersion: fbData.SmVersion} - fatbin.Kernels[key] = kernel + fatbin.AddKernel(key, kernel) } return nil diff --git a/pkg/gpu/cuda/fatbin_test.go b/pkg/gpu/cuda/fatbin_test.go index 702a9fa0207e5..c4d6b6974fa73 100644 --- a/pkg/gpu/cuda/fatbin_test.go +++ b/pkg/gpu/cuda/fatbin_test.go @@ -47,7 +47,7 @@ func TestParseFatbinFromPath(t *testing.T) { kern2MangledName: 256, } - for key, kernel := range res.Kernels { + for key, kernel := range res.kernels { seenSmVersionsAndKernels[key.SmVersion] = append(seenSmVersionsAndKernels[key.SmVersion], key.Name) require.Equal(t, key.Name, kernel.Name) @@ -112,7 +112,7 @@ func TestParseBigFatbinFromPath(t *testing.T) { seenSmVersionsAndKernels := make(map[uint32][]string) - for key, kernel := range res.Kernels { + for key, kernel := range res.kernels { seenSmVersionsAndKernels[key.SmVersion] = append(seenSmVersionsAndKernels[key.SmVersion], key.Name) require.Equal(t, key.Name, kernel.Name) diff --git a/pkg/gpu/cuda/symbols.go b/pkg/gpu/cuda/symbols.go index 650d6ca7add1e..88ea6eccb1e00 100644 --- a/pkg/gpu/cuda/symbols.go +++ b/pkg/gpu/cuda/symbols.go @@ -44,7 +44,10 @@ func GetSymbols(path string) (*Symbols, error) { } for _, sym := range syms { - data.SymbolTable[sym.Value] = sym.Name + // Only store symbols that are CUDA kernels + if fatbin.HasKernelWithName(sym.Name) { + data.SymbolTable[sym.Value] = sym.Name + } } return data, nil diff --git a/pkg/gpu/stream_test.go b/pkg/gpu/stream_test.go index d6a424f3e2cc7..f33e4f342e98b 100644 --- a/pkg/gpu/stream_test.go +++ b/pkg/gpu/stream_test.go @@ -343,19 +343,19 @@ func TestKernelLaunchesIncludeEnrichedKernelData(t *testing.T) { procBinPath := path.Join(proc, fmt.Sprintf("%d/root/%s", pid, binPath)) kernKey := cuda.CubinKernelKey{Name: kernName, SmVersion: smVersion} + + fatbin := cuda.NewFatbin() + fatbin.AddKernel(kernKey, &cuda.CubinKernel{ + Name: kernName, + KernelSize: kernSize, + SharedMem: sharedMem, + ConstantMem: constantMem, + }) + sysCtx.cudaSymbols[procBinPath] = &symbolsEntry{ Symbols: &cuda.Symbols{ SymbolTable: map[uint64]string{kernAddress: kernName}, - Fatbin: &cuda.Fatbin{ - Kernels: map[cuda.CubinKernelKey]*cuda.CubinKernel{ - kernKey: { - Name: kernName, - KernelSize: kernSize, - SharedMem: sharedMem, - ConstantMem: constantMem, - }, - }, - }, + Fatbin: fatbin, }, } From ae10a85f57e5f52a0a87a1a656a11dd75fd84c99 Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Fri, 29 Nov 2024 11:27:29 +0100 Subject: [PATCH 28/59] Update the apm-ecosystems-reliability slack channel (#31557) --- tasks/libs/pipeline/github_slack_map.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/libs/pipeline/github_slack_map.yaml b/tasks/libs/pipeline/github_slack_map.yaml index 4e83262868150..fd021cf169528 100644 --- a/tasks/libs/pipeline/github_slack_map.yaml +++ b/tasks/libs/pipeline/github_slack_map.yaml @@ -44,5 +44,5 @@ '@datadog/agent-devx-infra': '#agent-devx-ops' '@datadog/agent-devx-loops': '#agent-devx-ops' '@datadog/apm-onboarding': '#apm-onboarding' -'@datadog/apm-reliability-and-performance': '#apm-ecosystems-reliability-and-performance' +'@datadog/apm-reliability-and-performance': '#apm-ecosystems-reliability' '@DataDog/container-ecosystems': '#container-ecosystems-ops' From 06353eccb6cb529bfa31f66f2efb7b1ecc052184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lian=20Raimbault?= <161456554+CelianR@users.noreply.github.com> Date: Fri, 29 Nov 2024 06:10:47 -0500 Subject: [PATCH 29/59] worktree: Use git clone instead of git worktree (#31594) --- tasks/libs/common/worktree.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tasks/libs/common/worktree.py b/tasks/libs/common/worktree.py index 7e7da54af73df..18813788cfc43 100644 --- a/tasks/libs/common/worktree.py +++ b/tasks/libs/common/worktree.py @@ -27,7 +27,17 @@ def init_env(ctx, branch: str | None = None): """ if not WORKTREE_DIRECTORY.is_dir(): - if not ctx.run(f"git worktree add '{WORKTREE_DIRECTORY}' origin/{branch or 'main'}", warn=True): + print(f'{color_message("Info", Color.BLUE)}: Cloning datadog agent into {WORKTREE_DIRECTORY}') + remote = ctx.run("git remote get-url origin", hide=True).stdout.strip() + # Try to use this option to reduce cloning time + if all( + not ctx.run( + f"git clone '{remote}' '{WORKTREE_DIRECTORY}' -b {branch or 'main'} {filter_option}", + warn=True, + hide=True, + ) + for filter_option in ["--filter=blob:none", ""] + ): raise Exit( f'{color_message("Error", Color.RED)}: Cannot initialize worktree environment. You might want to reset the worktree directory with `inv worktree.remove`', code=1, @@ -47,7 +57,7 @@ def init_env(ctx, branch: str | None = None): def remove_env(ctx): """Will remove the environment for commands applying to a worktree.""" - ctx.run(f"git worktree remove -f '{WORKTREE_DIRECTORY}'", warn=True) + ctx.run(f"rm -rf '{WORKTREE_DIRECTORY}'", warn=True) def is_worktree(): From a9e81b3abcb3936cb6abaa0e422d3a5ec18f914f Mon Sep 17 00:00:00 2001 From: pducolin <45568537+pducolin@users.noreply.github.com> Date: Fri, 29 Nov 2024 12:17:15 +0100 Subject: [PATCH 30/59] [e2e] add local host provisioner based on podman (#31494) Co-authored-by: agent-platform-auto-pr[bot] <153269286+agent-platform-auto-pr[bot]@users.noreply.github.com> --- .../new-e2e/examples/agentenv_metrics_test.go | 1 - test/new-e2e/examples/vm_localpodman_test.go | 53 +++++ test/new-e2e/examples/vm_test.go | 6 - .../pkg/environments/local/host/podman.go | 182 ++++++++++++++++++ .../pkg/environments/local/kubernetes/kind.go | 2 - test/new-e2e/pkg/runner/configmap.go | 6 +- test/new-e2e/pkg/runner/configmap_test.go | 1 + test/new-e2e/pkg/utils/e2e/client/host.go | 2 +- 8 files changed, 242 insertions(+), 11 deletions(-) create mode 100644 test/new-e2e/examples/vm_localpodman_test.go create mode 100644 test/new-e2e/pkg/environments/local/host/podman.go diff --git a/test/new-e2e/examples/agentenv_metrics_test.go b/test/new-e2e/examples/agentenv_metrics_test.go index 513bfe72d8fdc..86150b5a5b26c 100644 --- a/test/new-e2e/examples/agentenv_metrics_test.go +++ b/test/new-e2e/examples/agentenv_metrics_test.go @@ -46,6 +46,5 @@ func (v *fakeintakeSuiteMetrics) Test3_FakeIntakeReceivesSystemUptimeHigherThanZ metrics, err := v.Env().FakeIntake.Client().FilterMetrics("system.uptime", client.WithMetricValueHigherThan(0)) assert.NoError(c, err) assert.Greater(c, len(metrics), 0, "no 'system.uptime' with value higher than 0 yet") - assert.Greater(c, len(metrics), 0, "no 'system.load.1' metrics yet") }, 5*time.Minute, 10*time.Second) } diff --git a/test/new-e2e/examples/vm_localpodman_test.go b/test/new-e2e/examples/vm_localpodman_test.go new file mode 100644 index 0000000000000..92941a6d7a8a4 --- /dev/null +++ b/test/new-e2e/examples/vm_localpodman_test.go @@ -0,0 +1,53 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +package examples + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/DataDog/datadog-agent/test/fakeintake/client" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + localhost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/local/host" +) + +type vmLocalPodmanSuite struct { + e2e.BaseSuite[environments.Host] +} + +// TestVMLocalPodmanSuite runs tests for the VM interface provisioned on a local podman managed container. +func TestVMLocalPodmanSuite(t *testing.T) { + suiteParams := []e2e.SuiteOption{e2e.WithProvisioner(localhost.PodmanProvisioner())} + + e2e.Run(t, &vmLocalPodmanSuite{}, suiteParams...) +} + +func (v *vmLocalPodmanSuite) TestExecute() { + vm := v.Env().RemoteHost + + out, err := vm.Execute("whoami") + v.Require().NoError(err) + v.Require().NotEmpty(out) +} + +func (v *vmLocalPodmanSuite) TestFakeIntakeReceivesSystemLoadMetric() { + v.EventuallyWithT(func(c *assert.CollectT) { + metrics, err := v.Env().FakeIntake.Client().FilterMetrics("system.load.1") + assert.NoError(c, err) + assert.Greater(c, len(metrics), 0, "no 'system.load.1' metrics yet") + }, 5*time.Minute, 10*time.Second) +} + +func (v *vmLocalPodmanSuite) TestFakeIntakeReceivesSystemUptimeHigherThanZero() { + v.EventuallyWithT(func(c *assert.CollectT) { + metrics, err := v.Env().FakeIntake.Client().FilterMetrics("system.uptime", client.WithMetricValueHigherThan(0)) + assert.NoError(c, err) + assert.Greater(c, len(metrics), 0, "no 'system.uptime' with value higher than 0 yet") + }, 5*time.Minute, 10*time.Second) +} diff --git a/test/new-e2e/examples/vm_test.go b/test/new-e2e/examples/vm_test.go index ea5624354ca2c..a2fea62f01969 100644 --- a/test/new-e2e/examples/vm_test.go +++ b/test/new-e2e/examples/vm_test.go @@ -6,7 +6,6 @@ package examples import ( - "flag" "testing" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" @@ -14,8 +13,6 @@ import ( awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" ) -var devMode = flag.Bool("devmode", false, "enable dev mode") - type vmSuite struct { e2e.BaseSuite[environments.Host] } @@ -23,9 +20,6 @@ type vmSuite struct { // TestVMSuite runs tests for the VM interface to ensure its implementation is correct. func TestVMSuite(t *testing.T) { suiteParams := []e2e.SuiteOption{e2e.WithProvisioner(awshost.ProvisionerNoAgentNoFakeIntake())} - if *devMode { - suiteParams = append(suiteParams, e2e.WithDevMode()) - } e2e.Run(t, &vmSuite{}, suiteParams...) } diff --git a/test/new-e2e/pkg/environments/local/host/podman.go b/test/new-e2e/pkg/environments/local/host/podman.go new file mode 100644 index 0000000000000..911a91f36ab76 --- /dev/null +++ b/test/new-e2e/pkg/environments/local/host/podman.go @@ -0,0 +1,182 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package localhost contains the provisioner for the local Host based environments +package localhost + +import ( + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" + + "github.com/DataDog/test-infra-definitions/components/datadog/agent" + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + "github.com/DataDog/test-infra-definitions/resources/local" + + fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake" + "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" + localpodman "github.com/DataDog/test-infra-definitions/scenarios/local/podman" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +const ( + provisionerBaseID = "local-host-" + defaultName = "podman-host" +) + +// ProvisionerParams contains all the parameters needed to create the environment +type ProvisionerParams struct { + name string + agentOptions []agentparams.Option + fakeintakeOptions []fakeintake.Option + extraConfigParams runner.ConfigMap +} + +func newProvisionerParams() *ProvisionerParams { + return &ProvisionerParams{ + name: defaultName, + agentOptions: []agentparams.Option{}, + fakeintakeOptions: []fakeintake.Option{}, + extraConfigParams: runner.ConfigMap{}, + } +} + +// ProvisionerOption is a function that modifies the ProvisionerParams +type ProvisionerOption func(*ProvisionerParams) error + +// WithName sets the name of the provisioner +func WithName(name string) ProvisionerOption { + return func(params *ProvisionerParams) error { + params.name = name + return nil + } +} + +// WithAgentOptions adds options to the agent +func WithAgentOptions(opts ...agentparams.Option) ProvisionerOption { + return func(params *ProvisionerParams) error { + params.agentOptions = opts + return nil + } +} + +// WithoutFakeIntake removes the fake intake +func WithoutFakeIntake() ProvisionerOption { + return func(params *ProvisionerParams) error { + params.fakeintakeOptions = nil + return nil + } +} + +// WithoutAgent removes the agent +func WithoutAgent() ProvisionerOption { + return func(params *ProvisionerParams) error { + params.agentOptions = nil + return nil + } +} + +// WithExtraConfigParams adds extra config parameters to the environment +func WithExtraConfigParams(configMap runner.ConfigMap) ProvisionerOption { + return func(params *ProvisionerParams) error { + params.extraConfigParams = configMap + return nil + } +} + +// PodmanProvisionerNoAgentNoFakeIntake wraps Provisioner with hardcoded WithoutAgent and WithoutFakeIntake options. +func PodmanProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { + mergedOpts := make([]ProvisionerOption, 0, len(opts)+2) + mergedOpts = append(mergedOpts, opts...) + mergedOpts = append(mergedOpts, WithoutAgent(), WithoutFakeIntake()) + + return PodmanProvisioner(mergedOpts...) +} + +// PodmanProvisionerNoFakeIntake wraps Provisioner with hardcoded WithoutFakeIntake option. +func PodmanProvisionerNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { + mergedOpts := make([]ProvisionerOption, 0, len(opts)+1) + mergedOpts = append(mergedOpts, opts...) + mergedOpts = append(mergedOpts, WithoutFakeIntake()) + + return PodmanProvisioner(mergedOpts...) +} + +// PodmanProvisioner creates a new provisioner +func PodmanProvisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { + // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. + // and it's easy to forget about it, leading to hard to debug issues. + params := newProvisionerParams() + _ = optional.ApplyOptions(params, opts) + + provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Host) error { + // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. + // and it's easy to forget about it, leading to hard to debug issues. + params := newProvisionerParams() + _ = optional.ApplyOptions(params, opts) + + return PodmanRunFunc(ctx, env, params) + }, params.extraConfigParams) + + return provisioner +} + +// PodmanRunFunc is the Pulumi run function that runs the provisioner +func PodmanRunFunc(ctx *pulumi.Context, env *environments.Host, params *ProvisionerParams) error { + localEnv, err := local.NewEnvironment(ctx) + if err != nil { + return err + } + + vm, err := localpodman.NewVM(localEnv, params.name) + if err != nil { + return err + } + + err = vm.Export(ctx, &env.RemoteHost.HostOutput) + if err != nil { + return err + } + + if params.fakeintakeOptions != nil { + fakeIntake, err := fakeintakeComp.NewLocalDockerFakeintake(&localEnv, "fakeintake") + if err != nil { + return err + } + err = fakeIntake.Export(ctx, &env.FakeIntake.FakeintakeOutput) + if err != nil { + return err + } + + if params.agentOptions != nil { + newOpts := []agentparams.Option{agentparams.WithFakeintake(fakeIntake)} + params.agentOptions = append(newOpts, params.agentOptions...) + } + } else { + env.FakeIntake = nil + } + + if params.agentOptions != nil { + agentOptions := []agentparams.Option{agentparams.WithHostname("localdocker-vm")} + agentOptions = append(agentOptions, params.agentOptions...) + agent, err := agent.NewHostAgent(&localEnv, vm, agentOptions...) + if err != nil { + return err + } + err = agent.Export(ctx, &env.Agent.HostAgentOutput) + if err != nil { + return err + } + } else { + env.Agent = nil + } + + // explicit set the updater as nil as we do not use it + env.Updater = nil + + return nil +} diff --git a/test/new-e2e/pkg/environments/local/kubernetes/kind.go b/test/new-e2e/pkg/environments/local/kubernetes/kind.go index 90234eaaee38a..99703f64eb402 100644 --- a/test/new-e2e/pkg/environments/local/kubernetes/kind.go +++ b/test/new-e2e/pkg/environments/local/kubernetes/kind.go @@ -150,8 +150,6 @@ func KindRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Prov } if params.fakeintakeOptions != nil { - fakeintakeOpts := []fakeintake.Option{fakeintake.WithLoadBalancer()} - params.fakeintakeOptions = append(fakeintakeOpts, params.fakeintakeOptions...) fakeIntake, err := fakeintakeComp.NewLocalDockerFakeintake(&localEnv, "fakeintake") if err != nil { return err diff --git a/test/new-e2e/pkg/runner/configmap.go b/test/new-e2e/pkg/runner/configmap.go index 20dcb1a875cdd..bb4fd0a9fb0f7 100644 --- a/test/new-e2e/pkg/runner/configmap.go +++ b/test/new-e2e/pkg/runner/configmap.go @@ -13,6 +13,7 @@ import ( infraaws "github.com/DataDog/test-infra-definitions/resources/aws" infraazure "github.com/DataDog/test-infra-definitions/resources/azure" infragcp "github.com/DataDog/test-infra-definitions/resources/gcp" + infralocal "github.com/DataDog/test-infra-definitions/resources/local" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner/parameters" @@ -62,6 +63,9 @@ const ( GCPPrivateKeyPath = commonconfig.DDInfraConfigNamespace + ":" + infragcp.DDInfraDefaultPrivateKeyPath // GCPPrivateKeyPassword pulumi config paramater name GCPPrivateKeyPassword = commonconfig.DDInfraConfigNamespace + ":" + infragcp.DDInfraDefaultPrivateKeyPassword + + // LocalPublicKeyPath pulumi config paramater name + LocalPublicKeyPath = commonconfig.DDInfraConfigNamespace + ":" + infralocal.DDInfraDefaultPublicKeyPath ) // ConfigMap type alias to auto.ConfigMap @@ -124,7 +128,7 @@ func BuildStackParameters(profile Profile, scenarioConfig ConfigMap) (ConfigMap, cm.Set(InfraEnvironmentVariables, profile.EnvironmentNames(), false) params := map[parameters.StoreKey][]string{ parameters.KeyPairName: {AWSKeyPairName}, - parameters.PublicKeyPath: {AWSPublicKeyPath, AzurePublicKeyPath, GCPPublicKeyPath}, + parameters.PublicKeyPath: {AWSPublicKeyPath, AzurePublicKeyPath, GCPPublicKeyPath, LocalPublicKeyPath}, parameters.PrivateKeyPath: {AWSPrivateKeyPath, AzurePrivateKeyPath, GCPPrivateKeyPath}, parameters.ExtraResourcesTags: {InfraExtraResourcesTags}, parameters.PipelineID: {AgentPipelineID}, diff --git a/test/new-e2e/pkg/runner/configmap_test.go b/test/new-e2e/pkg/runner/configmap_test.go index f60b91cfef341..2e9bf966a53a2 100644 --- a/test/new-e2e/pkg/runner/configmap_test.go +++ b/test/new-e2e/pkg/runner/configmap_test.go @@ -46,6 +46,7 @@ func Test_BuildStackParameters(t *testing.T) { "ddinfra:gcp/defaultPublicKeyPath": auto.ConfigValue{Value: "public_key_path", Secret: false}, "ddinfra:gcp/defaultPrivateKeyPath": auto.ConfigValue{Value: "private_key_path", Secret: false}, "ddinfra:gcp/defaultPrivateKeyPassword": auto.ConfigValue{Value: "private_key_password", Secret: true}, + "ddinfra:local/defaultPublicKeyPath": auto.ConfigValue{Value: "public_key_path", Secret: false}, "ddagent:pipeline_id": auto.ConfigValue{Value: "pipeline_id", Secret: false}, "ddagent:commit_sha": auto.ConfigValue{Value: "commit_sha", Secret: false}, "ddagent:majorVersion": auto.ConfigValue{Value: "major_version", Secret: false}, diff --git a/test/new-e2e/pkg/utils/e2e/client/host.go b/test/new-e2e/pkg/utils/e2e/client/host.go index 16d597805dd1a..e446f56ff32db 100644 --- a/test/new-e2e/pkg/utils/e2e/client/host.go +++ b/test/new-e2e/pkg/utils/e2e/client/host.go @@ -85,7 +85,7 @@ func NewHost(context e2e.Context, hostOutput remote.HostOutput) (*Host, error) { host := &Host{ context: context, username: hostOutput.Username, - host: fmt.Sprintf("%s:%d", hostOutput.Address, 22), + host: fmt.Sprintf("%s:%d", hostOutput.Address, hostOutput.Port), privateKey: privateSSHKey, privateKeyPassphrase: []byte(privateKeyPassword), buildCommand: buildCommandFactory(hostOutput.OSFamily), From bdf4917554eb4eaf0d5c427a9f6479120eb562d2 Mon Sep 17 00:00:00 2001 From: val06 Date: Fri, 29 Nov 2024 13:41:42 +0200 Subject: [PATCH 31/59] [EBPF] PatternScaner testutil - support matching finished log (#31564) Co-authored-by: Guy Arbitman --- .github/CODEOWNERS | 1 + .../usm/sharedlibraries/testutil/testutil.go | 3 +- pkg/util/testutil/docker/run.go | 7 +- pkg/util/testutil/patternscanner.go | 72 ++++++++++++++----- 4 files changed, 65 insertions(+), 18 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 547304d1cbca5..eaea27fa17792 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -465,6 +465,7 @@ /pkg/util/pdhutil/ @DataDog/windows-agent /pkg/util/winutil/ @DataDog/windows-agent /pkg/util/testutil/flake @DataDog/agent-devx-loops +/pkg/util/testutil/patternscanner.go @DataDog/universal-service-monitoring @DataDog/ebpf-platform /pkg/util/testutil/docker @DataDog/universal-service-monitoring @DataDog/ebpf-platform /pkg/util/trie @DataDog/container-integrations /pkg/languagedetection @DataDog/processes @DataDog/universal-service-monitoring diff --git a/pkg/network/usm/sharedlibraries/testutil/testutil.go b/pkg/network/usm/sharedlibraries/testutil/testutil.go index be937a68d330a..a5f36ab69c216 100644 --- a/pkg/network/usm/sharedlibraries/testutil/testutil.go +++ b/pkg/network/usm/sharedlibraries/testutil/testutil.go @@ -31,7 +31,8 @@ var mux sync.Mutex // handle to the given paths. func OpenFromProcess(t *testing.T, programExecutable string, paths ...string) (*exec.Cmd, error) { cmd := exec.Command(programExecutable, paths...) - patternScanner := protocolstestutil.NewScanner(regexp.MustCompile("awaiting signal"), make(chan struct{}, 1)) + patternScanner, err := protocolstestutil.NewScanner(regexp.MustCompile("awaiting signal"), protocolstestutil.NoPattern, make(chan struct{}, 1)) + require.NoError(t, err, "failed to create pattern scanner") cmd.Stdout = patternScanner cmd.Stderr = patternScanner diff --git a/pkg/util/testutil/docker/run.go b/pkg/util/testutil/docker/run.go index 2f3049858675a..acde40acd969c 100644 --- a/pkg/util/testutil/docker/run.go +++ b/pkg/util/testutil/docker/run.go @@ -14,6 +14,8 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/pkg/util/testutil" ) @@ -24,12 +26,15 @@ import ( func Run(t testing.TB, cfg LifecycleConfig) error { var err error var ctx context.Context + var scanner *testutil.PatternScanner for i := 0; i < cfg.Retries(); i++ { t.Helper() // Ensuring no previous instances exists. killPreviousInstances(cfg) - scanner := testutil.NewScanner(cfg.LogPattern(), make(chan struct{}, 1)) + //TODO: in the following PR move the scanner to be a field of the LifecycleConfig + scanner, err = testutil.NewScanner(cfg.LogPattern(), testutil.NoPattern, make(chan struct{}, 1)) + require.NoError(t, err, "failed to create pattern scanner") // attempt to start the container/s ctx, err = run(t, cfg, scanner) if err != nil { diff --git a/pkg/util/testutil/patternscanner.go b/pkg/util/testutil/patternscanner.go index a5b7d685e4f1d..0610ad30afd72 100644 --- a/pkg/util/testutil/patternscanner.go +++ b/pkg/util/testutil/patternscanner.go @@ -9,38 +9,53 @@ package testutil import ( + "errors" "regexp" "strings" "sync" "testing" ) +// NoPattern is a sugar syntax for empty pattern +var NoPattern *regexp.Regexp + // PatternScanner is a helper to scan logs for a given pattern. type PatternScanner struct { - // The log pattern to match on - pattern *regexp.Regexp + // The log pattern to match on validating successful start + startPattern *regexp.Regexp + // The log pattern to match on validating successful finish. This is optional + finishPattern *regexp.Regexp // Once we've found the correct log, we should notify the caller. DoneChan chan struct{} // A sync.Once instance to ensure we notify the caller only once, and stop the operation. stopOnce sync.Once - // A helper to spare redundant calls to the analyzer once we've found the relevant log. + + // flag to indicate that start was found, and we should look for finishPattern now + startPatternFound bool + // A helper to spare redundant calls to the analyzer once we've found both start and finish stopped bool // keep the stdout/err in case of failure buffers []string - //Buffer for accumulating partial lines lineBuf string } // NewScanner returns a new instance of PatternScanner. -func NewScanner(pattern *regexp.Regexp, doneChan chan struct{}) *PatternScanner { - return &PatternScanner{ - pattern: pattern, - DoneChan: doneChan, - stopOnce: sync.Once{}, - stopped: false, +// at least one of the startPattern/finishPattern should be provided. +func NewScanner(startPattern, finishPattern *regexp.Regexp, doneChan chan struct{}) (*PatternScanner, error) { + if startPattern == nil && finishPattern == nil { + return nil, errors.New("at least one pattern should be provided") } + return &PatternScanner{ + startPattern: startPattern, + finishPattern: finishPattern, + DoneChan: doneChan, + stopOnce: sync.Once{}, + // skip looking for start pattern if not provided + startPatternFound: startPattern == nil, + stopped: false, + }, nil } // Write implemented io.Writer to be used as a callback for log/string writing. @@ -61,17 +76,42 @@ func (ps *PatternScanner) Write(p []byte) (n int, err error) { // Process all complete lines. for _, line := range lines[:len(lines)-1] { ps.buffers = append(ps.buffers, line) // Save the log line. - if !ps.stopped && ps.pattern.MatchString(line) { - ps.stopOnce.Do(func() { - ps.stopped = true - close(ps.DoneChan) // Notify the caller about the match. - }) - } + + // Check if we've met the scanning criteria + ps.matchPatterns(line) } return len(p), nil } +// matchPatterns checks if the current line matches the scanning requirements +func (ps *PatternScanner) matchPatterns(line string) { + switch { + // startPatternFound pattern not found yet, look for it + case !ps.startPatternFound: + if ps.startPattern.MatchString(line) { + // found start pattern, flip the flag to start looking for finish pattern for following iterations + ps.startPatternFound = true + + // no finishPattern provided, we can stop here + if ps.finishPattern == nil { + ps.notifyAndStop() + } + } + // startPatternFound pattern found, look for finish pattern if provided + case ps.finishPattern != nil && ps.finishPattern.MatchString(line): + ps.notifyAndStop() + } +} + +func (ps *PatternScanner) notifyAndStop() { + ps.stopOnce.Do(func() { + ps.buffers = append(ps.buffers, ps.lineBuf) // flush the last line + ps.stopped = true + close(ps.DoneChan) + }) +} + // PrintLogs writes the captured logs into the test logger. func (ps *PatternScanner) PrintLogs(t testing.TB) { t.Log(strings.Join(ps.buffers, "\n")) From 092a3cb15c50e5edf3945bcb66793c33f1e0cd4b Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Fri, 29 Nov 2024 13:15:46 +0100 Subject: [PATCH 32/59] [CWS] do not resolve new fields in functional test field collector (#31584) --- pkg/security/secl/compiler/eval/context.go | 8 + .../secl/compiler/eval/context_functests.go | 18 + .../secl/compiler/eval/context_regular.go | 13 + pkg/security/secl/compiler/eval/evaluators.go | 51 - .../generators/accessors/accessors.tmpl | 2 + pkg/security/secl/model/accessors_unix.go | 1410 +++++++++++++++++ pkg/security/secl/model/accessors_windows.go | 151 ++ .../secl/rules/collected_events_functests.go | 20 +- .../secl/rules/collected_events_regular.go | 2 +- pkg/security/secl/rules/ruleset.go | 2 +- pkg/security/seclwin/model/accessors_win.go | 151 ++ 11 files changed, 1764 insertions(+), 64 deletions(-) create mode 100644 pkg/security/secl/compiler/eval/context_functests.go create mode 100644 pkg/security/secl/compiler/eval/context_regular.go diff --git a/pkg/security/secl/compiler/eval/context.go b/pkg/security/secl/compiler/eval/context.go index dc8804a459c50..038a24634b353 100644 --- a/pkg/security/secl/compiler/eval/context.go +++ b/pkg/security/secl/compiler/eval/context.go @@ -35,6 +35,8 @@ type Context struct { now time.Time CachedAncestorsCount int + + resolvedFields []string } // Now return and cache the `now` timestamp @@ -61,6 +63,12 @@ func (c *Context) Reset() { clear(c.Registers) clear(c.RegisterCache) c.CachedAncestorsCount = 0 + clear(c.resolvedFields) +} + +// GetResolvedFields returns the resolved fields, always empty outside of functional tests +func (c *Context) GetResolvedFields() []string { + return c.resolvedFields } // NewContext return a new Context diff --git a/pkg/security/secl/compiler/eval/context_functests.go b/pkg/security/secl/compiler/eval/context_functests.go new file mode 100644 index 0000000000000..4c0a56683d9ea --- /dev/null +++ b/pkg/security/secl/compiler/eval/context_functests.go @@ -0,0 +1,18 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +//go:build functionaltests + +// Package eval holds eval related files +package eval + +// AppendResolvedField instructs the context that this field has been resolved +func (c *Context) AppendResolvedField(field string) { + if field == "" { + return + } + + c.resolvedFields = append(c.resolvedFields, field) +} diff --git a/pkg/security/secl/compiler/eval/context_regular.go b/pkg/security/secl/compiler/eval/context_regular.go new file mode 100644 index 0000000000000..b2a8ff0d71851 --- /dev/null +++ b/pkg/security/secl/compiler/eval/context_regular.go @@ -0,0 +1,13 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +//go:build !functionaltests + +// Package eval holds eval related files +package eval + +// AppendResolvedField is a no-op outside of functional tests +func (c *Context) AppendResolvedField(_ string) { +} diff --git a/pkg/security/secl/compiler/eval/evaluators.go b/pkg/security/secl/compiler/eval/evaluators.go index df2d7ab22609e..784d65a7c7bb5 100644 --- a/pkg/security/secl/compiler/eval/evaluators.go +++ b/pkg/security/secl/compiler/eval/evaluators.go @@ -18,7 +18,6 @@ type Evaluator interface { IsDeterministicFor(field Field) bool GetField() string IsStatic() bool - GetWeight() int } // BoolEvaluator returns a bool as result of the evaluation @@ -53,11 +52,6 @@ func (b *BoolEvaluator) IsStatic() bool { return b.EvalFnc == nil } -// GetWeight returns the weight of the evaluator -func (b *BoolEvaluator) GetWeight() int { - return b.Weight -} - // IntEvaluator returns an int as result of the evaluation type IntEvaluator struct { EvalFnc func(ctx *Context) int @@ -92,11 +86,6 @@ func (i *IntEvaluator) IsStatic() bool { return i.EvalFnc == nil } -// GetWeight returns the weight of the evaluator -func (i *IntEvaluator) GetWeight() int { - return i.Weight -} - // StringEvaluator returns a string as result of the evaluation type StringEvaluator struct { EvalFnc func(ctx *Context) string @@ -131,11 +120,6 @@ func (s *StringEvaluator) IsStatic() bool { return s.EvalFnc == nil } -// GetWeight returns the weight of the evaluator -func (s *StringEvaluator) GetWeight() int { - return s.Weight -} - // GetValue returns the evaluator value func (s *StringEvaluator) GetValue(ctx *Context) string { if s.EvalFnc == nil { @@ -190,11 +174,6 @@ func (s *StringArrayEvaluator) IsStatic() bool { return s.EvalFnc == nil } -// GetWeight returns the weight of the evaluator -func (s *StringArrayEvaluator) GetWeight() int { - return s.Weight -} - // AppendValue append the given value func (s *StringArrayEvaluator) AppendValue(value string) { s.Values = append(s.Values, value) @@ -230,11 +209,6 @@ func (s *StringValuesEvaluator) IsStatic() bool { return s.EvalFnc == nil } -// GetWeight returns the weight of the evaluator -func (s *StringValuesEvaluator) GetWeight() int { - return s.Weight -} - // Compile the underlying StringValues func (s *StringValuesEvaluator) Compile(opts StringCmpOpts) error { return s.Values.Compile(opts) @@ -301,11 +275,6 @@ func (i *IntArrayEvaluator) IsStatic() bool { return i.EvalFnc == nil } -// GetWeight returns the weight of the evaluator -func (i *IntArrayEvaluator) GetWeight() int { - return i.Weight -} - // AppendValues to the array evaluator func (i *IntArrayEvaluator) AppendValues(values ...int) { i.Values = append(i.Values, values...) @@ -343,11 +312,6 @@ func (b *BoolArrayEvaluator) IsStatic() bool { return b.EvalFnc == nil } -// GetWeight returns the weight of the evaluator -func (b *BoolArrayEvaluator) GetWeight() int { - return b.Weight -} - // AppendValues to the array evaluator func (b *BoolArrayEvaluator) AppendValues(values ...bool) { b.Values = append(b.Values, values...) @@ -386,11 +350,6 @@ func (s *CIDREvaluator) IsStatic() bool { return s.EvalFnc == nil } -// GetWeight returns the weight of the evaluator -func (s *CIDREvaluator) GetWeight() int { - return s.Weight -} - // CIDRValuesEvaluator returns a net.IP type CIDRValuesEvaluator struct { EvalFnc func(ctx *Context) *CIDRValues @@ -422,11 +381,6 @@ func (s *CIDRValuesEvaluator) IsStatic() bool { return s.EvalFnc == nil } -// GetWeight returns the weight of the evaluator -func (s *CIDRValuesEvaluator) GetWeight() int { - return s.Weight -} - // CIDRArrayEvaluator returns an array of net.IPNet type CIDRArrayEvaluator struct { EvalFnc func(ctx *Context) []net.IPNet @@ -459,8 +413,3 @@ func (s *CIDRArrayEvaluator) GetField() string { func (s *CIDRArrayEvaluator) IsStatic() bool { return s.EvalFnc == nil } - -// GetWeight returns the weight of the evaluator -func (s *CIDRArrayEvaluator) GetWeight() int { - return s.Weight -} diff --git a/pkg/security/secl/compiler/generators/accessors/accessors.tmpl b/pkg/security/secl/compiler/generators/accessors/accessors.tmpl index 979b8776cc535..4829db9985f8a 100644 --- a/pkg/security/secl/compiler/generators/accessors/accessors.tmpl +++ b/pkg/security/secl/compiler/generators/accessors/accessors.tmpl @@ -67,6 +67,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval {{- end}} {{- if and $Field.Iterator (not $Field.IsIterator) }} EvalFnc: func(ctx *eval.Context) []{{$Field.ReturnType}} { + ctx.AppendResolvedField(field) {{if $Field.Handler}} ev := ctx.Event.(*Event) {{end}} @@ -181,6 +182,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval {{- else}} {{- $ReturnType := $Field.ReturnType}} EvalFnc: func(ctx *eval.Context) {{$Field.GetArrayPrefix}}{{$ReturnType}} { + ctx.AppendResolvedField(field) {{- if not (and $Field.IsLength $Field.IsIterator)}} ev := ctx.Event.(*Event) {{end}} diff --git a/pkg/security/secl/model/accessors_unix.go b/pkg/security/secl/model/accessors_unix.go index 2d8d69b7f0c7a..50664604aaf6a 100644 --- a/pkg/security/secl/model/accessors_unix.go +++ b/pkg/security/secl/model/accessors_unix.go @@ -86,6 +86,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bind.addr.family": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Bind.AddrFamily) }, @@ -95,6 +96,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bind.addr.ip": return &eval.CIDREvaluator{ EvalFnc: func(ctx *eval.Context) net.IPNet { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Bind.Addr.IPNet }, @@ -104,6 +106,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bind.addr.is_public": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveIsIPPublic(ev, &ev.Bind.Addr) }, @@ -113,6 +116,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bind.addr.port": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Bind.Addr.Port) }, @@ -122,6 +126,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bind.protocol": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Bind.Protocol) }, @@ -131,6 +136,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bind.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Bind.SyscallEvent.Retval) }, @@ -140,6 +146,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bpf.cmd": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BPF.Cmd) }, @@ -149,6 +156,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bpf.map.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BPF.Map.Name }, @@ -158,6 +166,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bpf.map.type": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BPF.Map.Type) }, @@ -167,6 +176,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bpf.prog.attach_type": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BPF.Program.AttachType) }, @@ -176,6 +186,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bpf.prog.helpers": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) result := make([]int, len(ev.BPF.Program.Helpers)) for i, v := range ev.BPF.Program.Helpers { @@ -189,6 +200,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bpf.prog.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BPF.Program.Name }, @@ -198,6 +210,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bpf.prog.tag": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BPF.Program.Tag }, @@ -207,6 +220,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bpf.prog.type": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BPF.Program.Type) }, @@ -216,6 +230,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "bpf.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BPF.SyscallEvent.Retval) }, @@ -225,6 +240,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "capset.cap_effective": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Capset.CapEffective) }, @@ -234,6 +250,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "capset.cap_permitted": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Capset.CapPermitted) }, @@ -243,6 +260,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "cgroup.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.CGroupContext.CGroupFile.Inode) }, @@ -252,6 +270,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "cgroup.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.CGroupContext.CGroupFile.MountID) }, @@ -261,6 +280,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "cgroup.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupID(ev, &ev.CGroupContext) }, @@ -270,6 +290,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "cgroup.manager": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupManager(ev, &ev.CGroupContext) }, @@ -279,6 +300,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chdir.File.FileFields.CTime) }, @@ -288,6 +310,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Chdir.File) }, @@ -297,6 +320,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chdir.File.FileFields.GID) }, @@ -306,6 +330,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Chdir.File.FileFields) }, @@ -315,6 +340,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Chdir.File) }, @@ -324,6 +350,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Chdir.File.FileFields) }, @@ -333,6 +360,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chdir.File.FileFields.PathKey.Inode) }, @@ -342,6 +370,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chdir.File.FileFields.Mode) }, @@ -351,6 +380,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chdir.File.FileFields.MTime) }, @@ -360,6 +390,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chdir.File.FileFields.PathKey.MountID) }, @@ -370,6 +401,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Chdir.File) }, @@ -380,6 +412,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Chdir.File)) }, @@ -389,6 +422,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Chdir.File) }, @@ -398,6 +432,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Chdir.File) }, @@ -407,6 +442,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Chdir.File) }, @@ -417,6 +453,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Chdir.File) }, @@ -427,6 +464,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Chdir.File)) }, @@ -436,6 +474,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Chdir.File.FileFields)) }, @@ -445,6 +484,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chdir.File.FileFields.UID) }, @@ -454,6 +494,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Chdir.File.FileFields) }, @@ -463,6 +504,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chdir.SyscallEvent.Retval) }, @@ -472,6 +514,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chdir.syscall.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr1(ev, &ev.Chdir.SyscallContext) }, @@ -481,6 +524,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.File.FileFields.CTime) }, @@ -490,6 +534,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.destination.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.Mode) }, @@ -499,6 +544,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.destination.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.Mode) }, @@ -508,6 +554,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Chmod.File) }, @@ -517,6 +564,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.File.FileFields.GID) }, @@ -526,6 +574,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Chmod.File.FileFields) }, @@ -535,6 +584,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Chmod.File) }, @@ -544,6 +594,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Chmod.File.FileFields) }, @@ -553,6 +604,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.File.FileFields.PathKey.Inode) }, @@ -562,6 +614,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.File.FileFields.Mode) }, @@ -571,6 +624,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.File.FileFields.MTime) }, @@ -580,6 +634,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.File.FileFields.PathKey.MountID) }, @@ -590,6 +645,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Chmod.File) }, @@ -600,6 +656,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Chmod.File)) }, @@ -609,6 +666,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Chmod.File) }, @@ -618,6 +676,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Chmod.File) }, @@ -627,6 +686,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Chmod.File) }, @@ -637,6 +697,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Chmod.File) }, @@ -647,6 +708,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Chmod.File)) }, @@ -656,6 +718,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Chmod.File.FileFields)) }, @@ -665,6 +728,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.File.FileFields.UID) }, @@ -674,6 +738,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Chmod.File.FileFields) }, @@ -683,6 +748,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chmod.SyscallEvent.Retval) }, @@ -692,6 +758,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.syscall.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveSyscallCtxArgsInt2(ev, &ev.Chmod.SyscallContext)) }, @@ -701,6 +768,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chmod.syscall.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr1(ev, &ev.Chmod.SyscallContext) }, @@ -710,6 +778,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.File.FileFields.CTime) }, @@ -719,6 +788,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.destination.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.GID) }, @@ -728,6 +798,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.destination.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveChownGID(ev, &ev.Chown) }, @@ -737,6 +808,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.destination.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.UID) }, @@ -746,6 +818,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.destination.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveChownUID(ev, &ev.Chown) }, @@ -755,6 +828,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Chown.File) }, @@ -764,6 +838,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.File.FileFields.GID) }, @@ -773,6 +848,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Chown.File.FileFields) }, @@ -782,6 +858,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Chown.File) }, @@ -791,6 +868,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Chown.File.FileFields) }, @@ -800,6 +878,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.File.FileFields.PathKey.Inode) }, @@ -809,6 +888,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.File.FileFields.Mode) }, @@ -818,6 +898,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.File.FileFields.MTime) }, @@ -827,6 +908,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.File.FileFields.PathKey.MountID) }, @@ -837,6 +919,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Chown.File) }, @@ -847,6 +930,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Chown.File)) }, @@ -856,6 +940,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Chown.File) }, @@ -865,6 +950,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Chown.File) }, @@ -874,6 +960,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Chown.File) }, @@ -884,6 +971,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Chown.File) }, @@ -894,6 +982,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Chown.File)) }, @@ -903,6 +992,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Chown.File.FileFields)) }, @@ -912,6 +1002,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.File.FileFields.UID) }, @@ -921,6 +1012,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Chown.File.FileFields) }, @@ -930,6 +1022,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Chown.SyscallEvent.Retval) }, @@ -939,6 +1032,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.syscall.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveSyscallCtxArgsInt3(ev, &ev.Chown.SyscallContext)) }, @@ -948,6 +1042,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.syscall.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr1(ev, &ev.Chown.SyscallContext) }, @@ -957,6 +1052,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "chown.syscall.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveSyscallCtxArgsInt2(ev, &ev.Chown.SyscallContext)) }, @@ -966,6 +1062,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "connect.addr.family": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Connect.AddrFamily) }, @@ -975,6 +1072,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "connect.addr.ip": return &eval.CIDREvaluator{ EvalFnc: func(ctx *eval.Context) net.IPNet { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Connect.Addr.IPNet }, @@ -984,6 +1082,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "connect.addr.is_public": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveIsIPPublic(ev, &ev.Connect.Addr) }, @@ -993,6 +1092,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "connect.addr.port": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Connect.Addr.Port) }, @@ -1002,6 +1102,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "connect.protocol": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Connect.Protocol) }, @@ -1011,6 +1112,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "connect.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Connect.SyscallEvent.Retval) }, @@ -1020,6 +1122,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveContainerCreatedAt(ev, ev.BaseEvent.ContainerContext)) }, @@ -1029,6 +1132,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveContainerID(ev, ev.BaseEvent.ContainerContext) }, @@ -1038,6 +1142,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.runtime": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveContainerRuntime(ev, ev.BaseEvent.ContainerContext) }, @@ -1047,6 +1152,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.tags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveContainerTags(ev, ev.BaseEvent.ContainerContext) }, @@ -1056,6 +1162,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "dns.id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.DNS.ID) }, @@ -1065,6 +1172,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "dns.question.class": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.DNS.Class) }, @@ -1074,6 +1182,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "dns.question.count": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.DNS.Count) }, @@ -1083,6 +1192,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "dns.question.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.DNS.Size) }, @@ -1093,6 +1203,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.DNS.Name }, @@ -1103,6 +1214,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.DNS.Name) }, @@ -1112,6 +1224,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "dns.question.type": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.DNS.Type) }, @@ -1121,6 +1234,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.async": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveAsync(ev) }, @@ -1130,6 +1244,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.hostname": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHostname(ev, &ev.BaseEvent) }, @@ -1139,6 +1254,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.origin": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.Origin }, @@ -1148,6 +1264,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.os": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.Os }, @@ -1157,6 +1274,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.service": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveService(ev, &ev.BaseEvent) }, @@ -1166,6 +1284,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.timestamp": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveEventTimestamp(ev, &ev.BaseEvent)) }, @@ -1175,6 +1294,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.args": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgs(ev, ev.Exec.Process) }, @@ -1184,6 +1304,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsFlags(ev, ev.Exec.Process) }, @@ -1193,6 +1314,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsOptions(ev, ev.Exec.Process) }, @@ -1202,6 +1324,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.args_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsTruncated(ev, ev.Exec.Process) }, @@ -1211,6 +1334,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv(ev, ev.Exec.Process) }, @@ -1220,6 +1344,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.argv0": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv0(ev, ev.Exec.Process) }, @@ -1229,6 +1354,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.auid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.Credentials.AUID) }, @@ -1238,6 +1364,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.cap_effective": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.Credentials.CapEffective) }, @@ -1247,6 +1374,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.cap_permitted": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.Credentials.CapPermitted) }, @@ -1256,6 +1384,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.cgroup.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.CGroup.CGroupFile.Inode) }, @@ -1265,6 +1394,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.cgroup.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.CGroup.CGroupFile.MountID) }, @@ -1274,6 +1404,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.cgroup.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupID(ev, &ev.Exec.Process.CGroup) }, @@ -1283,6 +1414,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.cgroup.manager": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupManager(ev, &ev.Exec.Process.CGroup) }, @@ -1292,6 +1424,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.comm": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.Comm }, @@ -1301,6 +1434,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessContainerID(ev, ev.Exec.Process) }, @@ -1310,6 +1444,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, ev.Exec.Process)) }, @@ -1319,6 +1454,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.egid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.Credentials.EGID) }, @@ -1328,6 +1464,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.egroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.Credentials.EGroup }, @@ -1337,6 +1474,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, ev.Exec.Process) }, @@ -1346,6 +1484,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, ev.Exec.Process) }, @@ -1355,6 +1494,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.envs_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvsTruncated(ev, ev.Exec.Process) }, @@ -1364,6 +1504,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.euid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.Credentials.EUID) }, @@ -1373,6 +1514,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.euser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.Credentials.EUser }, @@ -1382,6 +1524,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return 0 @@ -1394,6 +1537,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return "" @@ -1406,6 +1550,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return 0 @@ -1418,6 +1563,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return "" @@ -1430,6 +1576,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return []string{} @@ -1442,6 +1589,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return false @@ -1454,6 +1602,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return 0 @@ -1466,6 +1615,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return 0 @@ -1478,6 +1628,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return 0 @@ -1490,6 +1641,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return 0 @@ -1503,6 +1655,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return "" @@ -1516,6 +1669,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exec.Process.FileEvent)) }, @@ -1525,6 +1679,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return "" @@ -1537,6 +1692,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return "" @@ -1549,6 +1705,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return "" @@ -1562,6 +1719,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return "" @@ -1575,6 +1733,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Exec.Process.FileEvent)) }, @@ -1584,6 +1743,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return 0 @@ -1596,6 +1756,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return 0 @@ -1608,6 +1769,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.IsNotKworker() { return "" @@ -1620,6 +1782,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.fsgid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.Credentials.FSGID) }, @@ -1629,6 +1792,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.fsgroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.Credentials.FSGroup }, @@ -1638,6 +1802,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.fsuid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.Credentials.FSUID) }, @@ -1647,6 +1812,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.fsuser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.Credentials.FSUser }, @@ -1656,6 +1822,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.Credentials.GID) }, @@ -1665,6 +1832,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.Credentials.Group }, @@ -1674,6 +1842,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return 0 @@ -1686,6 +1855,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return "" @@ -1698,6 +1868,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return 0 @@ -1710,6 +1881,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return "" @@ -1722,6 +1894,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return []string{} @@ -1734,6 +1907,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return false @@ -1746,6 +1920,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return 0 @@ -1758,6 +1933,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return 0 @@ -1770,6 +1946,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return 0 @@ -1782,6 +1959,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return 0 @@ -1795,6 +1973,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return "" @@ -1808,6 +1987,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exec.Process.LinuxBinprm.FileEvent)) }, @@ -1817,6 +1997,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return "" @@ -1829,6 +2010,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return "" @@ -1841,6 +2023,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return "" @@ -1854,6 +2037,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return "" @@ -1867,6 +2051,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Exec.Process.LinuxBinprm.FileEvent)) }, @@ -1876,6 +2061,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return 0 @@ -1888,6 +2074,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return 0 @@ -1900,6 +2087,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.interpreter.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exec.Process.HasInterpreter() { return "" @@ -1912,6 +2100,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.is_exec": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.IsExec }, @@ -1921,6 +2110,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.is_kworker": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.PIDContext.IsKworker }, @@ -1930,6 +2120,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.is_thread": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessIsThread(ev, ev.Exec.Process) }, @@ -1939,6 +2130,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.PIDContext.Pid) }, @@ -1948,6 +2140,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.PPid) }, @@ -1957,6 +2150,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.syscall.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr1(ev, &ev.Exec.SyscallContext) }, @@ -1966,6 +2160,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.tid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.PIDContext.Tid) }, @@ -1975,6 +2170,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.tty_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.TTYName }, @@ -1984,6 +2180,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.Credentials.UID) }, @@ -1993,6 +2190,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.Credentials.User }, @@ -2002,6 +2200,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SGroups(ev, &ev.Exec.Process.UserSession) }, @@ -2011,6 +2210,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.user_session.k8s_uid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUID(ev, &ev.Exec.Process.UserSession) }, @@ -2020,6 +2220,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.user_session.k8s_username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUsername(ev, &ev.Exec.Process.UserSession) }, @@ -2029,6 +2230,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.args": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgs(ev, ev.Exit.Process) }, @@ -2038,6 +2240,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsFlags(ev, ev.Exit.Process) }, @@ -2047,6 +2250,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsOptions(ev, ev.Exit.Process) }, @@ -2056,6 +2260,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.args_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsTruncated(ev, ev.Exit.Process) }, @@ -2065,6 +2270,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv(ev, ev.Exit.Process) }, @@ -2074,6 +2280,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.argv0": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv0(ev, ev.Exit.Process) }, @@ -2083,6 +2290,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.auid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.Credentials.AUID) }, @@ -2092,6 +2300,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.cap_effective": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.Credentials.CapEffective) }, @@ -2101,6 +2310,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.cap_permitted": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.Credentials.CapPermitted) }, @@ -2110,6 +2320,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.cause": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Cause) }, @@ -2119,6 +2330,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.cgroup.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.CGroup.CGroupFile.Inode) }, @@ -2128,6 +2340,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.cgroup.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.CGroup.CGroupFile.MountID) }, @@ -2137,6 +2350,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.cgroup.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupID(ev, &ev.Exit.Process.CGroup) }, @@ -2146,6 +2360,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.cgroup.manager": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupManager(ev, &ev.Exit.Process.CGroup) }, @@ -2155,6 +2370,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.code": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Code) }, @@ -2164,6 +2380,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.comm": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.Comm }, @@ -2173,6 +2390,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessContainerID(ev, ev.Exit.Process) }, @@ -2182,6 +2400,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, ev.Exit.Process)) }, @@ -2191,6 +2410,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.egid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.Credentials.EGID) }, @@ -2200,6 +2420,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.egroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.Credentials.EGroup }, @@ -2209,6 +2430,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, ev.Exit.Process) }, @@ -2218,6 +2440,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, ev.Exit.Process) }, @@ -2227,6 +2450,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.envs_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvsTruncated(ev, ev.Exit.Process) }, @@ -2236,6 +2460,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.euid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.Credentials.EUID) }, @@ -2245,6 +2470,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.euser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.Credentials.EUser }, @@ -2254,6 +2480,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return 0 @@ -2266,6 +2493,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return "" @@ -2278,6 +2506,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return 0 @@ -2290,6 +2519,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return "" @@ -2302,6 +2532,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return []string{} @@ -2314,6 +2545,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return false @@ -2326,6 +2558,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return 0 @@ -2338,6 +2571,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return 0 @@ -2350,6 +2584,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return 0 @@ -2362,6 +2597,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return 0 @@ -2375,6 +2611,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return "" @@ -2388,6 +2625,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exit.Process.FileEvent)) }, @@ -2397,6 +2635,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return "" @@ -2409,6 +2648,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return "" @@ -2421,6 +2661,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return "" @@ -2434,6 +2675,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return "" @@ -2447,6 +2689,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Exit.Process.FileEvent)) }, @@ -2456,6 +2699,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return 0 @@ -2468,6 +2712,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return 0 @@ -2480,6 +2725,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.IsNotKworker() { return "" @@ -2492,6 +2738,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.fsgid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.Credentials.FSGID) }, @@ -2501,6 +2748,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.fsgroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.Credentials.FSGroup }, @@ -2510,6 +2758,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.fsuid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.Credentials.FSUID) }, @@ -2519,6 +2768,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.fsuser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.Credentials.FSUser }, @@ -2528,6 +2778,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.Credentials.GID) }, @@ -2537,6 +2788,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.Credentials.Group }, @@ -2546,6 +2798,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return 0 @@ -2558,6 +2811,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return "" @@ -2570,6 +2824,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return 0 @@ -2582,6 +2837,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return "" @@ -2594,6 +2850,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return []string{} @@ -2606,6 +2863,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return false @@ -2618,6 +2876,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return 0 @@ -2630,6 +2889,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return 0 @@ -2642,6 +2902,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return 0 @@ -2654,6 +2915,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return 0 @@ -2667,6 +2929,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return "" @@ -2680,6 +2943,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exit.Process.LinuxBinprm.FileEvent)) }, @@ -2689,6 +2953,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return "" @@ -2701,6 +2966,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return "" @@ -2713,6 +2979,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return "" @@ -2726,6 +2993,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return "" @@ -2739,6 +3007,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Exit.Process.LinuxBinprm.FileEvent)) }, @@ -2748,6 +3017,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return 0 @@ -2760,6 +3030,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return 0 @@ -2772,6 +3043,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.interpreter.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Exit.Process.HasInterpreter() { return "" @@ -2784,6 +3056,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.is_exec": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.IsExec }, @@ -2793,6 +3066,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.is_kworker": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.PIDContext.IsKworker }, @@ -2802,6 +3076,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.is_thread": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessIsThread(ev, ev.Exit.Process) }, @@ -2811,6 +3086,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.PIDContext.Pid) }, @@ -2820,6 +3096,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.PPid) }, @@ -2829,6 +3106,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.tid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.PIDContext.Tid) }, @@ -2838,6 +3116,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.tty_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.TTYName }, @@ -2847,6 +3126,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.Credentials.UID) }, @@ -2856,6 +3136,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.Credentials.User }, @@ -2865,6 +3146,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SGroups(ev, &ev.Exit.Process.UserSession) }, @@ -2874,6 +3156,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.user_session.k8s_uid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUID(ev, &ev.Exit.Process.UserSession) }, @@ -2883,6 +3166,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.user_session.k8s_username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUsername(ev, &ev.Exit.Process.UserSession) }, @@ -2892,6 +3176,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "imds.aws.is_imds_v2": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.IMDS.AWS.IsIMDSv2 }, @@ -2901,6 +3186,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "imds.aws.security_credentials.type": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.IMDS.AWS.SecurityCredentials.Type }, @@ -2910,6 +3196,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "imds.cloud_provider": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.IMDS.CloudProvider }, @@ -2919,6 +3206,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "imds.host": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.IMDS.Host }, @@ -2928,6 +3216,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "imds.server": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.IMDS.Server }, @@ -2937,6 +3226,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "imds.type": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.IMDS.Type }, @@ -2946,6 +3236,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "imds.url": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.IMDS.URL }, @@ -2955,6 +3246,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "imds.user_agent": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.IMDS.UserAgent }, @@ -2964,6 +3256,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Source.FileFields.CTime) }, @@ -2973,6 +3266,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Target.FileFields.CTime) }, @@ -2982,6 +3276,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Link.Target) }, @@ -2991,6 +3286,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Target.FileFields.GID) }, @@ -3000,6 +3296,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Link.Target.FileFields) }, @@ -3009,6 +3306,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Link.Target) }, @@ -3018,6 +3316,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Link.Target.FileFields) }, @@ -3027,6 +3326,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Target.FileFields.PathKey.Inode) }, @@ -3036,6 +3336,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Target.FileFields.Mode) }, @@ -3045,6 +3346,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Target.FileFields.MTime) }, @@ -3054,6 +3356,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Target.FileFields.PathKey.MountID) }, @@ -3064,6 +3367,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Link.Target) }, @@ -3074,6 +3378,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Link.Target)) }, @@ -3083,6 +3388,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Link.Target) }, @@ -3092,6 +3398,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Link.Target) }, @@ -3101,6 +3408,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Link.Target) }, @@ -3111,6 +3419,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Link.Target) }, @@ -3121,6 +3430,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Link.Target)) }, @@ -3130,6 +3440,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Link.Target.FileFields)) }, @@ -3139,6 +3450,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Target.FileFields.UID) }, @@ -3148,6 +3460,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.destination.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Link.Target.FileFields) }, @@ -3157,6 +3470,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Link.Source) }, @@ -3166,6 +3480,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Source.FileFields.GID) }, @@ -3175,6 +3490,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Link.Source.FileFields) }, @@ -3184,6 +3500,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Link.Source) }, @@ -3193,6 +3510,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Link.Source.FileFields) }, @@ -3202,6 +3520,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Source.FileFields.PathKey.Inode) }, @@ -3211,6 +3530,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Source.FileFields.Mode) }, @@ -3220,6 +3540,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Source.FileFields.MTime) }, @@ -3229,6 +3550,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Source.FileFields.PathKey.MountID) }, @@ -3239,6 +3561,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Link.Source) }, @@ -3249,6 +3572,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Link.Source)) }, @@ -3258,6 +3582,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Link.Source) }, @@ -3267,6 +3592,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Link.Source) }, @@ -3276,6 +3602,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Link.Source) }, @@ -3286,6 +3613,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Link.Source) }, @@ -3296,6 +3624,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Link.Source)) }, @@ -3305,6 +3634,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Link.Source.FileFields)) }, @@ -3314,6 +3644,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.Source.FileFields.UID) }, @@ -3323,6 +3654,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Link.Source.FileFields) }, @@ -3332,6 +3664,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Link.SyscallEvent.Retval) }, @@ -3341,6 +3674,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.syscall.destination.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr2(ev, &ev.Link.SyscallContext) }, @@ -3350,6 +3684,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "link.syscall.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr1(ev, &ev.Link.SyscallContext) }, @@ -3359,6 +3694,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.args": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveModuleArgs(ev, &ev.LoadModule) }, @@ -3368,6 +3704,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.args_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.LoadModule.ArgsTruncated }, @@ -3377,6 +3714,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveModuleArgv(ev, &ev.LoadModule) }, @@ -3386,6 +3724,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.LoadModule.File.FileFields.CTime) }, @@ -3395,6 +3734,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.LoadModule.File) }, @@ -3404,6 +3744,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.LoadModule.File.FileFields.GID) }, @@ -3413,6 +3754,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.LoadModule.File.FileFields) }, @@ -3422,6 +3764,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.LoadModule.File) }, @@ -3431,6 +3774,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.LoadModule.File.FileFields) }, @@ -3440,6 +3784,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.LoadModule.File.FileFields.PathKey.Inode) }, @@ -3449,6 +3794,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.LoadModule.File.FileFields.Mode) }, @@ -3458,6 +3804,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.LoadModule.File.FileFields.MTime) }, @@ -3467,6 +3814,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.LoadModule.File.FileFields.PathKey.MountID) }, @@ -3477,6 +3825,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.LoadModule.File) }, @@ -3487,6 +3836,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.LoadModule.File)) }, @@ -3496,6 +3846,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.LoadModule.File) }, @@ -3505,6 +3856,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.LoadModule.File) }, @@ -3514,6 +3866,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.LoadModule.File) }, @@ -3524,6 +3877,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.LoadModule.File) }, @@ -3534,6 +3888,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.LoadModule.File)) }, @@ -3543,6 +3898,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.LoadModule.File.FileFields)) }, @@ -3552,6 +3908,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.LoadModule.File.FileFields.UID) }, @@ -3561,6 +3918,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.LoadModule.File.FileFields) }, @@ -3570,6 +3928,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.loaded_from_memory": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.LoadModule.LoadedFromMemory }, @@ -3579,6 +3938,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.LoadModule.Name }, @@ -3588,6 +3948,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "load_module.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.LoadModule.SyscallEvent.Retval) }, @@ -3597,6 +3958,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.File.FileFields.CTime) }, @@ -3606,6 +3968,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.destination.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.Mode) }, @@ -3615,6 +3978,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.destination.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.Mode) }, @@ -3624,6 +3988,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Mkdir.File) }, @@ -3633,6 +3998,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.File.FileFields.GID) }, @@ -3642,6 +4008,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Mkdir.File.FileFields) }, @@ -3651,6 +4018,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Mkdir.File) }, @@ -3660,6 +4028,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Mkdir.File.FileFields) }, @@ -3669,6 +4038,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.File.FileFields.PathKey.Inode) }, @@ -3678,6 +4048,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.File.FileFields.Mode) }, @@ -3687,6 +4058,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.File.FileFields.MTime) }, @@ -3696,6 +4068,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.File.FileFields.PathKey.MountID) }, @@ -3706,6 +4079,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Mkdir.File) }, @@ -3716,6 +4090,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Mkdir.File)) }, @@ -3725,6 +4100,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Mkdir.File) }, @@ -3734,6 +4110,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Mkdir.File) }, @@ -3743,6 +4120,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Mkdir.File) }, @@ -3753,6 +4131,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Mkdir.File) }, @@ -3763,6 +4142,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Mkdir.File)) }, @@ -3772,6 +4152,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Mkdir.File.FileFields)) }, @@ -3781,6 +4162,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.File.FileFields.UID) }, @@ -3790,6 +4172,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Mkdir.File.FileFields) }, @@ -3799,6 +4182,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mkdir.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mkdir.SyscallEvent.Retval) }, @@ -3808,6 +4192,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.File.FileFields.CTime) }, @@ -3817,6 +4202,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.MMap.File) }, @@ -3826,6 +4212,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.File.FileFields.GID) }, @@ -3835,6 +4222,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.MMap.File.FileFields) }, @@ -3844,6 +4232,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.MMap.File) }, @@ -3853,6 +4242,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.MMap.File.FileFields) }, @@ -3862,6 +4252,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.File.FileFields.PathKey.Inode) }, @@ -3871,6 +4262,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.File.FileFields.Mode) }, @@ -3880,6 +4272,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.File.FileFields.MTime) }, @@ -3889,6 +4282,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.File.FileFields.PathKey.MountID) }, @@ -3899,6 +4293,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.MMap.File) }, @@ -3909,6 +4304,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.MMap.File)) }, @@ -3918,6 +4314,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.MMap.File) }, @@ -3927,6 +4324,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.MMap.File) }, @@ -3936,6 +4334,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.MMap.File) }, @@ -3946,6 +4345,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.MMap.File) }, @@ -3956,6 +4356,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.MMap.File)) }, @@ -3965,6 +4366,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.MMap.File.FileFields)) }, @@ -3974,6 +4376,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.File.FileFields.UID) }, @@ -3983,6 +4386,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.MMap.File.FileFields) }, @@ -3992,6 +4396,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.flags": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.Flags) }, @@ -4001,6 +4406,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.protection": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.Protection) }, @@ -4010,6 +4416,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mmap.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MMap.SyscallEvent.Retval) }, @@ -4019,6 +4426,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mount.fs_type": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Mount.Mount.FSType }, @@ -4028,6 +4436,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mount.mountpoint.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveMountPointPath(ev, &ev.Mount) }, @@ -4037,6 +4446,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mount.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Mount.SyscallEvent.Retval) }, @@ -4046,6 +4456,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mount.root.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveMountRootPath(ev, &ev.Mount) }, @@ -4055,6 +4466,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mount.source.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveMountSourcePath(ev, &ev.Mount) }, @@ -4064,6 +4476,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mount.syscall.fs_type": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr3(ev, &ev.Mount.SyscallContext) }, @@ -4073,6 +4486,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mount.syscall.mountpoint.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr2(ev, &ev.Mount.SyscallContext) }, @@ -4082,6 +4496,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mount.syscall.source.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr1(ev, &ev.Mount.SyscallContext) }, @@ -4091,6 +4506,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mprotect.req_protection": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.MProtect.ReqProtection }, @@ -4100,6 +4516,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mprotect.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.MProtect.SyscallEvent.Retval) }, @@ -4109,6 +4526,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "mprotect.vm_protection": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.MProtect.VMProtection }, @@ -4118,6 +4536,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.destination.ip": return &eval.CIDREvaluator{ EvalFnc: func(ctx *eval.Context) net.IPNet { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.NetworkContext.Destination.IPNet }, @@ -4127,6 +4546,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.destination.is_public": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveIsIPPublic(ev, &ev.NetworkContext.Destination) }, @@ -4136,6 +4556,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.destination.port": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.NetworkContext.Destination.Port) }, @@ -4145,6 +4566,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.device.ifname": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveNetworkDeviceIfName(ev, &ev.NetworkContext.Device) }, @@ -4154,6 +4576,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.l3_protocol": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.NetworkContext.L3Protocol) }, @@ -4163,6 +4586,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.l4_protocol": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.NetworkContext.L4Protocol) }, @@ -4172,6 +4596,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.size": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.NetworkContext.Size) }, @@ -4181,6 +4606,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.source.ip": return &eval.CIDREvaluator{ EvalFnc: func(ctx *eval.Context) net.IPNet { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.NetworkContext.Source.IPNet }, @@ -4190,6 +4616,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.source.is_public": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveIsIPPublic(ev, &ev.NetworkContext.Source) }, @@ -4199,6 +4626,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "network.source.port": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.NetworkContext.Source.Port) }, @@ -4208,6 +4636,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ondemand.arg1.str": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveOnDemandArg1Str(ev, &ev.OnDemand) }, @@ -4217,6 +4646,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ondemand.arg1.uint": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveOnDemandArg1Uint(ev, &ev.OnDemand)) }, @@ -4226,6 +4656,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ondemand.arg2.str": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveOnDemandArg2Str(ev, &ev.OnDemand) }, @@ -4235,6 +4666,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ondemand.arg2.uint": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveOnDemandArg2Uint(ev, &ev.OnDemand)) }, @@ -4244,6 +4676,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ondemand.arg3.str": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveOnDemandArg3Str(ev, &ev.OnDemand) }, @@ -4253,6 +4686,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ondemand.arg3.uint": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveOnDemandArg3Uint(ev, &ev.OnDemand)) }, @@ -4262,6 +4696,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ondemand.arg4.str": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveOnDemandArg4Str(ev, &ev.OnDemand) }, @@ -4271,6 +4706,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ondemand.arg4.uint": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveOnDemandArg4Uint(ev, &ev.OnDemand)) }, @@ -4280,6 +4716,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ondemand.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveOnDemandName(ev, &ev.OnDemand) }, @@ -4289,6 +4726,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.File.FileFields.CTime) }, @@ -4298,6 +4736,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.destination.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.Mode) }, @@ -4307,6 +4746,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Open.File) }, @@ -4316,6 +4756,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.File.FileFields.GID) }, @@ -4325,6 +4766,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Open.File.FileFields) }, @@ -4334,6 +4776,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Open.File) }, @@ -4343,6 +4786,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Open.File.FileFields) }, @@ -4352,6 +4796,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.File.FileFields.PathKey.Inode) }, @@ -4361,6 +4806,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.File.FileFields.Mode) }, @@ -4370,6 +4816,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.File.FileFields.MTime) }, @@ -4379,6 +4826,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.File.FileFields.PathKey.MountID) }, @@ -4389,6 +4837,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Open.File) }, @@ -4399,6 +4848,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Open.File)) }, @@ -4408,6 +4858,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Open.File) }, @@ -4417,6 +4868,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Open.File) }, @@ -4426,6 +4878,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Open.File) }, @@ -4436,6 +4889,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Open.File) }, @@ -4446,6 +4900,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Open.File)) }, @@ -4455,6 +4910,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Open.File.FileFields)) }, @@ -4464,6 +4920,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.File.FileFields.UID) }, @@ -4473,6 +4930,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Open.File.FileFields) }, @@ -4482,6 +4940,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.flags": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.Flags) }, @@ -4491,6 +4950,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Open.SyscallEvent.Retval) }, @@ -4500,6 +4960,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.syscall.flags": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveSyscallCtxArgsInt2(ev, &ev.Open.SyscallContext)) }, @@ -4509,6 +4970,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.syscall.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveSyscallCtxArgsInt3(ev, &ev.Open.SyscallContext)) }, @@ -4518,6 +4980,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.syscall.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr1(ev, &ev.Open.SyscallContext) }, @@ -4527,6 +4990,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.destination.ip": return &eval.CIDREvaluator{ EvalFnc: func(ctx *eval.Context) net.IPNet { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.RawPacket.NetworkContext.Destination.IPNet }, @@ -4536,6 +5000,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.destination.is_public": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveIsIPPublic(ev, &ev.RawPacket.NetworkContext.Destination) }, @@ -4545,6 +5010,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.destination.port": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RawPacket.NetworkContext.Destination.Port) }, @@ -4554,6 +5020,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.device.ifname": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveNetworkDeviceIfName(ev, &ev.RawPacket.NetworkContext.Device) }, @@ -4564,6 +5031,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: PacketFilterMatching, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.RawPacket.Filter }, @@ -4573,6 +5041,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.l3_protocol": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RawPacket.NetworkContext.L3Protocol) }, @@ -4582,6 +5051,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.l4_protocol": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RawPacket.NetworkContext.L4Protocol) }, @@ -4591,6 +5061,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.size": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RawPacket.NetworkContext.Size) }, @@ -4600,6 +5071,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.source.ip": return &eval.CIDREvaluator{ EvalFnc: func(ctx *eval.Context) net.IPNet { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.RawPacket.NetworkContext.Source.IPNet }, @@ -4609,6 +5081,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.source.is_public": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveIsIPPublic(ev, &ev.RawPacket.NetworkContext.Source) }, @@ -4618,6 +5091,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.source.port": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RawPacket.NetworkContext.Source.Port) }, @@ -4627,6 +5101,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "packet.tls.version": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RawPacket.TLSContext.Version) }, @@ -4636,6 +5111,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.args": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -4663,6 +5139,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -4690,6 +5167,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -4717,6 +5195,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.args_truncated": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -4744,6 +5223,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -4771,6 +5251,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.argv0": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -4798,6 +5279,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.auid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -4824,6 +5306,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.cap_effective": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -4850,6 +5333,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.cap_permitted": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -4876,6 +5360,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.cgroup.file.inode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -4902,6 +5387,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.cgroup.file.mount_id": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -4928,6 +5414,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.cgroup.id": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -4955,6 +5442,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.cgroup.manager": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -4982,6 +5470,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.comm": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -5008,6 +5497,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.container.id": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5035,6 +5525,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.created_at": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -5062,6 +5553,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.egid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5088,6 +5580,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.egroup": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -5114,6 +5607,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5141,6 +5635,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5168,6 +5663,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.envs_truncated": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -5195,6 +5691,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.euid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5221,6 +5718,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.euser": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -5247,6 +5745,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.change_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5279,6 +5778,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.filesystem": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5312,6 +5812,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.gid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5344,6 +5845,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.group": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5377,6 +5879,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5410,6 +5913,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.in_upper_layer": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -5443,6 +5947,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.inode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5475,6 +5980,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.mode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5507,6 +6013,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.modification_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5539,6 +6046,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.mount_id": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5572,6 +6080,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5606,6 +6115,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -5633,6 +6143,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.package.name": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5666,6 +6177,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.package.source_version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5699,6 +6211,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.package.version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5733,6 +6246,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5767,6 +6281,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -5794,6 +6309,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.rights": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -5827,6 +6343,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.uid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5859,6 +6376,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.file.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -5892,6 +6410,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.fsgid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5918,6 +6437,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.fsgroup": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -5944,6 +6464,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.fsuid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -5970,6 +6491,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.fsuser": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -5996,6 +6518,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.gid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6022,6 +6545,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.group": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -6048,6 +6572,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.change_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6080,6 +6605,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.filesystem": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6113,6 +6639,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.gid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6145,6 +6672,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.group": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6178,6 +6706,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6211,6 +6740,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.in_upper_layer": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -6244,6 +6774,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.inode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6276,6 +6807,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.mode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6308,6 +6840,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.modification_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6340,6 +6873,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.mount_id": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6373,6 +6907,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6407,6 +6942,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -6434,6 +6970,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.package.name": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6467,6 +7004,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.package.source_version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6500,6 +7038,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.package.version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6534,6 +7073,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6568,6 +7108,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -6595,6 +7136,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.rights": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -6628,6 +7170,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.uid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6660,6 +7203,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.interpreter.file.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6693,6 +7237,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.is_exec": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) if result, ok := ctx.BoolCache[field]; ok { return result } @@ -6719,6 +7264,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.is_kworker": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) if result, ok := ctx.BoolCache[field]; ok { return result } @@ -6745,6 +7291,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.is_thread": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -6772,6 +7319,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) iterator := &ProcessAncestorsIterator{} return iterator.Len(ctx) }, @@ -6781,6 +7329,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.pid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6807,6 +7356,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.ppid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6833,6 +7383,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.tid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6859,6 +7410,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.tty_name": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -6885,6 +7437,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.uid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -6911,6 +7464,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -6937,6 +7491,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6964,6 +7519,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.user_session.k8s_uid": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -6991,6 +7547,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.user_session.k8s_username": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -7018,6 +7575,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.args": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgs(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7027,6 +7585,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsFlags(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7036,6 +7595,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsOptions(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7045,6 +7605,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.args_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsTruncated(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7054,6 +7615,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7063,6 +7625,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.argv0": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv0(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7072,6 +7635,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.auid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.Credentials.AUID) }, @@ -7081,6 +7645,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.cap_effective": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.Credentials.CapEffective) }, @@ -7090,6 +7655,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.cap_permitted": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.Credentials.CapPermitted) }, @@ -7099,6 +7665,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.cgroup.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.CGroup.CGroupFile.Inode) }, @@ -7108,6 +7675,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.cgroup.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.CGroup.CGroupFile.MountID) }, @@ -7117,6 +7685,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.cgroup.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupID(ev, &ev.BaseEvent.ProcessContext.Process.CGroup) }, @@ -7126,6 +7695,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.cgroup.manager": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupManager(ev, &ev.BaseEvent.ProcessContext.Process.CGroup) }, @@ -7135,6 +7705,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.comm": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.Comm }, @@ -7144,6 +7715,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessContainerID(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7153,6 +7725,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, &ev.BaseEvent.ProcessContext.Process)) }, @@ -7162,6 +7735,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.egid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.Credentials.EGID) }, @@ -7171,6 +7745,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.egroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.Credentials.EGroup }, @@ -7180,6 +7755,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7189,6 +7765,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7198,6 +7775,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.envs_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvsTruncated(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7207,6 +7785,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.euid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.Credentials.EUID) }, @@ -7216,6 +7795,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.euser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.Credentials.EUser }, @@ -7225,6 +7805,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return 0 @@ -7237,6 +7818,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return "" @@ -7249,6 +7831,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return 0 @@ -7261,6 +7844,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return "" @@ -7273,6 +7857,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return []string{} @@ -7285,6 +7870,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return false @@ -7297,6 +7883,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return 0 @@ -7309,6 +7896,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return 0 @@ -7321,6 +7909,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return 0 @@ -7333,6 +7922,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return 0 @@ -7346,6 +7936,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return "" @@ -7359,6 +7950,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent)) }, @@ -7368,6 +7960,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return "" @@ -7380,6 +7973,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return "" @@ -7392,6 +7986,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return "" @@ -7405,6 +8000,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return "" @@ -7418,6 +8014,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent)) }, @@ -7427,6 +8024,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return 0 @@ -7439,6 +8037,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return 0 @@ -7451,6 +8050,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.IsNotKworker() { return "" @@ -7463,6 +8063,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.fsgid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.Credentials.FSGID) }, @@ -7472,6 +8073,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.fsgroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.Credentials.FSGroup }, @@ -7481,6 +8083,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.fsuid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.Credentials.FSUID) }, @@ -7490,6 +8093,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.fsuser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.Credentials.FSUser }, @@ -7499,6 +8103,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.Credentials.GID) }, @@ -7508,6 +8113,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.Credentials.Group }, @@ -7517,6 +8123,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return 0 @@ -7529,6 +8136,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return "" @@ -7541,6 +8149,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return 0 @@ -7553,6 +8162,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return "" @@ -7565,6 +8175,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return []string{} @@ -7577,6 +8188,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return false @@ -7589,6 +8201,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return 0 @@ -7601,6 +8214,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return 0 @@ -7613,6 +8227,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return 0 @@ -7625,6 +8240,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return 0 @@ -7638,6 +8254,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return "" @@ -7651,6 +8268,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Process.LinuxBinprm.FileEvent)) }, @@ -7660,6 +8278,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return "" @@ -7672,6 +8291,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return "" @@ -7684,6 +8304,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return "" @@ -7697,6 +8318,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return "" @@ -7710,6 +8332,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Process.LinuxBinprm.FileEvent)) }, @@ -7719,6 +8342,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return 0 @@ -7731,6 +8355,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return 0 @@ -7743,6 +8368,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.interpreter.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.Process.HasInterpreter() { return "" @@ -7755,6 +8381,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.is_exec": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.IsExec }, @@ -7764,6 +8391,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.is_kworker": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.PIDContext.IsKworker }, @@ -7773,6 +8401,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.is_thread": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessIsThread(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -7782,6 +8411,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.args": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -7794,6 +8424,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -7806,6 +8437,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -7818,6 +8450,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.args_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return false @@ -7830,6 +8463,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -7842,6 +8476,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.argv0": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -7854,6 +8489,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.auid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -7866,6 +8502,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.cap_effective": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -7878,6 +8515,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.cap_permitted": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -7890,6 +8528,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.cgroup.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -7902,6 +8541,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.cgroup.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -7914,6 +8554,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.cgroup.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -7926,6 +8567,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.cgroup.manager": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -7938,6 +8580,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.comm": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -7950,6 +8593,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -7962,6 +8606,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -7974,6 +8619,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.egid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -7986,6 +8632,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.egroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -7998,6 +8645,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -8010,6 +8658,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -8022,6 +8671,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.envs_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return false @@ -8034,6 +8684,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.euid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8046,6 +8697,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.euser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8058,6 +8710,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8073,6 +8726,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8088,6 +8742,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8103,6 +8758,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8118,6 +8774,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -8133,6 +8790,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return false @@ -8148,6 +8806,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8163,6 +8822,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8178,6 +8838,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8193,6 +8854,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8209,6 +8871,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8225,6 +8888,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Parent.FileEvent)) }, @@ -8234,6 +8898,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8249,6 +8914,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8264,6 +8930,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8280,6 +8947,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8296,6 +8964,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Parent.FileEvent)) }, @@ -8305,6 +8974,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8320,6 +8990,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8335,6 +9006,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8350,6 +9022,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.fsgid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8362,6 +9035,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.fsgroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8374,6 +9048,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.fsuid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8386,6 +9061,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.fsuser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8398,6 +9074,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8410,6 +9087,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8422,6 +9100,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8437,6 +9116,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8452,6 +9132,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8467,6 +9148,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8482,6 +9164,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -8497,6 +9180,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return false @@ -8512,6 +9196,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8527,6 +9212,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8542,6 +9228,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8557,6 +9244,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8573,6 +9261,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8589,6 +9278,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Parent.LinuxBinprm.FileEvent)) }, @@ -8598,6 +9288,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8613,6 +9304,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8628,6 +9320,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8644,6 +9337,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8660,6 +9354,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Parent.LinuxBinprm.FileEvent)) }, @@ -8669,6 +9364,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8684,6 +9380,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8699,6 +9396,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.interpreter.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8714,6 +9412,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.is_exec": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return false @@ -8726,6 +9425,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.is_kworker": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return false @@ -8738,6 +9438,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.is_thread": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return false @@ -8750,6 +9451,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8762,6 +9464,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8774,6 +9477,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.tid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8786,6 +9490,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.tty_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8798,6 +9503,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -8810,6 +9516,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8822,6 +9529,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -8834,6 +9542,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.user_session.k8s_uid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8846,6 +9555,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.user_session.k8s_username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -8858,6 +9568,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.PIDContext.Pid) }, @@ -8867,6 +9578,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.PPid) }, @@ -8876,6 +9588,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.tid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.PIDContext.Tid) }, @@ -8885,6 +9598,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.tty_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.TTYName }, @@ -8894,6 +9608,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.Credentials.UID) }, @@ -8903,6 +9618,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.Credentials.User }, @@ -8912,6 +9628,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SGroups(ev, &ev.BaseEvent.ProcessContext.Process.UserSession) }, @@ -8921,6 +9638,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.user_session.k8s_uid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUID(ev, &ev.BaseEvent.ProcessContext.Process.UserSession) }, @@ -8930,6 +9648,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.user_session.k8s_username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUsername(ev, &ev.BaseEvent.ProcessContext.Process.UserSession) }, @@ -8939,6 +9658,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.request": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Request) }, @@ -8948,6 +9668,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.SyscallEvent.Retval) }, @@ -8957,6 +9678,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.args": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -8984,6 +9706,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9011,6 +9734,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9038,6 +9762,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.args_truncated": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -9065,6 +9790,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9092,6 +9818,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.argv0": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9119,6 +9846,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.auid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9145,6 +9873,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.cap_effective": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9171,6 +9900,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.cap_permitted": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9197,6 +9927,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.cgroup.file.inode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9223,6 +9954,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.cgroup.file.mount_id": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9249,6 +9981,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.cgroup.id": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9276,6 +10009,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.cgroup.manager": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9303,6 +10037,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.comm": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -9329,6 +10064,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.container.id": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9356,6 +10092,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.created_at": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -9383,6 +10120,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.egid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9409,6 +10147,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.egroup": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -9435,6 +10174,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9462,6 +10202,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9489,6 +10230,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.envs_truncated": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -9516,6 +10258,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.euid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9542,6 +10285,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.euser": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -9568,6 +10312,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.change_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9600,6 +10345,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.filesystem": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9633,6 +10379,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.gid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9665,6 +10412,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.group": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9698,6 +10446,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9731,6 +10480,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.in_upper_layer": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -9764,6 +10514,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.inode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9796,6 +10547,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.mode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9828,6 +10580,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.modification_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9860,6 +10613,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.mount_id": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -9893,6 +10647,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9927,6 +10682,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -9954,6 +10710,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.package.name": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -9987,6 +10744,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.package.source_version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10020,6 +10778,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.package.version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10054,6 +10813,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10088,6 +10848,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -10115,6 +10876,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.rights": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -10148,6 +10910,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.uid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10180,6 +10943,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.file.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10213,6 +10977,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.fsgid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10239,6 +11004,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.fsgroup": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -10265,6 +11031,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.fsuid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10291,6 +11058,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.fsuser": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -10317,6 +11085,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.gid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10343,6 +11112,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.group": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -10369,6 +11139,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.change_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10401,6 +11172,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.filesystem": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10434,6 +11206,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.gid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10466,6 +11239,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.group": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10499,6 +11273,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10532,6 +11307,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.in_upper_layer": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -10565,6 +11341,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.inode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10597,6 +11374,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.mode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10629,6 +11407,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.modification_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10661,6 +11440,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.mount_id": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10694,6 +11474,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10728,6 +11509,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -10755,6 +11537,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.package.name": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10788,6 +11571,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.package.source_version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10821,6 +11605,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.package.version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10855,6 +11640,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -10889,6 +11675,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -10916,6 +11703,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.rights": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -10949,6 +11737,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.uid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -10981,6 +11770,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.interpreter.file.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -11014,6 +11804,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.is_exec": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) if result, ok := ctx.BoolCache[field]; ok { return result } @@ -11040,6 +11831,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.is_kworker": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) if result, ok := ctx.BoolCache[field]; ok { return result } @@ -11066,6 +11858,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.is_thread": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -11093,6 +11886,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) iterator := &ProcessAncestorsIterator{} return iterator.Len(ctx) }, @@ -11102,6 +11896,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.pid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -11128,6 +11923,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.ppid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -11154,6 +11950,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.tid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -11180,6 +11977,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.tty_name": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -11206,6 +12004,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.uid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -11232,6 +12031,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -11258,6 +12058,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -11285,6 +12086,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.user_session.k8s_uid": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -11312,6 +12114,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ancestors.user_session.k8s_username": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -11339,6 +12142,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.args": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgs(ev, &ev.PTrace.Tracee.Process) }, @@ -11348,6 +12152,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsFlags(ev, &ev.PTrace.Tracee.Process) }, @@ -11357,6 +12162,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsOptions(ev, &ev.PTrace.Tracee.Process) }, @@ -11366,6 +12172,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.args_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsTruncated(ev, &ev.PTrace.Tracee.Process) }, @@ -11375,6 +12182,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv(ev, &ev.PTrace.Tracee.Process) }, @@ -11384,6 +12192,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.argv0": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv0(ev, &ev.PTrace.Tracee.Process) }, @@ -11393,6 +12202,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.auid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.Credentials.AUID) }, @@ -11402,6 +12212,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.cap_effective": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.Credentials.CapEffective) }, @@ -11411,6 +12222,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.cap_permitted": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.Credentials.CapPermitted) }, @@ -11420,6 +12232,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.cgroup.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.CGroup.CGroupFile.Inode) }, @@ -11429,6 +12242,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.cgroup.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.CGroup.CGroupFile.MountID) }, @@ -11438,6 +12252,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.cgroup.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupID(ev, &ev.PTrace.Tracee.Process.CGroup) }, @@ -11447,6 +12262,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.cgroup.manager": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupManager(ev, &ev.PTrace.Tracee.Process.CGroup) }, @@ -11456,6 +12272,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.comm": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.Comm }, @@ -11465,6 +12282,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessContainerID(ev, &ev.PTrace.Tracee.Process) }, @@ -11474,6 +12292,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, &ev.PTrace.Tracee.Process)) }, @@ -11483,6 +12302,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.egid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.Credentials.EGID) }, @@ -11492,6 +12312,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.egroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.Credentials.EGroup }, @@ -11501,6 +12322,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, &ev.PTrace.Tracee.Process) }, @@ -11510,6 +12332,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, &ev.PTrace.Tracee.Process) }, @@ -11519,6 +12342,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.envs_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvsTruncated(ev, &ev.PTrace.Tracee.Process) }, @@ -11528,6 +12352,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.euid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.Credentials.EUID) }, @@ -11537,6 +12362,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.euser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.Credentials.EUser }, @@ -11546,6 +12372,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return 0 @@ -11558,6 +12385,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return "" @@ -11570,6 +12398,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return 0 @@ -11582,6 +12411,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return "" @@ -11594,6 +12424,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return []string{} @@ -11606,6 +12437,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return false @@ -11618,6 +12450,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return 0 @@ -11630,6 +12463,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return 0 @@ -11642,6 +12476,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return 0 @@ -11654,6 +12489,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return 0 @@ -11667,6 +12503,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return "" @@ -11680,6 +12517,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.PTrace.Tracee.Process.FileEvent)) }, @@ -11689,6 +12527,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return "" @@ -11701,6 +12540,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return "" @@ -11713,6 +12553,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return "" @@ -11726,6 +12567,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return "" @@ -11739,6 +12581,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.PTrace.Tracee.Process.FileEvent)) }, @@ -11748,6 +12591,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return 0 @@ -11760,6 +12604,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return 0 @@ -11772,6 +12617,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.IsNotKworker() { return "" @@ -11784,6 +12630,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.fsgid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.Credentials.FSGID) }, @@ -11793,6 +12640,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.fsgroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.Credentials.FSGroup }, @@ -11802,6 +12650,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.fsuid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.Credentials.FSUID) }, @@ -11811,6 +12660,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.fsuser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.Credentials.FSUser }, @@ -11820,6 +12670,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.Credentials.GID) }, @@ -11829,6 +12680,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.Credentials.Group }, @@ -11838,6 +12690,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return 0 @@ -11850,6 +12703,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return "" @@ -11862,6 +12716,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return 0 @@ -11874,6 +12729,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return "" @@ -11886,6 +12742,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return []string{} @@ -11898,6 +12755,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return false @@ -11910,6 +12768,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return 0 @@ -11922,6 +12781,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return 0 @@ -11934,6 +12794,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return 0 @@ -11946,6 +12807,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return 0 @@ -11959,6 +12821,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return "" @@ -11972,6 +12835,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.PTrace.Tracee.Process.LinuxBinprm.FileEvent)) }, @@ -11981,6 +12845,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return "" @@ -11993,6 +12858,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return "" @@ -12005,6 +12871,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return "" @@ -12018,6 +12885,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return "" @@ -12031,6 +12899,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.PTrace.Tracee.Process.LinuxBinprm.FileEvent)) }, @@ -12040,6 +12909,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return 0 @@ -12052,6 +12922,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return 0 @@ -12064,6 +12935,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.interpreter.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.Process.HasInterpreter() { return "" @@ -12076,6 +12948,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.is_exec": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.IsExec }, @@ -12085,6 +12958,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.is_kworker": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.PIDContext.IsKworker }, @@ -12094,6 +12968,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.is_thread": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessIsThread(ev, &ev.PTrace.Tracee.Process) }, @@ -12103,6 +12978,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.args": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12115,6 +12991,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return []string{} @@ -12127,6 +13004,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return []string{} @@ -12139,6 +13017,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.args_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return false @@ -12151,6 +13030,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return []string{} @@ -12163,6 +13043,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.argv0": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12175,6 +13056,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.auid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12187,6 +13069,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.cap_effective": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12199,6 +13082,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.cap_permitted": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12211,6 +13095,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.cgroup.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12223,6 +13108,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.cgroup.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12235,6 +13121,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.cgroup.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12247,6 +13134,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.cgroup.manager": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12259,6 +13147,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.comm": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12271,6 +13160,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12283,6 +13173,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12295,6 +13186,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.egid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12307,6 +13199,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.egroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12319,6 +13212,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return []string{} @@ -12331,6 +13225,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return []string{} @@ -12343,6 +13238,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.envs_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return false @@ -12355,6 +13251,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.euid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12367,6 +13264,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.euser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12379,6 +13277,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12394,6 +13293,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12409,6 +13309,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12424,6 +13325,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12439,6 +13341,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return []string{} @@ -12454,6 +13357,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return false @@ -12469,6 +13373,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12484,6 +13389,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12499,6 +13405,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12514,6 +13421,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12530,6 +13438,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12546,6 +13455,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.PTrace.Tracee.Parent.FileEvent)) }, @@ -12555,6 +13465,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12570,6 +13481,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12585,6 +13497,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12601,6 +13514,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12617,6 +13531,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.PTrace.Tracee.Parent.FileEvent)) }, @@ -12626,6 +13541,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12641,6 +13557,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12656,6 +13573,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12671,6 +13589,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.fsgid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12683,6 +13602,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.fsgroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12695,6 +13615,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.fsuid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12707,6 +13628,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.fsuser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12719,6 +13641,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12731,6 +13654,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12743,6 +13667,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12758,6 +13683,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12773,6 +13699,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12788,6 +13715,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12803,6 +13731,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return []string{} @@ -12818,6 +13747,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return false @@ -12833,6 +13763,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12848,6 +13779,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12863,6 +13795,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12878,6 +13811,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -12894,6 +13828,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12910,6 +13845,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.PTrace.Tracee.Parent.LinuxBinprm.FileEvent)) }, @@ -12919,6 +13855,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12934,6 +13871,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12949,6 +13887,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12965,6 +13904,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -12981,6 +13921,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.PTrace.Tracee.Parent.LinuxBinprm.FileEvent)) }, @@ -12990,6 +13931,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -13005,6 +13947,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -13020,6 +13963,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.interpreter.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -13035,6 +13979,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.is_exec": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return false @@ -13047,6 +13992,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.is_kworker": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return false @@ -13059,6 +14005,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.is_thread": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return false @@ -13071,6 +14018,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -13083,6 +14031,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -13095,6 +14044,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.tid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -13107,6 +14057,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.tty_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -13119,6 +14070,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return 0 @@ -13131,6 +14083,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -13143,6 +14096,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return []string{} @@ -13155,6 +14109,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.user_session.k8s_uid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -13167,6 +14122,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.parent.user_session.k8s_username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.PTrace.Tracee.HasParent() { return "" @@ -13179,6 +14135,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.PIDContext.Pid) }, @@ -13188,6 +14145,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.PPid) }, @@ -13197,6 +14155,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.tid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.PIDContext.Tid) }, @@ -13206,6 +14165,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.tty_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.TTYName }, @@ -13215,6 +14175,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.PTrace.Tracee.Process.Credentials.UID) }, @@ -13224,6 +14185,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.PTrace.Tracee.Process.Credentials.User }, @@ -13233,6 +14195,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SGroups(ev, &ev.PTrace.Tracee.Process.UserSession) }, @@ -13242,6 +14205,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.user_session.k8s_uid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUID(ev, &ev.PTrace.Tracee.Process.UserSession) }, @@ -13251,6 +14215,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "ptrace.tracee.user_session.k8s_username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUsername(ev, &ev.PTrace.Tracee.Process.UserSession) }, @@ -13260,6 +14225,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RemoveXAttr.File.FileFields.CTime) }, @@ -13269,6 +14235,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.destination.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveXAttrName(ev, &ev.RemoveXAttr) }, @@ -13278,6 +14245,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.destination.namespace": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveXAttrNamespace(ev, &ev.RemoveXAttr) }, @@ -13287,6 +14255,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.RemoveXAttr.File) }, @@ -13296,6 +14265,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RemoveXAttr.File.FileFields.GID) }, @@ -13305,6 +14275,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.RemoveXAttr.File.FileFields) }, @@ -13314,6 +14285,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.RemoveXAttr.File) }, @@ -13323,6 +14295,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.RemoveXAttr.File.FileFields) }, @@ -13332,6 +14305,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RemoveXAttr.File.FileFields.PathKey.Inode) }, @@ -13341,6 +14315,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RemoveXAttr.File.FileFields.Mode) }, @@ -13350,6 +14325,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RemoveXAttr.File.FileFields.MTime) }, @@ -13359,6 +14335,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RemoveXAttr.File.FileFields.PathKey.MountID) }, @@ -13369,6 +14346,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.RemoveXAttr.File) }, @@ -13379,6 +14357,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.RemoveXAttr.File)) }, @@ -13388,6 +14367,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.RemoveXAttr.File) }, @@ -13397,6 +14377,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.RemoveXAttr.File) }, @@ -13406,6 +14387,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.RemoveXAttr.File) }, @@ -13416,6 +14398,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.RemoveXAttr.File) }, @@ -13426,6 +14409,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.RemoveXAttr.File)) }, @@ -13435,6 +14419,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.RemoveXAttr.File.FileFields)) }, @@ -13444,6 +14429,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RemoveXAttr.File.FileFields.UID) }, @@ -13453,6 +14439,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.RemoveXAttr.File.FileFields) }, @@ -13462,6 +14449,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "removexattr.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.RemoveXAttr.SyscallEvent.Retval) }, @@ -13471,6 +14459,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.Old.FileFields.CTime) }, @@ -13480,6 +14469,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.New.FileFields.CTime) }, @@ -13489,6 +14479,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Rename.New) }, @@ -13498,6 +14489,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.New.FileFields.GID) }, @@ -13507,6 +14499,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Rename.New.FileFields) }, @@ -13516,6 +14509,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Rename.New) }, @@ -13525,6 +14519,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Rename.New.FileFields) }, @@ -13534,6 +14529,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.New.FileFields.PathKey.Inode) }, @@ -13543,6 +14539,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.New.FileFields.Mode) }, @@ -13552,6 +14549,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.New.FileFields.MTime) }, @@ -13561,6 +14559,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.New.FileFields.PathKey.MountID) }, @@ -13571,6 +14570,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Rename.New) }, @@ -13581,6 +14581,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Rename.New)) }, @@ -13590,6 +14591,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Rename.New) }, @@ -13599,6 +14601,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Rename.New) }, @@ -13608,6 +14611,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Rename.New) }, @@ -13618,6 +14622,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Rename.New) }, @@ -13628,6 +14633,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Rename.New)) }, @@ -13637,6 +14643,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Rename.New.FileFields)) }, @@ -13646,6 +14653,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.New.FileFields.UID) }, @@ -13655,6 +14663,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.destination.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Rename.New.FileFields) }, @@ -13664,6 +14673,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Rename.Old) }, @@ -13673,6 +14683,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.Old.FileFields.GID) }, @@ -13682,6 +14693,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Rename.Old.FileFields) }, @@ -13691,6 +14703,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Rename.Old) }, @@ -13700,6 +14713,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Rename.Old.FileFields) }, @@ -13709,6 +14723,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.Old.FileFields.PathKey.Inode) }, @@ -13718,6 +14733,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.Old.FileFields.Mode) }, @@ -13727,6 +14743,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.Old.FileFields.MTime) }, @@ -13736,6 +14753,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.Old.FileFields.PathKey.MountID) }, @@ -13746,6 +14764,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Rename.Old) }, @@ -13756,6 +14775,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Rename.Old)) }, @@ -13765,6 +14785,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Rename.Old) }, @@ -13774,6 +14795,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Rename.Old) }, @@ -13783,6 +14805,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Rename.Old) }, @@ -13793,6 +14816,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Rename.Old) }, @@ -13803,6 +14827,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Rename.Old)) }, @@ -13812,6 +14837,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Rename.Old.FileFields)) }, @@ -13821,6 +14847,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.Old.FileFields.UID) }, @@ -13830,6 +14857,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Rename.Old.FileFields) }, @@ -13839,6 +14867,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rename.SyscallEvent.Retval) }, @@ -13848,6 +14877,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.syscall.destination.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr2(ev, &ev.Rename.SyscallContext) }, @@ -13857,6 +14887,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rename.syscall.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr1(ev, &ev.Rename.SyscallContext) }, @@ -13866,6 +14897,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rmdir.File.FileFields.CTime) }, @@ -13875,6 +14907,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Rmdir.File) }, @@ -13884,6 +14917,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rmdir.File.FileFields.GID) }, @@ -13893,6 +14927,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Rmdir.File.FileFields) }, @@ -13902,6 +14937,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Rmdir.File) }, @@ -13911,6 +14947,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Rmdir.File.FileFields) }, @@ -13920,6 +14957,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rmdir.File.FileFields.PathKey.Inode) }, @@ -13929,6 +14967,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rmdir.File.FileFields.Mode) }, @@ -13938,6 +14977,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rmdir.File.FileFields.MTime) }, @@ -13947,6 +14987,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rmdir.File.FileFields.PathKey.MountID) }, @@ -13957,6 +14998,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Rmdir.File) }, @@ -13967,6 +15009,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Rmdir.File)) }, @@ -13976,6 +15019,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Rmdir.File) }, @@ -13985,6 +15029,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Rmdir.File) }, @@ -13994,6 +15039,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Rmdir.File) }, @@ -14004,6 +15050,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Rmdir.File) }, @@ -14014,6 +15061,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Rmdir.File)) }, @@ -14023,6 +15071,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Rmdir.File.FileFields)) }, @@ -14032,6 +15081,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rmdir.File.FileFields.UID) }, @@ -14041,6 +15091,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Rmdir.File.FileFields) }, @@ -14050,6 +15101,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "rmdir.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Rmdir.SyscallEvent.Retval) }, @@ -14059,6 +15111,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "selinux.bool.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSELinuxBoolName(ev, &ev.SELinux) }, @@ -14068,6 +15121,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "selinux.bool.state": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SELinux.BoolChangeValue }, @@ -14077,6 +15131,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "selinux.bool_commit.state": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SELinux.BoolCommitValue }, @@ -14086,6 +15141,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "selinux.enforce.status": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SELinux.EnforceStatus }, @@ -14095,6 +15151,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setgid.egid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetGID.EGID) }, @@ -14104,6 +15161,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setgid.egroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSetgidEGroup(ev, &ev.SetGID) }, @@ -14113,6 +15171,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setgid.fsgid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetGID.FSGID) }, @@ -14122,6 +15181,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setgid.fsgroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSetgidFSGroup(ev, &ev.SetGID) }, @@ -14131,6 +15191,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setgid.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetGID.GID) }, @@ -14140,6 +15201,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setgid.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSetgidGroup(ev, &ev.SetGID) }, @@ -14149,6 +15211,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setuid.euid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetUID.EUID) }, @@ -14158,6 +15221,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setuid.euser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSetuidEUser(ev, &ev.SetUID) }, @@ -14167,6 +15231,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setuid.fsuid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetUID.FSUID) }, @@ -14176,6 +15241,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setuid.fsuser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSetuidFSUser(ev, &ev.SetUID) }, @@ -14185,6 +15251,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setuid.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetUID.UID) }, @@ -14194,6 +15261,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setuid.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSetuidUser(ev, &ev.SetUID) }, @@ -14203,6 +15271,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetXAttr.File.FileFields.CTime) }, @@ -14212,6 +15281,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.destination.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveXAttrName(ev, &ev.SetXAttr) }, @@ -14221,6 +15291,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.destination.namespace": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveXAttrNamespace(ev, &ev.SetXAttr) }, @@ -14230,6 +15301,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.SetXAttr.File) }, @@ -14239,6 +15311,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetXAttr.File.FileFields.GID) }, @@ -14248,6 +15321,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.SetXAttr.File.FileFields) }, @@ -14257,6 +15331,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.SetXAttr.File) }, @@ -14266,6 +15341,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.SetXAttr.File.FileFields) }, @@ -14275,6 +15351,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetXAttr.File.FileFields.PathKey.Inode) }, @@ -14284,6 +15361,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetXAttr.File.FileFields.Mode) }, @@ -14293,6 +15371,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetXAttr.File.FileFields.MTime) }, @@ -14302,6 +15381,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetXAttr.File.FileFields.PathKey.MountID) }, @@ -14312,6 +15392,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.SetXAttr.File) }, @@ -14322,6 +15403,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.SetXAttr.File)) }, @@ -14331,6 +15413,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.SetXAttr.File) }, @@ -14340,6 +15423,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.SetXAttr.File) }, @@ -14349,6 +15433,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.SetXAttr.File) }, @@ -14359,6 +15444,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.SetXAttr.File) }, @@ -14369,6 +15455,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.SetXAttr.File)) }, @@ -14378,6 +15465,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.SetXAttr.File.FileFields)) }, @@ -14387,6 +15475,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetXAttr.File.FileFields.UID) }, @@ -14396,6 +15485,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.SetXAttr.File.FileFields) }, @@ -14405,6 +15495,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "setxattr.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.SetXAttr.SyscallEvent.Retval) }, @@ -14414,6 +15505,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.PID) }, @@ -14423,6 +15515,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.SyscallEvent.Retval) }, @@ -14432,6 +15525,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.args": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14459,6 +15553,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14486,6 +15581,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14513,6 +15609,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.args_truncated": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -14540,6 +15637,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14567,6 +15665,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.argv0": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14594,6 +15693,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.auid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -14620,6 +15720,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.cap_effective": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -14646,6 +15747,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.cap_permitted": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -14672,6 +15774,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.cgroup.file.inode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -14698,6 +15801,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.cgroup.file.mount_id": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -14724,6 +15828,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.cgroup.id": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14751,6 +15856,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.cgroup.manager": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14778,6 +15884,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.comm": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -14804,6 +15911,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.container.id": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14831,6 +15939,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.created_at": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -14858,6 +15967,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.egid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -14884,6 +15994,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.egroup": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -14910,6 +16021,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14937,6 +16049,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -14964,6 +16077,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.envs_truncated": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -14991,6 +16105,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.euid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15017,6 +16132,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.euser": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -15043,6 +16159,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.change_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15075,6 +16192,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.filesystem": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15108,6 +16226,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.gid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15140,6 +16259,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.group": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15173,6 +16293,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15206,6 +16327,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.in_upper_layer": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -15239,6 +16361,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.inode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15271,6 +16394,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.mode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15303,6 +16427,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.modification_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15335,6 +16460,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.mount_id": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15368,6 +16494,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15402,6 +16529,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -15429,6 +16557,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.package.name": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15462,6 +16591,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.package.source_version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15495,6 +16625,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.package.version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15529,6 +16660,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15563,6 +16695,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -15590,6 +16723,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.rights": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -15623,6 +16757,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.uid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15655,6 +16790,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.file.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15688,6 +16824,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.fsgid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15714,6 +16851,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.fsgroup": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -15740,6 +16878,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.fsuid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15766,6 +16905,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.fsuser": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -15792,6 +16932,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.gid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15818,6 +16959,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.group": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -15844,6 +16986,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.change_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15876,6 +17019,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.filesystem": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15909,6 +17053,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.gid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -15941,6 +17086,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.group": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -15974,6 +17120,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16007,6 +17154,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.in_upper_layer": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -16040,6 +17188,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.inode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -16072,6 +17221,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.mode": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -16104,6 +17254,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.modification_time": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -16136,6 +17287,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.mount_id": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -16169,6 +17321,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16203,6 +17356,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -16230,6 +17384,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.package.name": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16263,6 +17418,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.package.source_version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16296,6 +17452,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.package.version": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16330,6 +17487,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16364,6 +17522,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -16391,6 +17550,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.rights": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -16424,6 +17584,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.uid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -16456,6 +17617,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.interpreter.file.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16489,6 +17651,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.is_exec": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) if result, ok := ctx.BoolCache[field]; ok { return result } @@ -16515,6 +17678,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.is_kworker": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) if result, ok := ctx.BoolCache[field]; ok { return result } @@ -16541,6 +17705,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.is_thread": return &eval.BoolArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.BoolCache[field]; ok { return result @@ -16568,6 +17733,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) iterator := &ProcessAncestorsIterator{} return iterator.Len(ctx) }, @@ -16577,6 +17743,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.pid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -16603,6 +17770,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.ppid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -16629,6 +17797,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.tid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -16655,6 +17824,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.tty_name": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -16681,6 +17851,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.uid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -16707,6 +17878,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -16733,6 +17905,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16760,6 +17933,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.user_session.k8s_uid": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16787,6 +17961,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ancestors.user_session.k8s_username": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -16814,6 +17989,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.args": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgs(ev, &ev.Signal.Target.Process) }, @@ -16823,6 +17999,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsFlags(ev, &ev.Signal.Target.Process) }, @@ -16832,6 +18009,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsOptions(ev, &ev.Signal.Target.Process) }, @@ -16841,6 +18019,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.args_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgsTruncated(ev, &ev.Signal.Target.Process) }, @@ -16850,6 +18029,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv(ev, &ev.Signal.Target.Process) }, @@ -16859,6 +18039,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.argv0": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessArgv0(ev, &ev.Signal.Target.Process) }, @@ -16868,6 +18049,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.auid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.Credentials.AUID) }, @@ -16877,6 +18059,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.cap_effective": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.Credentials.CapEffective) }, @@ -16886,6 +18069,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.cap_permitted": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.Credentials.CapPermitted) }, @@ -16895,6 +18079,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.cgroup.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.CGroup.CGroupFile.Inode) }, @@ -16904,6 +18089,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.cgroup.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.CGroup.CGroupFile.MountID) }, @@ -16913,6 +18099,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.cgroup.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupID(ev, &ev.Signal.Target.Process.CGroup) }, @@ -16922,6 +18109,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.cgroup.manager": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveCGroupManager(ev, &ev.Signal.Target.Process.CGroup) }, @@ -16931,6 +18119,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.comm": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.Comm }, @@ -16940,6 +18129,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessContainerID(ev, &ev.Signal.Target.Process) }, @@ -16949,6 +18139,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, &ev.Signal.Target.Process)) }, @@ -16958,6 +18149,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.egid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.Credentials.EGID) }, @@ -16967,6 +18159,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.egroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.Credentials.EGroup }, @@ -16976,6 +18169,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, &ev.Signal.Target.Process) }, @@ -16985,6 +18179,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, &ev.Signal.Target.Process) }, @@ -16994,6 +18189,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.envs_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvsTruncated(ev, &ev.Signal.Target.Process) }, @@ -17003,6 +18199,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.euid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.Credentials.EUID) }, @@ -17012,6 +18209,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.euser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.Credentials.EUser }, @@ -17021,6 +18219,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return 0 @@ -17033,6 +18232,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return "" @@ -17045,6 +18245,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return 0 @@ -17057,6 +18258,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return "" @@ -17069,6 +18271,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return []string{} @@ -17081,6 +18284,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return false @@ -17093,6 +18297,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return 0 @@ -17105,6 +18310,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return 0 @@ -17117,6 +18323,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return 0 @@ -17129,6 +18336,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return 0 @@ -17142,6 +18350,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return "" @@ -17155,6 +18364,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Signal.Target.Process.FileEvent)) }, @@ -17164,6 +18374,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return "" @@ -17176,6 +18387,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return "" @@ -17188,6 +18400,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return "" @@ -17201,6 +18414,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return "" @@ -17214,6 +18428,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Signal.Target.Process.FileEvent)) }, @@ -17223,6 +18438,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return 0 @@ -17235,6 +18451,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return 0 @@ -17247,6 +18464,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.IsNotKworker() { return "" @@ -17259,6 +18477,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.fsgid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.Credentials.FSGID) }, @@ -17268,6 +18487,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.fsgroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.Credentials.FSGroup }, @@ -17277,6 +18497,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.fsuid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.Credentials.FSUID) }, @@ -17286,6 +18507,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.fsuser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.Credentials.FSUser }, @@ -17295,6 +18517,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.Credentials.GID) }, @@ -17304,6 +18527,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.Credentials.Group }, @@ -17313,6 +18537,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return 0 @@ -17325,6 +18550,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return "" @@ -17337,6 +18563,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return 0 @@ -17349,6 +18576,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return "" @@ -17361,6 +18589,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return []string{} @@ -17373,6 +18602,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return false @@ -17385,6 +18615,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return 0 @@ -17397,6 +18628,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return 0 @@ -17409,6 +18641,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return 0 @@ -17421,6 +18654,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return 0 @@ -17434,6 +18668,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return "" @@ -17447,6 +18682,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Signal.Target.Process.LinuxBinprm.FileEvent)) }, @@ -17456,6 +18692,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return "" @@ -17468,6 +18705,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return "" @@ -17480,6 +18718,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return "" @@ -17493,6 +18732,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return "" @@ -17506,6 +18746,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Signal.Target.Process.LinuxBinprm.FileEvent)) }, @@ -17515,6 +18756,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return 0 @@ -17527,6 +18769,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return 0 @@ -17539,6 +18782,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.interpreter.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.Process.HasInterpreter() { return "" @@ -17551,6 +18795,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.is_exec": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.IsExec }, @@ -17560,6 +18805,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.is_kworker": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.PIDContext.IsKworker }, @@ -17569,6 +18815,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.is_thread": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessIsThread(ev, &ev.Signal.Target.Process) }, @@ -17578,6 +18825,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.args": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17590,6 +18838,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.args_flags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return []string{} @@ -17602,6 +18851,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.args_options": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return []string{} @@ -17614,6 +18864,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.args_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return false @@ -17626,6 +18877,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.argv": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return []string{} @@ -17638,6 +18890,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.argv0": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17650,6 +18903,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.auid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17662,6 +18916,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.cap_effective": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17674,6 +18929,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.cap_permitted": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17686,6 +18942,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.cgroup.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17698,6 +18955,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.cgroup.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17710,6 +18968,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.cgroup.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17722,6 +18981,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.cgroup.manager": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17734,6 +18994,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.comm": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17746,6 +19007,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17758,6 +19020,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17770,6 +19033,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.egid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17782,6 +19046,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.egroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17794,6 +19059,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return []string{} @@ -17806,6 +19072,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return []string{} @@ -17818,6 +19085,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.envs_truncated": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return false @@ -17830,6 +19098,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.euid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17842,6 +19111,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.euser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17854,6 +19124,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17869,6 +19140,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17884,6 +19156,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17899,6 +19172,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -17914,6 +19188,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return []string{} @@ -17929,6 +19204,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return false @@ -17944,6 +19220,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17959,6 +19236,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17974,6 +19252,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -17989,6 +19268,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18005,6 +19285,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18021,6 +19302,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Signal.Target.Parent.FileEvent)) }, @@ -18030,6 +19312,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18045,6 +19328,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18060,6 +19344,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18076,6 +19361,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18092,6 +19378,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Signal.Target.Parent.FileEvent)) }, @@ -18101,6 +19388,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18116,6 +19404,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18131,6 +19420,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18146,6 +19436,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.fsgid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18158,6 +19449,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.fsgroup": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18170,6 +19462,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.fsuid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18182,6 +19475,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.fsuser": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18194,6 +19488,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18206,6 +19501,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18218,6 +19514,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18233,6 +19530,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18248,6 +19546,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18263,6 +19562,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18278,6 +19578,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return []string{} @@ -18293,6 +19594,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return false @@ -18308,6 +19610,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18323,6 +19626,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18338,6 +19642,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18353,6 +19658,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18369,6 +19675,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18385,6 +19692,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Signal.Target.Parent.LinuxBinprm.FileEvent)) }, @@ -18394,6 +19702,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18409,6 +19718,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18424,6 +19734,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18440,6 +19751,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18456,6 +19768,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Signal.Target.Parent.LinuxBinprm.FileEvent)) }, @@ -18465,6 +19778,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18480,6 +19794,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18495,6 +19810,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.interpreter.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18510,6 +19826,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.is_exec": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return false @@ -18522,6 +19839,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.is_kworker": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return false @@ -18534,6 +19852,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.is_thread": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return false @@ -18546,6 +19865,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18558,6 +19878,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18570,6 +19891,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.tid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18582,6 +19904,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.tty_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18594,6 +19917,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return 0 @@ -18606,6 +19930,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18618,6 +19943,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return []string{} @@ -18630,6 +19956,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.user_session.k8s_uid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18642,6 +19969,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.parent.user_session.k8s_username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.Signal.Target.HasParent() { return "" @@ -18654,6 +19982,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.PIDContext.Pid) }, @@ -18663,6 +19992,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.PPid) }, @@ -18672,6 +20002,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.tid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.PIDContext.Tid) }, @@ -18681,6 +20012,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.tty_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.TTYName }, @@ -18690,6 +20022,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Target.Process.Credentials.UID) }, @@ -18699,6 +20032,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Signal.Target.Process.Credentials.User }, @@ -18708,6 +20042,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.user_session.k8s_groups": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SGroups(ev, &ev.Signal.Target.Process.UserSession) }, @@ -18717,6 +20052,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.user_session.k8s_uid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUID(ev, &ev.Signal.Target.Process.UserSession) }, @@ -18726,6 +20062,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.target.user_session.k8s_username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveK8SUsername(ev, &ev.Signal.Target.Process.UserSession) }, @@ -18735,6 +20072,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "signal.type": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Signal.Type) }, @@ -18744,6 +20082,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.File.FileFields.CTime) }, @@ -18753,6 +20092,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Splice.File) }, @@ -18762,6 +20102,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.File.FileFields.GID) }, @@ -18771,6 +20112,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Splice.File.FileFields) }, @@ -18780,6 +20122,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Splice.File) }, @@ -18789,6 +20132,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Splice.File.FileFields) }, @@ -18798,6 +20142,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.File.FileFields.PathKey.Inode) }, @@ -18807,6 +20152,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.File.FileFields.Mode) }, @@ -18816,6 +20162,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.File.FileFields.MTime) }, @@ -18825,6 +20172,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.File.FileFields.PathKey.MountID) }, @@ -18835,6 +20183,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Splice.File) }, @@ -18845,6 +20194,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Splice.File)) }, @@ -18854,6 +20204,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Splice.File) }, @@ -18863,6 +20214,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Splice.File) }, @@ -18872,6 +20224,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Splice.File) }, @@ -18882,6 +20235,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Splice.File) }, @@ -18892,6 +20246,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Splice.File)) }, @@ -18901,6 +20256,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Splice.File.FileFields)) }, @@ -18910,6 +20266,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.File.FileFields.UID) }, @@ -18919,6 +20276,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Splice.File.FileFields) }, @@ -18928,6 +20286,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.pipe_entry_flag": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.PipeEntryFlag) }, @@ -18937,6 +20296,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.pipe_exit_flag": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.PipeExitFlag) }, @@ -18946,6 +20306,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "splice.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Splice.SyscallEvent.Retval) }, @@ -18955,6 +20316,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Unlink.File.FileFields.CTime) }, @@ -18964,6 +20326,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Unlink.File) }, @@ -18973,6 +20336,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Unlink.File.FileFields.GID) }, @@ -18982,6 +20346,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Unlink.File.FileFields) }, @@ -18991,6 +20356,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Unlink.File) }, @@ -19000,6 +20366,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Unlink.File.FileFields) }, @@ -19009,6 +20376,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Unlink.File.FileFields.PathKey.Inode) }, @@ -19018,6 +20386,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Unlink.File.FileFields.Mode) }, @@ -19027,6 +20396,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Unlink.File.FileFields.MTime) }, @@ -19036,6 +20406,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Unlink.File.FileFields.PathKey.MountID) }, @@ -19046,6 +20417,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Unlink.File) }, @@ -19056,6 +20428,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Unlink.File)) }, @@ -19065,6 +20438,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Unlink.File) }, @@ -19074,6 +20448,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Unlink.File) }, @@ -19083,6 +20458,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Unlink.File) }, @@ -19093,6 +20469,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Unlink.File) }, @@ -19103,6 +20480,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Unlink.File)) }, @@ -19112,6 +20490,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Unlink.File.FileFields)) }, @@ -19121,6 +20500,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Unlink.File.FileFields.UID) }, @@ -19130,6 +20510,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Unlink.File.FileFields) }, @@ -19139,6 +20520,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.flags": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Unlink.Flags) }, @@ -19148,6 +20530,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Unlink.SyscallEvent.Retval) }, @@ -19157,6 +20540,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.syscall.dirfd": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveSyscallCtxArgsInt1(ev, &ev.Unlink.SyscallContext)) }, @@ -19166,6 +20550,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.syscall.flags": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveSyscallCtxArgsInt3(ev, &ev.Unlink.SyscallContext)) }, @@ -19175,6 +20560,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unlink.syscall.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr2(ev, &ev.Unlink.SyscallContext) }, @@ -19184,6 +20570,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unload_module.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.UnloadModule.Name }, @@ -19193,6 +20580,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "unload_module.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.UnloadModule.SyscallEvent.Retval) }, @@ -19202,6 +20590,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.change_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Utimes.File.FileFields.CTime) }, @@ -19211,6 +20600,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.filesystem": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFilesystem(ev, &ev.Utimes.File) }, @@ -19220,6 +20610,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.gid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Utimes.File.FileFields.GID) }, @@ -19229,6 +20620,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.group": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsGroup(ev, &ev.Utimes.File.FileFields) }, @@ -19238,6 +20630,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.hashes": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHashesFromEvent(ev, &ev.Utimes.File) }, @@ -19247,6 +20640,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.in_upper_layer": return &eval.BoolEvaluator{ EvalFnc: func(ctx *eval.Context) bool { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsInUpperLayer(ev, &ev.Utimes.File.FileFields) }, @@ -19256,6 +20650,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.inode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Utimes.File.FileFields.PathKey.Inode) }, @@ -19265,6 +20660,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.mode": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Utimes.File.FileFields.Mode) }, @@ -19274,6 +20670,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.modification_time": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Utimes.File.FileFields.MTime) }, @@ -19283,6 +20680,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.mount_id": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Utimes.File.FileFields.PathKey.MountID) }, @@ -19293,6 +20691,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Utimes.File) }, @@ -19303,6 +20702,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkBasename, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Utimes.File)) }, @@ -19312,6 +20712,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.package.name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageName(ev, &ev.Utimes.File) }, @@ -19321,6 +20722,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.package.source_version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageSourceVersion(ev, &ev.Utimes.File) }, @@ -19330,6 +20732,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.package.version": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolvePackageVersion(ev, &ev.Utimes.File) }, @@ -19340,6 +20743,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Utimes.File) }, @@ -19350,6 +20754,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: ProcessSymlinkPathname, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Utimes.File)) }, @@ -19359,6 +20764,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.rights": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveRights(ev, &ev.Utimes.File.FileFields)) }, @@ -19368,6 +20774,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.uid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Utimes.File.FileFields.UID) }, @@ -19377,6 +20784,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.file.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileFieldsUser(ev, &ev.Utimes.File.FileFields) }, @@ -19386,6 +20794,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.retval": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Utimes.SyscallEvent.Retval) }, @@ -19395,6 +20804,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "utimes.syscall.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveSyscallCtxArgsStr1(ev, &ev.Utimes.SyscallContext) }, diff --git a/pkg/security/secl/model/accessors_windows.go b/pkg/security/secl/model/accessors_windows.go index 9bd0e32d553b9..6f15992c5aab1 100644 --- a/pkg/security/secl/model/accessors_windows.go +++ b/pkg/security/secl/model/accessors_windows.go @@ -43,6 +43,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.new_sd": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveNewSecurityDescriptor(ev, &ev.ChangePermission) }, @@ -52,6 +53,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.old_sd": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveOldSecurityDescriptor(ev, &ev.ChangePermission) }, @@ -61,6 +63,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.ChangePermission.ObjectName }, @@ -70,6 +73,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.type": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.ChangePermission.ObjectType }, @@ -79,6 +83,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.user_domain": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.ChangePermission.UserDomain }, @@ -88,6 +93,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.ChangePermission.UserName }, @@ -97,6 +103,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveContainerCreatedAt(ev, ev.BaseEvent.ContainerContext)) }, @@ -106,6 +113,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveContainerID(ev, ev.BaseEvent.ContainerContext) }, @@ -115,6 +123,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.runtime": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveContainerRuntime(ev, ev.BaseEvent.ContainerContext) }, @@ -124,6 +133,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.tags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveContainerTags(ev, ev.BaseEvent.ContainerContext) }, @@ -134,6 +144,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.CreateNewFile.File) }, @@ -144,6 +155,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.CreateNewFile.File)) }, @@ -154,6 +166,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.CreateNewFile.File) }, @@ -164,6 +177,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.CreateNewFile.File)) }, @@ -174,6 +188,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.CreateNewFile.File) }, @@ -184,6 +199,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.CreateNewFile.File)) }, @@ -193,6 +209,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "create.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.CreateRegistryKey.Registry.KeyName }, @@ -202,6 +219,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "create.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.CreateRegistryKey.Registry.KeyName) }, @@ -212,6 +230,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.CreateRegistryKey.Registry.KeyPath }, @@ -222,6 +241,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.CreateRegistryKey.Registry.KeyPath) }, @@ -231,6 +251,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "create_key.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.CreateRegistryKey.Registry.KeyName }, @@ -240,6 +261,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "create_key.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.CreateRegistryKey.Registry.KeyName) }, @@ -250,6 +272,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.CreateRegistryKey.Registry.KeyPath }, @@ -260,6 +283,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.CreateRegistryKey.Registry.KeyPath) }, @@ -270,6 +294,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.DeleteFile.File) }, @@ -280,6 +305,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.DeleteFile.File)) }, @@ -290,6 +316,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.DeleteFile.File) }, @@ -300,6 +327,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.DeleteFile.File)) }, @@ -310,6 +338,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.DeleteFile.File) }, @@ -320,6 +349,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.DeleteFile.File)) }, @@ -329,6 +359,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "delete.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.DeleteRegistryKey.Registry.KeyName }, @@ -338,6 +369,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "delete.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.DeleteRegistryKey.Registry.KeyName) }, @@ -348,6 +380,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.DeleteRegistryKey.Registry.KeyPath }, @@ -358,6 +391,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.DeleteRegistryKey.Registry.KeyPath) }, @@ -367,6 +401,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "delete_key.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.DeleteRegistryKey.Registry.KeyName }, @@ -376,6 +411,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "delete_key.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.DeleteRegistryKey.Registry.KeyName) }, @@ -386,6 +422,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.DeleteRegistryKey.Registry.KeyPath }, @@ -396,6 +433,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.DeleteRegistryKey.Registry.KeyPath) }, @@ -405,6 +443,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.hostname": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHostname(ev, &ev.BaseEvent) }, @@ -414,6 +453,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.origin": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.Origin }, @@ -423,6 +463,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.os": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.Os }, @@ -432,6 +473,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.service": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveService(ev, &ev.BaseEvent) }, @@ -441,6 +483,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.timestamp": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveEventTimestamp(ev, &ev.BaseEvent)) }, @@ -451,6 +494,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessCmdLine(ev, ev.Exec.Process) }, @@ -460,6 +504,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.ContainerID }, @@ -469,6 +514,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, ev.Exec.Process)) }, @@ -478,6 +524,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, ev.Exec.Process) }, @@ -487,6 +534,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, ev.Exec.Process) }, @@ -497,6 +545,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exec.Process.FileEvent) }, @@ -507,6 +556,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exec.Process.FileEvent)) }, @@ -517,6 +567,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Exec.Process.FileEvent) }, @@ -527,6 +578,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Exec.Process.FileEvent)) }, @@ -536,6 +588,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.PIDContext.Pid) }, @@ -545,6 +598,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.PPid) }, @@ -554,6 +608,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveUser(ev, ev.Exec.Process) }, @@ -563,6 +618,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.user_sid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.OwnerSidString }, @@ -572,6 +628,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.cause": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Cause) }, @@ -582,6 +639,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessCmdLine(ev, ev.Exit.Process) }, @@ -591,6 +649,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.code": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Code) }, @@ -600,6 +659,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.ContainerID }, @@ -609,6 +669,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, ev.Exit.Process)) }, @@ -618,6 +679,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, ev.Exit.Process) }, @@ -627,6 +689,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, ev.Exit.Process) }, @@ -637,6 +700,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exit.Process.FileEvent) }, @@ -647,6 +711,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exit.Process.FileEvent)) }, @@ -657,6 +722,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Exit.Process.FileEvent) }, @@ -667,6 +733,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Exit.Process.FileEvent)) }, @@ -676,6 +743,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.PIDContext.Pid) }, @@ -685,6 +753,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.PPid) }, @@ -694,6 +763,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveUser(ev, ev.Exit.Process) }, @@ -703,6 +773,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.user_sid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.OwnerSidString }, @@ -712,6 +783,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.OpenRegistryKey.Registry.KeyName }, @@ -721,6 +793,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.OpenRegistryKey.Registry.KeyName) }, @@ -731,6 +804,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.OpenRegistryKey.Registry.KeyPath }, @@ -741,6 +815,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.OpenRegistryKey.Registry.KeyPath) }, @@ -750,6 +825,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open_key.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.OpenRegistryKey.Registry.KeyName }, @@ -759,6 +835,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open_key.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.OpenRegistryKey.Registry.KeyName) }, @@ -769,6 +846,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.OpenRegistryKey.Registry.KeyPath }, @@ -779,6 +857,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.OpenRegistryKey.Registry.KeyPath) }, @@ -789,6 +868,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -816,6 +896,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.container.id": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -842,6 +923,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.created_at": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -869,6 +951,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -896,6 +979,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -924,6 +1008,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -952,6 +1037,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -980,6 +1066,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -1008,6 +1095,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -1035,6 +1123,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) iterator := &ProcessAncestorsIterator{} return iterator.Len(ctx) }, @@ -1044,6 +1133,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.pid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -1070,6 +1160,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.ppid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -1096,6 +1187,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -1123,6 +1215,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.user_sid": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -1150,6 +1243,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessCmdLine(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -1159,6 +1253,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.ContainerID }, @@ -1168,6 +1263,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, &ev.BaseEvent.ProcessContext.Process)) }, @@ -1177,6 +1273,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -1186,6 +1283,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -1196,6 +1294,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent) }, @@ -1206,6 +1305,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent)) }, @@ -1216,6 +1316,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent) }, @@ -1226,6 +1327,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent)) }, @@ -1236,6 +1338,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1248,6 +1351,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1260,6 +1364,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -1272,6 +1377,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -1284,6 +1390,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -1297,6 +1404,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1310,6 +1418,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Parent.FileEvent)) }, @@ -1320,6 +1429,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1333,6 +1443,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Parent.FileEvent)) }, @@ -1342,6 +1453,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -1354,6 +1466,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -1366,6 +1479,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1378,6 +1492,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.user_sid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1390,6 +1505,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.PIDContext.Pid) }, @@ -1399,6 +1515,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.PPid) }, @@ -1408,6 +1525,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveUser(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -1417,6 +1535,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.user_sid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.OwnerSidString }, @@ -1427,6 +1546,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.RenameFile.New) }, @@ -1437,6 +1557,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.RenameFile.New)) }, @@ -1447,6 +1568,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.RenameFile.New) }, @@ -1457,6 +1579,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.RenameFile.New)) }, @@ -1467,6 +1590,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.RenameFile.New) }, @@ -1477,6 +1601,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.RenameFile.New)) }, @@ -1487,6 +1612,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.RenameFile.Old) }, @@ -1497,6 +1623,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.RenameFile.Old)) }, @@ -1507,6 +1634,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.RenameFile.Old) }, @@ -1517,6 +1645,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.RenameFile.Old)) }, @@ -1527,6 +1656,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.RenameFile.Old) }, @@ -1537,6 +1667,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.RenameFile.Old)) }, @@ -1546,6 +1677,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.Registry.KeyName }, @@ -1555,6 +1687,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.Registry.KeyName) }, @@ -1565,6 +1698,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.Registry.KeyPath }, @@ -1575,6 +1709,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.Registry.KeyPath) }, @@ -1584,6 +1719,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.registry.value_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.ValueName }, @@ -1593,6 +1729,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.registry.value_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.ValueName) }, @@ -1602,6 +1739,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.value_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.ValueName }, @@ -1611,6 +1749,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.Registry.KeyName }, @@ -1620,6 +1759,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.Registry.KeyName) }, @@ -1630,6 +1770,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.Registry.KeyPath }, @@ -1640,6 +1781,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.Registry.KeyPath) }, @@ -1649,6 +1791,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.registry.value_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.ValueName }, @@ -1658,6 +1801,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.registry.value_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.ValueName) }, @@ -1667,6 +1811,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.value_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.ValueName }, @@ -1677,6 +1822,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.WriteFile.File) }, @@ -1687,6 +1833,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.WriteFile.File)) }, @@ -1697,6 +1844,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.WriteFile.File) }, @@ -1707,6 +1855,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.WriteFile.File)) }, @@ -1717,6 +1866,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.WriteFile.File) }, @@ -1727,6 +1877,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.WriteFile.File)) }, diff --git a/pkg/security/secl/rules/collected_events_functests.go b/pkg/security/secl/rules/collected_events_functests.go index eda8cfdb28948..25754a4c574c6 100644 --- a/pkg/security/secl/rules/collected_events_functests.go +++ b/pkg/security/secl/rules/collected_events_functests.go @@ -10,19 +10,18 @@ package rules import ( "errors" + "slices" "sync" "github.com/DataDog/datadog-agent/pkg/security/secl/compiler/eval" ) -const maxFieldWeight = 999 - type EventCollector struct { sync.Mutex eventsCollected []CollectedEvent } -func (ec *EventCollector) CollectEvent(rs *RuleSet, event eval.Event, result bool) { +func (ec *EventCollector) CollectEvent(rs *RuleSet, ctx *eval.Context, event eval.Event, result bool) { ec.Lock() defer ec.Unlock() var fieldNotSupportedError *eval.ErrNotSupported @@ -34,7 +33,14 @@ func (ec *EventCollector) CollectEvent(rs *RuleSet, event eval.Event, result boo Fields: make(map[string]interface{}, len(rs.fields)), } + resolvedFields := ctx.GetResolvedFields() + for _, field := range rs.fields { + // skip fields that have not been resolved + if !slices.Contains(resolvedFields, field) { + continue + } + fieldEventType, err := event.GetFieldEventType(field) if err != nil { rs.logger.Errorf("failed to get event type for field %s: %v", field, err) @@ -44,14 +50,6 @@ func (ec *EventCollector) CollectEvent(rs *RuleSet, event eval.Event, result boo continue } - // for non-matching events, we want to avoid resolving costly fields (e.g. file hashes) - // to avoid impacting events that should be matching - if !result { - if evaluator, err := rs.model.GetEvaluator(field, ""); err == nil && evaluator.GetWeight() > maxFieldWeight { - continue - } - } - value, err := event.GetFieldValue(field) if err != nil { // GetFieldValue returns the default type value with ErrNotSupported in case the field Check test fails diff --git a/pkg/security/secl/rules/collected_events_regular.go b/pkg/security/secl/rules/collected_events_regular.go index bbac542fe9479..dc9b42defeadd 100644 --- a/pkg/security/secl/rules/collected_events_regular.go +++ b/pkg/security/secl/rules/collected_events_regular.go @@ -15,7 +15,7 @@ type EventCollector struct { } // CollectEvent collects event -func (ec *EventCollector) CollectEvent(_ *RuleSet, _ eval.Event, _ bool) { +func (ec *EventCollector) CollectEvent(_ *RuleSet, _ *eval.Context, _ eval.Event, _ bool) { // no-op } diff --git a/pkg/security/secl/rules/ruleset.go b/pkg/security/secl/rules/ruleset.go index 2e34abf5d0aa3..90be57e0b71a9 100644 --- a/pkg/security/secl/rules/ruleset.go +++ b/pkg/security/secl/rules/ruleset.go @@ -603,7 +603,7 @@ func (rs *RuleSet) Evaluate(event eval.Event) bool { // no-op in the general case, only used to collect events in functional tests // for debugging purposes - rs.eventCollector.CollectEvent(rs, event, result) + rs.eventCollector.CollectEvent(rs, ctx, event, result) return result } diff --git a/pkg/security/seclwin/model/accessors_win.go b/pkg/security/seclwin/model/accessors_win.go index 4b14373018f29..d7f989e58bd93 100644 --- a/pkg/security/seclwin/model/accessors_win.go +++ b/pkg/security/seclwin/model/accessors_win.go @@ -41,6 +41,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.new_sd": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveNewSecurityDescriptor(ev, &ev.ChangePermission) }, @@ -50,6 +51,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.old_sd": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveOldSecurityDescriptor(ev, &ev.ChangePermission) }, @@ -59,6 +61,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.path": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.ChangePermission.ObjectName }, @@ -68,6 +71,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.type": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.ChangePermission.ObjectType }, @@ -77,6 +81,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.user_domain": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.ChangePermission.UserDomain }, @@ -86,6 +91,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "change_permission.username": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.ChangePermission.UserName }, @@ -95,6 +101,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveContainerCreatedAt(ev, ev.BaseEvent.ContainerContext)) }, @@ -104,6 +111,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveContainerID(ev, ev.BaseEvent.ContainerContext) }, @@ -113,6 +121,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.runtime": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveContainerRuntime(ev, ev.BaseEvent.ContainerContext) }, @@ -122,6 +131,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "container.tags": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveContainerTags(ev, ev.BaseEvent.ContainerContext) }, @@ -132,6 +142,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.CreateNewFile.File) }, @@ -142,6 +153,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.CreateNewFile.File)) }, @@ -152,6 +164,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.CreateNewFile.File) }, @@ -162,6 +175,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.CreateNewFile.File)) }, @@ -172,6 +186,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.CreateNewFile.File) }, @@ -182,6 +197,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.CreateNewFile.File)) }, @@ -191,6 +207,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "create.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.CreateRegistryKey.Registry.KeyName }, @@ -200,6 +217,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "create.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.CreateRegistryKey.Registry.KeyName) }, @@ -210,6 +228,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.CreateRegistryKey.Registry.KeyPath }, @@ -220,6 +239,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.CreateRegistryKey.Registry.KeyPath) }, @@ -229,6 +249,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "create_key.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.CreateRegistryKey.Registry.KeyName }, @@ -238,6 +259,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "create_key.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.CreateRegistryKey.Registry.KeyName) }, @@ -248,6 +270,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.CreateRegistryKey.Registry.KeyPath }, @@ -258,6 +281,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.CreateRegistryKey.Registry.KeyPath) }, @@ -268,6 +292,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.DeleteFile.File) }, @@ -278,6 +303,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.DeleteFile.File)) }, @@ -288,6 +314,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.DeleteFile.File) }, @@ -298,6 +325,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.DeleteFile.File)) }, @@ -308,6 +336,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.DeleteFile.File) }, @@ -318,6 +347,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.DeleteFile.File)) }, @@ -327,6 +357,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "delete.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.DeleteRegistryKey.Registry.KeyName }, @@ -336,6 +367,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "delete.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.DeleteRegistryKey.Registry.KeyName) }, @@ -346,6 +378,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.DeleteRegistryKey.Registry.KeyPath }, @@ -356,6 +389,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.DeleteRegistryKey.Registry.KeyPath) }, @@ -365,6 +399,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "delete_key.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.DeleteRegistryKey.Registry.KeyName }, @@ -374,6 +409,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "delete_key.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.DeleteRegistryKey.Registry.KeyName) }, @@ -384,6 +420,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.DeleteRegistryKey.Registry.KeyPath }, @@ -394,6 +431,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.DeleteRegistryKey.Registry.KeyPath) }, @@ -403,6 +441,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.hostname": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveHostname(ev, &ev.BaseEvent) }, @@ -412,6 +451,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.origin": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.Origin }, @@ -421,6 +461,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.os": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.Os }, @@ -430,6 +471,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.service": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveService(ev, &ev.BaseEvent) }, @@ -439,6 +481,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "event.timestamp": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveEventTimestamp(ev, &ev.BaseEvent)) }, @@ -449,6 +492,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessCmdLine(ev, ev.Exec.Process) }, @@ -458,6 +502,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.ContainerID }, @@ -467,6 +512,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, ev.Exec.Process)) }, @@ -476,6 +522,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, ev.Exec.Process) }, @@ -485,6 +532,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, ev.Exec.Process) }, @@ -495,6 +543,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exec.Process.FileEvent) }, @@ -505,6 +554,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exec.Process.FileEvent)) }, @@ -515,6 +565,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Exec.Process.FileEvent) }, @@ -525,6 +576,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Exec.Process.FileEvent)) }, @@ -534,6 +586,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.PIDContext.Pid) }, @@ -543,6 +596,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exec.Process.PPid) }, @@ -552,6 +606,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveUser(ev, ev.Exec.Process) }, @@ -561,6 +616,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exec.user_sid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exec.Process.OwnerSidString }, @@ -570,6 +626,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.cause": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Cause) }, @@ -580,6 +637,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessCmdLine(ev, ev.Exit.Process) }, @@ -589,6 +647,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.code": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Code) }, @@ -598,6 +657,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.ContainerID }, @@ -607,6 +667,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, ev.Exit.Process)) }, @@ -616,6 +677,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, ev.Exit.Process) }, @@ -625,6 +687,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, ev.Exit.Process) }, @@ -635,6 +698,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exit.Process.FileEvent) }, @@ -645,6 +709,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.Exit.Process.FileEvent)) }, @@ -655,6 +720,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.Exit.Process.FileEvent) }, @@ -665,6 +731,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.Exit.Process.FileEvent)) }, @@ -674,6 +741,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.PIDContext.Pid) }, @@ -683,6 +751,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.Exit.Process.PPid) }, @@ -692,6 +761,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveUser(ev, ev.Exit.Process) }, @@ -701,6 +771,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "exit.user_sid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.Exit.Process.OwnerSidString }, @@ -710,6 +781,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.OpenRegistryKey.Registry.KeyName }, @@ -719,6 +791,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.OpenRegistryKey.Registry.KeyName) }, @@ -729,6 +802,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.OpenRegistryKey.Registry.KeyPath }, @@ -739,6 +813,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.OpenRegistryKey.Registry.KeyPath) }, @@ -748,6 +823,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open_key.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.OpenRegistryKey.Registry.KeyName }, @@ -757,6 +833,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "open_key.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.OpenRegistryKey.Registry.KeyName) }, @@ -767,6 +844,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.OpenRegistryKey.Registry.KeyPath }, @@ -777,6 +855,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.OpenRegistryKey.Registry.KeyPath) }, @@ -787,6 +866,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -814,6 +894,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.container.id": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -840,6 +921,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.created_at": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -867,6 +949,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -894,6 +977,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -922,6 +1006,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -950,6 +1035,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -978,6 +1064,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringArrayEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -1006,6 +1093,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntArrayEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.IntCache[field]; ok { return result @@ -1033,6 +1121,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) iterator := &ProcessAncestorsIterator{} return iterator.Len(ctx) }, @@ -1042,6 +1131,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.pid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -1068,6 +1158,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.ppid": return &eval.IntArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []int { + ctx.AppendResolvedField(field) if result, ok := ctx.IntCache[field]; ok { return result } @@ -1094,6 +1185,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.user": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if result, ok := ctx.StringCache[field]; ok { return result @@ -1121,6 +1213,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ancestors.user_sid": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) if result, ok := ctx.StringCache[field]; ok { return result } @@ -1148,6 +1241,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessCmdLine(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -1157,6 +1251,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.ContainerID }, @@ -1166,6 +1261,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.FieldHandlers.ResolveProcessCreatedAt(ev, &ev.BaseEvent.ProcessContext.Process)) }, @@ -1175,6 +1271,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvp(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -1184,6 +1281,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveProcessEnvs(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -1194,6 +1292,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent) }, @@ -1204,6 +1303,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent)) }, @@ -1214,6 +1314,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent) }, @@ -1224,6 +1325,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Process.FileEvent)) }, @@ -1234,6 +1336,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1246,6 +1349,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.container.id": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1258,6 +1362,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.created_at": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -1270,6 +1375,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.envp": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -1282,6 +1388,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.envs": return &eval.StringArrayEvaluator{ EvalFnc: func(ctx *eval.Context) []string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return []string{} @@ -1295,6 +1402,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1308,6 +1416,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileBasename(ev, &ev.BaseEvent.ProcessContext.Parent.FileEvent)) }, @@ -1318,6 +1427,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1331,6 +1441,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFilePath(ev, &ev.BaseEvent.ProcessContext.Parent.FileEvent)) }, @@ -1340,6 +1451,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -1352,6 +1464,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return 0 @@ -1364,6 +1477,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1376,6 +1490,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.parent.user_sid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) if !ev.BaseEvent.ProcessContext.HasParent() { return "" @@ -1388,6 +1503,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.pid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.PIDContext.Pid) }, @@ -1397,6 +1513,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.ppid": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return int(ev.BaseEvent.ProcessContext.Process.PPid) }, @@ -1406,6 +1523,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.user": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveUser(ev, &ev.BaseEvent.ProcessContext.Process) }, @@ -1415,6 +1533,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "process.user_sid": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.BaseEvent.ProcessContext.Process.OwnerSidString }, @@ -1425,6 +1544,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.RenameFile.New) }, @@ -1435,6 +1555,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.RenameFile.New)) }, @@ -1445,6 +1566,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.RenameFile.New) }, @@ -1455,6 +1577,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.RenameFile.New)) }, @@ -1465,6 +1588,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.RenameFile.New) }, @@ -1475,6 +1599,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.RenameFile.New)) }, @@ -1485,6 +1610,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.RenameFile.Old) }, @@ -1495,6 +1621,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.RenameFile.Old)) }, @@ -1505,6 +1632,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.RenameFile.Old) }, @@ -1515,6 +1643,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.RenameFile.Old)) }, @@ -1525,6 +1654,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.RenameFile.Old) }, @@ -1535,6 +1665,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.RenameFile.Old)) }, @@ -1544,6 +1675,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.Registry.KeyName }, @@ -1553,6 +1685,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.Registry.KeyName) }, @@ -1563,6 +1696,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.Registry.KeyPath }, @@ -1573,6 +1707,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.Registry.KeyPath) }, @@ -1582,6 +1717,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.registry.value_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.ValueName }, @@ -1591,6 +1727,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.registry.value_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.ValueName) }, @@ -1600,6 +1737,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set.value_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.ValueName }, @@ -1609,6 +1747,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.registry.key_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.Registry.KeyName }, @@ -1618,6 +1757,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.registry.key_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.Registry.KeyName) }, @@ -1628,6 +1768,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.Registry.KeyPath }, @@ -1638,6 +1779,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.Registry.KeyPath) }, @@ -1647,6 +1789,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.registry.value_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.ValueName }, @@ -1656,6 +1799,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.registry.value_name.length": return &eval.IntEvaluator{ EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.SetRegistryKeyValue.ValueName) }, @@ -1665,6 +1809,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval case "set_key_value.value_name": return &eval.StringEvaluator{ EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.SetRegistryKeyValue.ValueName }, @@ -1675,6 +1820,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFilePath(ev, &ev.WriteFile.File) }, @@ -1685,6 +1831,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFilePath(ev, &ev.WriteFile.File)) }, @@ -1695,6 +1842,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.WriteFile.File) }, @@ -1705,6 +1853,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.CaseInsensitiveCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFimFileBasename(ev, &ev.WriteFile.File)) }, @@ -1715,6 +1864,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.StringEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) string { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return ev.FieldHandlers.ResolveFileUserPath(ev, &ev.WriteFile.File) }, @@ -1725,6 +1875,7 @@ func (m *Model) GetEvaluator(field eval.Field, regID eval.RegisterID) (eval.Eval return &eval.IntEvaluator{ OpOverrides: eval.WindowsPathCmp, EvalFnc: func(ctx *eval.Context) int { + ctx.AppendResolvedField(field) ev := ctx.Event.(*Event) return len(ev.FieldHandlers.ResolveFileUserPath(ev, &ev.WriteFile.File)) }, From 1b84417a6e57871e1c328915f886fe4583682e7c Mon Sep 17 00:00:00 2001 From: Sylvain Afchain Date: Fri, 29 Nov 2024 13:20:18 +0100 Subject: [PATCH 33/59] [CWS] do not report imds error response (#31598) --- pkg/security/probe/probe_ebpf.go | 11 ++++++++--- pkg/security/secl/model/errors.go | 3 +++ pkg/security/secl/model/unmarshallers_linux.go | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pkg/security/probe/probe_ebpf.go b/pkg/security/probe/probe_ebpf.go index 84d38e34619e9..333a055c20052 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -1143,6 +1143,7 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { case model.UnloadModuleEventType: if _, err = event.UnloadModule.UnmarshalBinary(data[offset:]); err != nil { seclog.Errorf("failed to decode unload_module event: %s (offset %d, len %d)", err, offset, len(data)) + return } case model.SignalEventType: if _, err = event.Signal.UnmarshalBinary(data[offset:]); err != nil { @@ -1178,6 +1179,7 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { case model.DNSEventType: if read, err = event.NetworkContext.UnmarshalBinary(data[offset:]); err != nil { seclog.Errorf("failed to decode Network Context") + return } offset += read @@ -1195,12 +1197,15 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { case model.IMDSEventType: if read, err = event.NetworkContext.UnmarshalBinary(data[offset:]); err != nil { seclog.Errorf("failed to decode Network Context") + return } offset += read if _, err = event.IMDS.UnmarshalBinary(data[offset:]); err != nil { - // it's very possible we can't parse the IMDS body, as such let's put it as debug for now - seclog.Debugf("failed to decode IMDS event: %s (offset %d, len %d)", err, offset, len(data)) + if err != model.ErrNoUsefulData { + // it's very possible we can't parse the IMDS body, as such let's put it as debug for now + seclog.Debugf("failed to decode IMDS event: %s (offset %d, len %d)", err, offset, len(data)) + } return } defer p.Resolvers.ProcessResolver.UpdateAWSSecurityCredentials(event.PIDContext.Pid, event) @@ -1410,7 +1415,7 @@ func (p *EBPFProbe) validEventTypeForConfig(eventType string) bool { case "dns": return p.probe.IsNetworkEnabled() case "imds": - return p.probe.IsNetworkEnabled() && p.config.Probe.NetworkIngressEnabled + return p.probe.IsNetworkEnabled() case "packet": return p.probe.IsNetworkRawPacketEnabled() } diff --git a/pkg/security/secl/model/errors.go b/pkg/security/secl/model/errors.go index 5cba794e1b3f2..e1d664117c930 100644 --- a/pkg/security/secl/model/errors.go +++ b/pkg/security/secl/model/errors.go @@ -26,6 +26,9 @@ var ( // ErrIncorrectDataSize is returned when the data read size doesn't correspond to the expected one ErrIncorrectDataSize = errors.New("incorrect data size") + + // ErrNoUsefulData returned when there is no useful data + ErrNoUsefulData = errors.New("no useful data") ) // ErrInvalidKeyPath is returned when inode or mountid are not valid diff --git a/pkg/security/secl/model/unmarshallers_linux.go b/pkg/security/secl/model/unmarshallers_linux.go index f198adf0bba84..d6bdfb32fa825 100644 --- a/pkg/security/secl/model/unmarshallers_linux.go +++ b/pkg/security/secl/model/unmarshallers_linux.go @@ -1122,6 +1122,10 @@ func (e *IMDSEvent) UnmarshalBinary(data []byte) (int, error) { } e.fillFromIMDSHeader(resp.Header, "") + if resp.StatusCode != http.StatusOK { + return len(data), ErrNoUsefulData + } + // try to parse cloud provider specific data if e.CloudProvider == IMDSAWSCloudProvider { b := new(bytes.Buffer) From 3765564e824e2fd1e11cd8ac2180aa8810245c16 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Fri, 29 Nov 2024 13:46:25 +0100 Subject: [PATCH 34/59] [CWS] Use containerutils.ContainerID in cgroup resolver (#31586) --- pkg/security/probe/custom_events.go | 2 +- pkg/security/probe/field_handlers_ebpf.go | 4 ++-- pkg/security/probe/probe_ebpf.go | 8 ++++---- pkg/security/probe/probe_ebpfless.go | 6 +++--- pkg/security/proto/ebpfless/msg.go | 5 +++-- pkg/security/ptracer/container_context.go | 7 ++++--- pkg/security/ptracer/cws.go | 3 ++- pkg/security/ptracer/utils.go | 6 +++--- pkg/security/resolvers/cgroup/model/model.go | 6 +++--- pkg/security/resolvers/cgroup/resolver.go | 17 +++++++++-------- pkg/security/resolvers/hash/resolver_linux.go | 2 +- pkg/security/resolvers/mount/resolver.go | 4 ++-- pkg/security/resolvers/process/resolver_ebpf.go | 2 +- .../resolvers/process/resolver_ebpfless.go | 6 +++--- .../resolvers/usergroup/resolver_linux.go | 2 +- pkg/security/secl/containerutils/cgroup.go | 8 ++++---- pkg/security/secl/containerutils/helpers.go | 6 +++--- .../secl/containerutils/helpers_test.go | 2 +- 18 files changed, 50 insertions(+), 46 deletions(-) diff --git a/pkg/security/probe/custom_events.go b/pkg/security/probe/custom_events.go index b31d4ae688917..88ce01daa3c2d 100644 --- a/pkg/security/probe/custom_events.go +++ b/pkg/security/probe/custom_events.go @@ -84,7 +84,7 @@ func NewEBPFLessHelloMsgEvent(acc *events.AgentContainerContext, msg *ebpfless.H evt := EBPFLessHelloMsgEvent{ NSID: msg.NSID, } - evt.Container.ID = msg.ContainerContext.ID + evt.Container.ID = string(msg.ContainerContext.ID) if tagger != nil { tags, err := tags.GetTagsOfContainer(tagger, containerutils.ContainerID(msg.ContainerContext.ID)) diff --git a/pkg/security/probe/field_handlers_ebpf.go b/pkg/security/probe/field_handlers_ebpf.go index 2f643304e1529..fad69cf7bbfd2 100644 --- a/pkg/security/probe/field_handlers_ebpf.go +++ b/pkg/security/probe/field_handlers_ebpf.go @@ -190,7 +190,7 @@ func (fh *EBPFFieldHandlers) ResolveMountRootPath(ev *model.Event, e *model.Moun // ResolveContainerContext queries the cgroup resolver to retrieve the ContainerContext of the event func (fh *EBPFFieldHandlers) ResolveContainerContext(ev *model.Event) (*model.ContainerContext, bool) { if ev.ContainerContext.ContainerID != "" && !ev.ContainerContext.Resolved { - if containerContext, _ := fh.resolvers.CGroupResolver.GetWorkload(string(ev.ContainerContext.ContainerID)); containerContext != nil { + if containerContext, _ := fh.resolvers.CGroupResolver.GetWorkload(ev.ContainerContext.ContainerID); containerContext != nil { if containerContext.CGroupFlags.IsContainer() { ev.ContainerContext = &containerContext.ContainerContext } @@ -525,7 +525,7 @@ func (fh *EBPFFieldHandlers) ResolveCGroupID(ev *model.Event, e *model.CGroupCon entry.Process.CGroup.CGroupID = containerutils.CGroupID(cgroup) entry.CGroup.CGroupID = containerutils.CGroupID(cgroup) - containerID, _ := containerutils.GetContainerFromCgroup(string(entry.CGroup.CGroupID)) + containerID, _ := containerutils.GetContainerFromCgroup(entry.CGroup.CGroupID) entry.Process.ContainerID = containerutils.ContainerID(containerID) entry.ContainerID = containerutils.ContainerID(containerID) } else { diff --git a/pkg/security/probe/probe_ebpf.go b/pkg/security/probe/probe_ebpf.go index 333a055c20052..f5135589812ba 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -810,12 +810,12 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { if pce != nil { path, err := p.Resolvers.DentryResolver.Resolve(event.CgroupWrite.File.PathKey, true) if err == nil && path != "" { - path = filepath.Dir(string(path)) - pce.CGroup.CGroupID = containerutils.CGroupID(path) - pce.Process.CGroup.CGroupID = containerutils.CGroupID(path) + cgroupID := containerutils.CGroupID(filepath.Dir(string(path))) + pce.CGroup.CGroupID = cgroupID + pce.Process.CGroup.CGroupID = cgroupID cgroupFlags := containerutils.CGroupFlags(event.CgroupWrite.CGroupFlags) if cgroupFlags.IsContainer() { - containerID, _ := containerutils.GetContainerFromCgroup(path) + containerID, _ := containerutils.GetContainerFromCgroup(cgroupID) pce.ContainerID = containerutils.ContainerID(containerID) pce.Process.ContainerID = containerutils.ContainerID(containerID) } diff --git a/pkg/security/probe/probe_ebpfless.go b/pkg/security/probe/probe_ebpfless.go index c7bfb2456e480..040af49fd827a 100644 --- a/pkg/security/probe/probe_ebpfless.go +++ b/pkg/security/probe/probe_ebpfless.go @@ -48,7 +48,7 @@ type client struct { conn net.Conn probe *EBPFLessProbe nsID uint64 - containerID string + containerID containerutils.ContainerID containerName string } @@ -62,7 +62,7 @@ type EBPFLessProbe struct { sync.Mutex Resolvers *resolvers.EBPFLessResolvers - containerContexts map[string]*ebpfless.ContainerContext + containerContexts map[containerutils.ContainerID]*ebpfless.ContainerContext // Constants and configuration opts Opts @@ -675,7 +675,7 @@ func NewEBPFLessProbe(probe *Probe, config *config.Config, opts Opts) (*EBPFLess cancelFnc: cancelFnc, clients: make(map[net.Conn]*client), processKiller: processKiller, - containerContexts: make(map[string]*ebpfless.ContainerContext), + containerContexts: make(map[containerutils.ContainerID]*ebpfless.ContainerContext), } resolversOpts := resolvers.Opts{ diff --git a/pkg/security/proto/ebpfless/msg.go b/pkg/security/proto/ebpfless/msg.go index 7ca6d7a8d5888..e8210ce48de67 100644 --- a/pkg/security/proto/ebpfless/msg.go +++ b/pkg/security/proto/ebpfless/msg.go @@ -9,6 +9,7 @@ package ebpfless import ( "encoding/json" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "modernc.org/mathutil" ) @@ -93,7 +94,7 @@ const ( // ContainerContext defines a container context type ContainerContext struct { - ID string + ID containerutils.ContainerID CreatedAt uint64 } @@ -303,7 +304,7 @@ type SyscallMsg struct { SpanContext *SpanContext `json:",omitempty"` Timestamp uint64 Retval int64 - ContainerID string + ContainerID containerutils.ContainerID Exec *ExecSyscallMsg `json:",omitempty"` Open *OpenSyscallMsg `json:",omitempty"` Fork *ForkSyscallMsg `json:",omitempty"` diff --git a/pkg/security/ptracer/container_context.go b/pkg/security/ptracer/container_context.go index 27af2e24ef269..76748eb8540dd 100644 --- a/pkg/security/ptracer/container_context.go +++ b/pkg/security/ptracer/container_context.go @@ -13,6 +13,7 @@ import ( "time" "github.com/DataDog/datadog-agent/pkg/security/proto/ebpfless" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" ) // ECSMetadata defines ECS metadata @@ -37,11 +38,11 @@ func retrieveECSMetadata(url string) (*ECSMetadata, error) { func retrieveEnvMetadata(ctx *ebpfless.ContainerContext) { if id := os.Getenv("DD_CONTAINER_ID"); id != "" { - ctx.ID = id + ctx.ID = containerutils.ContainerID(id) } } -func newContainerContext(containerID string) (*ebpfless.ContainerContext, error) { +func newContainerContext(containerID containerutils.ContainerID) (*ebpfless.ContainerContext, error) { ctx := &ebpfless.ContainerContext{ ID: containerID, } @@ -54,7 +55,7 @@ func newContainerContext(containerID string) (*ebpfless.ContainerContext, error) if data != nil { if data.DockerID != "" && ctx.ID == "" { // only set the container ID if we previously failed to retrieve it from proc - ctx.ID = data.DockerID + ctx.ID = containerutils.ContainerID(data.DockerID) } } } diff --git a/pkg/security/ptracer/cws.go b/pkg/security/ptracer/cws.go index 828229fffe990..2082190ddf400 100644 --- a/pkg/security/ptracer/cws.go +++ b/pkg/security/ptracer/cws.go @@ -25,6 +25,7 @@ import ( "github.com/vmihailenco/msgpack/v5" "github.com/DataDog/datadog-agent/pkg/security/proto/ebpfless" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" ) const ( @@ -66,7 +67,7 @@ type CWSPtracerCtx struct { wg sync.WaitGroup cancel context.Context cancelFnc context.CancelFunc - containerID string + containerID containerutils.ContainerID probeAddr string client net.Conn clientReady chan bool diff --git a/pkg/security/ptracer/utils.go b/pkg/security/ptracer/utils.go index 7edfc091c612b..3b1b92eab4e38 100644 --- a/pkg/security/ptracer/utils.go +++ b/pkg/security/ptracer/utils.go @@ -74,7 +74,7 @@ func getProcControlGroupsFromFile(path string) ([]controlGroup, error) { } -func getContainerIDFromProcFS(cgroupPath string) (string, error) { +func getContainerIDFromProcFS(cgroupPath string) (containerutils.ContainerID, error) { cgroups, err := getProcControlGroupsFromFile(cgroupPath) if err != nil { return "", err @@ -88,11 +88,11 @@ func getContainerIDFromProcFS(cgroupPath string) (string, error) { return "", nil } -func getCurrentProcContainerID() (string, error) { +func getCurrentProcContainerID() (containerutils.ContainerID, error) { return getContainerIDFromProcFS("/proc/self/cgroup") } -func getProcContainerID(pid int) (string, error) { +func getProcContainerID(pid int) (containerutils.ContainerID, error) { return getContainerIDFromProcFS(fmt.Sprintf("/proc/%d/cgroup", pid)) } diff --git a/pkg/security/resolvers/cgroup/model/model.go b/pkg/security/resolvers/cgroup/model/model.go index 8abaf74cd47bb..1990c8511e033 100644 --- a/pkg/security/resolvers/cgroup/model/model.go +++ b/pkg/security/resolvers/cgroup/model/model.go @@ -29,15 +29,15 @@ type CacheEntry struct { } // NewCacheEntry returns a new instance of a CacheEntry -func NewCacheEntry(containerID string, cgroupFlags uint64, pids ...uint32) (*CacheEntry, error) { +func NewCacheEntry(containerID containerutils.ContainerID, cgroupFlags uint64, pids ...uint32) (*CacheEntry, error) { newCGroup := CacheEntry{ Deleted: atomic.NewBool(false), CGroupContext: model.CGroupContext{ - CGroupID: containerutils.GetCgroupFromContainer(containerutils.ContainerID(containerID), containerutils.CGroupFlags(cgroupFlags)), + CGroupID: containerutils.GetCgroupFromContainer(containerID, containerutils.CGroupFlags(cgroupFlags)), CGroupFlags: containerutils.CGroupFlags(cgroupFlags), }, ContainerContext: model.ContainerContext{ - ContainerID: containerutils.ContainerID(containerID), + ContainerID: containerID, }, PIDs: make(map[uint32]bool, 10), } diff --git a/pkg/security/resolvers/cgroup/resolver.go b/pkg/security/resolvers/cgroup/resolver.go index 28a85576fee8a..0e7b7b07b1cd2 100644 --- a/pkg/security/resolvers/cgroup/resolver.go +++ b/pkg/security/resolvers/cgroup/resolver.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/golang-lru/v2/simplelru" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/seclog" "github.com/DataDog/datadog-agent/pkg/security/utils" @@ -47,7 +48,7 @@ type ResolverInterface interface { type Resolver struct { *utils.Notifier[Event, *cgroupModel.CacheEntry] sync.RWMutex - workloads *simplelru.LRU[string, *cgroupModel.CacheEntry] + workloads *simplelru.LRU[containerutils.ContainerID, *cgroupModel.CacheEntry] } // NewResolver returns a new cgroups monitor @@ -55,7 +56,7 @@ func NewResolver() (*Resolver, error) { cr := &Resolver{ Notifier: utils.NewNotifier[Event, *cgroupModel.CacheEntry](), } - workloads, err := simplelru.NewLRU(1024, func(_ string, value *cgroupModel.CacheEntry) { + workloads, err := simplelru.NewLRU(1024, func(_ containerutils.ContainerID, value *cgroupModel.CacheEntry) { value.CallReleaseCallback() value.Deleted.Store(true) @@ -77,7 +78,7 @@ func (cr *Resolver) AddPID(process *model.ProcessCacheEntry) { cr.Lock() defer cr.Unlock() - entry, exists := cr.workloads.Get(string(process.ContainerID)) + entry, exists := cr.workloads.Get(process.ContainerID) if exists { entry.AddPID(process.Pid) return @@ -85,7 +86,7 @@ func (cr *Resolver) AddPID(process *model.ProcessCacheEntry) { var err error // create new entry now - newCGroup, err := cgroupModel.NewCacheEntry(string(process.ContainerID), uint64(process.CGroup.CGroupFlags), process.Pid) + newCGroup, err := cgroupModel.NewCacheEntry(process.ContainerID, uint64(process.CGroup.CGroupFlags), process.Pid) if err != nil { seclog.Errorf("couldn't create new cgroup_resolver cache entry: %v", err) return @@ -93,13 +94,13 @@ func (cr *Resolver) AddPID(process *model.ProcessCacheEntry) { newCGroup.CreatedAt = uint64(process.ProcessContext.ExecTime.UnixNano()) // add the new CGroup to the cache - cr.workloads.Add(string(process.ContainerID), newCGroup) + cr.workloads.Add(process.ContainerID, newCGroup) cr.NotifyListeners(CGroupCreated, newCGroup) } // GetWorkload returns the workload referenced by the provided ID -func (cr *Resolver) GetWorkload(id string) (*cgroupModel.CacheEntry, bool) { +func (cr *Resolver) GetWorkload(id containerutils.ContainerID) (*cgroupModel.CacheEntry, bool) { cr.RLock() defer cr.RUnlock() @@ -120,7 +121,7 @@ func (cr *Resolver) DelPID(pid uint32) { } // DelPIDWithID removes a PID from the cgroup cache entry referenced by the provided ID -func (cr *Resolver) DelPIDWithID(id string, pid uint32) { +func (cr *Resolver) DelPIDWithID(id containerutils.ContainerID, pid uint32) { cr.Lock() defer cr.Unlock() @@ -139,7 +140,7 @@ func (cr *Resolver) deleteWorkloadPID(pid uint32, workload *cgroupModel.CacheEnt // check if the workload should be deleted if len(workload.PIDs) <= 0 { - cr.workloads.Remove(string(workload.ContainerID)) + cr.workloads.Remove(workload.ContainerID) } } diff --git a/pkg/security/resolvers/hash/resolver_linux.go b/pkg/security/resolvers/hash/resolver_linux.go index df33bc537caea..5fdef9e8cb298 100644 --- a/pkg/security/resolvers/hash/resolver_linux.go +++ b/pkg/security/resolvers/hash/resolver_linux.go @@ -285,7 +285,7 @@ func (resolver *Resolver) HashFileEvent(eventType model.EventType, ctrID contain // add pid one for hash resolution outside of a container rootPIDs := []uint32{1, pid} if resolver.cgroupResolver != nil { - w, ok := resolver.cgroupResolver.GetWorkload(string(ctrID)) + w, ok := resolver.cgroupResolver.GetWorkload(ctrID) if ok { rootPIDs = w.GetPIDs() } diff --git a/pkg/security/resolvers/mount/resolver.go b/pkg/security/resolvers/mount/resolver.go index 9a112d818546e..2a0dbf7a52e2b 100644 --- a/pkg/security/resolvers/mount/resolver.go +++ b/pkg/security/resolvers/mount/resolver.go @@ -453,7 +453,7 @@ func (mr *Resolver) resolveMountPath(mountID uint32, device uint32, pid uint32, } // force a resolution here to make sure the LRU keeps doing its job and doesn't evict important entries - workload, _ := mr.cgroupsResolver.GetWorkload(string(containerID)) + workload, _ := mr.cgroupsResolver.GetWorkload(containerID) path, source, origin, err := mr.getMountPath(mountID, device, pid) if err == nil { @@ -494,7 +494,7 @@ func (mr *Resolver) resolveMount(mountID uint32, device uint32, pid uint32, cont } // force a resolution here to make sure the LRU keeps doing its job and doesn't evict important entries - workload, _ := mr.cgroupsResolver.GetWorkload(string(containerID)) + workload, _ := mr.cgroupsResolver.GetWorkload(containerID) mount, source, origin := mr.lookupMount(mountID, device, pid) if mount != nil { diff --git a/pkg/security/resolvers/process/resolver_ebpf.go b/pkg/security/resolvers/process/resolver_ebpf.go index 89aaac120ca4e..3d4b3d71f5c92 100644 --- a/pkg/security/resolvers/process/resolver_ebpf.go +++ b/pkg/security/resolvers/process/resolver_ebpf.go @@ -605,7 +605,7 @@ func (p *EBPFResolver) deleteEntry(pid uint32, exitTime time.Time) { } if p.cgroupResolver != nil { - p.cgroupResolver.DelPIDWithID(string(entry.ContainerID), entry.Pid) + p.cgroupResolver.DelPIDWithID(entry.ContainerID, entry.Pid) } entry.Exit(exitTime) diff --git a/pkg/security/resolvers/process/resolver_ebpfless.go b/pkg/security/resolvers/process/resolver_ebpfless.go index 474ba4dd66607..e77edbe749788 100644 --- a/pkg/security/resolvers/process/resolver_ebpfless.go +++ b/pkg/security/resolvers/process/resolver_ebpfless.go @@ -104,7 +104,7 @@ func (p *EBPFLessResolver) AddForkEntry(key CacheResolverKey, ppid uint32, ts ui // NewEntry returns a new entry func (p *EBPFLessResolver) NewEntry(key CacheResolverKey, ppid uint32, file string, argv []string, argsTruncated bool, - envs []string, envsTruncated bool, ctrID string, ts uint64, tty string, source uint64) *model.ProcessCacheEntry { + envs []string, envsTruncated bool, ctrID containerutils.ContainerID, ts uint64, tty string, source uint64) *model.ProcessCacheEntry { entry := p.processCacheEntryPool.Get() entry.PIDContext.Pid = key.Pid @@ -146,7 +146,7 @@ func (p *EBPFLessResolver) NewEntry(key CacheResolverKey, ppid uint32, file stri // AddExecEntry adds an entry to the local cache and returns the newly created entry func (p *EBPFLessResolver) AddExecEntry(key CacheResolverKey, ppid uint32, file string, argv []string, argsTruncated bool, - envs []string, envsTruncated bool, ctrID string, ts uint64, tty string) *model.ProcessCacheEntry { + envs []string, envsTruncated bool, ctrID containerutils.ContainerID, ts uint64, tty string) *model.ProcessCacheEntry { if key.Pid == 0 { return nil } @@ -163,7 +163,7 @@ func (p *EBPFLessResolver) AddExecEntry(key CacheResolverKey, ppid uint32, file // AddProcFSEntry add a procfs entry func (p *EBPFLessResolver) AddProcFSEntry(key CacheResolverKey, ppid uint32, file string, argv []string, argsTruncated bool, - envs []string, envsTruncated bool, ctrID string, ts uint64, tty string) *model.ProcessCacheEntry { + envs []string, envsTruncated bool, ctrID containerutils.ContainerID, ts uint64, tty string) *model.ProcessCacheEntry { if key.Pid == 0 { return nil } diff --git a/pkg/security/resolvers/usergroup/resolver_linux.go b/pkg/security/resolvers/usergroup/resolver_linux.go index 39d54b8b670ed..e8e4179ca7bb0 100644 --- a/pkg/security/resolvers/usergroup/resolver_linux.go +++ b/pkg/security/resolvers/usergroup/resolver_linux.go @@ -80,7 +80,7 @@ func (r *Resolver) getFilesystem(containerID containerutils.ContainerID) (fs.FS, var fsys fs.FS if containerID != "" { - cgroupEntry, found := r.cgroupResolver.GetWorkload(string(containerID)) + cgroupEntry, found := r.cgroupResolver.GetWorkload(containerID) if !found { return nil, fmt.Errorf("failed to resolve container %s", containerID) } diff --git a/pkg/security/secl/containerutils/cgroup.go b/pkg/security/secl/containerutils/cgroup.go index fe9c444a06f04..f6fc93b635f34 100644 --- a/pkg/security/secl/containerutils/cgroup.go +++ b/pkg/security/secl/containerutils/cgroup.go @@ -56,11 +56,11 @@ func GetCGroupManager(cgroup string) (string, CGroupFlags) { } // GetContainerFromCgroup extracts the container ID from a cgroup name -func GetContainerFromCgroup(cgroup string) (string, CGroupFlags) { - cgroup = strings.TrimLeft(cgroup, "/") +func GetContainerFromCgroup(cgroup CGroupID) (ContainerID, CGroupFlags) { + cgroupID := strings.TrimLeft(string(cgroup), "/") for runtimePrefix, runtimeFlag := range RuntimePrefixes { - if strings.HasPrefix(cgroup, runtimePrefix) { - return cgroup[len(runtimePrefix):], CGroupFlags(runtimeFlag) + if strings.HasPrefix(cgroupID, runtimePrefix) { + return ContainerID(cgroupID[len(runtimePrefix):]), CGroupFlags(runtimeFlag) } } return "", 0 diff --git a/pkg/security/secl/containerutils/helpers.go b/pkg/security/secl/containerutils/helpers.go index 701e4f9cd1d9f..80211d0671234 100644 --- a/pkg/security/secl/containerutils/helpers.go +++ b/pkg/security/secl/containerutils/helpers.go @@ -34,7 +34,7 @@ func isSystemdCgroup(cgroup string) bool { } // FindContainerID extracts the first sub string that matches the pattern of a container ID along with the container flags induced from the container runtime prefix -func FindContainerID(s string) (string, uint64) { +func FindContainerID(s string) (ContainerID, uint64) { match := containerIDPattern.FindIndex([]byte(s)) if match == nil { if isSystemdCgroup(s) { @@ -69,9 +69,9 @@ func FindContainerID(s string) (string, uint64) { // it starts or/and ends the initial string cgroupID := s[match[0]:match[1]] - containerID, flags := GetContainerFromCgroup(cgroupID) + containerID, flags := GetContainerFromCgroup(CGroupID(cgroupID)) if containerID == "" { - return cgroupID, uint64(flags) + return ContainerID(cgroupID), uint64(flags) } return containerID, uint64(flags) diff --git a/pkg/security/secl/containerutils/helpers_test.go b/pkg/security/secl/containerutils/helpers_test.go index 12a810542fbf6..5b479b3860d12 100644 --- a/pkg/security/secl/containerutils/helpers_test.go +++ b/pkg/security/secl/containerutils/helpers_test.go @@ -93,7 +93,7 @@ func TestFindContainerID(t *testing.T) { for _, test := range testCases { containerID, containerFlags := FindContainerID(test.input) - assert.Equal(t, test.output, containerID) + assert.Equal(t, test.output, string(containerID)) assert.Equal(t, uint64(test.flags), containerFlags, "wrong flags for container %s", containerID) } } From 6273684cbbae3462612b4c497e098a11154099aa Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Fri, 29 Nov 2024 13:46:32 +0100 Subject: [PATCH 35/59] [CWS] do not start/stop manually the remote tagger in the resolver (#31599) --- pkg/security/resolvers/tags/resolver.go | 25 ++----------------- pkg/security/tests/fake_tags_resolver.go | 31 ------------------------ 2 files changed, 2 insertions(+), 54 deletions(-) diff --git a/pkg/security/resolvers/tags/resolver.go b/pkg/security/resolvers/tags/resolver.go index 180fcefd9f025..051122e4436ec 100644 --- a/pkg/security/resolvers/tags/resolver.go +++ b/pkg/security/resolvers/tags/resolver.go @@ -13,7 +13,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/seclog" "github.com/DataDog/datadog-agent/pkg/security/utils" - "github.com/DataDog/datadog-agent/pkg/util/log" ) // Event defines the tags event type @@ -26,8 +25,6 @@ const ( // Tagger defines a Tagger for the Tags Resolver type Tagger interface { - Start(ctx context.Context) error - Stop() error Tag(entity types.EntityID, cardinality types.TagCardinality) ([]string, error) GlobalTags(cardinality types.TagCardinality) ([]string, error) } @@ -74,31 +71,13 @@ func (t *DefaultResolver) GetValue(id containerutils.ContainerID, tag string) st } // Start the resolver -func (t *DefaultResolver) Start(ctx context.Context) error { - if t.tagger == nil { - return nil - } - - go func() { - if err := t.tagger.Start(ctx); err != nil { - log.Errorf("failed to init tagger: %s", err) - } - }() - - go func() { - <-ctx.Done() - _ = t.tagger.Stop() - }() - +func (t *DefaultResolver) Start(_ context.Context) error { return nil } // Stop the resolver func (t *DefaultResolver) Stop() error { - if t.tagger == nil { - return nil - } - return t.tagger.Stop() + return nil } // NewDefaultResolver returns a new default tags resolver diff --git a/pkg/security/tests/fake_tags_resolver.go b/pkg/security/tests/fake_tags_resolver.go index a8b1694349a3c..c1a5f9b7882d4 100644 --- a/pkg/security/tests/fake_tags_resolver.go +++ b/pkg/security/tests/fake_tags_resolver.go @@ -9,7 +9,6 @@ package tests import ( - "context" "fmt" "sync" @@ -26,16 +25,6 @@ type FakeTagger struct { containerIDs []string } -// Start the tagger -func (fr *FakeTagger) Start(_ context.Context) error { - return nil -} - -// Stop the tagger -func (fr *FakeTagger) Stop() error { - return nil -} - // Tag returns the tags for the given id func (fr *FakeTagger) Tag(entity types.EntityID, _ types.TagCardinality) ([]string, error) { containerID := entity.GetID() @@ -68,16 +57,6 @@ func NewFakeTaggerDifferentImageNames() tags.Tagger { // FakeMonoTagger represents a fake mono tagger type FakeMonoTagger struct{} -// Start the tagger -func (fmr *FakeMonoTagger) Start(_ context.Context) error { - return nil -} - -// Stop the tagger -func (fmr *FakeMonoTagger) Stop() error { - return nil -} - // Tag returns the tags for the given id func (fmr *FakeMonoTagger) Tag(entity types.EntityID, _ types.TagCardinality) ([]string, error) { return []string{"container_id:" + entity.GetID(), "image_name:fake_ubuntu", "image_tag:latest"}, nil @@ -103,16 +82,6 @@ type FakeManualTagger struct { nextSelectors []*cgroupModel.WorkloadSelector } -// Start the tagger -func (fmr *FakeManualTagger) Start(_ context.Context) error { - return nil -} - -// Stop the tagger -func (fmr *FakeManualTagger) Stop() error { - return nil -} - // SpecifyNextSelector specifies the next image name and tag to be resolved func (fmr *FakeManualTagger) SpecifyNextSelector(selector *cgroupModel.WorkloadSelector) { fmr.Lock() From 0e9db52da9552ee74f58b92a3f739b83a70577d2 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Fri, 29 Nov 2024 14:20:17 +0100 Subject: [PATCH 36/59] [CWS] Fix GetEventTags prototype on macOS (#31603) --- pkg/security/probe/probe_others.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/security/probe/probe_others.go b/pkg/security/probe/probe_others.go index b9dc61a9ae2e4..daf1ab253299a 100644 --- a/pkg/security/probe/probe_others.go +++ b/pkg/security/probe/probe_others.go @@ -68,7 +68,7 @@ func (p *Probe) GetService(_ *model.Event) string { } // GetEventTags returns the event tags -func (p *Probe) GetEventTags(_ string) []string { +func (p *Probe) GetEventTags(_ containerutils.ContainerID) []string { return nil } From 96c83b8e8627a8371586908d545e50ffdde484cf Mon Sep 17 00:00:00 2001 From: David Ortiz Date: Fri, 29 Nov 2024 14:29:27 +0100 Subject: [PATCH 37/59] [tagger/remote] Make constructor private (#31602) --- comp/core/tagger/impl-remote/remote.go | 6 ++---- comp/core/tagger/impl-remote/remote_test.go | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/comp/core/tagger/impl-remote/remote.go b/comp/core/tagger/impl-remote/remote.go index 68e56f3832847..111b14fc52895 100644 --- a/comp/core/tagger/impl-remote/remote.go +++ b/comp/core/tagger/impl-remote/remote.go @@ -97,7 +97,7 @@ type Options struct { // NewComponent returns a remote tagger func NewComponent(req Requires) (Provides, error) { - remoteTagger, err := NewRemoteTagger(req.Params, req.Config, req.Log, req.Telemetry) + remoteTagger, err := newRemoteTagger(req.Params, req.Config, req.Log, req.Telemetry) if err != nil { return Provides{}, err @@ -116,9 +116,7 @@ func NewComponent(req Requires) (Provides, error) { }, nil } -// NewRemoteTagger creates a new remote tagger. -// TODO: (components) remove once we pass the remote tagger instance to pkg/security/resolvers/tags/resolver.go -func NewRemoteTagger(params tagger.RemoteParams, cfg config.Component, log log.Component, telemetryComp coretelemetry.Component) (tagger.Component, error) { +func newRemoteTagger(params tagger.RemoteParams, cfg config.Component, log log.Component, telemetryComp coretelemetry.Component) (tagger.Component, error) { telemetryStore := telemetry.NewStore(telemetryComp) target, err := params.RemoteTarget(cfg) diff --git a/comp/core/tagger/impl-remote/remote_test.go b/comp/core/tagger/impl-remote/remote_test.go index 22a2354b4609e..60159eff7943f 100644 --- a/comp/core/tagger/impl-remote/remote_test.go +++ b/comp/core/tagger/impl-remote/remote_test.go @@ -39,7 +39,7 @@ func TestStart(t *testing.T) { log := logmock.New(t) telemetry := nooptelemetry.GetCompatComponent() - remoteTagger, err := NewRemoteTagger(params, cfg, log, telemetry) + remoteTagger, err := newRemoteTagger(params, cfg, log, telemetry) require.NoError(t, err) err = remoteTagger.Start(context.TODO()) require.NoError(t, err) @@ -61,7 +61,7 @@ func TestStartDoNotBlockIfServerIsNotAvailable(t *testing.T) { log := logmock.New(t) telemetry := nooptelemetry.GetCompatComponent() - remoteTagger, err := NewRemoteTagger(params, cfg, log, telemetry) + remoteTagger, err := newRemoteTagger(params, cfg, log, telemetry) require.NoError(t, err) err = remoteTagger.Start(context.TODO()) require.NoError(t, err) From 83ed39be3392ae7af0fb0e6763e496c2514b9969 Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Fri, 29 Nov 2024 14:51:25 +0100 Subject: [PATCH 38/59] Stop tagging the root module with `6.XX.0-devel` (#31608) --- tasks/libs/common/gomodules.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks/libs/common/gomodules.py b/tasks/libs/common/gomodules.py index 357ab03dc515e..8f33fa55ebb52 100644 --- a/tasks/libs/common/gomodules.py +++ b/tasks/libs/common/gomodules.py @@ -255,15 +255,14 @@ def __compute_dependencies(self): # Remove github.com/DataDog/datadog-agent/ from each line return [line[len(AGENT_MODULE_PATH_PREFIX) :] for line in output.strip().splitlines()] - # FIXME: Change when Agent 6 and Agent 7 releases are decoupled def tag(self, agent_version): """Return the module tag name for a given Agent version. >>> mods = [GoModule("."), GoModule("pkg/util/log")] >>> [mod.tag("7.27.0") for mod in mods] - [["6.27.0", "7.27.0"], ["pkg/util/log/v0.27.0"]] + [["7.27.0"], ["pkg/util/log/v0.27.0"]] """ if self.path == ".": - return ["6" + agent_version[1:], "7" + agent_version[1:]] + return ["7" + agent_version[1:]] return [f"{self.path}/{self.__version(agent_version)}"] From 191174d36d08a917b40e92c9d8e2dd7c194668eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Fri, 29 Nov 2024 15:32:19 +0100 Subject: [PATCH 39/59] update build images (#31592) --- .circleci/config.yml | 2 +- .gitlab-ci.yml | 44 ++++++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7cf19e2302bab..034e8b60da323 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ experimental: templates: job_template: &job_template docker: - - image: gcr.io/datadoghq/agent-circleci-runner:v48372186-ff395e52 + - image: gcr.io/datadoghq/agent-circleci-runner:v50094600-7b86dd80 environment: USE_SYSTEM_LIBS: "1" working_directory: /go/src/github.com/DataDog/datadog-agent diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 936abc4efddfb..40bbf63917f41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -173,49 +173,49 @@ variables: # To use images from datadog-agent-buildimages dev branches, set the corresponding # SUFFIX variable to _test_only DATADOG_AGENT_BUILDIMAGES_SUFFIX: "" - DATADOG_AGENT_BUILDIMAGES: v48815877-9bfad02c + DATADOG_AGENT_BUILDIMAGES: v50094600-7b86dd80 DATADOG_AGENT_WINBUILDIMAGES_SUFFIX: "" - DATADOG_AGENT_WINBUILDIMAGES: v48815877-9bfad02c + DATADOG_AGENT_WINBUILDIMAGES: v50094600-7b86dd80 DATADOG_AGENT_ARMBUILDIMAGES_SUFFIX: "" - DATADOG_AGENT_ARMBUILDIMAGES: v48815877-9bfad02c + DATADOG_AGENT_ARMBUILDIMAGES: v50094600-7b86dd80 DATADOG_AGENT_SYSPROBE_BUILDIMAGES_SUFFIX: "" - DATADOG_AGENT_SYSPROBE_BUILDIMAGES: v48815877-9bfad02c + DATADOG_AGENT_SYSPROBE_BUILDIMAGES: v50094600-7b86dd80 DATADOG_AGENT_BTF_GEN_BUILDIMAGES_SUFFIX: "" - DATADOG_AGENT_BTF_GEN_BUILDIMAGES: v48815877-9bfad02c + DATADOG_AGENT_BTF_GEN_BUILDIMAGES: v50094600-7b86dd80 # New images to enable different version per image - not used yet - CI_IMAGE_BTF_GEN: v48815877-9bfad02c + CI_IMAGE_BTF_GEN: v50094600-7b86dd80 CI_IMAGE_BTF_GEN_SUFFIX: "" - CI_IMAGE_DEB_X64: v48815877-9bfad02c + CI_IMAGE_DEB_X64: v50094600-7b86dd80 CI_IMAGE_DEB_X64_SUFFIX: "" - CI_IMAGE_DEB_ARM64: v48815877-9bfad02c + CI_IMAGE_DEB_ARM64: v50094600-7b86dd80 CI_IMAGE_DEB_ARM64_SUFFIX: "" - CI_IMAGE_DEB_ARMHF: v48815877-9bfad02c + CI_IMAGE_DEB_ARMHF: v50094600-7b86dd80 CI_IMAGE_DEB_ARMHF_SUFFIX: "" - CI_IMAGE_DD_AGENT_TESTING: v48815877-9bfad02c + CI_IMAGE_DD_AGENT_TESTING: v50094600-7b86dd80 CI_IMAGE_DD_AGENT_TESTING_SUFFIX: "" - CI_IMAGE_DOCKER_X64: v48815877-9bfad02c + CI_IMAGE_DOCKER_X64: v50094600-7b86dd80 CI_IMAGE_DOCKER_X64_SUFFIX: "" - CI_IMAGE_DOCKER_ARM64: v48815877-9bfad02c + CI_IMAGE_DOCKER_ARM64: v50094600-7b86dd80 CI_IMAGE_DOCKER_ARM64_SUFFIX: "" - CI_IMAGE_GITLAB_AGENT_DEPLOY: v48815877-9bfad02c + CI_IMAGE_GITLAB_AGENT_DEPLOY: v50094600-7b86dd80 CI_IMAGE_GITLAB_AGENT_DEPLOY_SUFFIX: "" - CI_IMAGE_LINUX_GLIBC_2_17_X64: v48815877-9bfad02c + CI_IMAGE_LINUX_GLIBC_2_17_X64: v50094600-7b86dd80 CI_IMAGE_LINUX_GLIBC_2_17_X64_SUFFIX: "" - CI_IMAGE_LINUX_GLIBC_2_23_ARM64: v48815877-9bfad02c + CI_IMAGE_LINUX_GLIBC_2_23_ARM64: v50094600-7b86dd80 CI_IMAGE_LINUX_GLIBC_2_23_ARM64_SUFFIX: "" - CI_IMAGE_SYSTEM_PROBE_X64: v48815877-9bfad02c + CI_IMAGE_SYSTEM_PROBE_X64: v50094600-7b86dd80 CI_IMAGE_SYSTEM_PROBE_X64_SUFFIX: "" - CI_IMAGE_SYSTEM_PROBE_ARM64: v48815877-9bfad02c + CI_IMAGE_SYSTEM_PROBE_ARM64: v50094600-7b86dd80 CI_IMAGE_SYSTEM_PROBE_ARM64_SUFFIX: "" - CI_IMAGE_RPM_X64: v48815877-9bfad02c + CI_IMAGE_RPM_X64: v50094600-7b86dd80 CI_IMAGE_RPM_X64_SUFFIX: "" - CI_IMAGE_RPM_ARM64: v48815877-9bfad02c + CI_IMAGE_RPM_ARM64: v50094600-7b86dd80 CI_IMAGE_RPM_ARM64_SUFFIX: "" - CI_IMAGE_RPM_ARMHF: v48815877-9bfad02c + CI_IMAGE_RPM_ARMHF: v50094600-7b86dd80 CI_IMAGE_RPM_ARMHF_SUFFIX: "" - CI_IMAGE_WIN_1809_X64: v48815877-9bfad02c + CI_IMAGE_WIN_1809_X64: v50094600-7b86dd80 CI_IMAGE_WIN_1809_X64_SUFFIX: "" - CI_IMAGE_WIN_LTSC2022_X64: v48815877-9bfad02c + CI_IMAGE_WIN_LTSC2022_X64: v50094600-7b86dd80 CI_IMAGE_WIN_LTSC2022_X64_SUFFIX: "" DATADOG_AGENT_EMBEDDED_PATH: /opt/datadog-agent/embedded From 33fe40a79cf537518b8d5578730781bdaf81f4c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Fri, 29 Nov 2024 15:36:17 +0100 Subject: [PATCH 40/59] omnibus: don't build the agent twice on heroku (#31572) --- omnibus/config/software/datadog-agent.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/omnibus/config/software/datadog-agent.rb b/omnibus/config/software/datadog-agent.rb index cabf4557c735c..139b18f469612 100644 --- a/omnibus/config/software/datadog-agent.rb +++ b/omnibus/config/software/datadog-agent.rb @@ -85,14 +85,14 @@ command "inv -e rtloader.install" include_sds = "" - if linux_target? + if linux_target? && !heroku_target? include_sds = "--include-sds" # we only support SDS on Linux targets for now end - command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg}", env: env - + agent_bin = "" if heroku_target? - command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent", env: env + agent_bin = "--agent-bin=bin/agent/core-agent" end + command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} #{agent_bin}", env: env end if osx_target? From 04718495a798518f09d645ccb539eebc6d349426 Mon Sep 17 00:00:00 2001 From: val06 Date: Fri, 29 Nov 2024 16:38:35 +0200 Subject: [PATCH 41/59] [EBPF] docker testutils: store patternScanner in base config (#31605) --- .../module/impl_linux_test.go | 7 ++- pkg/network/protocols/amqp/server.go | 5 +- pkg/network/protocols/kafka/server.go | 6 ++- pkg/network/protocols/mongo/server.go | 6 ++- pkg/network/protocols/mysql/server.go | 5 +- pkg/network/protocols/postgres/server.go | 6 ++- pkg/network/protocols/redis/server.go | 5 +- .../protocols/tls/gotls/testutil/server.go | 6 ++- pkg/network/protocols/tls/nodejs/nodejs.go | 6 ++- pkg/network/usm/monitor_tls_test.go | 5 +- .../usm/sharedlibraries/testutil/testutil.go | 2 +- pkg/util/testutil/docker/config.go | 53 +++++++++---------- pkg/util/testutil/docker/run.go | 24 +++------ pkg/util/testutil/patternscanner.go | 4 +- 14 files changed, 83 insertions(+), 57 deletions(-) diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go index 822e08866a0a1..d99063dfac193 100644 --- a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go +++ b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go @@ -56,6 +56,7 @@ import ( proccontainersmocks "github.com/DataDog/datadog-agent/pkg/process/util/containers/mocks" "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/DataDog/datadog-agent/pkg/util/kernel" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) @@ -795,13 +796,15 @@ func TestDocker(t *testing.T) { url, mockContainerProvider := setupDiscoveryModule(t) dir, _ := testutil.CurDir() + scanner, err := globalutils.NewScanner(regexp.MustCompile("Serving.*"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("foo-server", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile("Serving.*"), + scanner, dockerutils.EmptyEnv, filepath.Join(dir, "testdata", "docker-compose.yml")) - err := dockerutils.Run(t, dockerCfg) + err = dockerutils.Run(t, dockerCfg) require.NoError(t, err) proc, err := procfs.NewDefaultFS() diff --git a/pkg/network/protocols/amqp/server.go b/pkg/network/protocols/amqp/server.go index b6d5e14338e4a..ffd049cb36667 100644 --- a/pkg/network/protocols/amqp/server.go +++ b/pkg/network/protocols/amqp/server.go @@ -7,6 +7,7 @@ package amqp import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "os" "path/filepath" "regexp" @@ -46,10 +47,12 @@ func RunServer(t testing.TB, serverAddr, serverPort string, enableTLS bool) erro dir, _ := httpUtils.CurDir() + scanner, err := globalutils.NewScanner(startupRegexp, globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("amqp", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - startupRegexp, + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/kafka/server.go b/pkg/network/protocols/kafka/server.go index b1d892d985814..95c66ef23b8a1 100644 --- a/pkg/network/protocols/kafka/server.go +++ b/pkg/network/protocols/kafka/server.go @@ -8,6 +8,8 @@ package kafka import ( + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" + "github.com/stretchr/testify/require" "os" "path/filepath" "regexp" @@ -40,10 +42,12 @@ func RunServer(t testing.TB, serverAddr, serverPort string) error { return err } + scanner, err := globalutils.NewScanner(regexp.MustCompile(`.*started \(kafka.server.KafkaServer\).*`), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("kafka", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(`.*started \(kafka.server.KafkaServer\).*`), + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/mongo/server.go b/pkg/network/protocols/mongo/server.go index 3abf2f69300a2..59717d099a9ae 100644 --- a/pkg/network/protocols/mongo/server.go +++ b/pkg/network/protocols/mongo/server.go @@ -7,6 +7,8 @@ package mongo import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" + "github.com/stretchr/testify/require" "path/filepath" "regexp" "testing" @@ -31,10 +33,12 @@ func RunServer(t testing.TB, serverAddress, serverPort string) error { "MONGO_PASSWORD=" + Pass, } dir, _ := testutil.CurDir() + scanner, err := globalutils.NewScanner(regexp.MustCompile(fmt.Sprintf(".*Waiting for connections.*port.*:%s.*", serverPort)), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("mongo", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(fmt.Sprintf(".*Waiting for connections.*port.*:%s.*", serverPort)), + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/mysql/server.go b/pkg/network/protocols/mysql/server.go index 2ead1b2cbe9b5..1ea9ebb1ac1ec 100644 --- a/pkg/network/protocols/mysql/server.go +++ b/pkg/network/protocols/mysql/server.go @@ -7,6 +7,7 @@ package mysql import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "path/filepath" "regexp" "testing" @@ -45,10 +46,12 @@ func RunServer(t testing.TB, serverAddr, serverPort string, withTLS bool) error env = append(env, "MYSQL_TLS_ARGS=--require-secure-transport --ssl-cert=/mysql-test/cert.pem.0 --ssl-key=/mysql-test/server.key") } + scanner, err := globalutils.NewScanner(regexp.MustCompile(fmt.Sprintf(".*ready for connections.*port: %s.*", serverPort)), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("MYSQL", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(fmt.Sprintf(".*ready for connections.*port: %s.*", serverPort)), + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/postgres/server.go b/pkg/network/protocols/postgres/server.go index 8b95627347c16..2b4bd55bde9c6 100644 --- a/pkg/network/protocols/postgres/server.go +++ b/pkg/network/protocols/postgres/server.go @@ -10,6 +10,7 @@ package postgres import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "io" "os" "path/filepath" @@ -48,10 +49,13 @@ func RunServer(t testing.TB, serverAddr, serverPort string, enableTLS bool) erro "ENCRYPTION_MODE=" + encryptionMode, "TESTDIR=" + testDataDir, } + + scanner, err := globalutils.NewScanner(regexp.MustCompile(fmt.Sprintf(".*listening on IPv4 address \"0.0.0.0\", port %s", serverPort)), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("postgres", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(fmt.Sprintf(".*listening on IPv4 address \"0.0.0.0\", port %s", serverPort)), + scanner, env, filepath.Join(testDataDir, "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/redis/server.go b/pkg/network/protocols/redis/server.go index 4adf5191dc8bb..56d36fec8855c 100644 --- a/pkg/network/protocols/redis/server.go +++ b/pkg/network/protocols/redis/server.go @@ -11,6 +11,7 @@ package redis import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "path/filepath" "regexp" "testing" @@ -42,10 +43,12 @@ func RunServer(t testing.TB, serverAddr, serverPort string, enableTLS bool) erro env = append(env, args) } + scanner, err := globalutils.NewScanner(regexp.MustCompile(".*Ready to accept connections"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("redis", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(".*Ready to accept connections"), + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/tls/gotls/testutil/server.go b/pkg/network/protocols/tls/gotls/testutil/server.go index 9ae6e47339709..36a58b003c0e6 100644 --- a/pkg/network/protocols/tls/gotls/testutil/server.go +++ b/pkg/network/protocols/tls/gotls/testutil/server.go @@ -6,6 +6,8 @@ package testutil import ( + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" + "github.com/stretchr/testify/require" "regexp" "testing" @@ -21,10 +23,12 @@ func RunServer(t testing.TB, serverPort string) error { t.Helper() dir, _ := testutil.CurDir() + scanner, err := globalutils.NewScanner(regexp.MustCompile("go-httpbin listening on https://0.0.0.0:8080"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("https-gotls", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile("go-httpbin listening on https://0.0.0.0:8080"), + scanner, env, dir+"/../testdata/docker-compose.yml") return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/tls/nodejs/nodejs.go b/pkg/network/protocols/tls/nodejs/nodejs.go index c4b8b3682a25c..fb7dc18f60a9a 100644 --- a/pkg/network/protocols/tls/nodejs/nodejs.go +++ b/pkg/network/protocols/tls/nodejs/nodejs.go @@ -9,6 +9,8 @@ package nodejs import ( + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" + "github.com/stretchr/testify/require" "io" "os" "path" @@ -63,10 +65,12 @@ func RunServerNodeJS(t *testing.T, key, cert, serverPort string) error { "TESTDIR=" + dir + "/testdata", } + scanner, err := globalutils.NewScanner(regexp.MustCompile("Server running at https.*"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("nodejs-server", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile("Server running at https.*"), + scanner, env, path.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/usm/monitor_tls_test.go b/pkg/network/usm/monitor_tls_test.go index 4a609e0ac9a30..24f0f7b3a5d2f 100644 --- a/pkg/network/usm/monitor_tls_test.go +++ b/pkg/network/usm/monitor_tls_test.go @@ -12,6 +12,7 @@ import ( "bytes" "crypto/tls" "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "io" "math/rand" nethttp "net/http" @@ -112,10 +113,12 @@ func (s *tlsSuite) TestHTTPSViaLibraryIntegration() { require.NoError(t, err) dir = path.Join(dir, "testdata", "musl") + scanner, err := globalutils.NewScanner(regexp.MustCompile("started"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("musl-alpine", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile("started"), + scanner, dockerutils.EmptyEnv, path.Join(dir, "/docker-compose.yml")) err = dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/usm/sharedlibraries/testutil/testutil.go b/pkg/network/usm/sharedlibraries/testutil/testutil.go index a5f36ab69c216..ff10b58e7367d 100644 --- a/pkg/network/usm/sharedlibraries/testutil/testutil.go +++ b/pkg/network/usm/sharedlibraries/testutil/testutil.go @@ -31,7 +31,7 @@ var mux sync.Mutex // handle to the given paths. func OpenFromProcess(t *testing.T, programExecutable string, paths ...string) (*exec.Cmd, error) { cmd := exec.Command(programExecutable, paths...) - patternScanner, err := protocolstestutil.NewScanner(regexp.MustCompile("awaiting signal"), protocolstestutil.NoPattern, make(chan struct{}, 1)) + patternScanner, err := protocolstestutil.NewScanner(regexp.MustCompile("awaiting signal"), protocolstestutil.NoPattern) require.NoError(t, err, "failed to create pattern scanner") cmd.Stdout = patternScanner cmd.Stderr = patternScanner diff --git a/pkg/util/testutil/docker/config.go b/pkg/util/testutil/docker/config.go index c7b34281a979e..d5f374afb79eb 100644 --- a/pkg/util/testutil/docker/config.go +++ b/pkg/util/testutil/docker/config.go @@ -9,8 +9,9 @@ package docker import ( "fmt" - "regexp" "time" + + "github.com/DataDog/datadog-agent/pkg/util/testutil" ) const ( @@ -49,7 +50,7 @@ var _ LifecycleConfig = (*composeConfig)(nil) type LifecycleConfig interface { Timeout() time.Duration Retries() int - LogPattern() *regexp.Regexp + PatternScanner() *testutil.PatternScanner Env() []string Name() string command() string @@ -66,9 +67,9 @@ func (b baseConfig) Retries() int { return b.retries } -// LogPattern returns the regex pattern to match logs for readiness -func (b baseConfig) LogPattern() *regexp.Regexp { - return b.logPattern +// PatternScanner returns the patternScanner object used to match logs for readiness and completion of the target container/s +func (b baseConfig) PatternScanner() *testutil.PatternScanner { + return b.patternScanner } // Env returns the environment variables to set for the container/s @@ -83,11 +84,11 @@ func (b baseConfig) Name() string { // baseConfig contains shared configurations for both Docker and Docker Compose. type baseConfig struct { - name string // Container name for docker or an alias for docker-compose - timeout time.Duration // Timeout for the entire operation. - retries int // Number of retries for starting. - logPattern *regexp.Regexp // Regex pattern to match logs for readiness. - env []string // Environment variables to set. + name string // Container name for docker or an alias for docker-compose + timeout time.Duration // Timeout for the entire operation. + retries int // Number of retries for starting. + patternScanner *testutil.PatternScanner // Used to monitor container logs for known patterns. + env []string // Environment variables to set. } // runConfig contains specific configurations for Docker containers, embedding BaseConfig. @@ -153,16 +154,20 @@ func (c composeConfig) commandArgs(t subCommandType) []string { } } +func createBaseConfig(name string, timeout time.Duration, retries int, patternScanner *testutil.PatternScanner, env []string) baseConfig { + return baseConfig{ + name: name, + timeout: timeout, + retries: retries, + patternScanner: patternScanner, + env: env, + } +} + // NewRunConfig creates a new runConfig instance for a single docker container. -func NewRunConfig(name string, timeout time.Duration, retries int, logPattern *regexp.Regexp, env []string, imageName, binary string, binaryArgs []string, mounts map[string]string) LifecycleConfig { +func NewRunConfig(name string, timeout time.Duration, retries int, patternScanner *testutil.PatternScanner, env []string, imageName, binary string, binaryArgs []string, mounts map[string]string) LifecycleConfig { return runConfig{ - baseConfig: baseConfig{ - timeout: timeout, - retries: retries, - logPattern: logPattern, - env: env, - name: name, - }, + baseConfig: createBaseConfig(name, timeout, retries, patternScanner, env), ImageName: imageName, Binary: binary, BinaryArgs: binaryArgs, @@ -171,15 +176,9 @@ func NewRunConfig(name string, timeout time.Duration, retries int, logPattern *r } // NewComposeConfig creates a new composeConfig instance for the docker-compose. -func NewComposeConfig(name string, timeout time.Duration, retries int, logPattern *regexp.Regexp, env []string, file string) LifecycleConfig { +func NewComposeConfig(name string, timeout time.Duration, retries int, patternScanner *testutil.PatternScanner, env []string, file string) LifecycleConfig { return composeConfig{ - baseConfig: baseConfig{ - timeout: timeout, - retries: retries, - logPattern: logPattern, - env: env, - name: name, - }, - File: file, + baseConfig: createBaseConfig(name, timeout, retries, patternScanner, env), + File: file, } } diff --git a/pkg/util/testutil/docker/run.go b/pkg/util/testutil/docker/run.go index acde40acd969c..c92bb8484ae4e 100644 --- a/pkg/util/testutil/docker/run.go +++ b/pkg/util/testutil/docker/run.go @@ -13,10 +13,6 @@ import ( "os/exec" "testing" "time" - - "github.com/stretchr/testify/require" - - "github.com/DataDog/datadog-agent/pkg/util/testutil" ) // Run starts the container/s and ensures their successful invocation @@ -26,17 +22,13 @@ import ( func Run(t testing.TB, cfg LifecycleConfig) error { var err error var ctx context.Context - var scanner *testutil.PatternScanner for i := 0; i < cfg.Retries(); i++ { t.Helper() // Ensuring no previous instances exists. killPreviousInstances(cfg) - //TODO: in the following PR move the scanner to be a field of the LifecycleConfig - scanner, err = testutil.NewScanner(cfg.LogPattern(), testutil.NoPattern, make(chan struct{}, 1)) - require.NoError(t, err, "failed to create pattern scanner") // attempt to start the container/s - ctx, err = run(t, cfg, scanner) + ctx, err = run(t, cfg) if err != nil { t.Logf("could not start %s: %v", cfg.Name(), err) //this iteration failed, retry @@ -44,13 +36,13 @@ func Run(t testing.TB, cfg LifecycleConfig) error { } //check container logs for successful start - if err = checkReadiness(ctx, cfg, scanner); err == nil { + if err = checkReadiness(ctx, cfg); err == nil { // target container/s started successfully, we can stop the retries loop and finish here t.Logf("%s command succeeded. %s container is running", cfg.command(), cfg.Name()) return nil } t.Logf("[Attempt #%v] failed to start %s server: %v", i+1, cfg.Name(), err) - scanner.PrintLogs(t) + cfg.PatternScanner().PrintLogs(t) time.Sleep(5 * time.Second) } return err @@ -71,7 +63,7 @@ func killPreviousInstances(cfg LifecycleConfig) { _ = c.Run() } -func run(t testing.TB, cfg LifecycleConfig, scanner *testutil.PatternScanner) (context.Context, error) { +func run(t testing.TB, cfg LifecycleConfig) (context.Context, error) { ctx, cancel := context.WithCancel(context.Background()) t.Cleanup(cancel) @@ -80,8 +72,8 @@ func run(t testing.TB, cfg LifecycleConfig, scanner *testutil.PatternScanner) (c //prepare the command cmd := exec.CommandContext(ctx, cfg.command(), args...) cmd.Env = append(cmd.Env, cfg.Env()...) - cmd.Stdout = scanner - cmd.Stderr = scanner + cmd.Stdout = cfg.PatternScanner() + cmd.Stderr = cfg.PatternScanner() // run asynchronously and don't wait for the command to finish if err := cmd.Start(); err != nil { @@ -97,14 +89,14 @@ func run(t testing.TB, cfg LifecycleConfig, scanner *testutil.PatternScanner) (c return ctx, nil } -func checkReadiness(ctx context.Context, cfg LifecycleConfig, scanner *testutil.PatternScanner) error { +func checkReadiness(ctx context.Context, cfg LifecycleConfig) error { for { select { case <-ctx.Done(): if err := ctx.Err(); err != nil { return fmt.Errorf("failed to start the container %s due to: %w", cfg.Name(), err) } - case <-scanner.DoneChan: + case <-cfg.PatternScanner().DoneChan: return nil case <-time.After(cfg.Timeout()): return fmt.Errorf("failed to start the container %s, reached timeout of %v", cfg.Name(), cfg.Timeout()) diff --git a/pkg/util/testutil/patternscanner.go b/pkg/util/testutil/patternscanner.go index 0610ad30afd72..06dc357466033 100644 --- a/pkg/util/testutil/patternscanner.go +++ b/pkg/util/testutil/patternscanner.go @@ -43,14 +43,14 @@ type PatternScanner struct { // NewScanner returns a new instance of PatternScanner. // at least one of the startPattern/finishPattern should be provided. -func NewScanner(startPattern, finishPattern *regexp.Regexp, doneChan chan struct{}) (*PatternScanner, error) { +func NewScanner(startPattern, finishPattern *regexp.Regexp) (*PatternScanner, error) { if startPattern == nil && finishPattern == nil { return nil, errors.New("at least one pattern should be provided") } return &PatternScanner{ startPattern: startPattern, finishPattern: finishPattern, - DoneChan: doneChan, + DoneChan: make(chan struct{}, 1), stopOnce: sync.Once{}, // skip looking for start pattern if not provided startPatternFound: startPattern == nil, From ad40689b877dbf92b7144518f46d2a8f55f29e2e Mon Sep 17 00:00:00 2001 From: Pierre Gimalac Date: Fri, 29 Nov 2024 15:57:23 +0100 Subject: [PATCH 42/59] Update testify to 1.10.0 (#31520) --- LICENSE-3rdparty.csv | 1 + comp/api/api/def/go.mod | 1 + comp/api/api/def/go.sum | 4 ++-- comp/api/authtoken/go.mod | 2 +- comp/api/authtoken/go.sum | 4 ++-- comp/core/config/go.mod | 2 +- comp/core/config/go.sum | 4 ++-- comp/core/flare/types/go.mod | 2 +- comp/core/flare/types/go.sum | 4 ++-- comp/core/hostname/hostnameinterface/go.mod | 2 +- comp/core/hostname/hostnameinterface/go.sum | 4 ++-- comp/core/log/def/go.mod | 2 +- comp/core/log/def/go.sum | 4 ++-- comp/core/log/impl-trace/go.mod | 2 +- comp/core/log/impl-trace/go.sum | 3 ++- comp/core/log/impl/go.mod | 2 +- comp/core/log/impl/go.sum | 4 ++-- comp/core/log/mock/go.sum | 4 ++-- comp/core/secrets/go.mod | 2 +- comp/core/secrets/go.sum | 4 ++-- comp/core/status/go.mod | 2 +- comp/core/status/go.sum | 4 ++-- comp/core/status/statusimpl/go.mod | 2 +- comp/core/status/statusimpl/go.sum | 4 ++-- comp/core/tagger/types/go.mod | 2 +- comp/core/tagger/types/go.sum | 4 ++-- comp/core/tagger/utils/go.mod | 2 +- comp/core/tagger/utils/go.sum | 4 ++-- comp/core/telemetry/go.mod | 2 +- comp/core/telemetry/go.sum | 4 ++-- comp/def/go.mod | 2 +- comp/def/go.sum | 4 ++-- comp/forwarder/defaultforwarder/go.mod | 2 +- comp/forwarder/defaultforwarder/go.sum | 3 ++- .../orchestrator/orchestratorinterface/go.mod | 2 +- .../orchestrator/orchestratorinterface/go.sum | 3 ++- comp/logs/agent/config/go.mod | 2 +- comp/logs/agent/config/go.sum | 4 ++-- comp/otelcol/collector-contrib/def/go.mod | 2 +- comp/otelcol/collector-contrib/def/go.sum | 4 ++-- comp/otelcol/collector-contrib/impl/go.mod | 2 +- comp/otelcol/collector-contrib/impl/go.sum | 3 ++- comp/otelcol/converter/def/go.mod | 1 + comp/otelcol/converter/def/go.sum | 4 ++-- comp/otelcol/converter/impl/go.mod | 2 +- comp/otelcol/converter/impl/go.sum | 4 ++-- comp/otelcol/ddflareextension/def/go.mod | 1 + comp/otelcol/ddflareextension/def/go.sum | 4 ++-- comp/otelcol/ddflareextension/impl/go.mod | 2 +- comp/otelcol/ddflareextension/impl/go.sum | 3 ++- comp/otelcol/logsagentpipeline/go.mod | 2 +- comp/otelcol/logsagentpipeline/go.sum | 4 ++-- .../logsagentpipelineimpl/go.mod | 2 +- .../logsagentpipelineimpl/go.sum | 3 ++- .../components/exporter/datadogexporter/go.mod | 2 +- .../components/exporter/datadogexporter/go.sum | 4 ++-- .../components/exporter/logsagentexporter/go.mod | 2 +- .../components/exporter/logsagentexporter/go.sum | 3 ++- .../exporter/serializerexporter/go.mod | 2 +- .../exporter/serializerexporter/go.sum | 3 ++- .../otelcol/otlp/components/metricsclient/go.mod | 2 +- .../otelcol/otlp/components/metricsclient/go.sum | 4 ++-- .../processor/infraattributesprocessor/go.mod | 2 +- .../processor/infraattributesprocessor/go.sum | 4 ++-- .../otlp/components/statsprocessor/go.mod | 2 +- .../otlp/components/statsprocessor/go.sum | 3 ++- comp/otelcol/otlp/testutil/go.mod | 2 +- comp/otelcol/otlp/testutil/go.sum | 3 ++- comp/serializer/compression/go.mod | 2 +- comp/serializer/compression/go.sum | 4 ++-- comp/trace/agent/def/go.sum | 4 ++-- go.mod | 2 +- go.sum | 3 ++- internal/tools/go.mod | 2 +- internal/tools/go.sum | 3 ++- internal/tools/modparser/go.mod | 2 +- internal/tools/modparser/go.sum | 4 ++-- pkg/aggregator/ckey/go.mod | 2 +- pkg/aggregator/ckey/go.sum | 4 ++-- pkg/api/go.mod | 2 +- pkg/api/go.sum | 4 ++-- .../snmp/internal/checkconfig/config_test.go | 16 ++++++++-------- pkg/config/env/go.mod | 2 +- pkg/config/env/go.sum | 4 ++-- pkg/config/mock/go.mod | 2 +- pkg/config/mock/go.sum | 4 ++-- pkg/config/model/go.mod | 2 +- pkg/config/model/go.sum | 4 ++-- pkg/config/nodetreemodel/go.mod | 2 +- pkg/config/nodetreemodel/go.sum | 4 ++-- pkg/config/remote/go.mod | 2 +- pkg/config/remote/go.sum | 4 ++-- pkg/config/setup/go.mod | 2 +- pkg/config/setup/go.sum | 4 ++-- pkg/config/structure/go.mod | 2 +- pkg/config/structure/go.sum | 4 ++-- pkg/config/teeconfig/go.sum | 4 ++-- pkg/config/utils/go.mod | 2 +- pkg/config/utils/go.sum | 4 ++-- pkg/errors/go.mod | 2 +- pkg/errors/go.sum | 4 ++-- pkg/gohai/go.mod | 2 +- pkg/gohai/go.sum | 4 ++-- pkg/linters/components/pkgconfigusage/go.mod | 2 +- pkg/linters/components/pkgconfigusage/go.sum | 4 ++-- pkg/logs/auditor/go.mod | 2 +- pkg/logs/auditor/go.sum | 4 ++-- pkg/logs/client/go.mod | 2 +- pkg/logs/client/go.sum | 4 ++-- pkg/logs/diagnostic/go.mod | 2 +- pkg/logs/diagnostic/go.sum | 4 ++-- pkg/logs/message/go.mod | 2 +- pkg/logs/message/go.sum | 4 ++-- pkg/logs/metrics/go.mod | 2 +- pkg/logs/metrics/go.sum | 4 ++-- pkg/logs/pipeline/go.mod | 2 +- pkg/logs/pipeline/go.sum | 4 ++-- pkg/logs/processor/go.mod | 2 +- pkg/logs/processor/go.sum | 4 ++-- pkg/logs/sds/go.mod | 2 +- pkg/logs/sds/go.sum | 4 ++-- pkg/logs/sender/go.mod | 2 +- pkg/logs/sender/go.sum | 4 ++-- pkg/logs/sources/go.mod | 2 +- pkg/logs/sources/go.sum | 4 ++-- pkg/logs/status/utils/go.mod | 2 +- pkg/logs/status/utils/go.sum | 4 ++-- pkg/logs/util/testutils/go.sum | 4 ++-- pkg/metrics/go.mod | 2 +- pkg/metrics/go.sum | 4 ++-- pkg/networkdevice/profile/go.mod | 2 +- pkg/networkdevice/profile/go.sum | 4 ++-- pkg/obfuscate/go.mod | 2 +- pkg/obfuscate/go.sum | 4 ++-- pkg/orchestrator/model/go.sum | 4 ++-- pkg/process/util/api/go.mod | 2 +- pkg/process/util/api/go.sum | 4 ++-- pkg/proto/go.mod | 2 +- pkg/proto/go.sum | 4 ++-- pkg/remoteconfig/state/go.mod | 2 +- pkg/remoteconfig/state/go.sum | 4 ++-- pkg/security/secl/go.mod | 2 +- pkg/security/secl/go.sum | 4 ++-- pkg/security/seclwin/go.sum | 4 ++-- pkg/serializer/go.mod | 2 +- pkg/serializer/go.sum | 3 ++- pkg/status/health/go.mod | 2 +- pkg/status/health/go.sum | 4 ++-- pkg/tagset/go.mod | 2 +- pkg/tagset/go.sum | 4 ++-- pkg/telemetry/go.mod | 2 +- pkg/telemetry/go.sum | 4 ++-- pkg/trace/go.mod | 2 +- pkg/trace/go.sum | 3 ++- pkg/trace/stats/oteltest/go.mod | 2 +- pkg/trace/stats/oteltest/go.sum | 3 ++- pkg/util/backoff/go.mod | 2 +- pkg/util/backoff/go.sum | 4 ++-- pkg/util/buf/go.mod | 2 +- pkg/util/buf/go.sum | 4 ++-- pkg/util/cache/go.mod | 2 +- pkg/util/cache/go.sum | 4 ++-- pkg/util/cgroups/go.mod | 2 +- pkg/util/cgroups/go.sum | 4 ++-- pkg/util/common/go.mod | 2 +- pkg/util/common/go.sum | 4 ++-- pkg/util/containers/image/go.mod | 2 +- pkg/util/containers/image/go.sum | 4 ++-- pkg/util/defaultpaths/go.sum | 4 ++-- pkg/util/executable/go.mod | 2 +- pkg/util/executable/go.sum | 4 ++-- pkg/util/filesystem/go.mod | 2 +- pkg/util/filesystem/go.sum | 4 ++-- pkg/util/flavor/go.mod | 2 +- pkg/util/flavor/go.sum | 4 ++-- pkg/util/fxutil/go.mod | 2 +- pkg/util/fxutil/go.sum | 4 ++-- pkg/util/grpc/go.mod | 2 +- pkg/util/grpc/go.sum | 4 ++-- pkg/util/hostname/validate/go.mod | 2 +- pkg/util/hostname/validate/go.sum | 4 ++-- pkg/util/http/go.mod | 2 +- pkg/util/http/go.sum | 4 ++-- pkg/util/json/go.mod | 2 +- pkg/util/json/go.sum | 4 ++-- pkg/util/log/go.mod | 2 +- pkg/util/log/go.sum | 4 ++-- pkg/util/log/setup/go.mod | 2 +- pkg/util/log/setup/go.sum | 4 ++-- pkg/util/optional/go.mod | 2 +- pkg/util/optional/go.sum | 4 ++-- pkg/util/scrubber/go.mod | 2 +- pkg/util/scrubber/go.sum | 4 ++-- pkg/util/sort/go.mod | 2 +- pkg/util/sort/go.sum | 4 ++-- pkg/util/startstop/go.mod | 2 +- pkg/util/startstop/go.sum | 4 ++-- pkg/util/statstracker/go.mod | 2 +- pkg/util/statstracker/go.sum | 4 ++-- pkg/util/system/go.mod | 2 +- pkg/util/system/go.sum | 4 ++-- pkg/util/testutil/go.mod | 2 +- pkg/util/testutil/go.sum | 4 ++-- pkg/util/utilizationtracker/go.mod | 2 +- pkg/util/utilizationtracker/go.sum | 4 ++-- pkg/util/uuid/go.sum | 4 ++-- pkg/util/winutil/go.mod | 2 +- pkg/util/winutil/go.sum | 4 ++-- pkg/version/go.mod | 2 +- pkg/version/go.sum | 4 ++-- test/fakeintake/go.mod | 2 +- test/fakeintake/go.sum | 4 ++-- test/new-e2e/go.mod | 2 +- test/new-e2e/go.sum | 4 ++-- test/otel/go.mod | 2 +- test/otel/go.sum | 4 ++-- 216 files changed, 334 insertions(+), 315 deletions(-) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 32bfe097dee1d..d964afa55b338 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -2143,6 +2143,7 @@ core,github.com/stormcat24/protodep/pkg/logger,Apache-2.0,Copyright Akinori Yama core,github.com/streadway/amqp,BSD-2-Clause,"Copyright (c) 2012-2019, Sean Treadway, SoundCloud Ltd" core,github.com/stretchr/objx,MIT,"Copyright (c) 2014 Stretchr, Inc | Copyright (c) 2017-2018 objx contributors" core,github.com/stretchr/testify/assert,MIT,"Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors" +core,github.com/stretchr/testify/assert/yaml,MIT,"Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors" core,github.com/stretchr/testify/mock,MIT,"Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors" core,github.com/stretchr/testify/require,MIT,"Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors" core,github.com/stretchr/testify/suite,MIT,"Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors" diff --git a/comp/api/api/def/go.mod b/comp/api/api/def/go.mod index ffcd616197878..d0e801edaa33c 100644 --- a/comp/api/api/def/go.mod +++ b/comp/api/api/def/go.mod @@ -5,6 +5,7 @@ go 1.22.0 require go.uber.org/fx v1.22.2 require ( + github.com/stretchr/testify v1.10.0 // indirect go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect diff --git a/comp/api/api/def/go.sum b/comp/api/api/def/go.sum index 1f4bc972fc0d2..101b78c6cf5d6 100644 --- a/comp/api/api/def/go.sum +++ b/comp/api/api/def/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw= diff --git a/comp/api/authtoken/go.mod b/comp/api/authtoken/go.mod index 02392ef9508b1..04da7d39a3ba8 100644 --- a/comp/api/authtoken/go.mod +++ b/comp/api/authtoken/go.mod @@ -47,7 +47,7 @@ require ( github.com/DataDog/datadog-agent/pkg/api v0.56.0 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0 github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 ) diff --git a/comp/api/authtoken/go.sum b/comp/api/authtoken/go.sum index bbea552f0eb1a..a29a7509778c0 100644 --- a/comp/api/authtoken/go.sum +++ b/comp/api/authtoken/go.sum @@ -206,8 +206,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/core/config/go.mod b/comp/core/config/go.mod index c425778ab3813..92b478489fc7e 100644 --- a/comp/core/config/go.mod +++ b/comp/core/config/go.mod @@ -44,7 +44,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 github.com/DataDog/viper v1.13.5 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 ) diff --git a/comp/core/config/go.sum b/comp/core/config/go.sum index fddfe23b60921..965c7b7e107bc 100644 --- a/comp/core/config/go.sum +++ b/comp/core/config/go.sum @@ -210,8 +210,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/core/flare/types/go.mod b/comp/core/flare/types/go.mod index 15158d6218c92..323fc3f4191f4 100644 --- a/comp/core/flare/types/go.mod +++ b/comp/core/flare/types/go.mod @@ -10,7 +10,7 @@ require ( ) require ( - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.10.0 // indirect go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect diff --git a/comp/core/flare/types/go.sum b/comp/core/flare/types/go.sum index 926ff7c85c149..101b78c6cf5d6 100644 --- a/comp/core/flare/types/go.sum +++ b/comp/core/flare/types/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw= diff --git a/comp/core/hostname/hostnameinterface/go.mod b/comp/core/hostname/hostnameinterface/go.mod index 99f785f9d2364..825b6c434289b 100644 --- a/comp/core/hostname/hostnameinterface/go.mod +++ b/comp/core/hostname/hostnameinterface/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 ) diff --git a/comp/core/hostname/hostnameinterface/go.sum b/comp/core/hostname/hostnameinterface/go.sum index 039e347ff9cfc..135756fb05924 100644 --- a/comp/core/hostname/hostnameinterface/go.sum +++ b/comp/core/hostname/hostnameinterface/go.sum @@ -10,8 +10,8 @@ github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw= diff --git a/comp/core/log/def/go.mod b/comp/core/log/def/go.mod index 3528448f83d92..88318237b5c50 100644 --- a/comp/core/log/def/go.mod +++ b/comp/core/log/def/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/comp/core/log/def go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/comp/core/log/def/go.sum b/comp/core/log/def/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/comp/core/log/def/go.sum +++ b/comp/core/log/def/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/comp/core/log/impl-trace/go.mod b/comp/core/log/impl-trace/go.mod index af67376532a37..268642de8f814 100644 --- a/comp/core/log/impl-trace/go.mod +++ b/comp/core/log/impl-trace/go.mod @@ -47,7 +47,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect; v2.6 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 // indirect ) diff --git a/comp/core/log/impl-trace/go.sum b/comp/core/log/impl-trace/go.sum index d4d8cda8bdd8d..a0d64ddd8c50b 100644 --- a/comp/core/log/impl-trace/go.sum +++ b/comp/core/log/impl-trace/go.sum @@ -212,8 +212,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/core/log/impl/go.mod b/comp/core/log/impl/go.mod index d50f72726751c..075d19cf5918c 100644 --- a/comp/core/log/impl/go.mod +++ b/comp/core/log/impl/go.mod @@ -41,7 +41,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/log/setup v0.0.0-00010101000000-000000000000 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/comp/core/log/impl/go.sum b/comp/core/log/impl/go.sum index bbea552f0eb1a..a29a7509778c0 100644 --- a/comp/core/log/impl/go.sum +++ b/comp/core/log/impl/go.sum @@ -206,8 +206,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/core/log/mock/go.sum b/comp/core/log/mock/go.sum index 5b99deeef04d3..94c21dfdbfce8 100644 --- a/comp/core/log/mock/go.sum +++ b/comp/core/log/mock/go.sum @@ -171,8 +171,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/core/secrets/go.mod b/comp/core/secrets/go.mod index 952b3d81448f9..3432e8b1b2855 100644 --- a/comp/core/secrets/go.mod +++ b/comp/core/secrets/go.mod @@ -25,7 +25,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.0-rc.3 github.com/benbjohnson/clock v1.3.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f golang.org/x/sys v0.27.0 diff --git a/comp/core/secrets/go.sum b/comp/core/secrets/go.sum index 7d688fb3c7c70..ca7f0ac65c1a0 100644 --- a/comp/core/secrets/go.sum +++ b/comp/core/secrets/go.sum @@ -46,8 +46,8 @@ github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA= diff --git a/comp/core/status/go.mod b/comp/core/status/go.mod index e9b817883b56e..a692306d9ceba 100644 --- a/comp/core/status/go.mod +++ b/comp/core/status/go.mod @@ -6,7 +6,7 @@ require ( github.com/dustin/go-humanize v1.0.1 github.com/fatih/color v1.16.0 github.com/spf13/cast v1.7.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 golang.org/x/text v0.20.0 ) diff --git a/comp/core/status/go.sum b/comp/core/status/go.sum index f18d7b4e54647..dc06983efbed2 100644 --- a/comp/core/status/go.sum +++ b/comp/core/status/go.sum @@ -23,8 +23,8 @@ github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZV github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw= diff --git a/comp/core/status/statusimpl/go.mod b/comp/core/status/statusimpl/go.mod index 25a9194110a92..f9e78400f8b5d 100644 --- a/comp/core/status/statusimpl/go.mod +++ b/comp/core/status/statusimpl/go.mod @@ -52,7 +52,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 github.com/gorilla/mux v1.8.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 golang.org/x/text v0.20.0 ) diff --git a/comp/core/status/statusimpl/go.sum b/comp/core/status/statusimpl/go.sum index 8a07a5da2ca2a..4f7035a9ca416 100644 --- a/comp/core/status/statusimpl/go.sum +++ b/comp/core/status/statusimpl/go.sum @@ -216,8 +216,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= diff --git a/comp/core/tagger/types/go.mod b/comp/core/tagger/types/go.mod index 5b53752b6db32..9a402a40c1e32 100644 --- a/comp/core/tagger/types/go.mod +++ b/comp/core/tagger/types/go.mod @@ -32,7 +32,7 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/comp/core/tagger/types/go.sum b/comp/core/tagger/types/go.sum index 5fe56fd07e6db..6957a854c84ef 100644 --- a/comp/core/tagger/types/go.sum +++ b/comp/core/tagger/types/go.sum @@ -10,8 +10,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/comp/core/tagger/utils/go.mod b/comp/core/tagger/utils/go.mod index 6c66b5f466c8d..395b7fcf185b4 100644 --- a/comp/core/tagger/utils/go.mod +++ b/comp/core/tagger/utils/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/comp/core/tagger/utils go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/comp/core/tagger/utils/go.sum b/comp/core/tagger/utils/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/comp/core/tagger/utils/go.sum +++ b/comp/core/tagger/utils/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/comp/core/telemetry/go.mod b/comp/core/telemetry/go.mod index 9f67e1de3c0b6..f3c5bd058f783 100644 --- a/comp/core/telemetry/go.mod +++ b/comp/core/telemetry/go.mod @@ -12,7 +12,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 github.com/prometheus/client_golang v1.17.0 github.com/prometheus/client_model v0.5.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/otel/exporters/prometheus v0.42.0 go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/sdk/metric v1.27.0 diff --git a/comp/core/telemetry/go.sum b/comp/core/telemetry/go.sum index 4168353589568..514f0c77c0034 100644 --- a/comp/core/telemetry/go.sum +++ b/comp/core/telemetry/go.sum @@ -42,8 +42,8 @@ github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA= diff --git a/comp/def/go.mod b/comp/def/go.mod index e0a0f4cd3fdfe..43cd4e5e23dd6 100644 --- a/comp/def/go.mod +++ b/comp/def/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/comp/def go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/comp/def/go.sum b/comp/def/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/comp/def/go.sum +++ b/comp/def/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/comp/forwarder/defaultforwarder/go.mod b/comp/forwarder/defaultforwarder/go.mod index c58d4ab1df44c..c976351040837 100644 --- a/comp/forwarder/defaultforwarder/go.mod +++ b/comp/forwarder/defaultforwarder/go.mod @@ -75,7 +75,7 @@ require ( github.com/DataDog/datadog-agent/pkg/version v0.57.1 github.com/golang/protobuf v1.5.3 github.com/hashicorp/go-multierror v1.1.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 go.uber.org/fx v1.22.2 golang.org/x/text v0.20.0 diff --git a/comp/forwarder/defaultforwarder/go.sum b/comp/forwarder/defaultforwarder/go.sum index 6cd11bf22c595..98ac030df6f50 100644 --- a/comp/forwarder/defaultforwarder/go.sum +++ b/comp/forwarder/defaultforwarder/go.sum @@ -232,8 +232,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/forwarder/orchestrator/orchestratorinterface/go.mod b/comp/forwarder/orchestrator/orchestratorinterface/go.mod index 380db17a9e236..d677e905f8ca8 100644 --- a/comp/forwarder/orchestrator/orchestratorinterface/go.mod +++ b/comp/forwarder/orchestrator/orchestratorinterface/go.mod @@ -143,7 +143,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect diff --git a/comp/forwarder/orchestrator/orchestratorinterface/go.sum b/comp/forwarder/orchestrator/orchestratorinterface/go.sum index bcc5d074d0c77..5bd7767a6476e 100644 --- a/comp/forwarder/orchestrator/orchestratorinterface/go.sum +++ b/comp/forwarder/orchestrator/orchestratorinterface/go.sum @@ -234,8 +234,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/logs/agent/config/go.mod b/comp/logs/agent/config/go.mod index 9f42d20b4a700..21a46dec52c2f 100644 --- a/comp/logs/agent/config/go.mod +++ b/comp/logs/agent/config/go.mod @@ -46,7 +46,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 github.com/DataDog/viper v1.13.5 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 ) diff --git a/comp/logs/agent/config/go.sum b/comp/logs/agent/config/go.sum index bbea552f0eb1a..a29a7509778c0 100644 --- a/comp/logs/agent/config/go.sum +++ b/comp/logs/agent/config/go.sum @@ -206,8 +206,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/otelcol/collector-contrib/def/go.mod b/comp/otelcol/collector-contrib/def/go.mod index 3c83814b009b0..724a707c71c7a 100644 --- a/comp/otelcol/collector-contrib/def/go.mod +++ b/comp/otelcol/collector-contrib/def/go.mod @@ -55,7 +55,7 @@ require ( github.com/shirou/gopsutil/v4 v4.24.10 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect diff --git a/comp/otelcol/collector-contrib/def/go.sum b/comp/otelcol/collector-contrib/def/go.sum index 0e45e08ca1376..0018b1f3994af 100644 --- a/comp/otelcol/collector-contrib/def/go.sum +++ b/comp/otelcol/collector-contrib/def/go.sum @@ -97,8 +97,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= diff --git a/comp/otelcol/collector-contrib/impl/go.mod b/comp/otelcol/collector-contrib/impl/go.mod index 59a9d3d11f185..0d6b0f4a9836f 100644 --- a/comp/otelcol/collector-contrib/impl/go.mod +++ b/comp/otelcol/collector-contrib/impl/go.mod @@ -228,7 +228,7 @@ require ( github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/tinylib/msgp v1.2.4 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect diff --git a/comp/otelcol/collector-contrib/impl/go.sum b/comp/otelcol/collector-contrib/impl/go.sum index d9d7b58367343..85c06249af5a2 100644 --- a/comp/otelcol/collector-contrib/impl/go.sum +++ b/comp/otelcol/collector-contrib/impl/go.sum @@ -864,8 +864,9 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybuB4GY8G2HHgCkbMzMHo= diff --git a/comp/otelcol/converter/def/go.mod b/comp/otelcol/converter/def/go.mod index 2889709d6d8f3..be115884ce62f 100644 --- a/comp/otelcol/converter/def/go.mod +++ b/comp/otelcol/converter/def/go.mod @@ -11,6 +11,7 @@ require ( github.com/knadh/koanf/v2 v2.1.2 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/stretchr/testify v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/comp/otelcol/converter/def/go.sum b/comp/otelcol/converter/def/go.sum index f16eed9e249b4..802c3d8c7c117 100644 --- a/comp/otelcol/converter/def/go.sum +++ b/comp/otelcol/converter/def/go.sum @@ -20,8 +20,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= diff --git a/comp/otelcol/converter/impl/go.mod b/comp/otelcol/converter/impl/go.mod index b7fd685b06954..f2162418928f9 100644 --- a/comp/otelcol/converter/impl/go.mod +++ b/comp/otelcol/converter/impl/go.mod @@ -41,7 +41,7 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/core/config v0.56.2 github.com/DataDog/datadog-agent/comp/otelcol/converter/def v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/confmap v1.20.0 go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 diff --git a/comp/otelcol/converter/impl/go.sum b/comp/otelcol/converter/impl/go.sum index 96051d7ac6ba5..cfc250c7fb50e 100644 --- a/comp/otelcol/converter/impl/go.sum +++ b/comp/otelcol/converter/impl/go.sum @@ -219,8 +219,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= diff --git a/comp/otelcol/ddflareextension/def/go.mod b/comp/otelcol/ddflareextension/def/go.mod index 42c21799a0c31..7ef632104c53d 100644 --- a/comp/otelcol/ddflareextension/def/go.mod +++ b/comp/otelcol/ddflareextension/def/go.mod @@ -6,6 +6,7 @@ require go.opentelemetry.io/collector/extension v0.114.0 require ( github.com/gogo/protobuf v1.3.2 // indirect + github.com/stretchr/testify v1.10.0 // indirect go.opentelemetry.io/collector/component v0.114.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect go.opentelemetry.io/collector/pdata v1.20.0 // indirect diff --git a/comp/otelcol/ddflareextension/def/go.sum b/comp/otelcol/ddflareextension/def/go.sum index ee0e91a7a15de..daae981c08540 100644 --- a/comp/otelcol/ddflareextension/def/go.sum +++ b/comp/otelcol/ddflareextension/def/go.sum @@ -12,8 +12,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= diff --git a/comp/otelcol/ddflareextension/impl/go.mod b/comp/otelcol/ddflareextension/impl/go.mod index 930c7cacfed08..1c34652e6292e 100644 --- a/comp/otelcol/ddflareextension/impl/go.mod +++ b/comp/otelcol/ddflareextension/impl/go.mod @@ -119,7 +119,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.114.0 go.opentelemetry.io/collector/component/componentstatus v0.114.0 go.opentelemetry.io/collector/component/componenttest v0.114.0 diff --git a/comp/otelcol/ddflareextension/impl/go.sum b/comp/otelcol/ddflareextension/impl/go.sum index 3b7dcea39b6ac..9973ebc18ea56 100644 --- a/comp/otelcol/ddflareextension/impl/go.sum +++ b/comp/otelcol/ddflareextension/impl/go.sum @@ -789,8 +789,9 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tidwall/gjson v1.10.2 h1:APbLGOM0rrEkd8WBw9C24nllro4ajFuJu0Sc9hRz8Bo= github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= diff --git a/comp/otelcol/logsagentpipeline/go.mod b/comp/otelcol/logsagentpipeline/go.mod index 2d1a300964364..64afcc04eee4f 100644 --- a/comp/otelcol/logsagentpipeline/go.mod +++ b/comp/otelcol/logsagentpipeline/go.mod @@ -145,7 +145,7 @@ require ( github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect diff --git a/comp/otelcol/logsagentpipeline/go.sum b/comp/otelcol/logsagentpipeline/go.sum index 601934cb1bbbf..0c7f69245d9f9 100644 --- a/comp/otelcol/logsagentpipeline/go.sum +++ b/comp/otelcol/logsagentpipeline/go.sum @@ -224,8 +224,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod index 61cd7e5f4f5ff..fc19e21c7ea9e 100644 --- a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod +++ b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod @@ -83,7 +83,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 go.uber.org/zap v1.27.0 ) diff --git a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum index 00341258f4a82..b736646b68da3 100644 --- a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum +++ b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum @@ -225,8 +225,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod b/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod index bf81569416a56..6b57e97886ed1 100644 --- a/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod @@ -106,7 +106,7 @@ require ( github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.114.0 go.opentelemetry.io/collector/config/confignet v1.20.0 go.opentelemetry.io/collector/config/configretry v1.20.0 diff --git a/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum b/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum index 7eee36ba8763a..4e46200b7bbdf 100644 --- a/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum +++ b/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum @@ -359,8 +359,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tinylib/msgp v1.1.9 h1:SHf3yoO2sGA0veCJeCBYLHuttAVFHGm2RHgNodW7wQU= github.com/tinylib/msgp v1.1.9/go.mod h1:BCXGB54lDD8qUEPmiG0cQQUANC4IUQyB2ItS2UDlO/k= diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod index 213fd4cb16878..1b2347d9f24e2 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod @@ -51,7 +51,7 @@ require ( github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 github.com/stormcat24/protodep v0.1.8 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.114.0 go.opentelemetry.io/collector/exporter v0.114.0 go.opentelemetry.io/collector/exporter/exportertest v0.114.0 diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum index 47da0ff50cf4c..73ee4e46d9bdc 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum @@ -246,8 +246,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= diff --git a/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod b/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod index bc29f0dc5a7be..32e2889fbf704 100644 --- a/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod @@ -74,7 +74,7 @@ require ( github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/tinylib/msgp v1.1.8 go.opentelemetry.io/collector/component v0.114.0 go.opentelemetry.io/collector/config/confignet v1.20.0 // indirect diff --git a/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum b/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum index 0599bb87120a9..dad39da8df5dd 100644 --- a/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum +++ b/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum @@ -310,8 +310,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= diff --git a/comp/otelcol/otlp/components/metricsclient/go.mod b/comp/otelcol/otlp/components/metricsclient/go.mod index ce87cd0cc0cf0..0bf22c8f8eed2 100644 --- a/comp/otelcol/otlp/components/metricsclient/go.mod +++ b/comp/otelcol/otlp/components/metricsclient/go.mod @@ -7,7 +7,7 @@ replace github.com/DataDog/datadog-agent/pkg/trace => ../../../../../pkg/trace require ( github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 github.com/DataDog/datadog-go/v5 v5.5.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/otel v1.32.0 go.opentelemetry.io/otel/metric v1.32.0 go.opentelemetry.io/otel/sdk/metric v1.32.0 diff --git a/comp/otelcol/otlp/components/metricsclient/go.sum b/comp/otelcol/otlp/components/metricsclient/go.sum index 8615290d1ef0e..28792a9b75f4a 100644 --- a/comp/otelcol/otlp/components/metricsclient/go.sum +++ b/comp/otelcol/otlp/components/metricsclient/go.sum @@ -29,8 +29,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod index 5ced6ecc2e2ff..a64aa72d38da2 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod @@ -36,7 +36,7 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/core/tagger/tags v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/comp/core/tagger/types v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.114.0 go.opentelemetry.io/collector/component/componenttest v0.114.0 go.opentelemetry.io/collector/confmap v1.20.0 diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.sum b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.sum index e9c3ecb7a9efa..230527d5f3d4b 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.sum +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.sum @@ -44,8 +44,8 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= diff --git a/comp/otelcol/otlp/components/statsprocessor/go.mod b/comp/otelcol/otlp/components/statsprocessor/go.mod index 227e60c4937e6..362e818372026 100644 --- a/comp/otelcol/otlp/components/statsprocessor/go.mod +++ b/comp/otelcol/otlp/components/statsprocessor/go.mod @@ -24,7 +24,7 @@ require ( github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component/componenttest v0.114.0 go.opentelemetry.io/collector/pdata v1.20.0 go.opentelemetry.io/otel/sdk/metric v1.32.0 diff --git a/comp/otelcol/otlp/components/statsprocessor/go.sum b/comp/otelcol/otlp/components/statsprocessor/go.sum index 1698d19621bf8..471fdccea1d4d 100644 --- a/comp/otelcol/otlp/components/statsprocessor/go.sum +++ b/comp/otelcol/otlp/components/statsprocessor/go.sum @@ -116,8 +116,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= diff --git a/comp/otelcol/otlp/testutil/go.mod b/comp/otelcol/otlp/testutil/go.mod index d092897c329c0..851e3aa6c47a0 100644 --- a/comp/otelcol/otlp/testutil/go.mod +++ b/comp/otelcol/otlp/testutil/go.mod @@ -40,7 +40,7 @@ require ( github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 github.com/DataDog/sketches-go v1.4.6 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/pdata v1.20.0 google.golang.org/protobuf v1.35.1 ) diff --git a/comp/otelcol/otlp/testutil/go.sum b/comp/otelcol/otlp/testutil/go.sum index b1b8218380841..c8de2ef38e100 100644 --- a/comp/otelcol/otlp/testutil/go.sum +++ b/comp/otelcol/otlp/testutil/go.sum @@ -224,8 +224,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= diff --git a/comp/serializer/compression/go.mod b/comp/serializer/compression/go.mod index 47015b1e18351..167dfbeb07366 100644 --- a/comp/serializer/compression/go.mod +++ b/comp/serializer/compression/go.mod @@ -86,7 +86,7 @@ require ( github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect diff --git a/comp/serializer/compression/go.sum b/comp/serializer/compression/go.sum index 92da8d2bede28..7d46104035796 100644 --- a/comp/serializer/compression/go.sum +++ b/comp/serializer/compression/go.sum @@ -208,8 +208,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/comp/trace/agent/def/go.sum b/comp/trace/agent/def/go.sum index 15c48a0e652e6..96f740f700c35 100644 --- a/comp/trace/agent/def/go.sum +++ b/comp/trace/agent/def/go.sum @@ -33,8 +33,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= diff --git a/go.mod b/go.mod index a7a791af88629..864ec4fd5dc6c 100644 --- a/go.mod +++ b/go.mod @@ -274,7 +274,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/streadway/amqp v1.1.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 github.com/tinylib/msgp v1.2.4 github.com/twmb/murmur3 v1.1.8 diff --git a/go.sum b/go.sum index cb2bc7549b4d4..465ece1027020 100644 --- a/go.sum +++ b/go.sum @@ -1768,8 +1768,9 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 0062abfb5a49d..1ff612a893c22 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -195,7 +195,7 @@ require ( github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index a47b8b5e8a6af..9a7b4402f18d2 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -660,8 +660,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8= diff --git a/internal/tools/modparser/go.mod b/internal/tools/modparser/go.mod index f6850c8bf7d2e..9ff9bcc206498 100644 --- a/internal/tools/modparser/go.mod +++ b/internal/tools/modparser/go.mod @@ -3,7 +3,7 @@ module github.com/DataDog/datadog-agent/internal/tools/modparser go 1.22.0 require ( - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 golang.org/x/mod v0.22.0 ) diff --git a/internal/tools/modparser/go.sum b/internal/tools/modparser/go.sum index 9cc00d9a761fc..0f285622b01a1 100644 --- a/internal/tools/modparser/go.sum +++ b/internal/tools/modparser/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/pkg/aggregator/ckey/go.mod b/pkg/aggregator/ckey/go.mod index 22cf02ba1e175..b56ec53b6793f 100644 --- a/pkg/aggregator/ckey/go.mod +++ b/pkg/aggregator/ckey/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/tagset v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/twmb/murmur3 v1.1.8 ) diff --git a/pkg/aggregator/ckey/go.sum b/pkg/aggregator/ckey/go.sum index ec7ea5a8e7dbd..61bd0aafe2d5f 100644 --- a/pkg/aggregator/ckey/go.sum +++ b/pkg/aggregator/ckey/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/pkg/api/go.mod b/pkg/api/go.mod index a0cc8796129ea..564ddda94e787 100644 --- a/pkg/api/go.mod +++ b/pkg/api/go.mod @@ -45,7 +45,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/api/go.sum b/pkg/api/go.sum index bbea552f0eb1a..a29a7509778c0 100644 --- a/pkg/api/go.sum +++ b/pkg/api/go.sum @@ -206,8 +206,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/collector/corechecks/snmp/internal/checkconfig/config_test.go b/pkg/collector/corechecks/snmp/internal/checkconfig/config_test.go index d8536a4931cb6..07b6ba9eefaa4 100644 --- a/pkg/collector/corechecks/snmp/internal/checkconfig/config_test.go +++ b/pkg/collector/corechecks/snmp/internal/checkconfig/config_test.go @@ -2138,14 +2138,14 @@ func TestCheckConfig_Copy(t *testing.T) { assert.Equal(t, &config, configCopy) - assert.NotSame(t, config.RequestedMetrics, configCopy.RequestedMetrics) - assert.NotSame(t, config.RequestedMetricTags, configCopy.RequestedMetricTags) - assert.NotSame(t, config.Metrics, configCopy.Metrics) - assert.NotSame(t, config.MetricTags, configCopy.MetricTags) - assert.NotSame(t, config.ProfileTags, configCopy.ProfileTags) - assert.NotSame(t, config.ExtraTags, configCopy.ExtraTags) - assert.NotSame(t, config.InstanceTags, configCopy.InstanceTags) - assert.NotSame(t, config.DeviceIDTags, configCopy.DeviceIDTags) + assert.NotSame(t, &config.RequestedMetrics, &configCopy.RequestedMetrics) + assert.NotSame(t, &config.RequestedMetricTags, &configCopy.RequestedMetricTags) + assert.NotSame(t, &config.Metrics, &configCopy.Metrics) + assert.NotSame(t, &config.MetricTags, &configCopy.MetricTags) + assert.NotSame(t, &config.ProfileTags, &configCopy.ProfileTags) + assert.NotSame(t, &config.ExtraTags, &configCopy.ExtraTags) + assert.NotSame(t, &config.InstanceTags, &configCopy.InstanceTags) + assert.NotSame(t, &config.DeviceIDTags, &configCopy.DeviceIDTags) } func TestCheckConfig_CopyWithNewIP(t *testing.T) { diff --git a/pkg/config/env/go.mod b/pkg/config/env/go.mod index 28028eb906718..1b8b190d06565 100644 --- a/pkg/config/env/go.mod +++ b/pkg/config/env/go.mod @@ -15,7 +15,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/config/env/go.sum b/pkg/config/env/go.sum index 1a87a4e1f8386..9188458276b35 100644 --- a/pkg/config/env/go.sum +++ b/pkg/config/env/go.sum @@ -172,8 +172,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= diff --git a/pkg/config/mock/go.mod b/pkg/config/mock/go.mod index 3559629c3d248..d027b1ccacdaf 100644 --- a/pkg/config/mock/go.mod +++ b/pkg/config/mock/go.mod @@ -32,7 +32,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/config/mock/go.sum b/pkg/config/mock/go.sum index 164d7c1e62c7d..e430d7f027344 100644 --- a/pkg/config/mock/go.sum +++ b/pkg/config/mock/go.sum @@ -204,8 +204,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/config/model/go.mod b/pkg/config/model/go.mod index 82e1928f3ba1c..3ac77b920f8ee 100644 --- a/pkg/config/model/go.mod +++ b/pkg/config/model/go.mod @@ -13,7 +13,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 github.com/DataDog/viper v1.13.5 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f ) diff --git a/pkg/config/model/go.sum b/pkg/config/model/go.sum index 1abeca65a7f43..5ce9e24cba406 100644 --- a/pkg/config/model/go.sum +++ b/pkg/config/model/go.sum @@ -152,8 +152,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= diff --git a/pkg/config/nodetreemodel/go.mod b/pkg/config/nodetreemodel/go.mod index dbf7e7ae941d5..c51f9361c60b6 100644 --- a/pkg/config/nodetreemodel/go.mod +++ b/pkg/config/nodetreemodel/go.mod @@ -17,7 +17,7 @@ require ( github.com/DataDog/viper v1.13.5 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/spf13/cast v1.7.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f gopkg.in/yaml.v2 v2.4.0 diff --git a/pkg/config/nodetreemodel/go.sum b/pkg/config/nodetreemodel/go.sum index a8411cb4b4df2..1211d26367b59 100644 --- a/pkg/config/nodetreemodel/go.sum +++ b/pkg/config/nodetreemodel/go.sum @@ -155,8 +155,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= diff --git a/pkg/config/remote/go.mod b/pkg/config/remote/go.mod index b87c51a79735d..2c972c2f7493e 100644 --- a/pkg/config/remote/go.mod +++ b/pkg/config/remote/go.mod @@ -56,7 +56,7 @@ require ( github.com/benbjohnson/clock v1.3.0 github.com/pkg/errors v0.9.1 github.com/secure-systems-lab/go-securesystemslib v0.7.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.etcd.io/bbolt v1.3.7 go.uber.org/atomic v1.11.0 google.golang.org/protobuf v1.33.0 diff --git a/pkg/config/remote/go.sum b/pkg/config/remote/go.sum index 417661769c498..3cd90e3c78269 100644 --- a/pkg/config/remote/go.sum +++ b/pkg/config/remote/go.sum @@ -293,8 +293,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= diff --git a/pkg/config/setup/go.mod b/pkg/config/setup/go.mod index ed5d5cfaf6323..32bbab5773575 100644 --- a/pkg/config/setup/go.mod +++ b/pkg/config/setup/go.mod @@ -49,7 +49,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/pkg/config/setup/go.sum b/pkg/config/setup/go.sum index 76459cb929a41..4e9fda91af3c1 100644 --- a/pkg/config/setup/go.sum +++ b/pkg/config/setup/go.sum @@ -212,8 +212,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/config/structure/go.mod b/pkg/config/structure/go.mod index 74021409df252..11b426b459fac 100644 --- a/pkg/config/structure/go.mod +++ b/pkg/config/structure/go.mod @@ -38,7 +38,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 github.com/DataDog/viper v1.13.5 github.com/spf13/cast v1.7.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/config/structure/go.sum b/pkg/config/structure/go.sum index 7a923e42a77c2..ad0bf8e1c5d21 100644 --- a/pkg/config/structure/go.sum +++ b/pkg/config/structure/go.sum @@ -157,8 +157,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= diff --git a/pkg/config/teeconfig/go.sum b/pkg/config/teeconfig/go.sum index 4fd9cf82cf2c3..02e64e7a0270b 100644 --- a/pkg/config/teeconfig/go.sum +++ b/pkg/config/teeconfig/go.sum @@ -153,8 +153,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= diff --git a/pkg/config/utils/go.mod b/pkg/config/utils/go.mod index c918f10139e5f..ca43715e1bd66 100644 --- a/pkg/config/utils/go.mod +++ b/pkg/config/utils/go.mod @@ -40,7 +40,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/config/utils/go.sum b/pkg/config/utils/go.sum index 164d7c1e62c7d..e430d7f027344 100644 --- a/pkg/config/utils/go.sum +++ b/pkg/config/utils/go.sum @@ -204,8 +204,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/errors/go.mod b/pkg/errors/go.mod index 60ed78514353b..808a90c342fb2 100644 --- a/pkg/errors/go.mod +++ b/pkg/errors/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/errors go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/errors/go.sum b/pkg/errors/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/errors/go.sum +++ b/pkg/errors/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/gohai/go.mod b/pkg/gohai/go.mod index 94fd87c288708..62c36204e984d 100644 --- a/pkg/gohai/go.mod +++ b/pkg/gohai/go.mod @@ -9,7 +9,7 @@ require ( github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 github.com/moby/sys/mountinfo v0.7.2 github.com/shirou/gopsutil/v3 v3.24.5 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 golang.org/x/sys v0.27.0 ) diff --git a/pkg/gohai/go.sum b/pkg/gohai/go.sum index 52888d504c7f5..b263ca25c2cfa 100644 --- a/pkg/gohai/go.sum +++ b/pkg/gohai/go.sum @@ -33,8 +33,8 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= diff --git a/pkg/linters/components/pkgconfigusage/go.mod b/pkg/linters/components/pkgconfigusage/go.mod index b6283b65dfa3d..a2c57afec4295 100644 --- a/pkg/linters/components/pkgconfigusage/go.mod +++ b/pkg/linters/components/pkgconfigusage/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/golangci/plugin-module-register v0.1.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 golang.org/x/tools v0.27.0 ) diff --git a/pkg/linters/components/pkgconfigusage/go.sum b/pkg/linters/components/pkgconfigusage/go.sum index 15ea6b72c9e0e..870d5762aac9c 100644 --- a/pkg/linters/components/pkgconfigusage/go.sum +++ b/pkg/linters/components/pkgconfigusage/go.sum @@ -6,8 +6,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= diff --git a/pkg/logs/auditor/go.mod b/pkg/logs/auditor/go.mod index 6d6750edab39c..3f1f340492b82 100644 --- a/pkg/logs/auditor/go.mod +++ b/pkg/logs/auditor/go.mod @@ -48,7 +48,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/status/health v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/logs/auditor/go.sum b/pkg/logs/auditor/go.sum index 164d7c1e62c7d..e430d7f027344 100644 --- a/pkg/logs/auditor/go.sum +++ b/pkg/logs/auditor/go.sum @@ -204,8 +204,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/logs/client/go.mod b/pkg/logs/client/go.mod index 248888b50ddfe..37afb20c767e6 100644 --- a/pkg/logs/client/go.mod +++ b/pkg/logs/client/go.mod @@ -62,7 +62,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 golang.org/x/net v0.31.0 ) diff --git a/pkg/logs/client/go.sum b/pkg/logs/client/go.sum index b0bb34141f5f1..9ae147b4a2090 100644 --- a/pkg/logs/client/go.sum +++ b/pkg/logs/client/go.sum @@ -210,8 +210,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/logs/diagnostic/go.mod b/pkg/logs/diagnostic/go.mod index f3dba3dfded9e..d18d52a220f67 100644 --- a/pkg/logs/diagnostic/go.mod +++ b/pkg/logs/diagnostic/go.mod @@ -49,7 +49,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/logs/diagnostic/go.sum b/pkg/logs/diagnostic/go.sum index bbea552f0eb1a..a29a7509778c0 100644 --- a/pkg/logs/diagnostic/go.sum +++ b/pkg/logs/diagnostic/go.sum @@ -206,8 +206,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/logs/message/go.mod b/pkg/logs/message/go.mod index edd47485ff8b4..18a8e92f8509f 100644 --- a/pkg/logs/message/go.mod +++ b/pkg/logs/message/go.mod @@ -43,7 +43,7 @@ require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/logs/message/go.sum b/pkg/logs/message/go.sum index 164d7c1e62c7d..e430d7f027344 100644 --- a/pkg/logs/message/go.sum +++ b/pkg/logs/message/go.sum @@ -204,8 +204,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/logs/metrics/go.mod b/pkg/logs/metrics/go.mod index d7a851d653b61..077d2988f4c47 100644 --- a/pkg/logs/metrics/go.mod +++ b/pkg/logs/metrics/go.mod @@ -14,7 +14,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/benbjohnson/clock v1.3.5 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/logs/metrics/go.sum b/pkg/logs/metrics/go.sum index 38747b0736c7d..849ce5d2e6795 100644 --- a/pkg/logs/metrics/go.sum +++ b/pkg/logs/metrics/go.sum @@ -47,8 +47,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA= diff --git a/pkg/logs/pipeline/go.mod b/pkg/logs/pipeline/go.mod index 256b00b4cc489..11443f4acc6de 100644 --- a/pkg/logs/pipeline/go.mod +++ b/pkg/logs/pipeline/go.mod @@ -74,7 +74,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 github.com/hashicorp/go-multierror v1.1.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 ) diff --git a/pkg/logs/pipeline/go.sum b/pkg/logs/pipeline/go.sum index 3bc6eb3412ee8..f769262396028 100644 --- a/pkg/logs/pipeline/go.sum +++ b/pkg/logs/pipeline/go.sum @@ -221,8 +221,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/logs/processor/go.mod b/pkg/logs/processor/go.mod index 97ccb212e5894..70a6775f262e9 100644 --- a/pkg/logs/processor/go.mod +++ b/pkg/logs/processor/go.mod @@ -58,7 +58,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/sds v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/logs/processor/go.sum b/pkg/logs/processor/go.sum index 6d53c6bedf790..23deabea16b5e 100644 --- a/pkg/logs/processor/go.sum +++ b/pkg/logs/processor/go.sum @@ -217,8 +217,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/logs/sds/go.mod b/pkg/logs/sds/go.mod index 43da29661237f..5791f5434e1f6 100644 --- a/pkg/logs/sds/go.mod +++ b/pkg/logs/sds/go.mod @@ -54,7 +54,7 @@ require ( github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/logs/sds/go.sum b/pkg/logs/sds/go.sum index d8485f7587c11..71aa3ceef1969 100644 --- a/pkg/logs/sds/go.sum +++ b/pkg/logs/sds/go.sum @@ -210,8 +210,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/logs/sender/go.mod b/pkg/logs/sender/go.mod index f26fcc4e5ef98..98b69acde609e 100644 --- a/pkg/logs/sender/go.mod +++ b/pkg/logs/sender/go.mod @@ -61,7 +61,7 @@ require ( github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/benbjohnson/clock v1.3.5 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/logs/sender/go.sum b/pkg/logs/sender/go.sum index b0bb34141f5f1..9ae147b4a2090 100644 --- a/pkg/logs/sender/go.sum +++ b/pkg/logs/sender/go.sum @@ -210,8 +210,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/logs/sources/go.mod b/pkg/logs/sources/go.mod index 48700f9bea973..ec060a733c103 100644 --- a/pkg/logs/sources/go.mod +++ b/pkg/logs/sources/go.mod @@ -43,7 +43,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/logs/sources/go.sum b/pkg/logs/sources/go.sum index 164d7c1e62c7d..e430d7f027344 100644 --- a/pkg/logs/sources/go.sum +++ b/pkg/logs/sources/go.sum @@ -204,8 +204,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/logs/status/utils/go.mod b/pkg/logs/status/utils/go.mod index e9dd8e2332f2a..4a6fe8f44b45b 100644 --- a/pkg/logs/status/utils/go.mod +++ b/pkg/logs/status/utils/go.mod @@ -3,7 +3,7 @@ module github.com/DataDog/datadog-agent/pkg/logs/status/utils go 1.22.0 require ( - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 ) diff --git a/pkg/logs/status/utils/go.sum b/pkg/logs/status/utils/go.sum index 8040b08ea112f..82752f45a5c57 100644 --- a/pkg/logs/status/utils/go.sum +++ b/pkg/logs/status/utils/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/pkg/logs/util/testutils/go.sum b/pkg/logs/util/testutils/go.sum index 164d7c1e62c7d..e430d7f027344 100644 --- a/pkg/logs/util/testutils/go.sum +++ b/pkg/logs/util/testutils/go.sum @@ -204,8 +204,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/metrics/go.mod b/pkg/metrics/go.mod index 2dd14396a7fef..6eb9ddca00743 100644 --- a/pkg/metrics/go.mod +++ b/pkg/metrics/go.mod @@ -48,7 +48,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/buf v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 ) diff --git a/pkg/metrics/go.sum b/pkg/metrics/go.sum index e95081bd9b2e1..e4427151a2e4e 100644 --- a/pkg/metrics/go.sum +++ b/pkg/metrics/go.sum @@ -219,8 +219,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/networkdevice/profile/go.mod b/pkg/networkdevice/profile/go.mod index a597437498afe..a6b2ee6565e5f 100644 --- a/pkg/networkdevice/profile/go.mod +++ b/pkg/networkdevice/profile/go.mod @@ -5,7 +5,7 @@ go 1.22.0 require ( github.com/invopop/jsonschema v0.10.0 github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/pkg/networkdevice/profile/go.sum b/pkg/networkdevice/profile/go.sum index 3ed0cc77db449..695fa1448f3c5 100644 --- a/pkg/networkdevice/profile/go.sum +++ b/pkg/networkdevice/profile/go.sum @@ -25,8 +25,8 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/pkg/obfuscate/go.mod b/pkg/obfuscate/go.mod index 5f971734fcc4d..a3d535152eaea 100644 --- a/pkg/obfuscate/go.mod +++ b/pkg/obfuscate/go.mod @@ -6,7 +6,7 @@ require ( github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/go-sqllexer v0.0.16 github.com/outcaste-io/ristretto v0.2.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.10.0 ) diff --git a/pkg/obfuscate/go.sum b/pkg/obfuscate/go.sum index bcde2c4fb8e42..67a3e97516066 100644 --- a/pkg/obfuscate/go.sum +++ b/pkg/obfuscate/go.sum @@ -33,8 +33,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= diff --git a/pkg/orchestrator/model/go.sum b/pkg/orchestrator/model/go.sum index 5b3325ed13caf..2a28262f8369e 100644 --- a/pkg/orchestrator/model/go.sum +++ b/pkg/orchestrator/model/go.sum @@ -6,8 +6,8 @@ github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaR github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/pkg/process/util/api/go.mod b/pkg/process/util/api/go.mod index d995db5542469..93976516667be 100644 --- a/pkg/process/util/api/go.mod +++ b/pkg/process/util/api/go.mod @@ -14,7 +14,7 @@ require ( github.com/DataDog/agent-payload/v5 v5.0.114 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/gogo/protobuf v1.3.2 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/process/util/api/go.sum b/pkg/process/util/api/go.sum index b7b19b994a6da..7bf6969c0a53f 100644 --- a/pkg/process/util/api/go.sum +++ b/pkg/process/util/api/go.sum @@ -57,8 +57,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= diff --git a/pkg/proto/go.mod b/pkg/proto/go.mod index 2d92d4dfb9a31..3388c80e01d9f 100644 --- a/pkg/proto/go.mod +++ b/pkg/proto/go.mod @@ -9,7 +9,7 @@ require ( github.com/golang/protobuf v1.5.4 github.com/google/gofuzz v1.2.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/tinylib/msgp v1.1.8 github.com/vmihailenco/msgpack/v4 v4.3.12 google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d diff --git a/pkg/proto/go.sum b/pkg/proto/go.sum index 094c1167e0ff4..eb8bcf8192e2c 100644 --- a/pkg/proto/go.sum +++ b/pkg/proto/go.sum @@ -49,8 +49,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= diff --git a/pkg/remoteconfig/state/go.mod b/pkg/remoteconfig/state/go.mod index e78e465ed195b..8c36bdf9eee56 100644 --- a/pkg/remoteconfig/state/go.mod +++ b/pkg/remoteconfig/state/go.mod @@ -6,7 +6,7 @@ require ( github.com/DataDog/go-tuf v1.1.0-0.5.2 github.com/pkg/errors v0.9.1 github.com/secure-systems-lab/go-securesystemslib v0.7.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/remoteconfig/state/go.sum b/pkg/remoteconfig/state/go.sum index 6f9c918b2893e..f908ba00a83e8 100644 --- a/pkg/remoteconfig/state/go.sum +++ b/pkg/remoteconfig/state/go.sum @@ -18,8 +18,8 @@ github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZV github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/secure-systems-lab/go-securesystemslib v0.7.0 h1:OwvJ5jQf9LnIAS83waAjPbcMsODrTQUpJ02eNLUoxBg= github.com/secure-systems-lab/go-securesystemslib v0.7.0/go.mod h1:/2gYnlnHVQ6xeGtfIqFy7Do03K4cdCY0A/GlJLDKLHI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= diff --git a/pkg/security/secl/go.mod b/pkg/security/secl/go.mod index 9e1263fed7d5d..90fe310f06435 100644 --- a/pkg/security/secl/go.mod +++ b/pkg/security/secl/go.mod @@ -16,7 +16,7 @@ require ( github.com/jellydator/ttlcache/v3 v3.3.0 github.com/skydive-project/go-debouncer v1.0.0 github.com/spf13/cast v1.7.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/xeipuuv/gojsonschema v1.2.0 golang.org/x/sys v0.27.0 golang.org/x/text v0.20.0 diff --git a/pkg/security/secl/go.sum b/pkg/security/secl/go.sum index 790ae4a5627db..16e4c35e91833 100644 --- a/pkg/security/secl/go.sum +++ b/pkg/security/secl/go.sum @@ -61,8 +61,8 @@ github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cA github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= diff --git a/pkg/security/seclwin/go.sum b/pkg/security/seclwin/go.sum index 357acc1abc086..1449dfd6b9037 100644 --- a/pkg/security/seclwin/go.sum +++ b/pkg/security/seclwin/go.sum @@ -12,8 +12,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= diff --git a/pkg/serializer/go.mod b/pkg/serializer/go.mod index 15122b4a65601..891083ce4c897 100644 --- a/pkg/serializer/go.mod +++ b/pkg/serializer/go.mod @@ -84,7 +84,7 @@ require ( github.com/json-iterator/go v1.1.12 github.com/protocolbuffers/protoscope v0.0.0-20221109213918-8e7a6aafa2c9 github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 google.golang.org/protobuf v1.34.2 ) diff --git a/pkg/serializer/go.sum b/pkg/serializer/go.sum index f9739a4e3944c..6244a063459c5 100644 --- a/pkg/serializer/go.sum +++ b/pkg/serializer/go.sum @@ -264,8 +264,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/status/health/go.mod b/pkg/status/health/go.mod index bb3c1be9842f9..e5bb4fffa9003 100644 --- a/pkg/status/health/go.mod +++ b/pkg/status/health/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/status/health go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/status/health/go.sum b/pkg/status/health/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/status/health/go.sum +++ b/pkg/status/health/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/tagset/go.mod b/pkg/tagset/go.mod index 4852f516a8536..ac929946f609e 100644 --- a/pkg/tagset/go.mod +++ b/pkg/tagset/go.mod @@ -6,7 +6,7 @@ replace github.com/DataDog/datadog-agent/pkg/util/sort => ../util/sort/ require ( github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/twmb/murmur3 v1.1.8 ) diff --git a/pkg/tagset/go.sum b/pkg/tagset/go.sum index ec7ea5a8e7dbd..61bd0aafe2d5f 100644 --- a/pkg/tagset/go.sum +++ b/pkg/tagset/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/pkg/telemetry/go.mod b/pkg/telemetry/go.mod index d4dd6b23365ad..1380e174bb06c 100644 --- a/pkg/telemetry/go.mod +++ b/pkg/telemetry/go.mod @@ -33,7 +33,7 @@ require ( github.com/prometheus/procfs v0.11.1 // indirect github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.10.0 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.42.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect diff --git a/pkg/telemetry/go.sum b/pkg/telemetry/go.sum index 17c930e91caec..485978297a294 100644 --- a/pkg/telemetry/go.sum +++ b/pkg/telemetry/go.sum @@ -45,8 +45,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA= diff --git a/pkg/trace/go.mod b/pkg/trace/go.mod index 66b36093d36c4..3dd9fd6abd609 100644 --- a/pkg/trace/go.mod +++ b/pkg/trace/go.mod @@ -33,7 +33,7 @@ require ( github.com/google/uuid v1.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 github.com/shirou/gopsutil/v3 v3.24.4 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/tinylib/msgp v1.1.8 github.com/vmihailenco/msgpack/v4 v4.3.12 go.opentelemetry.io/collector/component v0.114.0 // indirect diff --git a/pkg/trace/go.sum b/pkg/trace/go.sum index 0f33fc983415d..1b9afa36fddb2 100644 --- a/pkg/trace/go.sum +++ b/pkg/trace/go.sum @@ -169,8 +169,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= diff --git a/pkg/trace/stats/oteltest/go.mod b/pkg/trace/stats/oteltest/go.mod index 9af8a62565b80..a95e3c9144023 100644 --- a/pkg/trace/stats/oteltest/go.mod +++ b/pkg/trace/stats/oteltest/go.mod @@ -9,7 +9,7 @@ require ( github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 github.com/google/go-cmp v0.6.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component/componenttest v0.114.0 go.opentelemetry.io/collector/pdata v1.20.0 go.opentelemetry.io/collector/semconv v0.114.0 diff --git a/pkg/trace/stats/oteltest/go.sum b/pkg/trace/stats/oteltest/go.sum index 1698d19621bf8..471fdccea1d4d 100644 --- a/pkg/trace/stats/oteltest/go.sum +++ b/pkg/trace/stats/oteltest/go.sum @@ -116,8 +116,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= diff --git a/pkg/util/backoff/go.mod b/pkg/util/backoff/go.mod index d0b3e29bf3d43..9cf1b36b6806f 100644 --- a/pkg/util/backoff/go.mod +++ b/pkg/util/backoff/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/util/backoff go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/util/backoff/go.sum b/pkg/util/backoff/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/util/backoff/go.sum +++ b/pkg/util/backoff/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/buf/go.mod b/pkg/util/buf/go.mod index ecbb514f609f4..4a0c13b4fd2fd 100644 --- a/pkg/util/buf/go.mod +++ b/pkg/util/buf/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/util/buf go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/util/buf/go.sum b/pkg/util/buf/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/util/buf/go.sum +++ b/pkg/util/buf/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/cache/go.mod b/pkg/util/cache/go.mod index c9235e5db8314..16941396b78b5 100644 --- a/pkg/util/cache/go.mod +++ b/pkg/util/cache/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/util/cache/go.sum b/pkg/util/cache/go.sum index d1ca0678c041b..291f4f06bcf16 100644 --- a/pkg/util/cache/go.sum +++ b/pkg/util/cache/go.sum @@ -4,8 +4,8 @@ github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaR github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/cgroups/go.mod b/pkg/util/cgroups/go.mod index 4b1dbb6e3be2d..fdb99e4995e03 100644 --- a/pkg/util/cgroups/go.mod +++ b/pkg/util/cgroups/go.mod @@ -14,7 +14,7 @@ require ( github.com/containerd/cgroups/v3 v3.0.2 github.com/google/go-cmp v0.6.0 github.com/karrick/godirwalk v1.17.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/util/cgroups/go.sum b/pkg/util/cgroups/go.sum index df00131f5e6cf..5b1eff0bbdf56 100644 --- a/pkg/util/cgroups/go.sum +++ b/pkg/util/cgroups/go.sum @@ -20,8 +20,8 @@ github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNia github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= diff --git a/pkg/util/common/go.mod b/pkg/util/common/go.mod index a9f6cbc90625d..1971e45bf1627 100644 --- a/pkg/util/common/go.mod +++ b/pkg/util/common/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/util/common go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/util/common/go.sum b/pkg/util/common/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/util/common/go.sum +++ b/pkg/util/common/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/containers/image/go.mod b/pkg/util/containers/image/go.mod index 7108f9f3db1a9..e94471c55838e 100644 --- a/pkg/util/containers/image/go.mod +++ b/pkg/util/containers/image/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/util/containers/image go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/util/containers/image/go.sum b/pkg/util/containers/image/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/util/containers/image/go.sum +++ b/pkg/util/containers/image/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/defaultpaths/go.sum b/pkg/util/defaultpaths/go.sum index 2444ae15ecba4..f51e7d258022c 100644 --- a/pkg/util/defaultpaths/go.sum +++ b/pkg/util/defaultpaths/go.sum @@ -6,8 +6,8 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uia github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= diff --git a/pkg/util/executable/go.mod b/pkg/util/executable/go.mod index 321ce303bd76d..c3081fb6e6913 100644 --- a/pkg/util/executable/go.mod +++ b/pkg/util/executable/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/util/executable/go.sum b/pkg/util/executable/go.sum index 019aeec36eaa7..575488bc2ce21 100644 --- a/pkg/util/executable/go.sum +++ b/pkg/util/executable/go.sum @@ -4,8 +4,8 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uia github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/filesystem/go.mod b/pkg/util/filesystem/go.mod index 16bd7778b0411..932960867b175 100644 --- a/pkg/util/filesystem/go.mod +++ b/pkg/util/filesystem/go.mod @@ -12,7 +12,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 github.com/shirou/gopsutil/v3 v3.23.9 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 golang.org/x/sys v0.27.0 ) diff --git a/pkg/util/filesystem/go.sum b/pkg/util/filesystem/go.sum index 2a30655ece48d..4b150782b098c 100644 --- a/pkg/util/filesystem/go.sum +++ b/pkg/util/filesystem/go.sum @@ -24,8 +24,8 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= diff --git a/pkg/util/flavor/go.mod b/pkg/util/flavor/go.mod index bf7c8684b66fd..39fabc94b2a48 100644 --- a/pkg/util/flavor/go.mod +++ b/pkg/util/flavor/go.mod @@ -32,7 +32,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/util/flavor/go.sum b/pkg/util/flavor/go.sum index 164d7c1e62c7d..e430d7f027344 100644 --- a/pkg/util/flavor/go.sum +++ b/pkg/util/flavor/go.sum @@ -204,8 +204,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/util/fxutil/go.mod b/pkg/util/fxutil/go.mod index 687a5f0030218..83d3e4300e794 100644 --- a/pkg/util/fxutil/go.mod +++ b/pkg/util/fxutil/go.mod @@ -6,7 +6,7 @@ require ( github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/optional v0.55.0 github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.22.2 ) diff --git a/pkg/util/fxutil/go.sum b/pkg/util/fxutil/go.sum index 039e347ff9cfc..135756fb05924 100644 --- a/pkg/util/fxutil/go.sum +++ b/pkg/util/fxutil/go.sum @@ -10,8 +10,8 @@ github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw= diff --git a/pkg/util/grpc/go.mod b/pkg/util/grpc/go.mod index 7155ae759c0ea..fb126847139c8 100644 --- a/pkg/util/grpc/go.mod +++ b/pkg/util/grpc/go.mod @@ -40,7 +40,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 golang.org/x/net v0.31.0 google.golang.org/grpc v1.59.0 ) diff --git a/pkg/util/grpc/go.sum b/pkg/util/grpc/go.sum index 782b8e78f8e1f..890d295927625 100644 --- a/pkg/util/grpc/go.sum +++ b/pkg/util/grpc/go.sum @@ -221,8 +221,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= diff --git a/pkg/util/hostname/validate/go.mod b/pkg/util/hostname/validate/go.mod index f20a7bbcd105f..d3e137199e729 100644 --- a/pkg/util/hostname/validate/go.mod +++ b/pkg/util/hostname/validate/go.mod @@ -9,7 +9,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/util/hostname/validate/go.sum b/pkg/util/hostname/validate/go.sum index caba8ce83c9f8..cf981ce9890ae 100644 --- a/pkg/util/hostname/validate/go.sum +++ b/pkg/util/hostname/validate/go.sum @@ -4,8 +4,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/pkg/util/http/go.mod b/pkg/util/http/go.mod index 603de761bfc27..587b03d209013 100644 --- a/pkg/util/http/go.mod +++ b/pkg/util/http/go.mod @@ -34,7 +34,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 golang.org/x/net v0.31.0 ) diff --git a/pkg/util/http/go.sum b/pkg/util/http/go.sum index 7905bae85c49e..a371e73ed50c4 100644 --- a/pkg/util/http/go.sum +++ b/pkg/util/http/go.sum @@ -204,8 +204,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/util/json/go.mod b/pkg/util/json/go.mod index 9e7ef3c021106..ec6c02f9ba767 100644 --- a/pkg/util/json/go.mod +++ b/pkg/util/json/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/json-iterator/go v1.1.12 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/util/json/go.sum b/pkg/util/json/go.sum index 09fb446e3abf1..2366e268aa511 100644 --- a/pkg/util/json/go.sum +++ b/pkg/util/json/go.sum @@ -12,8 +12,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/log/go.mod b/pkg/util/log/go.mod index b6a3ea0fd9245..0133bd1143b94 100644 --- a/pkg/util/log/go.mod +++ b/pkg/util/log/go.mod @@ -7,7 +7,7 @@ replace github.com/DataDog/datadog-agent/pkg/util/scrubber => ../scrubber require ( github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 go.uber.org/zap v1.22.0 ) diff --git a/pkg/util/log/go.sum b/pkg/util/log/go.sum index a6e97cc4198be..991cb97eaba89 100644 --- a/pkg/util/log/go.sum +++ b/pkg/util/log/go.sum @@ -11,8 +11,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= diff --git a/pkg/util/log/setup/go.mod b/pkg/util/log/setup/go.mod index 12e16b9767145..02af09c777767 100644 --- a/pkg/util/log/setup/go.mod +++ b/pkg/util/log/setup/go.mod @@ -35,7 +35,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/util/log/setup/go.sum b/pkg/util/log/setup/go.sum index 164d7c1e62c7d..e430d7f027344 100644 --- a/pkg/util/log/setup/go.sum +++ b/pkg/util/log/setup/go.sum @@ -204,8 +204,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= diff --git a/pkg/util/optional/go.mod b/pkg/util/optional/go.mod index 0b70349083646..38b3a76a16a19 100644 --- a/pkg/util/optional/go.mod +++ b/pkg/util/optional/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/util/optional go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/util/optional/go.sum b/pkg/util/optional/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/util/optional/go.sum +++ b/pkg/util/optional/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/scrubber/go.mod b/pkg/util/scrubber/go.mod index 759d875f2e1a2..7c312e2ffce17 100644 --- a/pkg/util/scrubber/go.mod +++ b/pkg/util/scrubber/go.mod @@ -3,7 +3,7 @@ module github.com/DataDog/datadog-agent/pkg/util/scrubber go 1.22.0 require ( - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/pkg/util/scrubber/go.sum b/pkg/util/scrubber/go.sum index 7415634da7791..9946cb087f892 100644 --- a/pkg/util/scrubber/go.sum +++ b/pkg/util/scrubber/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/pkg/util/sort/go.mod b/pkg/util/sort/go.mod index 8f94719ed921e..8a2e9f4c0340c 100644 --- a/pkg/util/sort/go.mod +++ b/pkg/util/sort/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/util/sort go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/util/sort/go.sum b/pkg/util/sort/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/util/sort/go.sum +++ b/pkg/util/sort/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/startstop/go.mod b/pkg/util/startstop/go.mod index d40b202c5a2d5..4b8aeca58989c 100644 --- a/pkg/util/startstop/go.mod +++ b/pkg/util/startstop/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/util/startstop go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/util/startstop/go.sum b/pkg/util/startstop/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/util/startstop/go.sum +++ b/pkg/util/startstop/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/statstracker/go.mod b/pkg/util/statstracker/go.mod index a46771e15eacf..b6c6b78922c60 100644 --- a/pkg/util/statstracker/go.mod +++ b/pkg/util/statstracker/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/util/statstracker go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/util/statstracker/go.sum b/pkg/util/statstracker/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/util/statstracker/go.sum +++ b/pkg/util/statstracker/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/system/go.mod b/pkg/util/system/go.mod index 0bf997443b822..511a9d3655ba7 100644 --- a/pkg/util/system/go.mod +++ b/pkg/util/system/go.mod @@ -18,7 +18,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.0-rc.3 github.com/shirou/gopsutil/v3 v3.23.12 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 golang.org/x/sys v0.27.0 ) diff --git a/pkg/util/system/go.sum b/pkg/util/system/go.sum index 91c1c1aab4320..4a302f99b9afb 100644 --- a/pkg/util/system/go.sum +++ b/pkg/util/system/go.sum @@ -29,8 +29,8 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= diff --git a/pkg/util/testutil/go.mod b/pkg/util/testutil/go.mod index 4722f205ecb6d..68cb7a15be3da 100644 --- a/pkg/util/testutil/go.mod +++ b/pkg/util/testutil/go.mod @@ -3,7 +3,7 @@ module github.com/DataDog/datadog-agent/pkg/util/testutil go 1.22.0 require ( - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/pkg/util/testutil/go.sum b/pkg/util/testutil/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/util/testutil/go.sum +++ b/pkg/util/testutil/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/utilizationtracker/go.mod b/pkg/util/utilizationtracker/go.mod index fd269ca0657a7..62e98ac848136 100644 --- a/pkg/util/utilizationtracker/go.mod +++ b/pkg/util/utilizationtracker/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/benbjohnson/clock v1.3.5 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/pkg/util/utilizationtracker/go.sum b/pkg/util/utilizationtracker/go.sum index 29fbd520c2821..ff6fcd97668a0 100644 --- a/pkg/util/utilizationtracker/go.sum +++ b/pkg/util/utilizationtracker/go.sum @@ -4,8 +4,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/util/uuid/go.sum b/pkg/util/uuid/go.sum index 181bb4f0fbf07..76258cf37685f 100644 --- a/pkg/util/uuid/go.sum +++ b/pkg/util/uuid/go.sum @@ -29,8 +29,8 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= diff --git a/pkg/util/winutil/go.mod b/pkg/util/winutil/go.mod index ba65d9206eb37..870749902af1a 100644 --- a/pkg/util/winutil/go.mod +++ b/pkg/util/winutil/go.mod @@ -11,7 +11,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 github.com/fsnotify/fsnotify v1.7.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 golang.org/x/sys v0.27.0 ) diff --git a/pkg/util/winutil/go.sum b/pkg/util/winutil/go.sum index e0dc36d7b4670..024be704560f4 100644 --- a/pkg/util/winutil/go.sum +++ b/pkg/util/winutil/go.sum @@ -6,8 +6,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= diff --git a/pkg/version/go.mod b/pkg/version/go.mod index 4bc287cf8e086..19cfbe1f41d48 100644 --- a/pkg/version/go.mod +++ b/pkg/version/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/pkg/version go 1.22.0 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/version/go.sum b/pkg/version/go.sum index 60ce688a04104..713a0b4f0a3a9 100644 --- a/pkg/version/go.sum +++ b/pkg/version/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/test/fakeintake/go.mod b/test/fakeintake/go.mod index 9665716301cb7..4b0d70c6581b9 100644 --- a/test/fakeintake/go.mod +++ b/test/fakeintake/go.mod @@ -21,7 +21,7 @@ require ( github.com/prometheus/client_golang v1.17.0 github.com/samber/lo v1.39.0 github.com/spf13/cobra v1.8.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/tinylib/msgp v1.1.8 google.golang.org/protobuf v1.33.0 modernc.org/sqlite v1.29.5 diff --git a/test/fakeintake/go.sum b/test/fakeintake/go.sum index d93977f79cdd4..393cb44415e62 100644 --- a/test/fakeintake/go.sum +++ b/test/fakeintake/go.sum @@ -80,8 +80,8 @@ github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index 1fbadfd55daff..e5286b1a6623f 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -80,7 +80,7 @@ require ( github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1 github.com/pulumi/pulumi/sdk/v3 v3.140.0 github.com/samber/lo v1.47.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/xeipuuv/gojsonschema v1.2.0 golang.org/x/crypto v0.29.0 golang.org/x/sys v0.27.0 diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index e1bf799b32880..966eb25eb3d8b 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -487,8 +487,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/texttheater/golang-levenshtein v1.0.1 h1:+cRNoVrfiwufQPhoMzB6N0Yf/Mqajr6t1lOv8GyGE2U= github.com/texttheater/golang-levenshtein v1.0.1/go.mod h1:PYAKrbF5sAiq9wd+H82hs7gNaen0CplQ9uvm6+enD/8= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= diff --git a/test/otel/go.mod b/test/otel/go.mod index 793d0622ee5a3..20ff83b773e4c 100644 --- a/test/otel/go.mod +++ b/test/otel/go.mod @@ -253,7 +253,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stormcat24/protodep v0.1.8 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/tinylib/msgp v1.1.9 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect diff --git a/test/otel/go.sum b/test/otel/go.sum index 5f4a1d4e8b03b..0b9de9dec8d57 100644 --- a/test/otel/go.sum +++ b/test/otel/go.sum @@ -343,8 +343,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tinylib/msgp v1.1.9 h1:SHf3yoO2sGA0veCJeCBYLHuttAVFHGm2RHgNodW7wQU= github.com/tinylib/msgp v1.1.9/go.mod h1:BCXGB54lDD8qUEPmiG0cQQUANC4IUQyB2ItS2UDlO/k= From 145152b1090b0063071c620ae3365812d08ac51a Mon Sep 17 00:00:00 2001 From: Alexandre Menasria <47357713+amenasria@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:16:45 +0100 Subject: [PATCH 43/59] [CI] Make the `tests_macos_gitlab_amd64` job not allowed to fail anymore (#31612) --- .gitlab/source_test/macos.yml | 2 +- comp/core/tagger/impl-remote/remote_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab/source_test/macos.yml b/.gitlab/source_test/macos.yml index 63d660ce8bf7c..da5ed4d68c8cf 100644 --- a/.gitlab/source_test/macos.yml +++ b/.gitlab/source_test/macos.yml @@ -40,7 +40,6 @@ tests_macos: rules: - !reference [.except_mergequeue] - when: on_success - allow_failure: true extends: .macos_gitlab needs: ["go_deps", "go_tools_deps"] variables: @@ -78,6 +77,7 @@ tests_macos_gitlab_arm64: rules: !reference [.manual] tags: ["macos:monterey-arm64", "specific:true"] + allow_failure: true after_script: - !reference [.vault_login] - !reference [.select_python_env_commands] diff --git a/comp/core/tagger/impl-remote/remote_test.go b/comp/core/tagger/impl-remote/remote_test.go index 60159eff7943f..8d29a965b8a23 100644 --- a/comp/core/tagger/impl-remote/remote_test.go +++ b/comp/core/tagger/impl-remote/remote_test.go @@ -7,6 +7,8 @@ package remotetaggerimpl import ( "context" + "os" + "runtime" "testing" "github.com/stretchr/testify/require" @@ -21,6 +23,9 @@ import ( ) func TestStart(t *testing.T) { + if os.Getenv("CI") == "true" && runtime.GOOS == "darwin" { + t.Skip("TestStart is known to fail on the macOS Gitlab runners because of the already running Agent") + } grpcServer, authToken, err := grpc.NewMockGrpcSecureServer("5001") require.NoError(t, err) defer grpcServer.Stop() From 795f8204212c31b584170b9408436508ff01406e Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Fri, 29 Nov 2024 16:16:52 +0100 Subject: [PATCH 44/59] Fix the RELEASE_BRANCH_PATTERN (#31611) --- tasks/libs/ciproviders/github_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/libs/ciproviders/github_api.py b/tasks/libs/ciproviders/github_api.py index 4d1b3e6a6319b..48bd741c85748 100644 --- a/tasks/libs/ciproviders/github_api.py +++ b/tasks/libs/ciproviders/github_api.py @@ -28,7 +28,7 @@ __all__ = ["GithubAPI"] -RELEASE_BRANCH_PATTERN = re.compile(r"\d+\.\d+\.x") +RELEASE_BRANCH_PATTERN = re.compile(r"^\d+\.\d+\.x$") class GithubAPI: From 102d8e44ff1e8642fa860d7c9cc5ad6b253d4039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Fri, 29 Nov 2024 16:56:54 +0100 Subject: [PATCH 45/59] Revert "omnibus: don't build the agent twice on heroku (#31572)" (#31625) --- omnibus/config/software/datadog-agent.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/omnibus/config/software/datadog-agent.rb b/omnibus/config/software/datadog-agent.rb index 139b18f469612..cabf4557c735c 100644 --- a/omnibus/config/software/datadog-agent.rb +++ b/omnibus/config/software/datadog-agent.rb @@ -85,14 +85,14 @@ command "inv -e rtloader.install" include_sds = "" - if linux_target? && !heroku_target? + if linux_target? include_sds = "--include-sds" # we only support SDS on Linux targets for now end - agent_bin = "" + command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg}", env: env + if heroku_target? - agent_bin = "--agent-bin=bin/agent/core-agent" + command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent", env: env end - command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} #{agent_bin}", env: env end if osx_target? From daad6bc7197f23d24a8a07678fa543a64381c889 Mon Sep 17 00:00:00 2001 From: Baptiste Foy Date: Fri, 29 Nov 2024 17:53:20 +0100 Subject: [PATCH 46/59] upgrade(installer): Report and store policies metadata (#31474) --- pkg/fleet/daemon/daemon.go | 22 +- pkg/fleet/installer/installer.go | 8 +- pkg/fleet/installer/repository/repository.go | 44 ++ pkg/fleet/internal/cdn/cdn.go | 131 +++- pkg/fleet/internal/cdn/cdn_http.go | 49 +- pkg/fleet/internal/cdn/cdn_local.go | 35 +- pkg/fleet/internal/cdn/cdn_noop.go | 27 +- pkg/fleet/internal/cdn/cdn_rc.go | 50 +- .../internal/cdn/config_datadog_agent.go | 26 +- pkg/fleet/internal/cdn/config_datadog_apm.go | 25 +- .../datadog/remoteconfig/remoteconfig.proto | 14 +- pkg/proto/pbgo/core/remoteconfig.pb.go | 638 ++++++++++-------- pkg/proto/pbgo/core/remoteconfig_gen.go | 361 +++++++++- pkg/proto/pbgo/core/remoteconfig_gen_test.go | 58 ++ test/new-e2e/go.mod | 3 + test/new-e2e/go.sum | 19 + .../installer/unix/upgrade_scenario_test.go | 9 + 17 files changed, 1033 insertions(+), 486 deletions(-) diff --git a/pkg/fleet/daemon/daemon.go b/pkg/fleet/daemon/daemon.go index dab1305100748..d4d99ff7fd68e 100644 --- a/pkg/fleet/daemon/daemon.go +++ b/pkg/fleet/daemon/daemon.go @@ -71,7 +71,7 @@ type daemonImpl struct { env *env.Env installer installer.Installer rc *remoteConfig - cdn cdn.CDN + cdn *cdn.CDN catalog catalog requests chan remoteAPIRequest requestsWG sync.WaitGroup @@ -105,7 +105,7 @@ func NewDaemon(rcFetcher client.ConfigFetcher, config config.Reader) (Daemon, er return newDaemon(rc, installer, env, cdn), nil } -func newDaemon(rc *remoteConfig, installer installer.Installer, env *env.Env, cdn cdn.CDN) *daemonImpl { +func newDaemon(rc *remoteConfig, installer installer.Installer, env *env.Env, cdn *cdn.CDN) *daemonImpl { i := &daemonImpl{ env: env, rc: rc, @@ -556,15 +556,15 @@ func setRequestDone(ctx context.Context, err error) { } } -func (d *daemonImpl) resolveRemoteConfigVersion(ctx context.Context, pkg string) (string, error) { +func (d *daemonImpl) resolveRemoteConfigVersion(ctx context.Context, pkg string) (*pbgo.PoliciesState, error) { if !d.env.RemotePolicies { - return "", nil + return nil, nil } config, err := d.cdn.Get(ctx, pkg) if err != nil { - return "", err + return nil, err } - return config.Version(), nil + return config.State(), nil } func (d *daemonImpl) refreshState(ctx context.Context) { @@ -597,13 +597,13 @@ func (d *daemonImpl) refreshState(ctx context.Context) { } cs, hasConfig := configState[pkg] if hasConfig { - p.StableConfigVersion = cs.Stable - p.ExperimentConfigVersion = cs.Experiment + p.StableConfigState = cs.StablePoliciesState + p.ExperimentConfigState = cs.ExperimentPoliciesState } - configVersion, err := d.resolveRemoteConfigVersion(ctx, pkg) - if err == nil { - p.RemoteConfigVersion = configVersion + configState, err := d.resolveRemoteConfigVersion(ctx, pkg) + if err == nil && configState != nil { + p.RemoteConfigState = configState } else if err != cdn.ErrProductNotSupported { log.Warnf("could not get remote config version: %v", err) } diff --git a/pkg/fleet/installer/installer.go b/pkg/fleet/installer/installer.go index 391c5a1e2069a..4b62c43b5aee9 100644 --- a/pkg/fleet/installer/installer.go +++ b/pkg/fleet/installer/installer.go @@ -72,7 +72,7 @@ type installerImpl struct { m sync.Mutex env *fleetEnv.Env - cdn cdn.CDN + cdn *cdn.CDN db *db.PackagesDB downloader *oci.Downloader packages *repository.Repositories @@ -308,8 +308,8 @@ func (i *installerImpl) InstallConfigExperiment(ctx context.Context, pkg string, if err != nil { return fmt.Errorf("could not get cdn config: %w", err) } - if config.Version() != version { - return fmt.Errorf("version mismatch: expected %s, got %s", config.Version(), version) + if config.State().GetVersion() != version { + return fmt.Errorf("version mismatch: expected %s, got %s", config.State().GetVersion(), version) } tmpDir, err := i.packages.MkdirTemp() @@ -619,7 +619,7 @@ func (i *installerImpl) configurePackage(ctx context.Context, pkg string) (err e if err != nil { return fmt.Errorf("could not write %s config: %w", pkg, err) } - err = i.configs.Create(pkg, config.Version(), tmpDir) + err = i.configs.Create(pkg, config.State().GetVersion(), tmpDir) if err != nil { return fmt.Errorf("could not create %s repository: %w", pkg, err) } diff --git a/pkg/fleet/installer/repository/repository.go b/pkg/fleet/installer/repository/repository.go index 559bf88854641..b83a03d4e81d7 100644 --- a/pkg/fleet/installer/repository/repository.go +++ b/pkg/fleet/installer/repository/repository.go @@ -7,6 +7,7 @@ package repository import ( + "encoding/json" "errors" "fmt" "io/fs" @@ -16,6 +17,7 @@ import ( "github.com/DataDog/gopsutil/process" + pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -62,6 +64,9 @@ type Repository struct { type State struct { Stable string Experiment string + + StablePoliciesState *pbgo.PoliciesState + ExperimentPoliciesState *pbgo.PoliciesState } // HasStable returns true if the repository has a stable package. @@ -98,12 +103,51 @@ func (r *Repository) GetState() (State, error) { if experiment == stable { experiment = "" } + + // Load the policies state + stablePoliciesState, err := r.loadPoliciesMetadata(stable) + if err != nil { + return State{}, fmt.Errorf("could not load stable policies state: %w", err) + } + + experimentPoliciesState, err := r.loadPoliciesMetadata(experiment) + if err != nil { + return State{}, fmt.Errorf("could not load experiment policies state: %w", err) + } + return State{ Stable: stable, Experiment: experiment, + + StablePoliciesState: stablePoliciesState, + ExperimentPoliciesState: experimentPoliciesState, }, nil } +func (r *Repository) loadPoliciesMetadata(version string) (*pbgo.PoliciesState, error) { + if version == "" { + return nil, nil + } + + statePath := filepath.Join(r.rootPath, version, "policy.metadata") + stateFile, err := os.ReadFile(statePath) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil, nil + } + return nil, fmt.Errorf("could not read policies state: %w", err) + } + + state := &pbgo.PoliciesState{} + err = json.Unmarshal(stateFile, state) + if err != nil { + return nil, fmt.Errorf("could not unmarshal policies state: %w", err) + } + state.Version = version + + return state, nil +} + // Create creates a fresh new repository at the given root path // and moves the given stable source path to the repository as the first stable. // If a repository already exists at the given path, it is fully removed. diff --git a/pkg/fleet/internal/cdn/cdn.go b/pkg/fleet/internal/cdn/cdn.go index 38083cccd5314..5f1ae7865a1d0 100644 --- a/pkg/fleet/internal/cdn/cdn.go +++ b/pkg/fleet/internal/cdn/cdn.go @@ -8,12 +8,20 @@ package cdn import ( "context" + "encoding/json" "errors" + "fmt" + "os" + "path/filepath" "runtime" "github.com/DataDog/datadog-agent/pkg/fleet/env" + pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" + "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) +const policyMetadataFilename = "policy.metadata" + var ( // ErrProductNotSupported is returned when the product is not supported. ErrProductNotSupported = errors.New("product not supported") @@ -21,24 +29,39 @@ var ( // Config represents a configuration. type Config interface { - Version() string + State() *pbgo.PoliciesState Write(dir string) error } +// fetcher provides access to the Remote Config CDN. +type fetcher interface { + get(ctx context.Context) ([][]byte, error) + close() error +} + // CDN provides access to the Remote Config CDN. -type CDN interface { - Get(ctx context.Context, pkg string) (Config, error) - Close() error +type CDN struct { + fetcher fetcher + hostTagsGetter hostTagsGetter } // New creates a new CDN and chooses the implementation depending // on the environment -func New(env *env.Env, configDBPath string) (CDN, error) { +func New(env *env.Env, configDBPath string) (*CDN, error) { + cdn := CDN{ + hostTagsGetter: newHostTagsGetter(env), + } + if runtime.GOOS == "windows" { // There's an assumption on windows that some directories are already there // but they are in fact created by the regular CDN implementation. Until // there is a fix on windows we keep the previous CDN behaviour for them - return newCDNHTTP(env, configDBPath) + fetcher, err := newHTTPFetcher(env, configDBPath) + if err != nil { + return nil, err + } + cdn.fetcher = fetcher + return &cdn, nil } if !env.RemotePolicies { @@ -46,21 +69,109 @@ func New(env *env.Env, configDBPath string) (CDN, error) { // and we don't want to create the directories that the CDN // implementation would create. We return a no-op CDN to avoid // nil pointer dereference. - return newCDNNoop() + fetcher, err := newNoopFetcher() + if err != nil { + return nil, err + } + cdn.fetcher = fetcher + return &cdn, nil } if env.CDNLocalDirPath != "" { // Mock the CDN for local development or testing - return newCDNLocal(env) + fetcher, err := newLocalFetcher(env) + if err != nil { + return nil, err + } + cdn.fetcher = fetcher + return &cdn, nil } if !env.CDNEnabled { // Remote policies are enabled but we don't want to use the CDN // as it's still in development. We use standard remote config calls // instead (dubbed "direct" CDN). - return newCDNRC(env, configDBPath) + fetcher, err := newRCFetcher(env, configDBPath) + if err != nil { + return nil, err + } + cdn.fetcher = fetcher + return &cdn, nil } // Regular CDN with the cloudfront distribution - return newCDNHTTP(env, configDBPath) + fetcher, err := newHTTPFetcher(env, configDBPath) + if err != nil { + return nil, err + } + cdn.fetcher = fetcher + return &cdn, nil +} + +// Get fetches the configuration for the given package. +func (c *CDN) Get(ctx context.Context, pkg string) (cfg Config, err error) { + span, _ := tracer.StartSpanFromContext(ctx, "cdn.Get") + defer func() { + spanErr := err + if spanErr == ErrProductNotSupported { + spanErr = nil + } + span.Finish(tracer.WithError(spanErr)) + }() + + switch pkg { + case "datadog-agent": + orderedLayers, err := c.fetcher.get(ctx) + if err != nil { + return nil, err + } + cfg, err = newAgentConfig(orderedLayers...) + if err != nil { + return nil, err + } + case "datadog-apm-inject": + orderedLayers, err := c.fetcher.get(ctx) + if err != nil { + return nil, err + } + cfg, err = newAPMConfig(c.hostTagsGetter.get(), orderedLayers...) + if err != nil { + return nil, err + } + default: + return nil, ErrProductNotSupported + } + + return cfg, nil +} + +// Close closes the CDN. +func (c *CDN) Close() error { + return c.fetcher.close() +} + +// writePolicyMetadata writes the policy metadata to the given directory +// and makes it readable to dd-agent +func writePolicyMetadata(config Config, dir string) error { + ddAgentUID, ddAgentGID, err := getAgentIDs() + if err != nil { + return fmt.Errorf("error getting dd-agent user and group IDs: %w", err) + } + + state := config.State() + stateBytes, err := json.Marshal(state) + if err != nil { + return fmt.Errorf("could not marshal state: %w", err) + } + err = os.WriteFile(filepath.Join(dir, policyMetadataFilename), stateBytes, 0440) + if err != nil { + return fmt.Errorf("could not write %s: %w", policyMetadataFilename, err) + } + if runtime.GOOS != "windows" { + err = os.Chown(filepath.Join(dir, policyMetadataFilename), ddAgentUID, ddAgentGID) + if err != nil { + return fmt.Errorf("could not chown %s: %w", policyMetadataFilename, err) + } + } + return nil } diff --git a/pkg/fleet/internal/cdn/cdn_http.go b/pkg/fleet/internal/cdn/cdn_http.go index 98633efdf46d4..53d8f379d124e 100644 --- a/pkg/fleet/internal/cdn/cdn_http.go +++ b/pkg/fleet/internal/cdn/cdn_http.go @@ -16,17 +16,16 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/version" "github.com/DataDog/go-tuf/data" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) -type cdnHTTP struct { +type fetcherHTTP struct { client *remoteconfig.HTTPClient currentRootsVersion uint64 hostTagsGetter hostTagsGetter env *env.Env } -func newCDNHTTP(env *env.Env, configDBPath string) (CDN, error) { +func newHTTPFetcher(env *env.Env, configDBPath string) (fetcher, error) { client, err := remoteconfig.NewHTTPClient( configDBPath, env.Site, @@ -36,7 +35,7 @@ func newCDNHTTP(env *env.Env, configDBPath string) (CDN, error) { if err != nil { return nil, err } - return &cdnHTTP{ + return &fetcherHTTP{ client: client, currentRootsVersion: 1, hostTagsGetter: newHostTagsGetter(env), @@ -44,51 +43,13 @@ func newCDNHTTP(env *env.Env, configDBPath string) (CDN, error) { }, nil } -// Get gets the configuration from the CDN. -func (c *cdnHTTP) Get(ctx context.Context, pkg string) (cfg Config, err error) { - span, _ := tracer.StartSpanFromContext(ctx, "cdn.Get") - span.SetTag("cdn_type", "cdn") - defer func() { - spanErr := err - if spanErr == ErrProductNotSupported { - spanErr = nil - } - span.Finish(tracer.WithError(spanErr)) - }() - - switch pkg { - case "datadog-agent": - orderedLayers, err := c.get(ctx) - if err != nil { - return nil, err - } - cfg, err = newAgentConfig(orderedLayers...) - if err != nil { - return nil, err - } - case "datadog-apm-inject": - orderedLayers, err := c.get(ctx) - if err != nil { - return nil, err - } - cfg, err = newAPMConfig(c.hostTagsGetter.get(), orderedLayers...) - if err != nil { - return nil, err - } - default: - return nil, ErrProductNotSupported - } - - return cfg, nil -} - // Close cleans up the CDN's resources -func (c *cdnHTTP) Close() error { +func (c *fetcherHTTP) close() error { return c.client.Close() } // get calls the Remote Config service to get the ordered layers. -func (c *cdnHTTP) get(ctx context.Context) ([][]byte, error) { +func (c *fetcherHTTP) get(ctx context.Context) ([][]byte, error) { agentConfigUpdate, err := c.client.GetCDNConfigUpdate( ctx, []string{"AGENT_CONFIG"}, diff --git a/pkg/fleet/internal/cdn/cdn_local.go b/pkg/fleet/internal/cdn/cdn_local.go index 83d6ed412cede..6cfefe31732b3 100644 --- a/pkg/fleet/internal/cdn/cdn_local.go +++ b/pkg/fleet/internal/cdn/cdn_local.go @@ -14,19 +14,18 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/env" ) -type cdnLocal struct { +type fetcherLocal struct { dirPath string } -// newCDNLocal creates a new local CDN. -func newCDNLocal(env *env.Env) (CDN, error) { - return &cdnLocal{ +// newfetcherLocal creates a new local CDN. +func newLocalFetcher(env *env.Env) (fetcher, error) { + return &fetcherLocal{ dirPath: env.CDNLocalDirPath, }, nil } -// Get gets the configuration from the CDN. -func (c *cdnLocal) Get(_ context.Context, pkg string) (cfg Config, err error) { +func (c *fetcherLocal) get(_ context.Context) (orderedLayers [][]byte, err error) { f, err := os.ReadDir(c.dirPath) if err != nil { return nil, fmt.Errorf("couldn't read directory %s: %w", c.dirPath, err) @@ -46,29 +45,9 @@ func (c *cdnLocal) Get(_ context.Context, pkg string) (cfg Config, err error) { files[file.Name()] = contents } - layers, err := getOrderedScopedLayers(files, nil) - if err != nil { - return nil, err - } - - switch pkg { - case "datadog-agent": - cfg, err = newAgentConfig(layers...) - if err != nil { - return nil, err - } - case "datadog-apm-inject": - cfg, err = newAPMConfig([]string{}, layers...) - if err != nil { - return nil, err - } - default: - return nil, ErrProductNotSupported - } - - return cfg, nil + return getOrderedScopedLayers(files, nil) } -func (c *cdnLocal) Close() error { +func (c *fetcherLocal) close() error { return nil } diff --git a/pkg/fleet/internal/cdn/cdn_noop.go b/pkg/fleet/internal/cdn/cdn_noop.go index b18e0e788c011..9be9fb1ae3264 100644 --- a/pkg/fleet/internal/cdn/cdn_noop.go +++ b/pkg/fleet/internal/cdn/cdn_noop.go @@ -11,33 +11,20 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/log" ) -type cdnNoop struct { +type fetcherNoop struct { } -type configNoop struct{} - -// newCDNNoop creates a new noop CDN. -func newCDNNoop() (CDN, error) { - return &cdnNoop{}, nil +// newNoopFetcher creates a new noop CDN. +func newNoopFetcher() (fetcher, error) { + return &fetcherNoop{}, nil } -// Get gets the configuration from the CDN. -func (c *cdnNoop) Get(_ context.Context, _ string) (Config, error) { +func (c *fetcherNoop) get(_ context.Context) ([][]byte, error) { log.Debug("Noop CDN get") - return &configNoop{}, nil + return nil, nil } -func (c *cdnNoop) Close() error { +func (c *fetcherNoop) close() error { log.Debug("Noop CDN close") return nil } - -func (c *configNoop) Version() string { - log.Debug("Noop CDN version") - return "" -} - -func (c *configNoop) Write(_ string) error { - log.Debug("Noop CDN write") - return nil -} diff --git a/pkg/fleet/internal/cdn/cdn_rc.go b/pkg/fleet/internal/cdn/cdn_rc.go index afee2a514fe67..e3db586530dd2 100644 --- a/pkg/fleet/internal/cdn/cdn_rc.go +++ b/pkg/fleet/internal/cdn/cdn_rc.go @@ -22,10 +22,9 @@ import ( "github.com/DataDog/datadog-agent/pkg/version" "github.com/DataDog/go-tuf/data" "github.com/google/uuid" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) -type cdnRC struct { +type fetcherRC struct { rcService *remoteconfig.CoreAgentService currentRootsVersion uint64 clientUUID string @@ -35,9 +34,9 @@ type cdnRC struct { env *env.Env } -// newCDNRC creates a new CDN with RC: it fetches the configuration from the remote config service instead of cloudfront +// newRCFetcher creates a new CDN fetcher with RC: it fetches the configuration from the remote config service instead of cloudfront // note: naming is a bit misleading, it's not really a cdn, but we're following the convention -func newCDNRC(env *env.Env, configDBPath string) (CDN, error) { +func newRCFetcher(env *env.Env, configDBPath string) (fetcher, error) { ctx := context.Background() ctx, cc := context.WithTimeout(ctx, 10*time.Second) defer cc() @@ -80,7 +79,7 @@ func newCDNRC(env *env.Env, configDBPath string) (CDN, error) { if err != nil { return nil, err } - cdn := &cdnRC{ + cdn := &fetcherRC{ rcService: service, currentRootsVersion: 1, clientUUID: uuid.New().String(), @@ -93,45 +92,8 @@ func newCDNRC(env *env.Env, configDBPath string) (CDN, error) { return cdn, nil } -func (c *cdnRC) Get(ctx context.Context, pkg string) (cfg Config, err error) { - span, _ := tracer.StartSpanFromContext(ctx, "cdn.Get") - span.SetTag("cdn_type", "remote_config") - defer func() { - spanErr := err - if spanErr == ErrProductNotSupported { - spanErr = nil - } - span.Finish(tracer.WithError(spanErr)) - }() - - switch pkg { - case "datadog-agent": - orderedLayers, err := c.get(ctx) - if err != nil { - return nil, err - } - cfg, err = newAgentConfig(orderedLayers...) - if err != nil { - return nil, err - } - case "datadog-apm-inject": - orderedLayers, err := c.get(ctx) - if err != nil { - return nil, err - } - cfg, err = newAPMConfig(c.hostTagsGetter.get(), orderedLayers...) - if err != nil { - return nil, err - } - default: - return nil, ErrProductNotSupported - } - - return cfg, nil -} - // get calls the Remote Config service to get the ordered layers. -func (c *cdnRC) get(ctx context.Context) ([][]byte, error) { +func (c *fetcherRC) get(ctx context.Context) ([][]byte, error) { if c.firstRequest { // A first request is made to the remote config service at service startup, // so if we do another request too close to the first one (in the same second) @@ -198,7 +160,7 @@ func (c *cdnRC) get(ctx context.Context) ([][]byte, error) { ) } -func (c *cdnRC) Close() error { +func (c *fetcherRC) close() error { err := c.rcService.Stop() if err != nil { return err diff --git a/pkg/fleet/internal/cdn/config_datadog_agent.go b/pkg/fleet/internal/cdn/config_datadog_agent.go index 8698095be1268..b9882ebaad469 100644 --- a/pkg/fleet/internal/cdn/config_datadog_agent.go +++ b/pkg/fleet/internal/cdn/config_datadog_agent.go @@ -16,6 +16,7 @@ import ( "runtime" "strconv" + pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" "github.com/DataDog/datadog-agent/pkg/util/log" "gopkg.in/yaml.v2" ) @@ -31,7 +32,9 @@ const ( // agentConfig represents the agent configuration from the CDN. type agentConfig struct { - version string + version string + policyIDs []string + datadog []byte securityAgent []byte systemProbe []byte @@ -45,14 +48,17 @@ type agentConfigLayer struct { SystemProbeConfig map[string]interface{} `json:"system_probe"` } -// Version returns the version (hash) of the agent configuration. -func (a *agentConfig) Version() string { - return a.version +// State returns the agent policies state +func (a *agentConfig) State() *pbgo.PoliciesState { + return &pbgo.PoliciesState{ + MatchedPolicies: a.policyIDs, + Version: a.version, + } } func newAgentConfig(orderedLayers ...[]byte) (*agentConfig, error) { // Compile ordered layers into a single config - layerIDs := []string{} + policyIDs := []string{} compiledLayer := &agentConfigLayer{ AgentConfig: map[string]interface{}{}, SecurityAgentConfig: map[string]interface{}{}, @@ -69,7 +75,7 @@ func newAgentConfig(orderedLayers ...[]byte) (*agentConfig, error) { continue } - layerIDs = append(layerIDs, layer.ID) + policyIDs = append(policyIDs, layer.ID) if layer.AgentConfig != nil { agentConfig, err := merge(compiledLayer.AgentConfig, layer.AgentConfig) @@ -97,7 +103,7 @@ func newAgentConfig(orderedLayers ...[]byte) (*agentConfig, error) { } // Report applied layers - compiledLayer.AgentConfig[layerKeys] = layerIDs + compiledLayer.AgentConfig[layerKeys] = policyIDs // Marshal into YAML configs config, err := marshalAgentConfig(compiledLayer.AgentConfig) @@ -121,7 +127,9 @@ func newAgentConfig(orderedLayers ...[]byte) (*agentConfig, error) { hash.Write(version) return &agentConfig{ - version: fmt.Sprintf("%x", hash.Sum(nil)), + version: fmt.Sprintf("%x", hash.Sum(nil)), + policyIDs: policyIDs, + datadog: config, securityAgent: securityAgentConfig, systemProbe: systemProbeConfig, @@ -171,7 +179,7 @@ func (a *agentConfig) Write(dir string) error { } } } - return nil + return writePolicyMetadata(a, dir) } // marshalAgentConfig marshals the config as YAML. diff --git a/pkg/fleet/internal/cdn/config_datadog_apm.go b/pkg/fleet/internal/cdn/config_datadog_apm.go index 30c2f2f19dceb..fd171f06e0d92 100644 --- a/pkg/fleet/internal/cdn/config_datadog_apm.go +++ b/pkg/fleet/internal/cdn/config_datadog_apm.go @@ -12,6 +12,7 @@ import ( "os" "path/filepath" + pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/vmihailenco/msgpack/v5" ) @@ -22,7 +23,9 @@ const ( // apmConfig represents the injector configuration from the CDN. type apmConfig struct { - version string + version string + policyIDs []string + injectorConfig []byte } @@ -32,14 +35,18 @@ type apmConfigLayer struct { InjectorConfig map[string]interface{} `json:"apm_ssi_config"` } -// Version returns the version (hash) of the agent configuration. -func (i *apmConfig) Version() string { - return i.version +// State returns the APM configs state +func (i *apmConfig) State() *pbgo.PoliciesState { + return &pbgo.PoliciesState{ + MatchedPolicies: i.policyIDs, + Version: i.version, + } } func newAPMConfig(hostTags []string, orderedLayers ...[]byte) (*apmConfig, error) { // Compile ordered layers into a single config // TODO: maybe we don't want that and we should reject if there are more than one config? + policyIDs := []string{} compiledLayer := &apmConfigLayer{ InjectorConfig: map[string]interface{}{}, } @@ -50,12 +57,14 @@ func newAPMConfig(hostTags []string, orderedLayers ...[]byte) (*apmConfig, error continue } + // Only add layers that match the injector if layer.InjectorConfig != nil { injectorConfig, err := merge(compiledLayer.InjectorConfig, layer.InjectorConfig) if err != nil { return nil, err } compiledLayer.InjectorConfig = injectorConfig.(map[string]interface{}) + policyIDs = append(policyIDs, layer.ID) } } @@ -76,7 +85,9 @@ func newAPMConfig(hostTags []string, orderedLayers ...[]byte) (*apmConfig, error } return &apmConfig{ - version: fmt.Sprintf("%x", hash.Sum(nil)), + version: fmt.Sprintf("%x", hash.Sum(nil)), + policyIDs: policyIDs, + injectorConfig: injectorConfig, }, nil } @@ -86,8 +97,8 @@ func (i *apmConfig) Write(dir string) error { if i.injectorConfig != nil { err := os.WriteFile(filepath.Join(dir, injectorConfigFilename), []byte(i.injectorConfig), 0644) // Must be world readable if err != nil { - return fmt.Errorf("could not write datadog.yaml: %w", err) + return fmt.Errorf("could not write %s: %w", injectorConfigFilename, err) } } - return nil + return writePolicyMetadata(i, dir) } diff --git a/pkg/proto/datadog/remoteconfig/remoteconfig.proto b/pkg/proto/datadog/remoteconfig/remoteconfig.proto index c592cde0fb2c2..488c406bae3d9 100644 --- a/pkg/proto/datadog/remoteconfig/remoteconfig.proto +++ b/pkg/proto/datadog/remoteconfig/remoteconfig.proto @@ -120,10 +120,18 @@ message PackageState { string package = 1; string stable_version = 2; string experiment_version = 3; - string stable_config_version = 5; - string experiment_config_version = 6; - string remote_config_version = 7; PackageStateTask task = 4; + reserved 5; + reserved 6; + reserved 7; + PoliciesState stable_config_state = 8; + PoliciesState experiment_config_state = 9; + PoliciesState remote_config_state = 10; +} + +message PoliciesState { + string version = 1; + repeated string matched_policies = 2; } message PackageStateTask { diff --git a/pkg/proto/pbgo/core/remoteconfig.pb.go b/pkg/proto/pbgo/core/remoteconfig.pb.go index e81826f5763ca..37f3f8aea7592 100644 --- a/pkg/proto/pbgo/core/remoteconfig.pb.go +++ b/pkg/proto/pbgo/core/remoteconfig.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.28.3 // source: datadog/remoteconfig/remoteconfig.proto package core @@ -1100,13 +1100,13 @@ type PackageState struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` - StableVersion string `protobuf:"bytes,2,opt,name=stable_version,json=stableVersion,proto3" json:"stable_version,omitempty"` - ExperimentVersion string `protobuf:"bytes,3,opt,name=experiment_version,json=experimentVersion,proto3" json:"experiment_version,omitempty"` - StableConfigVersion string `protobuf:"bytes,5,opt,name=stable_config_version,json=stableConfigVersion,proto3" json:"stable_config_version,omitempty"` - ExperimentConfigVersion string `protobuf:"bytes,6,opt,name=experiment_config_version,json=experimentConfigVersion,proto3" json:"experiment_config_version,omitempty"` - RemoteConfigVersion string `protobuf:"bytes,7,opt,name=remote_config_version,json=remoteConfigVersion,proto3" json:"remote_config_version,omitempty"` - Task *PackageStateTask `protobuf:"bytes,4,opt,name=task,proto3" json:"task,omitempty"` + Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` + StableVersion string `protobuf:"bytes,2,opt,name=stable_version,json=stableVersion,proto3" json:"stable_version,omitempty"` + ExperimentVersion string `protobuf:"bytes,3,opt,name=experiment_version,json=experimentVersion,proto3" json:"experiment_version,omitempty"` + Task *PackageStateTask `protobuf:"bytes,4,opt,name=task,proto3" json:"task,omitempty"` + StableConfigState *PoliciesState `protobuf:"bytes,8,opt,name=stable_config_state,json=stableConfigState,proto3" json:"stable_config_state,omitempty"` + ExperimentConfigState *PoliciesState `protobuf:"bytes,9,opt,name=experiment_config_state,json=experimentConfigState,proto3" json:"experiment_config_state,omitempty"` + RemoteConfigState *PoliciesState `protobuf:"bytes,10,opt,name=remote_config_state,json=remoteConfigState,proto3" json:"remote_config_state,omitempty"` } func (x *PackageState) Reset() { @@ -1162,30 +1162,85 @@ func (x *PackageState) GetExperimentVersion() string { return "" } -func (x *PackageState) GetStableConfigVersion() string { +func (x *PackageState) GetTask() *PackageStateTask { if x != nil { - return x.StableConfigVersion + return x.Task } - return "" + return nil } -func (x *PackageState) GetExperimentConfigVersion() string { +func (x *PackageState) GetStableConfigState() *PoliciesState { if x != nil { - return x.ExperimentConfigVersion + return x.StableConfigState } - return "" + return nil } -func (x *PackageState) GetRemoteConfigVersion() string { +func (x *PackageState) GetExperimentConfigState() *PoliciesState { if x != nil { - return x.RemoteConfigVersion + return x.ExperimentConfigState + } + return nil +} + +func (x *PackageState) GetRemoteConfigState() *PoliciesState { + if x != nil { + return x.RemoteConfigState + } + return nil +} + +type PoliciesState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + MatchedPolicies []string `protobuf:"bytes,2,rep,name=matched_policies,json=matchedPolicies,proto3" json:"matched_policies,omitempty"` +} + +func (x *PoliciesState) Reset() { + *x = PoliciesState{} + if protoimpl.UnsafeEnabled { + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PoliciesState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PoliciesState) ProtoMessage() {} + +func (x *PoliciesState) ProtoReflect() protoreflect.Message { + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PoliciesState.ProtoReflect.Descriptor instead. +func (*PoliciesState) Descriptor() ([]byte, []int) { + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{14} +} + +func (x *PoliciesState) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (x *PackageState) GetTask() *PackageStateTask { +func (x *PoliciesState) GetMatchedPolicies() []string { if x != nil { - return x.Task + return x.MatchedPolicies } return nil } @@ -1203,7 +1258,7 @@ type PackageStateTask struct { func (x *PackageStateTask) Reset() { *x = PackageStateTask{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1216,7 +1271,7 @@ func (x *PackageStateTask) String() string { func (*PackageStateTask) ProtoMessage() {} func (x *PackageStateTask) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1229,7 +1284,7 @@ func (x *PackageStateTask) ProtoReflect() protoreflect.Message { // Deprecated: Use PackageStateTask.ProtoReflect.Descriptor instead. func (*PackageStateTask) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{14} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{15} } func (x *PackageStateTask) GetId() string { @@ -1265,7 +1320,7 @@ type TaskError struct { func (x *TaskError) Reset() { *x = TaskError{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1278,7 +1333,7 @@ func (x *TaskError) String() string { func (*TaskError) ProtoMessage() {} func (x *TaskError) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1291,7 +1346,7 @@ func (x *TaskError) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskError.ProtoReflect.Descriptor instead. func (*TaskError) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{15} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{16} } func (x *TaskError) GetCode() uint64 { @@ -1323,7 +1378,7 @@ type ConfigState struct { func (x *ConfigState) Reset() { *x = ConfigState{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1336,7 +1391,7 @@ func (x *ConfigState) String() string { func (*ConfigState) ProtoMessage() {} func (x *ConfigState) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1349,7 +1404,7 @@ func (x *ConfigState) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigState.ProtoReflect.Descriptor instead. func (*ConfigState) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{16} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{17} } func (x *ConfigState) GetId() string { @@ -1403,7 +1458,7 @@ type ClientState struct { func (x *ClientState) Reset() { *x = ClientState{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1416,7 +1471,7 @@ func (x *ClientState) String() string { func (*ClientState) ProtoMessage() {} func (x *ClientState) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1429,7 +1484,7 @@ func (x *ClientState) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientState.ProtoReflect.Descriptor instead. func (*ClientState) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{17} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{18} } func (x *ClientState) GetRootVersion() uint64 { @@ -1486,7 +1541,7 @@ type TargetFileHash struct { func (x *TargetFileHash) Reset() { *x = TargetFileHash{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1499,7 +1554,7 @@ func (x *TargetFileHash) String() string { func (*TargetFileHash) ProtoMessage() {} func (x *TargetFileHash) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1512,7 +1567,7 @@ func (x *TargetFileHash) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetFileHash.ProtoReflect.Descriptor instead. func (*TargetFileHash) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{18} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{19} } func (x *TargetFileHash) GetAlgorithm() string { @@ -1542,7 +1597,7 @@ type TargetFileMeta struct { func (x *TargetFileMeta) Reset() { *x = TargetFileMeta{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1555,7 +1610,7 @@ func (x *TargetFileMeta) String() string { func (*TargetFileMeta) ProtoMessage() {} func (x *TargetFileMeta) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1568,7 +1623,7 @@ func (x *TargetFileMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetFileMeta.ProtoReflect.Descriptor instead. func (*TargetFileMeta) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{19} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{20} } func (x *TargetFileMeta) GetPath() string { @@ -1604,7 +1659,7 @@ type ClientGetConfigsRequest struct { func (x *ClientGetConfigsRequest) Reset() { *x = ClientGetConfigsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1617,7 +1672,7 @@ func (x *ClientGetConfigsRequest) String() string { func (*ClientGetConfigsRequest) ProtoMessage() {} func (x *ClientGetConfigsRequest) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1630,7 +1685,7 @@ func (x *ClientGetConfigsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientGetConfigsRequest.ProtoReflect.Descriptor instead. func (*ClientGetConfigsRequest) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{20} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{21} } func (x *ClientGetConfigsRequest) GetClient() *Client { @@ -1661,7 +1716,7 @@ type ClientGetConfigsResponse struct { func (x *ClientGetConfigsResponse) Reset() { *x = ClientGetConfigsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1674,7 +1729,7 @@ func (x *ClientGetConfigsResponse) String() string { func (*ClientGetConfigsResponse) ProtoMessage() {} func (x *ClientGetConfigsResponse) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1687,7 +1742,7 @@ func (x *ClientGetConfigsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientGetConfigsResponse.ProtoReflect.Descriptor instead. func (*ClientGetConfigsResponse) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{21} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{22} } func (x *ClientGetConfigsResponse) GetRoots() [][]byte { @@ -1730,7 +1785,7 @@ type FileMetaState struct { func (x *FileMetaState) Reset() { *x = FileMetaState{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1743,7 +1798,7 @@ func (x *FileMetaState) String() string { func (*FileMetaState) ProtoMessage() {} func (x *FileMetaState) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1756,7 +1811,7 @@ func (x *FileMetaState) ProtoReflect() protoreflect.Message { // Deprecated: Use FileMetaState.ProtoReflect.Descriptor instead. func (*FileMetaState) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{22} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{23} } func (x *FileMetaState) GetVersion() uint64 { @@ -1787,7 +1842,7 @@ type GetStateConfigResponse struct { func (x *GetStateConfigResponse) Reset() { *x = GetStateConfigResponse{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1800,7 +1855,7 @@ func (x *GetStateConfigResponse) String() string { func (*GetStateConfigResponse) ProtoMessage() {} func (x *GetStateConfigResponse) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1813,7 +1868,7 @@ func (x *GetStateConfigResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStateConfigResponse.ProtoReflect.Descriptor instead. func (*GetStateConfigResponse) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{23} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{24} } func (x *GetStateConfigResponse) GetConfigState() map[string]*FileMetaState { @@ -1861,7 +1916,7 @@ type TracerPredicateV1 struct { func (x *TracerPredicateV1) Reset() { *x = TracerPredicateV1{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1874,7 +1929,7 @@ func (x *TracerPredicateV1) String() string { func (*TracerPredicateV1) ProtoMessage() {} func (x *TracerPredicateV1) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1887,7 +1942,7 @@ func (x *TracerPredicateV1) ProtoReflect() protoreflect.Message { // Deprecated: Use TracerPredicateV1.ProtoReflect.Descriptor instead. func (*TracerPredicateV1) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{24} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{25} } func (x *TracerPredicateV1) GetClientID() string { @@ -1950,7 +2005,7 @@ type TracerPredicates struct { func (x *TracerPredicates) Reset() { *x = TracerPredicates{} if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1963,7 +2018,7 @@ func (x *TracerPredicates) String() string { func (*TracerPredicates) ProtoMessage() {} func (x *TracerPredicates) ProtoReflect() protoreflect.Message { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25] + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1976,7 +2031,7 @@ func (x *TracerPredicates) ProtoReflect() protoreflect.Message { // Deprecated: Use TracerPredicates.ProtoReflect.Descriptor instead. func (*TracerPredicates) Descriptor() ([]byte, []int) { - return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{25} + return file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP(), []int{26} } func (x *TracerPredicates) GetTracerPredicatesV1() []*TracerPredicateV1 { @@ -2162,7 +2217,7 @@ var file_datadog_remoteconfig_remoteconfig_proto_rawDesc = []byte{ 0x65, 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x61, 0x76, 0x61, 0x69, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x70, 0x61, 0x63, 0x65, 0x22, 0xd8, 0x02, + 0x61, 0x62, 0x6c, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x70, 0x61, 0x63, 0x65, 0x22, 0xbb, 0x03, 0x0a, 0x0c, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x62, @@ -2170,164 +2225,175 @@ var file_datadog_remoteconfig_remoteconfig_proto_rawDesc = []byte{ 0x52, 0x0d, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x78, 0x70, - 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, - 0x0a, 0x15, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x19, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, - 0x0a, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x61, - 0x73, 0x6b, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x50, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, - 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, - 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, - 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, - 0x61, 0x73, 0x6b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, - 0x39, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x1f, - 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x22, 0x80, 0x02, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x72, 0x6f, 0x6f, 0x74, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x5f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0d, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x1b, - 0x0a, 0x09, 0x68, 0x61, 0x73, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x08, 0x68, 0x61, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x12, 0x30, 0x0a, 0x14, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x12, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x22, 0x48, 0x0a, 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, - 0x68, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x74, 0x0a, - 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x12, - 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x36, 0x0a, 0x06, 0x68, - 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x06, 0x68, 0x61, 0x73, - 0x68, 0x65, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x17, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2e, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, - 0x4e, 0x0a, 0x13, 0x63, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x11, 0x63, 0x61, - 0x63, 0x68, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x22, - 0xaa, 0x01, 0x0a, 0x18, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x6f, 0x6f, - 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x0c, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0x3d, 0x0a, 0x0d, - 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x81, 0x05, 0x0a, 0x16, - 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x65, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x60, 0x0a, 0x0e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x12, 0x66, 0x0a, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x0e, - 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x0d, 0x61, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x5d, 0x0a, 0x10, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5f, 0x0a, 0x12, 0x44, 0x69, - 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, + 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x04, + 0x74, 0x61, 0x73, 0x6b, 0x12, 0x4d, 0x0a, 0x13, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0xeb, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x56, 0x31, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, - 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, - 0x44, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x65, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, - 0x0a, 0x61, 0x70, 0x70, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, - 0x0d, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x44, 0x22, 0x67, 0x0a, - 0x10, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x73, 0x12, 0x53, 0x0a, 0x14, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x64, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x31, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x56, 0x31, 0x52, 0x12, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x73, 0x56, 0x31, 0x2a, 0x4a, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x44, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x0b, 0x0a, - 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, - 0x4e, 0x45, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, - 0x10, 0x04, 0x42, 0x15, 0x5a, 0x13, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x70, 0x62, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x69, 0x67, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x11, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x55, 0x0a, 0x17, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x15, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x4d, 0x0a, 0x13, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, + 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x11, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, + 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x22, 0x54, 0x0a, 0x0d, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x64, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, + 0x73, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x39, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x79, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x61, 0x70, + 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, + 0x79, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, + 0x70, 0x70, 0x6c, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x80, 0x02, 0x0a, 0x0b, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x6f, + 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x72, 0x6f, 0x6f, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x5f, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x68, 0x61, 0x73, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x62, 0x61, + 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, + 0x64, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x48, 0x0a, 0x0e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, + 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x74, 0x0a, 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, + 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x12, 0x36, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x48, 0x61, 0x73, 0x68, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x99, 0x01, 0x0a, + 0x17, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, + 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x13, 0x63, 0x61, 0x63, 0x68, + 0x65, 0x64, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x11, 0x63, 0x61, 0x63, 0x68, 0x65, 0x64, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x22, 0xaa, 0x01, 0x0a, 0x18, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, + 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x25, + 0x0a, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0x3d, 0x0a, 0x0d, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x68, 0x61, 0x73, 0x68, 0x22, 0x81, 0x05, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5a, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x60, 0x0a, 0x0e, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, + 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x66, 0x0a, + 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, + 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x0e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x0d, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x5d, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4d, + 0x65, 0x74, 0x61, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x5f, 0x0a, 0x12, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x4d, 0x65, 0x74, 0x61, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x46, 0x69, + 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xeb, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x72, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x56, 0x31, 0x12, 0x1a, + 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, + 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x49, 0x44, 0x22, 0x67, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, + 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x53, 0x0a, 0x14, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x5f, + 0x76, 0x31, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, + 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, + 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x56, 0x31, 0x52, 0x12, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x72, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x56, 0x31, 0x2a, + 0x4a, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, + 0x49, 0x44, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, + 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x11, 0x0a, + 0x0d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x03, + 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x42, 0x15, 0x5a, 0x13, 0x70, + 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x67, 0x6f, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2343,8 +2409,8 @@ func file_datadog_remoteconfig_remoteconfig_proto_rawDescGZIP() []byte { } var file_datadog_remoteconfig_remoteconfig_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_datadog_remoteconfig_remoteconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 29) -var file_datadog_remoteconfig_remoteconfig_proto_goTypes = []interface{}{ +var file_datadog_remoteconfig_remoteconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 30) +var file_datadog_remoteconfig_remoteconfig_proto_goTypes = []any{ (TaskState)(0), // 0: datadog.config.TaskState (*ConfigMetas)(nil), // 1: datadog.config.ConfigMetas (*DirectorMetas)(nil), // 2: datadog.config.DirectorMetas @@ -2360,21 +2426,22 @@ var file_datadog_remoteconfig_remoteconfig_proto_goTypes = []interface{}{ (*ClientAgent)(nil), // 12: datadog.config.ClientAgent (*ClientUpdater)(nil), // 13: datadog.config.ClientUpdater (*PackageState)(nil), // 14: datadog.config.PackageState - (*PackageStateTask)(nil), // 15: datadog.config.PackageStateTask - (*TaskError)(nil), // 16: datadog.config.TaskError - (*ConfigState)(nil), // 17: datadog.config.ConfigState - (*ClientState)(nil), // 18: datadog.config.ClientState - (*TargetFileHash)(nil), // 19: datadog.config.TargetFileHash - (*TargetFileMeta)(nil), // 20: datadog.config.TargetFileMeta - (*ClientGetConfigsRequest)(nil), // 21: datadog.config.ClientGetConfigsRequest - (*ClientGetConfigsResponse)(nil), // 22: datadog.config.ClientGetConfigsResponse - (*FileMetaState)(nil), // 23: datadog.config.FileMetaState - (*GetStateConfigResponse)(nil), // 24: datadog.config.GetStateConfigResponse - (*TracerPredicateV1)(nil), // 25: datadog.config.TracerPredicateV1 - (*TracerPredicates)(nil), // 26: datadog.config.TracerPredicates - nil, // 27: datadog.config.GetStateConfigResponse.ConfigStateEntry - nil, // 28: datadog.config.GetStateConfigResponse.DirectorStateEntry - nil, // 29: datadog.config.GetStateConfigResponse.TargetFilenamesEntry + (*PoliciesState)(nil), // 15: datadog.config.PoliciesState + (*PackageStateTask)(nil), // 16: datadog.config.PackageStateTask + (*TaskError)(nil), // 17: datadog.config.TaskError + (*ConfigState)(nil), // 18: datadog.config.ConfigState + (*ClientState)(nil), // 19: datadog.config.ClientState + (*TargetFileHash)(nil), // 20: datadog.config.TargetFileHash + (*TargetFileMeta)(nil), // 21: datadog.config.TargetFileMeta + (*ClientGetConfigsRequest)(nil), // 22: datadog.config.ClientGetConfigsRequest + (*ClientGetConfigsResponse)(nil), // 23: datadog.config.ClientGetConfigsResponse + (*FileMetaState)(nil), // 24: datadog.config.FileMetaState + (*GetStateConfigResponse)(nil), // 25: datadog.config.GetStateConfigResponse + (*TracerPredicateV1)(nil), // 26: datadog.config.TracerPredicateV1 + (*TracerPredicates)(nil), // 27: datadog.config.TracerPredicates + nil, // 28: datadog.config.GetStateConfigResponse.ConfigStateEntry + nil, // 29: datadog.config.GetStateConfigResponse.DirectorStateEntry + nil, // 30: datadog.config.GetStateConfigResponse.TargetFilenamesEntry } var file_datadog_remoteconfig_remoteconfig_proto_depIdxs = []int32{ 4, // 0: datadog.config.ConfigMetas.roots:type_name -> datadog.config.TopMeta @@ -2390,31 +2457,34 @@ var file_datadog_remoteconfig_remoteconfig_proto_depIdxs = []int32{ 1, // 10: datadog.config.LatestConfigsResponse.config_metas:type_name -> datadog.config.ConfigMetas 2, // 11: datadog.config.LatestConfigsResponse.director_metas:type_name -> datadog.config.DirectorMetas 5, // 12: datadog.config.LatestConfigsResponse.target_files:type_name -> datadog.config.File - 18, // 13: datadog.config.Client.state:type_name -> datadog.config.ClientState + 19, // 13: datadog.config.Client.state:type_name -> datadog.config.ClientState 11, // 14: datadog.config.Client.client_tracer:type_name -> datadog.config.ClientTracer 12, // 15: datadog.config.Client.client_agent:type_name -> datadog.config.ClientAgent 13, // 16: datadog.config.Client.client_updater:type_name -> datadog.config.ClientUpdater 14, // 17: datadog.config.ClientUpdater.packages:type_name -> datadog.config.PackageState - 15, // 18: datadog.config.PackageState.task:type_name -> datadog.config.PackageStateTask - 0, // 19: datadog.config.PackageStateTask.state:type_name -> datadog.config.TaskState - 16, // 20: datadog.config.PackageStateTask.error:type_name -> datadog.config.TaskError - 17, // 21: datadog.config.ClientState.config_states:type_name -> datadog.config.ConfigState - 19, // 22: datadog.config.TargetFileMeta.hashes:type_name -> datadog.config.TargetFileHash - 10, // 23: datadog.config.ClientGetConfigsRequest.client:type_name -> datadog.config.Client - 20, // 24: datadog.config.ClientGetConfigsRequest.cached_target_files:type_name -> datadog.config.TargetFileMeta - 5, // 25: datadog.config.ClientGetConfigsResponse.target_files:type_name -> datadog.config.File - 27, // 26: datadog.config.GetStateConfigResponse.config_state:type_name -> datadog.config.GetStateConfigResponse.ConfigStateEntry - 28, // 27: datadog.config.GetStateConfigResponse.director_state:type_name -> datadog.config.GetStateConfigResponse.DirectorStateEntry - 29, // 28: datadog.config.GetStateConfigResponse.target_filenames:type_name -> datadog.config.GetStateConfigResponse.TargetFilenamesEntry - 10, // 29: datadog.config.GetStateConfigResponse.active_clients:type_name -> datadog.config.Client - 25, // 30: datadog.config.TracerPredicates.tracer_predicates_v1:type_name -> datadog.config.TracerPredicateV1 - 23, // 31: datadog.config.GetStateConfigResponse.ConfigStateEntry.value:type_name -> datadog.config.FileMetaState - 23, // 32: datadog.config.GetStateConfigResponse.DirectorStateEntry.value:type_name -> datadog.config.FileMetaState - 33, // [33:33] is the sub-list for method output_type - 33, // [33:33] is the sub-list for method input_type - 33, // [33:33] is the sub-list for extension type_name - 33, // [33:33] is the sub-list for extension extendee - 0, // [0:33] is the sub-list for field type_name + 16, // 18: datadog.config.PackageState.task:type_name -> datadog.config.PackageStateTask + 15, // 19: datadog.config.PackageState.stable_config_state:type_name -> datadog.config.PoliciesState + 15, // 20: datadog.config.PackageState.experiment_config_state:type_name -> datadog.config.PoliciesState + 15, // 21: datadog.config.PackageState.remote_config_state:type_name -> datadog.config.PoliciesState + 0, // 22: datadog.config.PackageStateTask.state:type_name -> datadog.config.TaskState + 17, // 23: datadog.config.PackageStateTask.error:type_name -> datadog.config.TaskError + 18, // 24: datadog.config.ClientState.config_states:type_name -> datadog.config.ConfigState + 20, // 25: datadog.config.TargetFileMeta.hashes:type_name -> datadog.config.TargetFileHash + 10, // 26: datadog.config.ClientGetConfigsRequest.client:type_name -> datadog.config.Client + 21, // 27: datadog.config.ClientGetConfigsRequest.cached_target_files:type_name -> datadog.config.TargetFileMeta + 5, // 28: datadog.config.ClientGetConfigsResponse.target_files:type_name -> datadog.config.File + 28, // 29: datadog.config.GetStateConfigResponse.config_state:type_name -> datadog.config.GetStateConfigResponse.ConfigStateEntry + 29, // 30: datadog.config.GetStateConfigResponse.director_state:type_name -> datadog.config.GetStateConfigResponse.DirectorStateEntry + 30, // 31: datadog.config.GetStateConfigResponse.target_filenames:type_name -> datadog.config.GetStateConfigResponse.TargetFilenamesEntry + 10, // 32: datadog.config.GetStateConfigResponse.active_clients:type_name -> datadog.config.Client + 26, // 33: datadog.config.TracerPredicates.tracer_predicates_v1:type_name -> datadog.config.TracerPredicateV1 + 24, // 34: datadog.config.GetStateConfigResponse.ConfigStateEntry.value:type_name -> datadog.config.FileMetaState + 24, // 35: datadog.config.GetStateConfigResponse.DirectorStateEntry.value:type_name -> datadog.config.FileMetaState + 36, // [36:36] is the sub-list for method output_type + 36, // [36:36] is the sub-list for method input_type + 36, // [36:36] is the sub-list for extension type_name + 36, // [36:36] is the sub-list for extension extendee + 0, // [0:36] is the sub-list for field type_name } func init() { file_datadog_remoteconfig_remoteconfig_proto_init() } @@ -2423,7 +2493,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*ConfigMetas); i { case 0: return &v.state @@ -2435,7 +2505,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*DirectorMetas); i { case 0: return &v.state @@ -2447,7 +2517,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*DelegatedMeta); i { case 0: return &v.state @@ -2459,7 +2529,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*TopMeta); i { case 0: return &v.state @@ -2471,7 +2541,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*File); i { case 0: return &v.state @@ -2483,7 +2553,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*LatestConfigsRequest); i { case 0: return &v.state @@ -2495,7 +2565,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*LatestConfigsResponse); i { case 0: return &v.state @@ -2507,7 +2577,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*OrgDataResponse); i { case 0: return &v.state @@ -2519,7 +2589,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*OrgStatusResponse); i { case 0: return &v.state @@ -2531,7 +2601,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*Client); i { case 0: return &v.state @@ -2543,7 +2613,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*ClientTracer); i { case 0: return &v.state @@ -2555,7 +2625,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*ClientAgent); i { case 0: return &v.state @@ -2567,7 +2637,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*ClientUpdater); i { case 0: return &v.state @@ -2579,7 +2649,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*PackageState); i { case 0: return &v.state @@ -2591,7 +2661,19 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14].Exporter = func(v any, i int) any { + switch v := v.(*PoliciesState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*PackageStateTask); i { case 0: return &v.state @@ -2603,7 +2685,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*TaskError); i { case 0: return &v.state @@ -2615,7 +2697,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*ConfigState); i { case 0: return &v.state @@ -2627,7 +2709,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*ClientState); i { case 0: return &v.state @@ -2639,7 +2721,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*TargetFileHash); i { case 0: return &v.state @@ -2651,7 +2733,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20].Exporter = func(v any, i int) any { switch v := v.(*TargetFileMeta); i { case 0: return &v.state @@ -2663,7 +2745,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21].Exporter = func(v any, i int) any { switch v := v.(*ClientGetConfigsRequest); i { case 0: return &v.state @@ -2675,7 +2757,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*ClientGetConfigsResponse); i { case 0: return &v.state @@ -2687,7 +2769,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23].Exporter = func(v any, i int) any { switch v := v.(*FileMetaState); i { case 0: return &v.state @@ -2699,7 +2781,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24].Exporter = func(v any, i int) any { switch v := v.(*GetStateConfigResponse); i { case 0: return &v.state @@ -2711,7 +2793,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25].Exporter = func(v any, i int) any { switch v := v.(*TracerPredicateV1); i { case 0: return &v.state @@ -2723,7 +2805,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { return nil } } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_datadog_remoteconfig_remoteconfig_proto_msgTypes[26].Exporter = func(v any, i int) any { switch v := v.(*TracerPredicates); i { case 0: return &v.state @@ -2742,7 +2824,7 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_datadog_remoteconfig_remoteconfig_proto_rawDesc, NumEnums: 1, - NumMessages: 29, + NumMessages: 30, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/proto/pbgo/core/remoteconfig_gen.go b/pkg/proto/pbgo/core/remoteconfig_gen.go index 8b3916428bab6..cdaaa9e7c3d0a 100644 --- a/pkg/proto/pbgo/core/remoteconfig_gen.go +++ b/pkg/proto/pbgo/core/remoteconfig_gen.go @@ -3069,15 +3069,6 @@ func (z *PackageState) MarshalMsg(b []byte) (o []byte, err error) { // string "ExperimentVersion" o = append(o, 0xb1, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) o = msgp.AppendString(o, z.ExperimentVersion) - // string "StableConfigVersion" - o = append(o, 0xb3, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) - o = msgp.AppendString(o, z.StableConfigVersion) - // string "ExperimentConfigVersion" - o = append(o, 0xb7, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) - o = msgp.AppendString(o, z.ExperimentConfigVersion) - // string "RemoteConfigVersion" - o = append(o, 0xb3, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) - o = msgp.AppendString(o, z.RemoteConfigVersion) // string "Task" o = append(o, 0xa4, 0x54, 0x61, 0x73, 0x6b) if z.Task == nil { @@ -3089,6 +3080,54 @@ func (z *PackageState) MarshalMsg(b []byte) (o []byte, err error) { return } } + // string "StableConfigState" + o = append(o, 0xb1, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65) + if z.StableConfigState == nil { + o = msgp.AppendNil(o) + } else { + // map header, size 2 + // string "Version" + o = append(o, 0x82, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.StableConfigState.Version) + // string "MatchedPolicies" + o = append(o, 0xaf, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.StableConfigState.MatchedPolicies))) + for za0001 := range z.StableConfigState.MatchedPolicies { + o = msgp.AppendString(o, z.StableConfigState.MatchedPolicies[za0001]) + } + } + // string "ExperimentConfigState" + o = append(o, 0xb5, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65) + if z.ExperimentConfigState == nil { + o = msgp.AppendNil(o) + } else { + // map header, size 2 + // string "Version" + o = append(o, 0x82, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.ExperimentConfigState.Version) + // string "MatchedPolicies" + o = append(o, 0xaf, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.ExperimentConfigState.MatchedPolicies))) + for za0002 := range z.ExperimentConfigState.MatchedPolicies { + o = msgp.AppendString(o, z.ExperimentConfigState.MatchedPolicies[za0002]) + } + } + // string "RemoteConfigState" + o = append(o, 0xb1, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65) + if z.RemoteConfigState == nil { + o = msgp.AppendNil(o) + } else { + // map header, size 2 + // string "Version" + o = append(o, 0x82, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.RemoteConfigState.Version) + // string "MatchedPolicies" + o = append(o, 0xaf, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.RemoteConfigState.MatchedPolicies))) + for za0003 := range z.RemoteConfigState.MatchedPolicies { + o = msgp.AppendString(o, z.RemoteConfigState.MatchedPolicies[za0003]) + } + } return } @@ -3128,24 +3167,6 @@ func (z *PackageState) UnmarshalMsg(bts []byte) (o []byte, err error) { err = msgp.WrapError(err, "ExperimentVersion") return } - case "StableConfigVersion": - z.StableConfigVersion, bts, err = msgp.ReadStringBytes(bts) - if err != nil { - err = msgp.WrapError(err, "StableConfigVersion") - return - } - case "ExperimentConfigVersion": - z.ExperimentConfigVersion, bts, err = msgp.ReadStringBytes(bts) - if err != nil { - err = msgp.WrapError(err, "ExperimentConfigVersion") - return - } - case "RemoteConfigVersion": - z.RemoteConfigVersion, bts, err = msgp.ReadStringBytes(bts) - if err != nil { - err = msgp.WrapError(err, "RemoteConfigVersion") - return - } case "Task": if msgp.IsNil(bts) { bts, err = msgp.ReadNilBytes(bts) @@ -3163,6 +3184,183 @@ func (z *PackageState) UnmarshalMsg(bts []byte) (o []byte, err error) { return } } + case "StableConfigState": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.StableConfigState = nil + } else { + if z.StableConfigState == nil { + z.StableConfigState = new(PoliciesState) + } + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StableConfigState") + return + } + for zb0002 > 0 { + zb0002-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "StableConfigState") + return + } + switch msgp.UnsafeString(field) { + case "Version": + z.StableConfigState.Version, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StableConfigState", "Version") + return + } + case "MatchedPolicies": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StableConfigState", "MatchedPolicies") + return + } + if cap(z.StableConfigState.MatchedPolicies) >= int(zb0003) { + z.StableConfigState.MatchedPolicies = (z.StableConfigState.MatchedPolicies)[:zb0003] + } else { + z.StableConfigState.MatchedPolicies = make([]string, zb0003) + } + for za0001 := range z.StableConfigState.MatchedPolicies { + z.StableConfigState.MatchedPolicies[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StableConfigState", "MatchedPolicies", za0001) + return + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "StableConfigState") + return + } + } + } + } + case "ExperimentConfigState": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.ExperimentConfigState = nil + } else { + if z.ExperimentConfigState == nil { + z.ExperimentConfigState = new(PoliciesState) + } + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ExperimentConfigState") + return + } + for zb0004 > 0 { + zb0004-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "ExperimentConfigState") + return + } + switch msgp.UnsafeString(field) { + case "Version": + z.ExperimentConfigState.Version, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ExperimentConfigState", "Version") + return + } + case "MatchedPolicies": + var zb0005 uint32 + zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ExperimentConfigState", "MatchedPolicies") + return + } + if cap(z.ExperimentConfigState.MatchedPolicies) >= int(zb0005) { + z.ExperimentConfigState.MatchedPolicies = (z.ExperimentConfigState.MatchedPolicies)[:zb0005] + } else { + z.ExperimentConfigState.MatchedPolicies = make([]string, zb0005) + } + for za0002 := range z.ExperimentConfigState.MatchedPolicies { + z.ExperimentConfigState.MatchedPolicies[za0002], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ExperimentConfigState", "MatchedPolicies", za0002) + return + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "ExperimentConfigState") + return + } + } + } + } + case "RemoteConfigState": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.RemoteConfigState = nil + } else { + if z.RemoteConfigState == nil { + z.RemoteConfigState = new(PoliciesState) + } + var zb0006 uint32 + zb0006, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RemoteConfigState") + return + } + for zb0006 > 0 { + zb0006-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "RemoteConfigState") + return + } + switch msgp.UnsafeString(field) { + case "Version": + z.RemoteConfigState.Version, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RemoteConfigState", "Version") + return + } + case "MatchedPolicies": + var zb0007 uint32 + zb0007, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RemoteConfigState", "MatchedPolicies") + return + } + if cap(z.RemoteConfigState.MatchedPolicies) >= int(zb0007) { + z.RemoteConfigState.MatchedPolicies = (z.RemoteConfigState.MatchedPolicies)[:zb0007] + } else { + z.RemoteConfigState.MatchedPolicies = make([]string, zb0007) + } + for za0003 := range z.RemoteConfigState.MatchedPolicies { + z.RemoteConfigState.MatchedPolicies[za0003], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RemoteConfigState", "MatchedPolicies", za0003) + return + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "RemoteConfigState") + return + } + } + } + } default: bts, err = msgp.Skip(bts) if err != nil { @@ -3177,12 +3375,39 @@ func (z *PackageState) UnmarshalMsg(bts []byte) (o []byte, err error) { // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message func (z *PackageState) Msgsize() (s int) { - s = 1 + 8 + msgp.StringPrefixSize + len(z.Package) + 14 + msgp.StringPrefixSize + len(z.StableVersion) + 18 + msgp.StringPrefixSize + len(z.ExperimentVersion) + 20 + msgp.StringPrefixSize + len(z.StableConfigVersion) + 24 + msgp.StringPrefixSize + len(z.ExperimentConfigVersion) + 20 + msgp.StringPrefixSize + len(z.RemoteConfigVersion) + 5 + s = 1 + 8 + msgp.StringPrefixSize + len(z.Package) + 14 + msgp.StringPrefixSize + len(z.StableVersion) + 18 + msgp.StringPrefixSize + len(z.ExperimentVersion) + 5 if z.Task == nil { s += msgp.NilSize } else { s += z.Task.Msgsize() } + s += 18 + if z.StableConfigState == nil { + s += msgp.NilSize + } else { + s += 1 + 8 + msgp.StringPrefixSize + len(z.StableConfigState.Version) + 16 + msgp.ArrayHeaderSize + for za0001 := range z.StableConfigState.MatchedPolicies { + s += msgp.StringPrefixSize + len(z.StableConfigState.MatchedPolicies[za0001]) + } + } + s += 22 + if z.ExperimentConfigState == nil { + s += msgp.NilSize + } else { + s += 1 + 8 + msgp.StringPrefixSize + len(z.ExperimentConfigState.Version) + 16 + msgp.ArrayHeaderSize + for za0002 := range z.ExperimentConfigState.MatchedPolicies { + s += msgp.StringPrefixSize + len(z.ExperimentConfigState.MatchedPolicies[za0002]) + } + } + s += 18 + if z.RemoteConfigState == nil { + s += msgp.NilSize + } else { + s += 1 + 8 + msgp.StringPrefixSize + len(z.RemoteConfigState.Version) + 16 + msgp.ArrayHeaderSize + for za0003 := range z.RemoteConfigState.MatchedPolicies { + s += msgp.StringPrefixSize + len(z.RemoteConfigState.MatchedPolicies[za0003]) + } + } return } @@ -3315,6 +3540,86 @@ func (z *PackageStateTask) Msgsize() (s int) { return } +// MarshalMsg implements msgp.Marshaler +func (z *PoliciesState) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 2 + // string "Version" + o = append(o, 0x82, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Version) + // string "MatchedPolicies" + o = append(o, 0xaf, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.MatchedPolicies))) + for za0001 := range z.MatchedPolicies { + o = msgp.AppendString(o, z.MatchedPolicies[za0001]) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *PoliciesState) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Version": + z.Version, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Version") + return + } + case "MatchedPolicies": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MatchedPolicies") + return + } + if cap(z.MatchedPolicies) >= int(zb0002) { + z.MatchedPolicies = (z.MatchedPolicies)[:zb0002] + } else { + z.MatchedPolicies = make([]string, zb0002) + } + for za0001 := range z.MatchedPolicies { + z.MatchedPolicies[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MatchedPolicies", za0001) + return + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *PoliciesState) Msgsize() (s int) { + s = 1 + 8 + msgp.StringPrefixSize + len(z.Version) + 16 + msgp.ArrayHeaderSize + for za0001 := range z.MatchedPolicies { + s += msgp.StringPrefixSize + len(z.MatchedPolicies[za0001]) + } + return +} + // MarshalMsg implements msgp.Marshaler func (z TargetFileHash) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) diff --git a/pkg/proto/pbgo/core/remoteconfig_gen_test.go b/pkg/proto/pbgo/core/remoteconfig_gen_test.go index 8bb705b8db5b5..4f572c39bff7a 100644 --- a/pkg/proto/pbgo/core/remoteconfig_gen_test.go +++ b/pkg/proto/pbgo/core/remoteconfig_gen_test.go @@ -1168,6 +1168,64 @@ func BenchmarkUnmarshalPackageStateTask(b *testing.B) { } } +func TestMarshalUnmarshalPoliciesState(t *testing.T) { + v := PoliciesState{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgPoliciesState(b *testing.B) { + v := PoliciesState{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgPoliciesState(b *testing.B) { + v := PoliciesState{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalPoliciesState(b *testing.B) { + v := PoliciesState{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + func TestMarshalUnmarshalTargetFileHash(t *testing.T) { v := TargetFileHash{} bts, err := v.MarshalMsg(nil) diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index e5286b1a6623f..22e7754303033 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -300,6 +300,7 @@ require ( require ( github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.59.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.67.0 // indirect github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.56.0 // indirect github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.67.0 // indirect @@ -315,4 +316,6 @@ require ( go.opentelemetry.io/collector/pdata v1.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect + google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect ) diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index 966eb25eb3d8b..076037f33850b 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -1,4 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= @@ -42,6 +43,7 @@ github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4u github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= @@ -133,6 +135,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro= github.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= @@ -168,7 +171,9 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -186,6 +191,7 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -225,6 +231,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -253,6 +260,7 @@ github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbu github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -261,6 +269,7 @@ github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= @@ -449,6 +458,7 @@ github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= @@ -583,12 +593,14 @@ golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= @@ -602,10 +614,12 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -691,15 +705,19 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 h1:ImUcDPHjTrAqNhlOkSocDLfG9rrNHH7w7uoKWPaWZ8s= +google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7/go.mod h1:/3XmxOjePkvmKrHuBy4zNFw7IzxJXtAgdpXi8Ll990U= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -723,6 +741,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/test/new-e2e/tests/installer/unix/upgrade_scenario_test.go b/test/new-e2e/tests/installer/unix/upgrade_scenario_test.go index 2ed3db8edffca..74d3b888cab58 100644 --- a/test/new-e2e/tests/installer/unix/upgrade_scenario_test.go +++ b/test/new-e2e/tests/installer/unix/upgrade_scenario_test.go @@ -10,6 +10,7 @@ import ( "fmt" "time" + pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/host" e2eos "github.com/DataDog/test-infra-definitions/components/os" @@ -404,6 +405,14 @@ func (s *upgradeScenarioSuite) TestConfigUpgradeSuccessful() { state := s.host.State() state.AssertSymlinkExists("/etc/datadog-agent/managed/datadog-agent/stable", "/etc/datadog-agent/managed/datadog-agent/e94406c45ae766b7d34d2793e4759b9c4d15ed5d5e2b7f73ce1bf0e6836f728d", "root", "root") + // Verify metadata + state.AssertFileExists("/etc/datadog-agent/managed/datadog-agent/e94406c45ae766b7d34d2793e4759b9c4d15ed5d5e2b7f73ce1bf0e6836f728d/policy.metadata", 0440, "dd-agent", "dd-agent") + file := s.Env().RemoteHost.MustExecute("sudo cat /etc/datadog-agent/managed/datadog-agent/e94406c45ae766b7d34d2793e4759b9c4d15ed5d5e2b7f73ce1bf0e6836f728d/policy.metadata") + policiesState := &pbgo.PoliciesState{} + err := json.Unmarshal([]byte(file), policiesState) + require.NoError(s.T(), err) + require.Len(s.T(), policiesState.MatchedPolicies, 1) + require.Equal(s.T(), policiesState.Version, "e94406c45ae766b7d34d2793e4759b9c4d15ed5d5e2b7f73ce1bf0e6836f728d") localCDN.UpdateLayer("config", "\"log_level\": \"error\"") s.executeConfigGoldenPath(localCDN.DirPath, "c78c5e96820c89c6cbc178ddba4ce20a167138a3a580ed4637369a9c5ed804c3") From e2e7e1a4c5ca7fe262e5a9c920f4637e1250e45b Mon Sep 17 00:00:00 2001 From: Jonathan Ribas Date: Fri, 29 Nov 2024 18:34:43 +0100 Subject: [PATCH 47/59] [CWS] Fix a ptrace test and add Centos7 support (#31552) --- pkg/security/probe/probe_ebpf.go | 16 +-- pkg/security/tests/ptrace_test.go | 4 +- .../tests/syscall_tester/c/syscall_tester.c | 5 +- pkg/security/utils/proc_linux.go | 97 +++++++++++++++++++ 4 files changed, 105 insertions(+), 17 deletions(-) diff --git a/pkg/security/probe/probe_ebpf.go b/pkg/security/probe/probe_ebpf.go index f5135589812ba..6f1090b63a72c 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -1086,23 +1086,15 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { pidToResolve := event.PTrace.PID if pidToResolve == 0 { // resolve the PID given as argument instead - if event.ContainerContext.ContainerID == "" { + containerID := p.fieldHandlers.ResolveContainerID(event, event.ContainerContext) + if containerID == "" && event.PTrace.Request != unix.PTRACE_ATTACH { pidToResolve = event.PTrace.NSPID } else { - // 1. get the pid namespace of the tracer - ns, err := utils.GetProcessPidNamespace(event.ProcessContext.Process.Pid) + pid, err := utils.TryToResolveTraceePid(event.ProcessContext.Process.Pid, event.PTrace.NSPID) if err != nil { - seclog.Errorf("Failed to resolve PID namespace: %v", err) + seclog.Errorf("PTrace err: %v", err) return } - - // 2. find the host pid matching the arg pid with he tracer namespace - pid, err := utils.FindPidNamespace(event.PTrace.NSPID, ns) - if err != nil { - seclog.Warnf("Failed to resolve tracee PID namespace: %v", err) - return - } - pidToResolve = pid } } diff --git a/pkg/security/tests/ptrace_test.go b/pkg/security/tests/ptrace_test.go index f6f660422ae46..2ee8d4e170946 100644 --- a/pkg/security/tests/ptrace_test.go +++ b/pkg/security/tests/ptrace_test.go @@ -102,7 +102,7 @@ func TestPTraceEvent(t *testing.T) { }) test.Run(t, "ptrace-attach", func(t *testing.T, _ wrapperType, cmdFunc func(cmd string, args []string, envs []string) *exec.Cmd) { - args := []string{"ptrace-attach"} + args := []string{"sleep", "2", ";", "ptrace-attach"} envs := []string{} err := test.GetEventSent(t, func() error { @@ -122,7 +122,7 @@ func TestPTraceEvent(t *testing.T) { test.validatePTraceSchema(t, event) return true - }, time.Second*3, "test_ptrace_attach") + }, time.Second*6, "test_ptrace_attach") if err != nil { t.Error(err) } diff --git a/pkg/security/tests/syscall_tester/c/syscall_tester.c b/pkg/security/tests/syscall_tester/c/syscall_tester.c index 76844cf222e5c..5fc0ba53ddf09 100644 --- a/pkg/security/tests/syscall_tester/c/syscall_tester.c +++ b/pkg/security/tests/syscall_tester/c/syscall_tester.c @@ -188,12 +188,11 @@ int ptrace_traceme() { int ptrace_attach() { int child = fork(); if (child == 0) { - for (int i = 0; i < 20; i++) { - sleep(1); - } + sleep(3); } else { ptrace(PTRACE_ATTACH, child, 0, NULL); wait(NULL); + sleep(3); // sleep here to let the agent resolve the pid namespace on procfs } return EXIT_SUCCESS; } diff --git a/pkg/security/utils/proc_linux.go b/pkg/security/utils/proc_linux.go index 9fcbbde812ca7..5868a0a958457 100644 --- a/pkg/security/utils/proc_linux.go +++ b/pkg/security/utils/proc_linux.go @@ -468,3 +468,100 @@ func FindPidNamespace(nspid uint32, ns uint64) (uint32, error) { } return 0, errors.New("PID not found") } + +// GetTracerPid returns the tracer pid of the the givent root pid +func GetTracerPid(pid uint32) (uint32, error) { + statusFile := StatusPath(pid) + content, err := os.ReadFile(statusFile) + if err != nil { + return 0, fmt.Errorf("failed to read status file: %w", err) + } + + lines := strings.Split(string(content), "\n") + for _, line := range lines { + if strings.HasPrefix(line, "TracerPid:") { + // Remove "NSpid:" prefix and trim spaces + line = strings.TrimPrefix(line, "TracerPid:") + line = strings.TrimSpace(line) + + tracerPid, err := strconv.ParseUint(line, 10, 64) + if err != nil { + return 0, fmt.Errorf("failed to parse TracerPid value: %w", err) + } + return uint32(tracerPid), nil + } + } + return 0, fmt.Errorf("TracerPid field not found") +} + +// FindTraceesByTracerPid returns the process list being trced by the given tracer host PID +func FindTraceesByTracerPid(pid uint32) ([]uint32, error) { + procPids, err := process.Pids() + if err != nil { + return nil, err + } + + traceePids := []uint32{} + for _, procPid := range procPids { + tracerPid, err := GetTracerPid(uint32(procPid)) + if err != nil { + continue + } + if tracerPid == pid { + traceePids = append(traceePids, uint32(procPid)) + } + } + return traceePids, nil +} + +var isNsPidAvailable = sync.OnceValue(func() bool { + content, err := os.ReadFile("/proc/self/status") + if err != nil { + return false + } + lines := strings.Split(string(content), "\n") + for _, line := range lines { + if strings.HasPrefix(line, "NSpid:") { + return true + } + } + return false +}) + +// TryToResolveTraceePid tries to resolve and returnt the HOST tracee PID, given the HOST tracer PID and the namespaced tracee PID. +func TryToResolveTraceePid(hostTracerPID, NsTraceePid uint32) (uint32, error) { + // Look if the NSpid status field is available or not (it should be, except for Centos7). + if isNsPidAvailable() { + /* + If it's available, we will search for an host pid having the same PID namespace as the + tracer, and having the corresponding NS PID in its status field + */ + + // 1. get the pid namespace of the tracer + ns, err := GetProcessPidNamespace(hostTracerPID) + if err != nil { + return 0, fmt.Errorf("Failed to resolve PID namespace: %v", err) + } + + // 2. find the host pid matching the arg pid with he tracer namespace + pid, err := FindPidNamespace(NsTraceePid, ns) + if err != nil { + return 0, fmt.Errorf("Failed to resolve tracee PID namespace: %v", err) + } + return pid, nil + } + + /* + Otherwise, we look at all process matching the tracer PID. And as a tracer can attach + to multiple tracees, we return a result only if we found only one. + */ + traceePids, err := FindTraceesByTracerPid(hostTracerPID) + if err != nil { + return 0, fmt.Errorf("Failed to find tracee pids matching tracer pid: %v", err) + } + if len(traceePids) == 1 { + return traceePids[0], nil + } + + return 0, errors.New("Unable to resolve host tracee PID") +} From c86fec45705791989b6b81be7b33d33a487dc619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Fri, 29 Nov 2024 18:34:48 +0100 Subject: [PATCH 48/59] omnibus: don't bother creating the xz package for heroku (#31626) --- omnibus/config/projects/agent.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omnibus/config/projects/agent.rb b/omnibus/config/projects/agent.rb index bd24283687dbf..62a6afb6deaf7 100644 --- a/omnibus/config/projects/agent.rb +++ b/omnibus/config/projects/agent.rb @@ -211,7 +211,7 @@ end package :xz do - skip_packager (!do_build && !BUILD_OCIRU) + skip_packager (!do_build && !BUILD_OCIRU) || heroku_target? compression_threads COMPRESSION_THREADS compression_level COMPRESSION_LEVEL end From 8c32e54d86186e0c28a32b7ff5e11fadee211e5f Mon Sep 17 00:00:00 2001 From: Arthur Bellal Date: Fri, 29 Nov 2024 19:02:38 +0100 Subject: [PATCH 49/59] (fleet) rename services => packages (#31613) --- pkg/fleet/installer/installer.go | 30 +++++++++---------- .../{service => packages}/apm_inject.go | 5 ++-- .../{service => packages}/apm_inject_test.go | 3 +- .../apm_inject_windows.go | 3 +- .../{service => packages}/apm_sockets.go | 3 +- .../{service => packages}/apm_sockets_test.go | 3 +- .../{service => packages}/app_armor.go | 3 +- .../{service => packages}/datadog_agent.go | 3 +- .../datadog_agent_windows.go | 3 +- .../datadog_installer.go | 3 +- .../datadog_installer_windows.go | 4 ++- .../installer/{service => packages}/docker.go | 3 +- .../{service => packages}/docker_test.go | 3 +- .../embedded/datadog-agent-exp.service | 0 .../datadog-agent-process-exp.service | 0 .../embedded/datadog-agent-process.service | 0 .../datadog-agent-security-exp.service | 0 .../embedded/datadog-agent-security.service | 0 .../datadog-agent-sysprobe-exp.service | 0 .../embedded/datadog-agent-sysprobe.service | 0 .../embedded/datadog-agent-trace-exp.service | 0 .../embedded/datadog-agent-trace.service | 0 .../embedded/datadog-agent.service | 0 .../embedded/datadog-installer-exp.service | 0 .../embedded/datadog-installer.service | 0 .../{service => packages}/embedded/dd-cleanup | 0 .../embedded/dd-container-install | 0 .../embedded/dd-host-install | 0 .../{service => packages}/embedded/embed.go | 0 .../installer/{service => packages}/file.go | 3 +- .../{service => packages}/file_test.go | 3 +- .../{service => packages}/msiexec.go | 7 +++-- .../{service => packages}/systemd.go | 5 ++-- .../{service => packages}/systemd_windows.go | 3 +- 34 files changed, 40 insertions(+), 50 deletions(-) rename pkg/fleet/installer/{service => packages}/apm_inject.go (98%) rename pkg/fleet/installer/{service => packages}/apm_inject_test.go (98%) rename pkg/fleet/installer/{service => packages}/apm_inject_windows.go (89%) rename pkg/fleet/installer/{service => packages}/apm_sockets.go (98%) rename pkg/fleet/installer/{service => packages}/apm_sockets_test.go (98%) rename pkg/fleet/installer/{service => packages}/app_armor.go (96%) rename pkg/fleet/installer/{service => packages}/datadog_agent.go (98%) rename pkg/fleet/installer/{service => packages}/datadog_agent_windows.go (97%) rename pkg/fleet/installer/{service => packages}/datadog_installer.go (98%) rename pkg/fleet/installer/{service => packages}/datadog_installer_windows.go (96%) rename pkg/fleet/installer/{service => packages}/docker.go (98%) rename pkg/fleet/installer/{service => packages}/docker_test.go (97%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent-exp.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent-process-exp.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent-process.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent-security-exp.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent-security.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent-sysprobe-exp.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent-sysprobe.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent-trace-exp.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent-trace.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-agent.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-installer-exp.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/datadog-installer.service (100%) rename pkg/fleet/installer/{service => packages}/embedded/dd-cleanup (100%) rename pkg/fleet/installer/{service => packages}/embedded/dd-container-install (100%) rename pkg/fleet/installer/{service => packages}/embedded/dd-host-install (100%) rename pkg/fleet/installer/{service => packages}/embedded/embed.go (100%) rename pkg/fleet/installer/{service => packages}/file.go (98%) rename pkg/fleet/installer/{service => packages}/file_test.go (98%) rename pkg/fleet/installer/{service => packages}/msiexec.go (99%) rename pkg/fleet/installer/{service => packages}/systemd.go (96%) rename pkg/fleet/installer/{service => packages}/systemd_windows.go (82%) diff --git a/pkg/fleet/installer/installer.go b/pkg/fleet/installer/installer.go index 4b62c43b5aee9..8db7bc07954a5 100644 --- a/pkg/fleet/installer/installer.go +++ b/pkg/fleet/installer/installer.go @@ -21,8 +21,8 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" fleetEnv "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages" "github.com/DataDog/datadog-agent/pkg/fleet/installer/repository" - "github.com/DataDog/datadog-agent/pkg/fleet/installer/service" "github.com/DataDog/datadog-agent/pkg/fleet/internal/db" "github.com/DataDog/datadog-agent/pkg/fleet/internal/oci" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -476,7 +476,7 @@ func (i *installerImpl) InstrumentAPMInjector(ctx context.Context, method string return fmt.Errorf("APM injector is not installed") } - err = service.InstrumentAPMInjector(ctx, method) + err = packages.InstrumentAPMInjector(ctx, method) if err != nil { return fmt.Errorf("could not instrument APM: %w", err) } @@ -496,7 +496,7 @@ func (i *installerImpl) UninstrumentAPMInjector(ctx context.Context, method stri return fmt.Errorf("APM injector is not installed") } - err = service.UninstrumentAPMInjector(ctx, method) + err = packages.UninstrumentAPMInjector(ctx, method) if err != nil { return fmt.Errorf("could not instrument APM: %w", err) } @@ -539,9 +539,9 @@ func (i *installerImpl) Close() error { func (i *installerImpl) startExperiment(ctx context.Context, pkg string) error { switch pkg { case packageDatadogAgent: - return service.StartAgentExperiment(ctx) + return packages.StartAgentExperiment(ctx) case packageDatadogInstaller: - return service.StartInstallerExperiment(ctx) + return packages.StartInstallerExperiment(ctx) default: return nil } @@ -550,9 +550,9 @@ func (i *installerImpl) startExperiment(ctx context.Context, pkg string) error { func (i *installerImpl) stopExperiment(ctx context.Context, pkg string) error { switch pkg { case packageDatadogAgent: - return service.StopAgentExperiment(ctx) + return packages.StopAgentExperiment(ctx) case packageDatadogInstaller: - return service.StopInstallerExperiment(ctx) + return packages.StopInstallerExperiment(ctx) default: return nil } @@ -561,9 +561,9 @@ func (i *installerImpl) stopExperiment(ctx context.Context, pkg string) error { func (i *installerImpl) promoteExperiment(ctx context.Context, pkg string) error { switch pkg { case packageDatadogAgent: - return service.PromoteAgentExperiment(ctx) + return packages.PromoteAgentExperiment(ctx) case packageDatadogInstaller: - return service.PromoteInstallerExperiment(ctx) + return packages.PromoteInstallerExperiment(ctx) default: return nil } @@ -572,11 +572,11 @@ func (i *installerImpl) promoteExperiment(ctx context.Context, pkg string) error func (i *installerImpl) setupPackage(ctx context.Context, pkg string, args []string) error { switch pkg { case packageDatadogInstaller: - return service.SetupInstaller(ctx) + return packages.SetupInstaller(ctx) case packageDatadogAgent: - return service.SetupAgent(ctx, args) + return packages.SetupAgent(ctx, args) case packageAPMInjector: - return service.SetupAPMInjector(ctx) + return packages.SetupAPMInjector(ctx) default: return nil } @@ -585,11 +585,11 @@ func (i *installerImpl) setupPackage(ctx context.Context, pkg string, args []str func (i *installerImpl) removePackage(ctx context.Context, pkg string) error { switch pkg { case packageDatadogAgent: - return service.RemoveAgent(ctx) + return packages.RemoveAgent(ctx) case packageAPMInjector: - return service.RemoveAPMInjector(ctx) + return packages.RemoveAPMInjector(ctx) case packageDatadogInstaller: - return service.RemoveInstaller(ctx) + return packages.RemoveInstaller(ctx) default: return nil } diff --git a/pkg/fleet/installer/service/apm_inject.go b/pkg/fleet/installer/packages/apm_inject.go similarity index 98% rename from pkg/fleet/installer/service/apm_inject.go rename to pkg/fleet/installer/packages/apm_inject.go index af60de60025dd..cd7c08504deb6 100644 --- a/pkg/fleet/installer/service/apm_inject.go +++ b/pkg/fleet/installer/packages/apm_inject.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "bytes" @@ -19,7 +18,7 @@ import ( "strings" "github.com/DataDog/datadog-agent/pkg/fleet/env" - "github.com/DataDog/datadog-agent/pkg/fleet/installer/service/embedded" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages/embedded" "github.com/DataDog/datadog-agent/pkg/util/log" "go.uber.org/multierr" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" diff --git a/pkg/fleet/installer/service/apm_inject_test.go b/pkg/fleet/installer/packages/apm_inject_test.go similarity index 98% rename from pkg/fleet/installer/service/apm_inject_test.go rename to pkg/fleet/installer/packages/apm_inject_test.go index 559531541bd60..736077ea7b934 100644 --- a/pkg/fleet/installer/service/apm_inject_test.go +++ b/pkg/fleet/installer/packages/apm_inject_test.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "context" diff --git a/pkg/fleet/installer/service/apm_inject_windows.go b/pkg/fleet/installer/packages/apm_inject_windows.go similarity index 89% rename from pkg/fleet/installer/service/apm_inject_windows.go rename to pkg/fleet/installer/packages/apm_inject_windows.go index 75e041f8651e4..3e80c0d56a2c0 100644 --- a/pkg/fleet/installer/service/apm_inject_windows.go +++ b/pkg/fleet/installer/packages/apm_inject_windows.go @@ -5,8 +5,7 @@ //go:build windows -// Package service provides a way to interact with os services -package service +package packages import "context" diff --git a/pkg/fleet/installer/service/apm_sockets.go b/pkg/fleet/installer/packages/apm_sockets.go similarity index 98% rename from pkg/fleet/installer/service/apm_sockets.go rename to pkg/fleet/installer/packages/apm_sockets.go index a01889a47ea45..db2def19fe43f 100644 --- a/pkg/fleet/installer/service/apm_sockets.go +++ b/pkg/fleet/installer/packages/apm_sockets.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "bytes" diff --git a/pkg/fleet/installer/service/apm_sockets_test.go b/pkg/fleet/installer/packages/apm_sockets_test.go similarity index 98% rename from pkg/fleet/installer/service/apm_sockets_test.go rename to pkg/fleet/installer/packages/apm_sockets_test.go index 71148ecc8dca7..a65b6d959d9da 100644 --- a/pkg/fleet/installer/service/apm_sockets_test.go +++ b/pkg/fleet/installer/packages/apm_sockets_test.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "context" diff --git a/pkg/fleet/installer/service/app_armor.go b/pkg/fleet/installer/packages/app_armor.go similarity index 96% rename from pkg/fleet/installer/service/app_armor.go rename to pkg/fleet/installer/packages/app_armor.go index fceb30c9171a8..bd0ea2889802e 100644 --- a/pkg/fleet/installer/service/app_armor.go +++ b/pkg/fleet/installer/packages/app_armor.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "context" diff --git a/pkg/fleet/installer/service/datadog_agent.go b/pkg/fleet/installer/packages/datadog_agent.go similarity index 98% rename from pkg/fleet/installer/service/datadog_agent.go rename to pkg/fleet/installer/packages/datadog_agent.go index 56e039f5bb0c1..df7c9cbb37063 100644 --- a/pkg/fleet/installer/service/datadog_agent.go +++ b/pkg/fleet/installer/packages/datadog_agent.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "context" diff --git a/pkg/fleet/installer/service/datadog_agent_windows.go b/pkg/fleet/installer/packages/datadog_agent_windows.go similarity index 97% rename from pkg/fleet/installer/service/datadog_agent_windows.go rename to pkg/fleet/installer/packages/datadog_agent_windows.go index 98fb9dfeae519..3000a96fe712d 100644 --- a/pkg/fleet/installer/service/datadog_agent_windows.go +++ b/pkg/fleet/installer/packages/datadog_agent_windows.go @@ -5,8 +5,7 @@ //go:build windows -// Package service provides a way to interact with os services -package service +package packages import ( "context" diff --git a/pkg/fleet/installer/service/datadog_installer.go b/pkg/fleet/installer/packages/datadog_installer.go similarity index 98% rename from pkg/fleet/installer/service/datadog_installer.go rename to pkg/fleet/installer/packages/datadog_installer.go index 722766a6a0659..14d0f042cd0e6 100644 --- a/pkg/fleet/installer/service/datadog_installer.go +++ b/pkg/fleet/installer/packages/datadog_installer.go @@ -5,7 +5,8 @@ //go:build !windows -package service +// Package packages contains the install/upgrades/uninstall logic for packages +package packages import ( "context" diff --git a/pkg/fleet/installer/service/datadog_installer_windows.go b/pkg/fleet/installer/packages/datadog_installer_windows.go similarity index 96% rename from pkg/fleet/installer/service/datadog_installer_windows.go rename to pkg/fleet/installer/packages/datadog_installer_windows.go index 3bc775e2efa83..2d8dc8241c541 100644 --- a/pkg/fleet/installer/service/datadog_installer_windows.go +++ b/pkg/fleet/installer/packages/datadog_installer_windows.go @@ -5,10 +5,12 @@ //go:build windows -package service +// Package packages contains the install/upgrades/uninstall logic for packages +package packages import ( "context" + "github.com/DataDog/datadog-agent/pkg/util/log" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) diff --git a/pkg/fleet/installer/service/docker.go b/pkg/fleet/installer/packages/docker.go similarity index 98% rename from pkg/fleet/installer/service/docker.go rename to pkg/fleet/installer/packages/docker.go index 088fb5678c2ac..8c19fc04a4ec8 100644 --- a/pkg/fleet/installer/service/docker.go +++ b/pkg/fleet/installer/packages/docker.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "bytes" diff --git a/pkg/fleet/installer/service/docker_test.go b/pkg/fleet/installer/packages/docker_test.go similarity index 97% rename from pkg/fleet/installer/service/docker_test.go rename to pkg/fleet/installer/packages/docker_test.go index cf72e877cebb6..0ef9c42be0a98 100644 --- a/pkg/fleet/installer/service/docker_test.go +++ b/pkg/fleet/installer/packages/docker_test.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "context" diff --git a/pkg/fleet/installer/service/embedded/datadog-agent-exp.service b/pkg/fleet/installer/packages/embedded/datadog-agent-exp.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent-exp.service rename to pkg/fleet/installer/packages/embedded/datadog-agent-exp.service diff --git a/pkg/fleet/installer/service/embedded/datadog-agent-process-exp.service b/pkg/fleet/installer/packages/embedded/datadog-agent-process-exp.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent-process-exp.service rename to pkg/fleet/installer/packages/embedded/datadog-agent-process-exp.service diff --git a/pkg/fleet/installer/service/embedded/datadog-agent-process.service b/pkg/fleet/installer/packages/embedded/datadog-agent-process.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent-process.service rename to pkg/fleet/installer/packages/embedded/datadog-agent-process.service diff --git a/pkg/fleet/installer/service/embedded/datadog-agent-security-exp.service b/pkg/fleet/installer/packages/embedded/datadog-agent-security-exp.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent-security-exp.service rename to pkg/fleet/installer/packages/embedded/datadog-agent-security-exp.service diff --git a/pkg/fleet/installer/service/embedded/datadog-agent-security.service b/pkg/fleet/installer/packages/embedded/datadog-agent-security.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent-security.service rename to pkg/fleet/installer/packages/embedded/datadog-agent-security.service diff --git a/pkg/fleet/installer/service/embedded/datadog-agent-sysprobe-exp.service b/pkg/fleet/installer/packages/embedded/datadog-agent-sysprobe-exp.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent-sysprobe-exp.service rename to pkg/fleet/installer/packages/embedded/datadog-agent-sysprobe-exp.service diff --git a/pkg/fleet/installer/service/embedded/datadog-agent-sysprobe.service b/pkg/fleet/installer/packages/embedded/datadog-agent-sysprobe.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent-sysprobe.service rename to pkg/fleet/installer/packages/embedded/datadog-agent-sysprobe.service diff --git a/pkg/fleet/installer/service/embedded/datadog-agent-trace-exp.service b/pkg/fleet/installer/packages/embedded/datadog-agent-trace-exp.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent-trace-exp.service rename to pkg/fleet/installer/packages/embedded/datadog-agent-trace-exp.service diff --git a/pkg/fleet/installer/service/embedded/datadog-agent-trace.service b/pkg/fleet/installer/packages/embedded/datadog-agent-trace.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent-trace.service rename to pkg/fleet/installer/packages/embedded/datadog-agent-trace.service diff --git a/pkg/fleet/installer/service/embedded/datadog-agent.service b/pkg/fleet/installer/packages/embedded/datadog-agent.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-agent.service rename to pkg/fleet/installer/packages/embedded/datadog-agent.service diff --git a/pkg/fleet/installer/service/embedded/datadog-installer-exp.service b/pkg/fleet/installer/packages/embedded/datadog-installer-exp.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-installer-exp.service rename to pkg/fleet/installer/packages/embedded/datadog-installer-exp.service diff --git a/pkg/fleet/installer/service/embedded/datadog-installer.service b/pkg/fleet/installer/packages/embedded/datadog-installer.service similarity index 100% rename from pkg/fleet/installer/service/embedded/datadog-installer.service rename to pkg/fleet/installer/packages/embedded/datadog-installer.service diff --git a/pkg/fleet/installer/service/embedded/dd-cleanup b/pkg/fleet/installer/packages/embedded/dd-cleanup similarity index 100% rename from pkg/fleet/installer/service/embedded/dd-cleanup rename to pkg/fleet/installer/packages/embedded/dd-cleanup diff --git a/pkg/fleet/installer/service/embedded/dd-container-install b/pkg/fleet/installer/packages/embedded/dd-container-install similarity index 100% rename from pkg/fleet/installer/service/embedded/dd-container-install rename to pkg/fleet/installer/packages/embedded/dd-container-install diff --git a/pkg/fleet/installer/service/embedded/dd-host-install b/pkg/fleet/installer/packages/embedded/dd-host-install similarity index 100% rename from pkg/fleet/installer/service/embedded/dd-host-install rename to pkg/fleet/installer/packages/embedded/dd-host-install diff --git a/pkg/fleet/installer/service/embedded/embed.go b/pkg/fleet/installer/packages/embedded/embed.go similarity index 100% rename from pkg/fleet/installer/service/embedded/embed.go rename to pkg/fleet/installer/packages/embedded/embed.go diff --git a/pkg/fleet/installer/service/file.go b/pkg/fleet/installer/packages/file.go similarity index 98% rename from pkg/fleet/installer/service/file.go rename to pkg/fleet/installer/packages/file.go index 5fa6e94541683..b8670b26ee34d 100644 --- a/pkg/fleet/installer/service/file.go +++ b/pkg/fleet/installer/packages/file.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "bytes" diff --git a/pkg/fleet/installer/service/file_test.go b/pkg/fleet/installer/packages/file_test.go similarity index 98% rename from pkg/fleet/installer/service/file_test.go rename to pkg/fleet/installer/packages/file_test.go index f795bd07bda49..8a8170ee6e5ee 100644 --- a/pkg/fleet/installer/service/file_test.go +++ b/pkg/fleet/installer/packages/file_test.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "context" diff --git a/pkg/fleet/installer/service/msiexec.go b/pkg/fleet/installer/packages/msiexec.go similarity index 99% rename from pkg/fleet/installer/service/msiexec.go rename to pkg/fleet/installer/packages/msiexec.go index 6eb0e0958bd38..e65692bb38c8f 100644 --- a/pkg/fleet/installer/service/msiexec.go +++ b/pkg/fleet/installer/packages/msiexec.go @@ -5,15 +5,16 @@ //go:build windows -package service +package packages import ( "fmt" + "os/exec" + "path/filepath" + "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" "github.com/DataDog/datadog-agent/pkg/util/log" "golang.org/x/sys/windows/registry" - "os/exec" - "path/filepath" ) func msiexec(target, product, operation string, args []string) (*exec.Cmd, error) { diff --git a/pkg/fleet/installer/service/systemd.go b/pkg/fleet/installer/packages/systemd.go similarity index 96% rename from pkg/fleet/installer/service/systemd.go rename to pkg/fleet/installer/packages/systemd.go index 264394b6858f2..679331907f7fd 100644 --- a/pkg/fleet/installer/service/systemd.go +++ b/pkg/fleet/installer/packages/systemd.go @@ -5,8 +5,7 @@ //go:build !windows -// Package service provides a way to interact with os services -package service +package packages import ( "context" @@ -17,7 +16,7 @@ import ( "path" "path/filepath" - "github.com/DataDog/datadog-agent/pkg/fleet/installer/service/embedded" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages/embedded" "github.com/DataDog/datadog-agent/pkg/util/log" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) diff --git a/pkg/fleet/installer/service/systemd_windows.go b/pkg/fleet/installer/packages/systemd_windows.go similarity index 82% rename from pkg/fleet/installer/service/systemd_windows.go rename to pkg/fleet/installer/packages/systemd_windows.go index 8233b83a18e07..2ead580795638 100644 --- a/pkg/fleet/installer/service/systemd_windows.go +++ b/pkg/fleet/installer/packages/systemd_windows.go @@ -5,8 +5,7 @@ //go:build windows -// Package service provides a way to interact with os services -package service +package packages // IsSystemdRunning noop func IsSystemdRunning() (running bool, err error) { From 98b799cb74f2e95be94c27a0627643f0ab259a2c Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Fri, 29 Nov 2024 19:05:16 +0100 Subject: [PATCH 50/59] [CWS] switch auid hooks to fentry (#28769) --- pkg/security/ebpf/c/include/hooks/login_uid.h | 12 ++++++------ pkg/security/ebpf/kernel/kernel.go | 15 ++++++++++++--- pkg/security/probe/probe_ebpf.go | 14 +++++++++++--- pkg/security/tests/login_uid_test.go | 2 -- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/pkg/security/ebpf/c/include/hooks/login_uid.h b/pkg/security/ebpf/c/include/hooks/login_uid.h index 86d25f0e94816..d96148bdfa84f 100644 --- a/pkg/security/ebpf/c/include/hooks/login_uid.h +++ b/pkg/security/ebpf/c/include/hooks/login_uid.h @@ -3,12 +3,12 @@ #include "helpers/syscalls.h" -SEC("kprobe/audit_set_loginuid") -int hook_audit_set_loginuid(struct pt_regs *ctx) { +HOOK_ENTRY("audit_set_loginuid") +int hook_audit_set_loginuid(ctx_t *ctx) { struct syscall_cache_t syscall = { .type = EVENT_LOGIN_UID_WRITE, .login_uid = { - .auid = (u32)PT_REGS_PARM1(ctx), + .auid = (u32)CTX_PARM1(ctx), }, }; @@ -16,9 +16,9 @@ int hook_audit_set_loginuid(struct pt_regs *ctx) { return 0; } -SEC("kretprobe/audit_set_loginuid") -int rethook_audit_set_loginuid(struct pt_regs *ctx) { - int retval = PT_REGS_RC(ctx); +HOOK_EXIT("audit_set_loginuid") +int rethook_audit_set_loginuid(ctx_t *ctx) { + int retval = CTX_PARMRET(ctx, 1); if (retval < 0) { return 0; } diff --git a/pkg/security/ebpf/kernel/kernel.go b/pkg/security/ebpf/kernel/kernel.go index e710b4a29eb9b..011273ef79589 100644 --- a/pkg/security/ebpf/kernel/kernel.go +++ b/pkg/security/ebpf/kernel/kernel.go @@ -332,8 +332,7 @@ func (k *Version) HaveLegacyPipeInodeInfoStruct() bool { return k.Code != 0 && k.Code < Kernel5_5 } -// HaveFentrySupport returns whether the kernel supports fentry probes -func (k *Version) HaveFentrySupport() bool { +func (k *Version) commonFentryCheck(funcName string) bool { if features.HaveProgramType(ebpf.Tracing) != nil { return false } @@ -341,7 +340,7 @@ func (k *Version) HaveFentrySupport() bool { spec := &ebpf.ProgramSpec{ Type: ebpf.Tracing, AttachType: ebpf.AttachTraceFEntry, - AttachTo: "vfs_open", + AttachTo: funcName, Instructions: asm.Instructions{ asm.LoadImm(asm.R0, 0, asm.DWord), asm.Return(), @@ -366,6 +365,16 @@ func (k *Version) HaveFentrySupport() bool { return true } +// HaveFentrySupport returns whether the kernel supports fentry probes +func (k *Version) HaveFentrySupport() bool { + return k.commonFentryCheck("vfs_open") +} + +// HaveFentrySupportWithStructArgs returns whether the kernel supports fentry probes with struct arguments +func (k *Version) HaveFentrySupportWithStructArgs() bool { + return k.commonFentryCheck("audit_set_loginuid") +} + // SupportBPFSendSignal returns true if the eBPF function bpf_send_signal is available func (k *Version) SupportBPFSendSignal() bool { return k.Code != 0 && k.Code >= Kernel5_3 diff --git a/pkg/security/probe/probe_ebpf.go b/pkg/security/probe/probe_ebpf.go index 6f1090b63a72c..1c1e8fa37bc82 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -194,11 +194,19 @@ func (p *EBPFProbe) selectFentryMode() { return } - supported := p.kernelVersion.HaveFentrySupport() - if !supported { + if !p.kernelVersion.HaveFentrySupport() { + p.useFentry = false seclog.Errorf("fentry enabled but not supported, falling back to kprobe mode") + return } - p.useFentry = supported + + if !p.kernelVersion.HaveFentrySupportWithStructArgs() { + p.useFentry = false + seclog.Warnf("fentry enabled but not supported with struct args, falling back to kprobe mode") + return + } + + p.useFentry = true } func (p *EBPFProbe) isNetworkNotSupported() bool { diff --git a/pkg/security/tests/login_uid_test.go b/pkg/security/tests/login_uid_test.go index 31d548788e349..82743dcabeee7 100644 --- a/pkg/security/tests/login_uid_test.go +++ b/pkg/security/tests/login_uid_test.go @@ -89,8 +89,6 @@ func TestLoginUID(t *testing.T) { return err } - t.Logf("test out: %s\n", string(out)) - return nil }, func(event *model.Event, rule *rules.Rule) { assert.Equal(t, "exec", event.GetType(), "wrong event type") From 8a9c5b52a1033205b828483fe7fb98a01bfa8169 Mon Sep 17 00:00:00 2001 From: Guy Arbitman Date: Sun, 1 Dec 2024 11:40:36 +0200 Subject: [PATCH 51/59] usm: Fix imports (#31634) --- pkg/network/protocols/amqp/server.go | 2 +- pkg/network/protocols/kafka/server.go | 5 +++-- pkg/network/protocols/mongo/server.go | 5 +++-- pkg/network/protocols/mysql/server.go | 2 +- pkg/network/protocols/postgres/server.go | 2 +- pkg/network/protocols/redis/server.go | 2 +- pkg/network/protocols/tls/gotls/testutil/server.go | 5 +++-- pkg/network/protocols/tls/nodejs/nodejs.go | 5 +++-- pkg/network/usm/monitor_tls_test.go | 2 +- 9 files changed, 17 insertions(+), 13 deletions(-) diff --git a/pkg/network/protocols/amqp/server.go b/pkg/network/protocols/amqp/server.go index ffd049cb36667..fd343ab5a29ae 100644 --- a/pkg/network/protocols/amqp/server.go +++ b/pkg/network/protocols/amqp/server.go @@ -7,7 +7,6 @@ package amqp import ( "fmt" - globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "os" "path/filepath" "regexp" @@ -17,6 +16,7 @@ import ( httpUtils "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" protocolsUtils "github.com/DataDog/datadog-agent/pkg/network/protocols/testutil" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) diff --git a/pkg/network/protocols/kafka/server.go b/pkg/network/protocols/kafka/server.go index 95c66ef23b8a1..eeb5a91c58a5d 100644 --- a/pkg/network/protocols/kafka/server.go +++ b/pkg/network/protocols/kafka/server.go @@ -8,14 +8,15 @@ package kafka import ( - globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" - "github.com/stretchr/testify/require" "os" "path/filepath" "regexp" "testing" + "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) diff --git a/pkg/network/protocols/mongo/server.go b/pkg/network/protocols/mongo/server.go index 59717d099a9ae..cc9bf63b55545 100644 --- a/pkg/network/protocols/mongo/server.go +++ b/pkg/network/protocols/mongo/server.go @@ -7,13 +7,14 @@ package mongo import ( "fmt" - globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" - "github.com/stretchr/testify/require" "path/filepath" "regexp" "testing" + "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) diff --git a/pkg/network/protocols/mysql/server.go b/pkg/network/protocols/mysql/server.go index 1ea9ebb1ac1ec..423ca963943e7 100644 --- a/pkg/network/protocols/mysql/server.go +++ b/pkg/network/protocols/mysql/server.go @@ -7,7 +7,6 @@ package mysql import ( "fmt" - globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "path/filepath" "regexp" "testing" @@ -15,6 +14,7 @@ import ( "github.com/stretchr/testify/require" "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) diff --git a/pkg/network/protocols/postgres/server.go b/pkg/network/protocols/postgres/server.go index 2b4bd55bde9c6..556c918a1bd34 100644 --- a/pkg/network/protocols/postgres/server.go +++ b/pkg/network/protocols/postgres/server.go @@ -10,7 +10,6 @@ package postgres import ( "fmt" - globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "io" "os" "path/filepath" @@ -20,6 +19,7 @@ import ( "github.com/stretchr/testify/require" "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) diff --git a/pkg/network/protocols/redis/server.go b/pkg/network/protocols/redis/server.go index 56d36fec8855c..58e645a42b3fd 100644 --- a/pkg/network/protocols/redis/server.go +++ b/pkg/network/protocols/redis/server.go @@ -11,7 +11,6 @@ package redis import ( "fmt" - globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "path/filepath" "regexp" "testing" @@ -19,6 +18,7 @@ import ( "github.com/stretchr/testify/require" "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) diff --git a/pkg/network/protocols/tls/gotls/testutil/server.go b/pkg/network/protocols/tls/gotls/testutil/server.go index 36a58b003c0e6..ec2e56f054625 100644 --- a/pkg/network/protocols/tls/gotls/testutil/server.go +++ b/pkg/network/protocols/tls/gotls/testutil/server.go @@ -6,12 +6,13 @@ package testutil import ( - globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" - "github.com/stretchr/testify/require" "regexp" "testing" + "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) diff --git a/pkg/network/protocols/tls/nodejs/nodejs.go b/pkg/network/protocols/tls/nodejs/nodejs.go index fb7dc18f60a9a..54a21acf99dd8 100644 --- a/pkg/network/protocols/tls/nodejs/nodejs.go +++ b/pkg/network/protocols/tls/nodejs/nodejs.go @@ -9,15 +9,16 @@ package nodejs import ( - globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" - "github.com/stretchr/testify/require" "io" "os" "path" "regexp" "testing" + "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) diff --git a/pkg/network/usm/monitor_tls_test.go b/pkg/network/usm/monitor_tls_test.go index 24f0f7b3a5d2f..c7553370b7c7b 100644 --- a/pkg/network/usm/monitor_tls_test.go +++ b/pkg/network/usm/monitor_tls_test.go @@ -12,7 +12,6 @@ import ( "bytes" "crypto/tls" "fmt" - globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "io" "math/rand" nethttp "net/http" @@ -46,6 +45,7 @@ import ( usmtestutil "github.com/DataDog/datadog-agent/pkg/network/usm/testutil" "github.com/DataDog/datadog-agent/pkg/network/usm/utils" procmontestutil "github.com/DataDog/datadog-agent/pkg/process/monitor/testutil" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) From c6d0c1e0d7d4c9f7e82126a4961333c5fb81a138 Mon Sep 17 00:00:00 2001 From: Baptiste Foy Date: Sun, 1 Dec 2024 11:51:54 +0100 Subject: [PATCH 52/59] upgrade(installer): Return specific error codes (#31619) Co-authored-by: arbll --- cmd/installer/main.go | 24 ++++++- pkg/fleet/daemon/daemon.go | 2 +- pkg/fleet/installer/errors/errors.go | 71 +++++++++++++++------ pkg/fleet/installer/errors/errors_test.go | 27 ++++++-- pkg/fleet/installer/installer.go | 76 ++++++++++++++++++----- pkg/fleet/internal/exec/installer_exec.go | 6 +- pkg/fleet/internal/oci/download.go | 7 ++- 7 files changed, 170 insertions(+), 43 deletions(-) diff --git a/cmd/installer/main.go b/cmd/installer/main.go index 15fcd2a8eb91c..1cd198631d420 100644 --- a/cmd/installer/main.go +++ b/cmd/installer/main.go @@ -9,13 +9,33 @@ package main import ( + "fmt" "os" "github.com/DataDog/datadog-agent/cmd/installer/command" "github.com/DataDog/datadog-agent/cmd/installer/subcommands" - "github.com/DataDog/datadog-agent/cmd/internal/runcmd" + "github.com/spf13/cobra" + "go.uber.org/dig" + + installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" ) func main() { - os.Exit(runcmd.Run(command.MakeCommand(subcommands.InstallerSubcommands()))) + os.Exit(runCmd(command.MakeCommand(subcommands.InstallerSubcommands()))) +} + +func runCmd(cmd *cobra.Command) int { + // always silence errors, since they are handled here + cmd.SilenceErrors = true + + err := cmd.Execute() + if err != nil { + if rootCauseErr := dig.RootCause(err); rootCauseErr != err { + fmt.Fprintln(cmd.ErrOrStderr(), installerErrors.FromErr(rootCauseErr).ToJSON()) + } else { + fmt.Fprintln(cmd.ErrOrStderr(), installerErrors.FromErr(err).ToJSON()) + } + return -1 + } + return 0 } diff --git a/pkg/fleet/daemon/daemon.go b/pkg/fleet/daemon/daemon.go index d4d99ff7fd68e..c0e38e5cc545c 100644 --- a/pkg/fleet/daemon/daemon.go +++ b/pkg/fleet/daemon/daemon.go @@ -552,7 +552,7 @@ func setRequestDone(ctx context.Context, err error) { state.State = pbgo.TaskState_DONE if err != nil { state.State = pbgo.TaskState_ERROR - state.Err = installerErrors.From(err) + state.Err = installerErrors.FromErr(err) } } diff --git a/pkg/fleet/installer/errors/errors.go b/pkg/fleet/installer/errors/errors.go index 589d8179a2fa8..736c609af033c 100644 --- a/pkg/fleet/installer/errors/errors.go +++ b/pkg/fleet/installer/errors/errors.go @@ -7,6 +7,7 @@ package errors import ( + "encoding/json" "errors" ) @@ -14,19 +15,15 @@ import ( type InstallerErrorCode uint64 const ( - errUnknown InstallerErrorCode = iota // This error code is purposefully not exported - // ErrInstallFailed is the code for an install failure. - ErrInstallFailed + errUnknown InstallerErrorCode = 0 // This error code is purposefully not exported // ErrDownloadFailed is the code for a download failure. - ErrDownloadFailed - // ErrInvalidHash is the code for an invalid hash. - ErrInvalidHash - // ErrInvalidState is the code for an invalid state. - ErrInvalidState + ErrDownloadFailed InstallerErrorCode = 1 + // ErrNotEnoughDiskSpace is the code for not enough disk space. + ErrNotEnoughDiskSpace InstallerErrorCode = 2 // ErrPackageNotFound is the code for a package not found. - ErrPackageNotFound - // ErrUpdateExperimentFailed is the code for an update experiment failure. - ErrUpdateExperimentFailed + ErrPackageNotFound InstallerErrorCode = 3 + // ErrFilesystemIssue is the code for a filesystem issue (e.g. permission issue). + ErrFilesystemIssue InstallerErrorCode = 4 ) // InstallerError is an error type used by the installer. @@ -35,6 +32,11 @@ type InstallerError struct { code InstallerErrorCode } +type installerErrorJSON struct { + Error string `json:"error"` + Code int `json:"code"` +} + // Error returns the error message. func (e InstallerError) Error() string { return e.err.Error() @@ -60,7 +62,7 @@ func (e InstallerError) Code() InstallerErrorCode { // If the given error is already an installer error, it is not wrapped and // left as it is. Only the deepest InstallerError remains. func Wrap(errCode InstallerErrorCode, err error) error { - if errors.Is(err, &InstallerError{}) { + if FromErr(err).code != errUnknown { return err } return &InstallerError{ @@ -69,18 +71,51 @@ func Wrap(errCode InstallerErrorCode, err error) error { } } -// From returns a new InstallerError from the given error. -func From(err error) *InstallerError { +// FromErr returns a new InstallerError from the given error. +// Unwraps the error until it finds an InstallerError and return unknown error code if not found. +func FromErr(err error) *InstallerError { if err == nil { return nil } - e, ok := err.(*InstallerError) if !ok { - return &InstallerError{ - err: err, - code: errUnknown, + unwrappedErr := errors.Unwrap(err) + if unwrappedErr == nil { + return &InstallerError{ + err: err, + code: errUnknown, + } } + return FromErr(unwrappedErr) } return e } + +// ToJSON returns the error as a JSON string. +func (e InstallerError) ToJSON() string { + tmp := installerErrorJSON{ + Error: e.err.Error(), + Code: int(e.code), + } + jsonErr, err := json.Marshal(tmp) + if err != nil { + return e.err.Error() + } + return string(jsonErr) +} + +// FromJSON returns an InstallerError from a JSON string. +func FromJSON(errStr string) InstallerError { + var jsonError installerErrorJSON + err := json.Unmarshal([]byte(errStr), &jsonError) + if err != nil { + return InstallerError{ + err: errors.New(errStr), + code: errUnknown, + } + } + return InstallerError{ + err: errors.New(jsonError.Error), + code: InstallerErrorCode(jsonError.Code), + } +} diff --git a/pkg/fleet/installer/errors/errors_test.go b/pkg/fleet/installer/errors/errors_test.go index 44a5cdc584b95..5115faaaf8a26 100644 --- a/pkg/fleet/installer/errors/errors_test.go +++ b/pkg/fleet/installer/errors/errors_test.go @@ -12,18 +12,34 @@ import ( "github.com/stretchr/testify/assert" ) -func TestFrom(t *testing.T) { +func TestFromErr(t *testing.T) { var err error = &InstallerError{ err: fmt.Errorf("test: test"), code: ErrDownloadFailed, } - taskErr := From(err) + taskErr := FromErr(err) assert.Equal(t, taskErr, &InstallerError{ err: fmt.Errorf("test: test"), code: ErrDownloadFailed, }) - assert.Nil(t, From(nil)) + assert.Nil(t, FromErr(nil)) +} + +func TestFromErrWithWrap(t *testing.T) { + err := fmt.Errorf("test: %w", &InstallerError{ + err: fmt.Errorf("test: test"), + code: ErrDownloadFailed, + }) + taskErr := FromErr(err) + assert.Equal(t, taskErr, &InstallerError{ + err: fmt.Errorf("test: test"), + code: ErrDownloadFailed, + }) + + taskErr2 := fmt.Errorf("Wrap 2: %w", fmt.Errorf("Wrap 1: %w", taskErr)) + assert.Equal(t, FromErr(taskErr2).Code(), ErrDownloadFailed) + assert.Nil(t, FromErr(nil)) } func TestWrap(t *testing.T) { @@ -36,9 +52,12 @@ func TestWrap(t *testing.T) { // Check that Wrap doesn't change anything if the error // is already an InstallerError - taskErr2 := Wrap(ErrInstallFailed, taskErr) + taskErr2 := Wrap(ErrNotEnoughDiskSpace, taskErr) assert.Equal(t, taskErr2, &InstallerError{ err: err, code: ErrDownloadFailed, }) + + taskErr3 := Wrap(ErrFilesystemIssue, fmt.Errorf("Wrap 2: %w", fmt.Errorf("Wrap 1: %w", taskErr2))) + assert.Equal(t, FromErr(taskErr3).Code(), ErrDownloadFailed) } diff --git a/pkg/fleet/installer/installer.go b/pkg/fleet/installer/installer.go index 8db7bc07954a5..be2706643df76 100644 --- a/pkg/fleet/installer/installer.go +++ b/pkg/fleet/installer/installer.go @@ -21,6 +21,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" fleetEnv "github.com/DataDog/datadog-agent/pkg/fleet/env" + installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages" "github.com/DataDog/datadog-agent/pkg/fleet/installer/repository" "github.com/DataDog/datadog-agent/pkg/fleet/internal/db" @@ -227,30 +228,48 @@ func (i *installerImpl) InstallExperiment(ctx context.Context, url string) error defer i.m.Unlock() pkg, err := i.downloader.Download(ctx, url) if err != nil { - return fmt.Errorf("could not download package: %w", err) + return installerErrors.Wrap( + installerErrors.ErrDownloadFailed, + fmt.Errorf("could not download package: %w", err), + ) } err = checkAvailableDiskSpace(i.packages, pkg) if err != nil { - return fmt.Errorf("not enough disk space: %w", err) + return installerErrors.Wrap( + installerErrors.ErrNotEnoughDiskSpace, + fmt.Errorf("not enough disk space: %w", err), + ) } tmpDir, err := i.packages.MkdirTemp() if err != nil { - return fmt.Errorf("could not create temporary directory: %w", err) + return installerErrors.Wrap( + installerErrors.ErrFilesystemIssue, + fmt.Errorf("could create temporary directory: %w", err), + ) } defer os.RemoveAll(tmpDir) configDir := filepath.Join(i.userConfigsDir, pkg.Name) err = pkg.ExtractLayers(oci.DatadogPackageLayerMediaType, tmpDir) if err != nil { - return fmt.Errorf("could not extract package layers: %w", err) + return installerErrors.Wrap( + installerErrors.ErrDownloadFailed, + fmt.Errorf("could not extract package layer: %w", err), + ) } err = pkg.ExtractLayers(oci.DatadogPackageConfigLayerMediaType, configDir) if err != nil { - return fmt.Errorf("could not extract package config layer: %w", err) + return installerErrors.Wrap( + installerErrors.ErrDownloadFailed, + fmt.Errorf("could not extract package config layer: %w", err), + ) } repository := i.packages.Get(pkg.Name) err = repository.SetExperiment(pkg.Version, tmpDir) if err != nil { - return fmt.Errorf("could not set experiment: %w", err) + return installerErrors.Wrap( + installerErrors.ErrFilesystemIssue, + fmt.Errorf("could not set experiment: %w", err), + ) } return i.startExperiment(ctx, pkg.Name) @@ -267,7 +286,10 @@ func (i *installerImpl) RemoveExperiment(ctx context.Context, pkg string) error // will kill the current process, delete the experiment first. err := repository.DeleteExperiment() if err != nil { - return fmt.Errorf("could not delete experiment: %w", err) + return installerErrors.Wrap( + installerErrors.ErrFilesystemIssue, + fmt.Errorf("could not delete experiment: %w", err), + ) } err = i.stopExperiment(ctx, pkg) if err != nil { @@ -280,7 +302,10 @@ func (i *installerImpl) RemoveExperiment(ctx context.Context, pkg string) error } err = repository.DeleteExperiment() if err != nil { - return fmt.Errorf("could not delete experiment: %w", err) + return installerErrors.Wrap( + installerErrors.ErrFilesystemIssue, + fmt.Errorf("could not delete experiment: %w", err), + ) } } return nil @@ -306,27 +331,42 @@ func (i *installerImpl) InstallConfigExperiment(ctx context.Context, pkg string, config, err := i.cdn.Get(ctx, pkg) if err != nil { - return fmt.Errorf("could not get cdn config: %w", err) + return installerErrors.Wrap( + installerErrors.ErrDownloadFailed, + fmt.Errorf("could not get cdn config: %w", err), + ) } if config.State().GetVersion() != version { - return fmt.Errorf("version mismatch: expected %s, got %s", config.State().GetVersion(), version) + return installerErrors.Wrap( + installerErrors.ErrDownloadFailed, + fmt.Errorf("version mismatch: expected %s, got %s", config.State().GetVersion(), version), + ) } tmpDir, err := i.packages.MkdirTemp() if err != nil { - return fmt.Errorf("could not create temporary directory: %w", err) + return installerErrors.Wrap( + installerErrors.ErrFilesystemIssue, + fmt.Errorf("could not create temporary directory: %w", err), + ) } defer os.RemoveAll(tmpDir) err = config.Write(tmpDir) if err != nil { - return fmt.Errorf("could not write agent config: %w", err) + return installerErrors.Wrap( + installerErrors.ErrFilesystemIssue, + fmt.Errorf("could not write agent config: %w", err), + ) } configRepo := i.configs.Get(pkg) err = configRepo.SetExperiment(version, tmpDir) if err != nil { - return fmt.Errorf("could not set experiment: %w", err) + return installerErrors.Wrap( + installerErrors.ErrFilesystemIssue, + fmt.Errorf("could not set experiment: %w", err), + ) } switch runtime.GOOS { @@ -349,7 +389,10 @@ func (i *installerImpl) RemoveConfigExperiment(ctx context.Context, pkg string) repository := i.configs.Get(pkg) err = repository.DeleteExperiment() if err != nil { - return fmt.Errorf("could not delete experiment: %w", err) + return installerErrors.Wrap( + installerErrors.ErrFilesystemIssue, + fmt.Errorf("could not delete experiment: %w", err), + ) } return nil } @@ -362,7 +405,10 @@ func (i *installerImpl) PromoteConfigExperiment(ctx context.Context, pkg string) repository := i.configs.Get(pkg) err := repository.PromoteExperiment() if err != nil { - return fmt.Errorf("could not promote experiment: %w", err) + return installerErrors.Wrap( + installerErrors.ErrFilesystemIssue, + fmt.Errorf("could not promote experiment: %w", err), + ) } return i.promoteExperiment(ctx, pkg) } diff --git a/pkg/fleet/internal/exec/installer_exec.go b/pkg/fleet/internal/exec/installer_exec.go index 1841de484b841..34a3cfad4fbcf 100644 --- a/pkg/fleet/internal/exec/installer_exec.go +++ b/pkg/fleet/internal/exec/installer_exec.go @@ -19,6 +19,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/fleet/env" + installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" "github.com/DataDog/datadog-agent/pkg/fleet/installer/repository" "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" @@ -247,8 +248,9 @@ func (iCmd *installerCmd) Run() error { } if len(errBuf.Bytes()) == 0 { - return fmt.Errorf("run failed: %s", err.Error()) + return fmt.Errorf("run failed: %w", err) } - return fmt.Errorf("run failed: %s \n%s", strings.TrimSpace(errBuf.String()), err.Error()) + installerError := installerErrors.FromJSON(strings.TrimSpace(errBuf.String())) + return fmt.Errorf("run failed: %v \n%s", installerError, err.Error()) } diff --git a/pkg/fleet/internal/oci/download.go b/pkg/fleet/internal/oci/download.go index f4a19fe29e59c..6bf91468fa0e6 100644 --- a/pkg/fleet/internal/oci/download.go +++ b/pkg/fleet/internal/oci/download.go @@ -33,6 +33,8 @@ import ( "golang.org/x/net/http2" httptrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/net/http" + installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" + "github.com/DataDog/datadog-agent/pkg/fleet/env" "github.com/DataDog/datadog-agent/pkg/fleet/internal/tar" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -304,7 +306,10 @@ func (d *Downloader) downloadIndex(index oci.ImageIndex) (oci.Image, error) { } return image, nil } - return nil, fmt.Errorf("no matching image found in the index") + return nil, installerErrors.Wrap( + installerErrors.ErrPackageNotFound, + fmt.Errorf("no matching image found in the index"), + ) } // ExtractLayers extracts the layers of the downloaded package with the given media type to the given directory. From 8ea4e935b5192660c2dca85ed0a39dd6e9624222 Mon Sep 17 00:00:00 2001 From: Arthur Bellal Date: Sun, 1 Dec 2024 13:23:20 +0100 Subject: [PATCH 53/59] (fleet) env cleanup (#31628) --- .../subcommands/installer/command.go | 4 +- .../telemetry/telemetryimpl/telemetry.go | 17 ++-- comp/updater/updater/updaterimpl/updater.go | 9 +- pkg/fleet/bootstrapper/bootstrapper.go | 2 +- pkg/fleet/daemon/daemon.go | 23 ++++- pkg/fleet/daemon/daemon_test.go | 2 +- pkg/fleet/env/http_client.go | 22 ----- pkg/fleet/env/install_script.go | 33 -------- pkg/fleet/installer/default_packages.go | 2 +- pkg/fleet/installer/default_packages_test.go | 2 +- pkg/fleet/{ => installer}/env/env.go | 83 ++++++++++++------- pkg/fleet/{ => installer}/env/env_test.go | 0 pkg/fleet/installer/installer.go | 8 +- pkg/fleet/installer/installer_test.go | 2 +- pkg/fleet/installer/packages/apm_inject.go | 2 +- .../installer/packages/apm_inject_test.go | 2 +- pkg/fleet/installer/setup.go | 2 +- pkg/fleet/internal/bootstrap/bootstrap.go | 3 +- pkg/fleet/internal/bootstrap/bootstrap_nix.go | 8 +- .../internal/bootstrap/bootstrap_windows.go | 8 +- pkg/fleet/internal/cdn/cdn.go | 2 +- pkg/fleet/internal/cdn/cdn_http.go | 2 +- pkg/fleet/internal/cdn/cdn_local.go | 2 +- pkg/fleet/internal/cdn/cdn_rc.go | 2 +- pkg/fleet/internal/cdn/scope_expression.go | 2 +- pkg/fleet/internal/cdn/tags.go | 2 +- pkg/fleet/internal/exec/installer_exec.go | 2 +- pkg/fleet/internal/oci/download.go | 3 +- pkg/fleet/internal/oci/download_test.go | 2 +- pkg/fleet/telemetry/telemetry.go | 5 +- 30 files changed, 126 insertions(+), 132 deletions(-) delete mode 100644 pkg/fleet/env/http_client.go delete mode 100644 pkg/fleet/env/install_script.go rename pkg/fleet/{ => installer}/env/env.go (85%) rename pkg/fleet/{ => installer}/env/env_test.go (100%) diff --git a/cmd/installer/subcommands/installer/command.go b/cmd/installer/subcommands/installer/command.go index f4b25dd1a164e..ebbe269aa7ebd 100644 --- a/cmd/installer/subcommands/installer/command.go +++ b/cmd/installer/subcommands/installer/command.go @@ -17,8 +17,8 @@ import ( "github.com/DataDog/datadog-agent/cmd/installer/command" "github.com/DataDog/datadog-agent/pkg/fleet/bootstrapper" - "github.com/DataDog/datadog-agent/pkg/fleet/env" "github.com/DataDog/datadog-agent/pkg/fleet/installer" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/version" "github.com/spf13/cobra" @@ -226,7 +226,7 @@ func newTelemetry(env *env.Env) *telemetry.Telemetry { if site == "" { site = config.Site } - t, err := telemetry.NewTelemetry(apiKey, site, "datadog-installer") // No sampling rules for commands + t, err := telemetry.NewTelemetry(env.HTTPClient(), apiKey, site, "datadog-installer") // No sampling rules for commands if err != nil { fmt.Printf("failed to initialize telemetry: %v\n", err) return nil diff --git a/comp/updater/telemetry/telemetryimpl/telemetry.go b/comp/updater/telemetry/telemetryimpl/telemetry.go index caf3b90e73bcc..cf19e681c5708 100644 --- a/comp/updater/telemetry/telemetryimpl/telemetry.go +++ b/comp/updater/telemetry/telemetryimpl/telemetry.go @@ -7,14 +7,17 @@ package telemetryimpl import ( + "net/http" + "go.uber.org/fx" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/comp/updater/telemetry" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/config/utils" fleettelemetry "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/fxutil" + httputils "github.com/DataDog/datadog-agent/pkg/util/http" ) type dependencies struct { @@ -32,12 +35,14 @@ func Module() fxutil.Module { } func newTelemetry(deps dependencies) (telemetry.Component, error) { - env := env.FromConfig(deps.Config) - telemetry, err := fleettelemetry.NewTelemetry(env.APIKey, env.Site, "datadog-installer", + client := &http.Client{ + Transport: httputils.CreateHTTPTransport(deps.Config), + } + telemetry, err := fleettelemetry.NewTelemetry(client, utils.SanitizeAPIKey(deps.Config.GetString("api_key")), deps.Config.GetString("site"), "datadog-installer-daemon", fleettelemetry.WithSamplingRules( - tracer.NameServiceRule("cdn.*", "datadog-installer", 0.1), - tracer.NameServiceRule("*garbage_collect*", "datadog-installer", 0.05), - tracer.NameServiceRule("HTTPClient.*", "datadog-installer", 0.05), + tracer.NameServiceRule("cdn.*", "datadog-installer-daemon", 0.1), + tracer.NameServiceRule("*garbage_collect*", "datadog-installer-daemon", 0.05), + tracer.NameServiceRule("HTTPClient.*", "datadog-installer-daemon", 0.05), ), ) if err != nil { diff --git a/comp/updater/updater/updaterimpl/updater.go b/comp/updater/updater/updaterimpl/updater.go index 117ea9c937653..5ed1cbd252375 100644 --- a/comp/updater/updater/updaterimpl/updater.go +++ b/comp/updater/updater/updaterimpl/updater.go @@ -7,12 +7,14 @@ package updaterimpl import ( + "context" "errors" "fmt" "go.uber.org/fx" "github.com/DataDog/datadog-agent/comp/core/config" + "github.com/DataDog/datadog-agent/comp/core/hostname" log "github.com/DataDog/datadog-agent/comp/core/log/def" "github.com/DataDog/datadog-agent/comp/remote-config/rcservice" updatercomp "github.com/DataDog/datadog-agent/comp/updater/updater" @@ -36,6 +38,7 @@ func Module() fxutil.Module { type dependencies struct { fx.In + Hostname hostname.Component Log log.Component Config config.Component RemoteConfig optional.Option[rcservice.Component] @@ -46,7 +49,11 @@ func newUpdaterComponent(lc fx.Lifecycle, dependencies dependencies) (updatercom if !ok { return nil, errRemoteConfigRequired } - daemon, err := daemon.NewDaemon(remoteConfig, dependencies.Config) + hostname, err := dependencies.Hostname.Get(context.Background()) + if err != nil { + return nil, fmt.Errorf("could not get hostname: %w", err) + } + daemon, err := daemon.NewDaemon(hostname, remoteConfig, dependencies.Config) if err != nil { return nil, fmt.Errorf("could not create updater: %w", err) } diff --git a/pkg/fleet/bootstrapper/bootstrapper.go b/pkg/fleet/bootstrapper/bootstrapper.go index a21960a096527..e935a6cadc649 100644 --- a/pkg/fleet/bootstrapper/bootstrapper.go +++ b/pkg/fleet/bootstrapper/bootstrapper.go @@ -10,7 +10,7 @@ import ( "context" "fmt" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/internal/bootstrap" "github.com/DataDog/datadog-agent/pkg/fleet/internal/exec" "github.com/DataDog/datadog-agent/pkg/fleet/internal/oci" diff --git a/pkg/fleet/daemon/daemon.go b/pkg/fleet/daemon/daemon.go index c0e38e5cc545c..566275521126a 100644 --- a/pkg/fleet/daemon/daemon.go +++ b/pkg/fleet/daemon/daemon.go @@ -16,6 +16,7 @@ import ( osexec "os/exec" "path/filepath" "runtime" + "strings" "sync" "time" @@ -24,8 +25,9 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/pkg/config/remote/client" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/config/utils" "github.com/DataDog/datadog-agent/pkg/fleet/installer" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" "github.com/DataDog/datadog-agent/pkg/fleet/installer/repository" "github.com/DataDog/datadog-agent/pkg/fleet/internal/bootstrap" @@ -83,7 +85,7 @@ func newInstaller(env *env.Env, installerBin string) installer.Installer { } // NewDaemon returns a new daemon. -func NewDaemon(rcFetcher client.ConfigFetcher, config config.Reader) (Daemon, error) { +func NewDaemon(hostname string, rcFetcher client.ConfigFetcher, config config.Reader) (Daemon, error) { installerBin, err := os.Executable() if err != nil { return nil, fmt.Errorf("could not get installer executable path: %w", err) @@ -96,7 +98,22 @@ func NewDaemon(rcFetcher client.ConfigFetcher, config config.Reader) (Daemon, er if err != nil { return nil, fmt.Errorf("could not create remote config client: %w", err) } - env := env.FromConfig(config) + env := &env.Env{ + APIKey: utils.SanitizeAPIKey(config.GetString("api_key")), + Site: config.GetString("site"), + RemoteUpdates: config.GetBool("remote_updates"), + RemotePolicies: config.GetBool("remote_policies"), + Mirror: config.GetString("installer.mirror"), + RegistryOverride: config.GetString("installer.registry.url"), + RegistryAuthOverride: config.GetString("installer.registry.auth"), + RegistryUsername: config.GetString("installer.registry.username"), + RegistryPassword: config.GetString("installer.registry.password"), + Tags: utils.GetConfiguredTags(config, false), + Hostname: hostname, + HTTPProxy: config.GetString("proxy.http"), + HTTPSProxy: config.GetString("proxy.https"), + NoProxy: strings.Join(config.GetStringSlice("proxy.no_proxy"), ","), + } installer := newInstaller(env, installerBin) cdn, err := cdn.New(env, filepath.Join(paths.RunPath, "rc_daemon")) if err != nil { diff --git a/pkg/fleet/daemon/daemon_test.go b/pkg/fleet/daemon/daemon_test.go index 6a5db6fcf957c..228b37089845f 100644 --- a/pkg/fleet/daemon/daemon_test.go +++ b/pkg/fleet/daemon/daemon_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/installer/repository" "github.com/DataDog/datadog-agent/pkg/fleet/internal/cdn" pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" diff --git a/pkg/fleet/env/http_client.go b/pkg/fleet/env/http_client.go deleted file mode 100644 index 7d9184e944849..0000000000000 --- a/pkg/fleet/env/http_client.go +++ /dev/null @@ -1,22 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -package env - -import ( - "net/http" - - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" - httputils "github.com/DataDog/datadog-agent/pkg/util/http" -) - -// GetHTTPClient returns an HTTP client with the proxy settings loaded from the environment. -func GetHTTPClient() *http.Client { - // Load proxy settings before creating any HTTP transport - pkgconfigsetup.LoadProxyFromEnv(pkgconfigsetup.Datadog()) - httpClient := http.DefaultClient - httpClient.Transport = httputils.CreateHTTPTransport(pkgconfigsetup.Datadog()) - return httpClient -} diff --git a/pkg/fleet/env/install_script.go b/pkg/fleet/env/install_script.go deleted file mode 100644 index eb89f36b74d44..0000000000000 --- a/pkg/fleet/env/install_script.go +++ /dev/null @@ -1,33 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -package env - -const ( - envApmInstrumentationEnabled = "DD_APM_INSTRUMENTATION_ENABLED" -) - -const ( - // APMInstrumentationEnabledAll enables APM instrumentation for all containers. - APMInstrumentationEnabledAll = "all" - // APMInstrumentationEnabledDocker enables APM instrumentation for Docker containers. - APMInstrumentationEnabledDocker = "docker" - // APMInstrumentationEnabledHost enables APM instrumentation for the host. - APMInstrumentationEnabledHost = "host" - // APMInstrumentationNotSet is the default value when the environment variable is not set. - APMInstrumentationNotSet = "not_set" -) - -// InstallScriptEnv contains the environment variables for the install script. -type InstallScriptEnv struct { - APMInstrumentationEnabled string -} - -func installScriptEnvFromEnv() InstallScriptEnv { - return InstallScriptEnv{ - // defaults to all if not set - APMInstrumentationEnabled: getEnvOrDefault(envApmInstrumentationEnabled, APMInstrumentationNotSet), - } -} diff --git a/pkg/fleet/installer/default_packages.go b/pkg/fleet/installer/default_packages.go index ff2e87cdb9e5f..66c7017f42bac 100644 --- a/pkg/fleet/installer/default_packages.go +++ b/pkg/fleet/installer/default_packages.go @@ -10,7 +10,7 @@ import ( "slices" "strings" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/internal/oci" ) diff --git a/pkg/fleet/installer/default_packages_test.go b/pkg/fleet/installer/default_packages_test.go index 0e28847f0158e..e17645ec7cefb 100644 --- a/pkg/fleet/installer/default_packages_test.go +++ b/pkg/fleet/installer/default_packages_test.go @@ -8,7 +8,7 @@ package installer import ( "testing" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/internal/oci" "github.com/stretchr/testify/assert" ) diff --git a/pkg/fleet/env/env.go b/pkg/fleet/installer/env/env.go similarity index 85% rename from pkg/fleet/env/env.go rename to pkg/fleet/installer/env/env.go index a1415ea1780a3..094003754ddb3 100644 --- a/pkg/fleet/env/env.go +++ b/pkg/fleet/installer/env/env.go @@ -7,16 +7,16 @@ package env import ( - "context" "fmt" + "net" + "net/http" + "net/url" "os" "slices" "strings" "time" - "github.com/DataDog/datadog-agent/pkg/config/model" - "github.com/DataDog/datadog-agent/pkg/config/utils" - "github.com/DataDog/datadog-agent/pkg/util/hostname" + "golang.org/x/net/http/httpproxy" ) const ( @@ -49,6 +49,9 @@ const ( envHTTPSProxy = "HTTPS_PROXY" envDDNoProxy = "DD_PROXY_NO_PROXY" envNoProxy = "NO_PROXY" + + // install script + envApmInstrumentationEnabled = "DD_APM_INSTRUMENTATION_ENABLED" ) var defaultEnv = Env{ @@ -80,6 +83,22 @@ type ApmLibLanguage string // ApmLibVersion is the version of the library defined in DD_APM_INSTRUMENTATION_LIBRARIES env var type ApmLibVersion string +const ( + // APMInstrumentationEnabledAll enables APM instrumentation for all containers. + APMInstrumentationEnabledAll = "all" + // APMInstrumentationEnabledDocker enables APM instrumentation for Docker containers. + APMInstrumentationEnabledDocker = "docker" + // APMInstrumentationEnabledHost enables APM instrumentation for the host. + APMInstrumentationEnabledHost = "host" + // APMInstrumentationNotSet is the default value when the environment variable is not set. + APMInstrumentationNotSet = "not_set" +) + +// InstallScriptEnv contains the environment variables for the install script. +type InstallScriptEnv struct { + APMInstrumentationEnabled string +} + // Env contains the configuration for the installer. type Env struct { APIKey string @@ -119,6 +138,32 @@ type Env struct { NoProxy string } +// HTTPClient returns an HTTP client with the proxy settings from the environment. +func (e *Env) HTTPClient() *http.Client { + proxyConfig := &httpproxy.Config{ + HTTPProxy: e.HTTPProxy, + HTTPSProxy: e.HTTPSProxy, + NoProxy: e.NoProxy, + } + proxyFunc := func(r *http.Request) (*url.URL, error) { + return proxyConfig.ProxyFunc()(r.URL) + } + client := &http.Client{ + Transport: &http.Transport{ + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).DialContext, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + Proxy: proxyFunc, + }, + } + return client +} + // FromEnv returns an Env struct with values from the environment. func FromEnv() *Env { splitFunc := func(c rune) bool { @@ -150,7 +195,9 @@ func FromEnv() *Env { AgentMinorVersion: os.Getenv(envAgentMinorVersion), AgentUserName: getEnvOrDefault(envAgentUserName, os.Getenv(envAgentUserNameCompat)), - InstallScript: installScriptEnvFromEnv(), + InstallScript: InstallScriptEnv{ + APMInstrumentationEnabled: getEnvOrDefault(envApmInstrumentationEnabled, APMInstrumentationNotSet), + }, CDNEnabled: strings.ToLower(os.Getenv(envCDNEnabled)) == "true", CDNLocalDirPath: getEnvOrDefault(envCDNLocalDirPath, ""), @@ -167,32 +214,6 @@ func FromEnv() *Env { } } -// FromConfig returns an Env struct with values from the configuration. -func FromConfig(config model.Reader) *Env { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) - defer cancel() - hostname, err := hostname.Get(ctx) - if err != nil { - hostname = "unknown" - } - return &Env{ - APIKey: utils.SanitizeAPIKey(config.GetString("api_key")), - Site: config.GetString("site"), - RemoteUpdates: config.GetBool("remote_updates"), - RemotePolicies: config.GetBool("remote_policies"), - Mirror: config.GetString("installer.mirror"), - RegistryOverride: config.GetString("installer.registry.url"), - RegistryAuthOverride: config.GetString("installer.registry.auth"), - RegistryUsername: config.GetString("installer.registry.username"), - RegistryPassword: config.GetString("installer.registry.password"), - Tags: utils.GetConfiguredTags(config, false), - Hostname: hostname, - HTTPProxy: config.GetString("proxy.http"), - HTTPSProxy: config.GetString("proxy.https"), - NoProxy: strings.Join(config.GetStringSlice("proxy.no_proxy"), ","), - } -} - // ToEnv returns a slice of environment variables from the Env struct. func (e *Env) ToEnv() []string { var env []string diff --git a/pkg/fleet/env/env_test.go b/pkg/fleet/installer/env/env_test.go similarity index 100% rename from pkg/fleet/env/env_test.go rename to pkg/fleet/installer/env/env_test.go diff --git a/pkg/fleet/installer/installer.go b/pkg/fleet/installer/installer.go index be2706643df76..8000be3c5a261 100644 --- a/pkg/fleet/installer/installer.go +++ b/pkg/fleet/installer/installer.go @@ -20,7 +20,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/internal/cdn" "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" - fleetEnv "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages" "github.com/DataDog/datadog-agent/pkg/fleet/installer/repository" @@ -72,7 +72,7 @@ type Installer interface { type installerImpl struct { m sync.Mutex - env *fleetEnv.Env + env *env.Env cdn *cdn.CDN db *db.PackagesDB downloader *oci.Downloader @@ -84,7 +84,7 @@ type installerImpl struct { } // NewInstaller returns a new Package Manager. -func NewInstaller(env *fleetEnv.Env) (Installer, error) { +func NewInstaller(env *env.Env) (Installer, error) { err := ensureRepositoriesExist() if err != nil { return nil, fmt.Errorf("could not ensure packages and config directory exists: %w", err) @@ -101,7 +101,7 @@ func NewInstaller(env *fleetEnv.Env) (Installer, error) { env: env, cdn: cdn, db: db, - downloader: oci.NewDownloader(env, fleetEnv.GetHTTPClient()), + downloader: oci.NewDownloader(env, env.HTTPClient()), packages: repository.NewRepositories(paths.PackagesPath, paths.LocksPath), configs: repository.NewRepositories(paths.ConfigsPath, paths.LocksPath), diff --git a/pkg/fleet/installer/installer_test.go b/pkg/fleet/installer/installer_test.go index a86562cc32609..9ab772b32dc0f 100644 --- a/pkg/fleet/installer/installer_test.go +++ b/pkg/fleet/installer/installer_test.go @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/installer/repository" "github.com/DataDog/datadog-agent/pkg/fleet/internal/db" "github.com/DataDog/datadog-agent/pkg/fleet/internal/fixtures" diff --git a/pkg/fleet/installer/packages/apm_inject.go b/pkg/fleet/installer/packages/apm_inject.go index cd7c08504deb6..febd93ecf8dc7 100644 --- a/pkg/fleet/installer/packages/apm_inject.go +++ b/pkg/fleet/installer/packages/apm_inject.go @@ -17,7 +17,7 @@ import ( "path/filepath" "strings" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages/embedded" "github.com/DataDog/datadog-agent/pkg/util/log" "go.uber.org/multierr" diff --git a/pkg/fleet/installer/packages/apm_inject_test.go b/pkg/fleet/installer/packages/apm_inject_test.go index 736077ea7b934..254feab2b0075 100644 --- a/pkg/fleet/installer/packages/apm_inject_test.go +++ b/pkg/fleet/installer/packages/apm_inject_test.go @@ -11,7 +11,7 @@ import ( "context" "testing" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/stretchr/testify/assert" ) diff --git a/pkg/fleet/installer/setup.go b/pkg/fleet/installer/setup.go index 230bc1b6a1bd1..6673e44e2b081 100644 --- a/pkg/fleet/installer/setup.go +++ b/pkg/fleet/installer/setup.go @@ -10,7 +10,7 @@ import ( "context" "fmt" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/internal/exec" "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" ) diff --git a/pkg/fleet/internal/bootstrap/bootstrap.go b/pkg/fleet/internal/bootstrap/bootstrap.go index e16f0cd9d603e..5f15ec79167d5 100644 --- a/pkg/fleet/internal/bootstrap/bootstrap.go +++ b/pkg/fleet/internal/bootstrap/bootstrap.go @@ -8,7 +8,8 @@ package bootstrap import ( "context" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" ) const ( diff --git a/pkg/fleet/internal/bootstrap/bootstrap_nix.go b/pkg/fleet/internal/bootstrap/bootstrap_nix.go index 6a3a7dd36e6f2..fbc9817f0783c 100644 --- a/pkg/fleet/internal/bootstrap/bootstrap_nix.go +++ b/pkg/fleet/internal/bootstrap/bootstrap_nix.go @@ -16,12 +16,12 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" - fleetEnv "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/internal/exec" "github.com/DataDog/datadog-agent/pkg/fleet/internal/oci" ) -func install(ctx context.Context, env *fleetEnv.Env, url string, experiment bool) error { +func install(ctx context.Context, env *env.Env, url string, experiment bool) error { err := os.MkdirAll(paths.RootTmpDir, 0755) if err != nil { return fmt.Errorf("failed to create temporary directory: %w", err) @@ -48,9 +48,9 @@ func install(ctx context.Context, env *fleetEnv.Env, url string, experiment bool // 2. Export the installer image as an OCI layout on the disk. // 3. Extract the installer image layers on the disk. // 4. Create an installer executor from the extract layer. -func downloadInstaller(ctx context.Context, env *fleetEnv.Env, url string, tmpDir string) (*exec.InstallerExec, error) { +func downloadInstaller(ctx context.Context, env *env.Env, url string, tmpDir string) (*exec.InstallerExec, error) { // 1. Download the installer package from the registry. - downloader := oci.NewDownloader(env, fleetEnv.GetHTTPClient()) + downloader := oci.NewDownloader(env, env.HTTPClient()) downloadedPackage, err := downloader.Download(ctx, url) if err != nil { return nil, fmt.Errorf("failed to download installer package: %w", err) diff --git a/pkg/fleet/internal/bootstrap/bootstrap_windows.go b/pkg/fleet/internal/bootstrap/bootstrap_windows.go index 9e4d260e73897..c3d867f959db2 100644 --- a/pkg/fleet/internal/bootstrap/bootstrap_windows.go +++ b/pkg/fleet/internal/bootstrap/bootstrap_windows.go @@ -15,14 +15,14 @@ import ( "os/exec" "path/filepath" - fleetEnv "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" iexec "github.com/DataDog/datadog-agent/pkg/fleet/internal/exec" "github.com/DataDog/datadog-agent/pkg/fleet/internal/oci" ) -func install(ctx context.Context, env *fleetEnv.Env, url string, experiment bool) error { +func install(ctx context.Context, env *env.Env, url string, experiment bool) error { err := paths.CreateInstallerDataDir() if err != nil { return fmt.Errorf("failed to create installer data directory: %w", err) @@ -47,8 +47,8 @@ func install(ctx context.Context, env *fleetEnv.Env, url string, experiment bool } // downloadInstaller downloads the installer package from the registry and returns the path to the executable. -func downloadInstaller(ctx context.Context, env *fleetEnv.Env, url string, tmpDir string) (*iexec.InstallerExec, error) { - downloader := oci.NewDownloader(env, fleetEnv.GetHTTPClient()) +func downloadInstaller(ctx context.Context, env *env.Env, url string, tmpDir string) (*iexec.InstallerExec, error) { + downloader := oci.NewDownloader(env, env.HTTPClient()) downloadedPackage, err := downloader.Download(ctx, url) if err != nil { return nil, fmt.Errorf("failed to download installer package: %w", err) diff --git a/pkg/fleet/internal/cdn/cdn.go b/pkg/fleet/internal/cdn/cdn.go index 5f1ae7865a1d0..ab74ce9bfe0a7 100644 --- a/pkg/fleet/internal/cdn/cdn.go +++ b/pkg/fleet/internal/cdn/cdn.go @@ -15,7 +15,7 @@ import ( "path/filepath" "runtime" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) diff --git a/pkg/fleet/internal/cdn/cdn_http.go b/pkg/fleet/internal/cdn/cdn_http.go index 53d8f379d124e..1e0c90b36d69a 100644 --- a/pkg/fleet/internal/cdn/cdn_http.go +++ b/pkg/fleet/internal/cdn/cdn_http.go @@ -11,7 +11,7 @@ import ( "encoding/json" remoteconfig "github.com/DataDog/datadog-agent/pkg/config/remote/service" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/version" diff --git a/pkg/fleet/internal/cdn/cdn_local.go b/pkg/fleet/internal/cdn/cdn_local.go index 6cfefe31732b3..f657d870ab7d3 100644 --- a/pkg/fleet/internal/cdn/cdn_local.go +++ b/pkg/fleet/internal/cdn/cdn_local.go @@ -11,7 +11,7 @@ import ( "os" "path/filepath" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" ) type fetcherLocal struct { diff --git a/pkg/fleet/internal/cdn/cdn_rc.go b/pkg/fleet/internal/cdn/cdn_rc.go index e3db586530dd2..b0713047b586d 100644 --- a/pkg/fleet/internal/cdn/cdn_rc.go +++ b/pkg/fleet/internal/cdn/cdn_rc.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/datadog-agent/comp/remote-config/rctelemetryreporter/rctelemetryreporterimpl" remoteconfig "github.com/DataDog/datadog-agent/pkg/config/remote/service" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" pkghostname "github.com/DataDog/datadog-agent/pkg/util/hostname" "github.com/DataDog/datadog-agent/pkg/util/log" diff --git a/pkg/fleet/internal/cdn/scope_expression.go b/pkg/fleet/internal/cdn/scope_expression.go index a67e701942848..659d6798c0670 100644 --- a/pkg/fleet/internal/cdn/scope_expression.go +++ b/pkg/fleet/internal/cdn/scope_expression.go @@ -10,7 +10,7 @@ import ( "fmt" "regexp" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/version" "github.com/expr-lang/expr" ) diff --git a/pkg/fleet/internal/cdn/tags.go b/pkg/fleet/internal/cdn/tags.go index 53c20841143bb..101c3afec8ce3 100644 --- a/pkg/fleet/internal/cdn/tags.go +++ b/pkg/fleet/internal/cdn/tags.go @@ -13,7 +13,7 @@ import ( detectenv "github.com/DataDog/datadog-agent/pkg/config/env" "github.com/DataDog/datadog-agent/pkg/config/model" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" ) type hostTagsGetter struct { diff --git a/pkg/fleet/internal/exec/installer_exec.go b/pkg/fleet/internal/exec/installer_exec.go index 34a3cfad4fbcf..29ca01999dcb9 100644 --- a/pkg/fleet/internal/exec/installer_exec.go +++ b/pkg/fleet/internal/exec/installer_exec.go @@ -18,7 +18,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" "github.com/DataDog/datadog-agent/pkg/fleet/installer/repository" "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" diff --git a/pkg/fleet/internal/oci/download.go b/pkg/fleet/internal/oci/download.go index 6bf91468fa0e6..a03f7917d27df 100644 --- a/pkg/fleet/internal/oci/download.go +++ b/pkg/fleet/internal/oci/download.go @@ -33,9 +33,8 @@ import ( "golang.org/x/net/http2" httptrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/net/http" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" - - "github.com/DataDog/datadog-agent/pkg/fleet/env" "github.com/DataDog/datadog-agent/pkg/fleet/internal/tar" "github.com/DataDog/datadog-agent/pkg/util/log" ) diff --git a/pkg/fleet/internal/oci/download_test.go b/pkg/fleet/internal/oci/download_test.go index c3fb215373c01..e3c9b61916145 100644 --- a/pkg/fleet/internal/oci/download_test.go +++ b/pkg/fleet/internal/oci/download_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/assert" "golang.org/x/net/http2" - "github.com/DataDog/datadog-agent/pkg/fleet/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/internal/fixtures" "github.com/google/go-containerregistry/pkg/authn" oci "github.com/google/go-containerregistry/pkg/v1" diff --git a/pkg/fleet/telemetry/telemetry.go b/pkg/fleet/telemetry/telemetry.go index 00372e69ce760..842ea1b678cbd 100644 --- a/pkg/fleet/telemetry/telemetry.go +++ b/pkg/fleet/telemetry/telemetry.go @@ -22,7 +22,6 @@ import ( "github.com/gorilla/mux" - "github.com/DataDog/datadog-agent/pkg/fleet/env" "github.com/DataDog/datadog-agent/pkg/internaltelemetry" pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" traceconfig "github.com/DataDog/datadog-agent/pkg/trace/config" @@ -60,14 +59,14 @@ type Telemetry struct { type Option func(*Telemetry) // NewTelemetry creates a new telemetry instance -func NewTelemetry(apiKey string, site string, service string, opts ...Option) (*Telemetry, error) { +func NewTelemetry(client *http.Client, apiKey string, site string, service string, opts ...Option) (*Telemetry, error) { endpoint := &traceconfig.Endpoint{ Host: fmt.Sprintf("https://%s.%s", telemetrySubdomain, strings.TrimSpace(site)), APIKey: apiKey, } listener := newTelemetryListener() t := &Telemetry{ - telemetryClient: internaltelemetry.NewClient(env.GetHTTPClient(), []*traceconfig.Endpoint{endpoint}, service, site == "datad0g.com"), + telemetryClient: internaltelemetry.NewClient(client, []*traceconfig.Endpoint{endpoint}, service, site == "datad0g.com"), site: site, service: service, listener: listener, From 1434b74667b9df0b76a66f6b8b8192fd5d9ef043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lian=20Raimbault?= <161456554+CelianR@users.noreply.github.com> Date: Mon, 2 Dec 2024 03:46:38 -0500 Subject: [PATCH 54/59] [incident-32914] Disable worktree unit tests (#31641) --- .../unit_tests/libs/common/worktree_tests.py | 139 +++++++++--------- 1 file changed, 73 insertions(+), 66 deletions(-) diff --git a/tasks/unit_tests/libs/common/worktree_tests.py b/tasks/unit_tests/libs/common/worktree_tests.py index 3998357c1accc..8af09d2d128bc 100644 --- a/tasks/unit_tests/libs/common/worktree_tests.py +++ b/tasks/unit_tests/libs/common/worktree_tests.py @@ -1,97 +1,104 @@ -import os -import unittest +# TODO(celian): Reintroduce these tests -from invoke import Context +""" +NOTE: These tests are disabled since they use git commands that are not mocked yet. +This breaks unit tests ran with macos runners. +""" -from tasks.libs.common.git import get_default_branch -from tasks.libs.common.gomodules import get_default_modules -from tasks.libs.common.worktree import agent_context, init_env, is_worktree +# import os +# import unittest +# from invoke import Context -def get_ctx(): - return Context() +# from tasks.libs.common.git import get_default_branch +# from tasks.libs.common.gomodules import get_default_modules +# from tasks.libs.common.worktree import agent_context, init_env, is_worktree -class TestWorktree(unittest.TestCase): - def setUp(self): - # Pull only once - init_env(get_ctx(), '6.53.x') - os.environ['AGENT_WORKTREE_NO_PULL'] = '1' +# def get_ctx(): +# return Context() - def test_context_is_worktree_true(self): - with agent_context(get_ctx(), '6.53.x'): - self.assertTrue(is_worktree()) - def test_context_is_worktree_false(self): - self.assertFalse(is_worktree()) +# class TestWorktree(unittest.TestCase): +# def setUp(self): +# # Pull only once +# init_env(get_ctx(), '6.53.x') +# os.environ['AGENT_WORKTREE_NO_PULL'] = '1' - def test_context_nested(self): - with agent_context(get_ctx(), '6.53.x'): - with agent_context(get_ctx(), '6.53.x'): - self.assertTrue(is_worktree()) - self.assertTrue(is_worktree()) +# def test_context_is_worktree_true(self): +# with agent_context(get_ctx(), '6.53.x'): +# self.assertTrue(is_worktree()) - def test_context_pwd(self): - ctx = get_ctx() +# def test_context_is_worktree_false(self): +# self.assertFalse(is_worktree()) - with agent_context(ctx, None, skip_checkout=True): - pwdnone = ctx.run('pwd').stdout +# def test_context_nested(self): +# with agent_context(get_ctx(), '6.53.x'): +# with agent_context(get_ctx(), '6.53.x'): +# self.assertTrue(is_worktree()) +# self.assertTrue(is_worktree()) - with agent_context(ctx, '6.53.x'): - pwd6 = ctx.run('pwd').stdout +# def test_context_pwd(self): +# ctx = get_ctx() - with agent_context(ctx, 'main'): - pwdmain = ctx.run('pwd').stdout +# with agent_context(ctx, None, skip_checkout=True): +# pwdnone = ctx.run('pwd').stdout - self.assertEqual(pwd6, pwdnone) - self.assertEqual(pwd6, pwdmain) +# with agent_context(ctx, '6.53.x'): +# pwd6 = ctx.run('pwd').stdout - def test_context_modules(self): - ctx = get_ctx() +# with agent_context(ctx, 'main'): +# pwdmain = ctx.run('pwd').stdout - with agent_context(ctx, 'main'): - modules7 = get_default_modules() +# self.assertEqual(pwd6, pwdnone) +# self.assertEqual(pwd6, pwdmain) - with agent_context(ctx, '6.53.x'): - modules6 = get_default_modules() +# def test_context_modules(self): +# ctx = get_ctx() - self.assertNotEqual(set(modules6.keys()), set(modules7.keys())) +# with agent_context(ctx, 'main'): +# modules7 = get_default_modules() - def test_context_branch(self): - ctx = get_ctx() +# with agent_context(ctx, '6.53.x'): +# modules6 = get_default_modules() - with agent_context(ctx, 'main'): - branch7 = get_default_branch() +# self.assertNotEqual(set(modules6.keys()), set(modules7.keys())) - with agent_context(ctx, '6.53.x'): - branch6 = get_default_branch() +# def test_context_branch(self): +# ctx = get_ctx() - self.assertNotEqual(branch6, branch7) +# with agent_context(ctx, 'main'): +# branch7 = get_default_branch() - def test_context_no_checkout(self): - ctx = get_ctx() +# with agent_context(ctx, '6.53.x'): +# branch6 = get_default_branch() - with agent_context(ctx, '6.53.x'): - branch6 = get_default_branch() +# self.assertNotEqual(branch6, branch7) - with agent_context(ctx, 'main'): - branch7 = get_default_branch() +# def test_context_no_checkout(self): +# ctx = get_ctx() - with agent_context(ctx, 'main', skip_checkout=True): - branch_no_checkout = get_default_branch() +# with agent_context(ctx, '6.53.x'): +# branch6 = get_default_branch() - self.assertNotEqual(branch6, branch7) - self.assertEqual(branch7, branch_no_checkout) +# with agent_context(ctx, 'main'): +# branch7 = get_default_branch() - def test_context_no_checkout_error(self): - ctx = get_ctx() +# with agent_context(ctx, 'main', skip_checkout=True): +# branch_no_checkout = get_default_branch() - with agent_context(ctx, '6.53.x'): - pass +# self.assertNotEqual(branch6, branch7) +# self.assertEqual(branch7, branch_no_checkout) - def switch_context(): - # The current branch is not main - with agent_context(ctx, 'main', skip_checkout=True): - pass +# def test_context_no_checkout_error(self): +# ctx = get_ctx() - self.assertRaises(AssertionError, switch_context) +# with agent_context(ctx, '6.53.x'): +# pass + +# def switch_context(): +# # The current branch is not main +# with agent_context(ctx, 'main', skip_checkout=True): +# pass + +# self.assertRaises(AssertionError, switch_context) From e263f3754831e392ddee359a6110df64718a32a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:00:42 +0000 Subject: [PATCH 55/59] Bump github/codeql-action from 3.27.1 to 3.27.5 (#31441) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ac6cb803af3f9..884c65f390ee8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -45,7 +45,7 @@ jobs: go-version-file: ".go-version" - name: Initialize CodeQL - uses: github/codeql-action/init@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 + uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: languages: ${{ matrix.language }} config: | @@ -67,4 +67,4 @@ jobs: invoke agent.build --build-exclude=systemd - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 + uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 From f99d0f47f9d99b27acfd5321e87e259137e3b4dd Mon Sep 17 00:00:00 2001 From: "agent-platform-auto-pr[bot]" <153269286+agent-platform-auto-pr[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:05:30 +0000 Subject: [PATCH 56/59] [test-infra-definitions][automated] Bump test-infra-definitions to 1f340fd450e3494bde2e48f5ef9a6b46d74fe99d (#31623) Co-authored-by: agent-platform-auto-pr[bot] <153269286+agent-platform-auto-pr[bot]@users.noreply.github.com> --- .gitlab/common/test_infra_version.yml | 2 +- test/new-e2e/go.mod | 8 ++++---- test/new-e2e/go.sum | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.gitlab/common/test_infra_version.yml b/.gitlab/common/test_infra_version.yml index dd6770058e7ec..7844ff82e9ee3 100644 --- a/.gitlab/common/test_infra_version.yml +++ b/.gitlab/common/test_infra_version.yml @@ -4,4 +4,4 @@ variables: # and check the job creating the image to make sure you have the right SHA prefix TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX: "" # Make sure to update test-infra-definitions version in go.mod as well - TEST_INFRA_DEFINITIONS_BUILDIMAGES: 047dd64128b6 + TEST_INFRA_DEFINITIONS_BUILDIMAGES: 1f340fd450e3 diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index 22e7754303033..92f74bcc9a3d0 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -47,7 +47,7 @@ replace ( require ( github.com/DataDog/agent-payload/v5 v5.0.122 github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def v0.56.2 - github.com/DataDog/datadog-agent/pkg/util/optional v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.2 github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.2 github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.2 @@ -60,7 +60,7 @@ require ( // `TEST_INFRA_DEFINITIONS_BUILDIMAGES` matches the commit sha in the module version // Example: github.com/DataDog/test-infra-definitions v0.0.0-YYYYMMDDHHmmSS-0123456789AB // => TEST_INFRA_DEFINITIONS_BUILDIMAGES: 0123456789AB - github.com/DataDog/test-infra-definitions v0.0.0-20241127134930-047dd64128b6 + github.com/DataDog/test-infra-definitions v0.0.0-20241129143439-1f340fd450e3 github.com/aws/aws-sdk-go-v2 v1.32.2 github.com/aws/aws-sdk-go-v2/config v1.27.40 github.com/aws/aws-sdk-go-v2/service/ec2 v1.164.2 @@ -76,7 +76,7 @@ require ( github.com/pkg/sftp v1.13.6 github.com/pulumi/pulumi-aws/sdk/v6 v6.56.1 github.com/pulumi/pulumi-awsx/sdk/v2 v2.16.1 - github.com/pulumi/pulumi-eks/sdk/v2 v2.7.8 // indirect + github.com/pulumi/pulumi-eks/sdk/v2 v2.8.1 // indirect github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1 github.com/pulumi/pulumi/sdk/v3 v3.140.0 github.com/samber/lo v1.47.0 @@ -227,7 +227,7 @@ require ( github.com/pulumi/pulumi-command/sdk v1.0.1 // indirect github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5 // indirect github.com/pulumi/pulumi-libvirt/sdk v0.4.7 // indirect - github.com/pulumi/pulumi-random/sdk/v4 v4.16.6 // indirect + github.com/pulumi/pulumi-random/sdk/v4 v4.16.7 // indirect github.com/pulumi/pulumi-tls/sdk/v4 v4.11.1 // indirect github.com/pulumiverse/pulumi-time/sdk v0.1.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index 076037f33850b..0eec3057c4dae 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -17,8 +17,8 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a h1:m9REhmyaWD5YJ0P53ygRHxKKo+KM+nw+zz0hEdKztMo= github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= -github.com/DataDog/test-infra-definitions v0.0.0-20241127134930-047dd64128b6 h1:7Cy8Iju8X6XdwqXyTrkke1ULq/yEikXVEwAgg4yCGFg= -github.com/DataDog/test-infra-definitions v0.0.0-20241127134930-047dd64128b6/go.mod h1:YYNx5mySRiinvCoTQIkToR8PcBXpxrRIW/HqmTw9XAY= +github.com/DataDog/test-infra-definitions v0.0.0-20241129143439-1f340fd450e3 h1:s+bNaiOoY3W7vCSQVqD4mU3mrtXsbkeRX+vVTwCyStQ= +github.com/DataDog/test-infra-definitions v0.0.0-20241129143439-1f340fd450e3/go.mod h1:7nVt9okOqKKC9B9YfKqk4jitYuv1I3q2Cd/yZWuViZU= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= @@ -434,8 +434,8 @@ github.com/pulumi/pulumi-command/sdk v1.0.1 h1:ZuBSFT57nxg/fs8yBymUhKLkjJ6qmyN3g github.com/pulumi/pulumi-command/sdk v1.0.1/go.mod h1:C7sfdFbUIoXKoIASfXUbP/U9xnwPfxvz8dBpFodohlA= github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5 h1:7OjAfgLz5PAy95ynbgPAlWls5WBe4I/QW/61TdPWRlQ= github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5/go.mod h1:XZKLFXbw13olxuztlWnmVUPYZp2a+BqzqhuMl0j/Ow8= -github.com/pulumi/pulumi-eks/sdk/v2 v2.7.8 h1:NeCKFxyOLpAaG4pJDk7+ewnCuV2IbXR7PggYSNujOno= -github.com/pulumi/pulumi-eks/sdk/v2 v2.7.8/go.mod h1:ARGNnIZENIpDUVSX21JEQJKrESj/0u0r0iT61rpb86I= +github.com/pulumi/pulumi-eks/sdk/v2 v2.8.1 h1:upeongxe3/2oCO2BHq78qqQbO7SGJz9rnp/KyDmJwqs= +github.com/pulumi/pulumi-eks/sdk/v2 v2.8.1/go.mod h1:ARGNnIZENIpDUVSX21JEQJKrESj/0u0r0iT61rpb86I= github.com/pulumi/pulumi-gcp/sdk/v6 v6.67.1 h1:PUH/sUbJmBmHjNFNthJ/dW2+riFuJV0FhrGAwuUuRIg= github.com/pulumi/pulumi-gcp/sdk/v6 v6.67.1/go.mod h1:OmZeji3dNMwB1qldAlaQfcfJPc2BaZyweVGH7Ej4SJg= github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0 h1:21oSj+TKlKTzQcxN9Hik7iSNNHPUQXN4s3itOnahy/w= @@ -444,8 +444,8 @@ github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1 h1:VDX+hu+qK3fbf2FodgG5kfh2h1 github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1/go.mod h1:e69ohZtUePLLYNLXYgiOWp0FvRGg6ya/3fsq3o00nN0= github.com/pulumi/pulumi-libvirt/sdk v0.4.7 h1:/BBnqqx/Gbg2vINvJxXIVb58THXzw2lSqFqxlRSXH9M= github.com/pulumi/pulumi-libvirt/sdk v0.4.7/go.mod h1:VKvjhAm1sGtzKZruYwIhgascabEx7+oVVRCoxp/cPi4= -github.com/pulumi/pulumi-random/sdk/v4 v4.16.6 h1:M9BSF13bQxj74C61nBTVITrsgT6oRR6cgudsKz7WOFU= -github.com/pulumi/pulumi-random/sdk/v4 v4.16.6/go.mod h1:l5ew7S/G1GspPLH9KeWXqxQ4ZmS2hh2sEMv3bW9M3yc= +github.com/pulumi/pulumi-random/sdk/v4 v4.16.7 h1:39rhOe/PTUGMYia8pR5T2wbxxMt2pwrlonf0ncYKSzE= +github.com/pulumi/pulumi-random/sdk/v4 v4.16.7/go.mod h1:cxxDhJzUPt/YElfvlWa15Q4NGF6XXS8kUs4OQsCxSBk= github.com/pulumi/pulumi-tls/sdk/v4 v4.11.1 h1:tXemWrzeVTqG8zq6hBdv1TdPFXjgZ+dob63a/6GlF1o= github.com/pulumi/pulumi-tls/sdk/v4 v4.11.1/go.mod h1:hODo3iEmmXDFOXqPK+V+vwI0a3Ww7BLjs5Tgamp86Ng= github.com/pulumi/pulumi/sdk/v3 v3.140.0 h1:+Z/RBvdYg7tBNkBwk4p/FzlV7niBT3TbLAICq/Y0LDU= From 1a573fb5ec66db0717cc9f10b5f3922422f4f010 Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Mon, 2 Dec 2024 10:20:34 +0100 Subject: [PATCH 57/59] [CWS] remove hash burst config, since we always have burst = 1 (#31633) --- pkg/config/setup/system_probe_cws.go | 1 - pkg/security/config/config.go | 3 --- pkg/security/resolvers/hash/resolver_linux.go | 8 +++++++- pkg/security/resolvers/hash/resolver_test.go | 8 -------- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/pkg/config/setup/system_probe_cws.go b/pkg/config/setup/system_probe_cws.go index f7ee9bfd90395..b72d72df3c971 100644 --- a/pkg/config/setup/system_probe_cws.go +++ b/pkg/config/setup/system_probe_cws.go @@ -114,7 +114,6 @@ func initCWSSystemProbeConfig(cfg pkgconfigmodel.Config) { cfg.BindEnvAndSetDefault("runtime_security_config.hash_resolver.event_types", []string{"exec", "open"}) cfg.BindEnvAndSetDefault("runtime_security_config.hash_resolver.max_file_size", (1<<20)*10) // 10 MB cfg.BindEnvAndSetDefault("runtime_security_config.hash_resolver.max_hash_rate", 500) - cfg.BindEnvAndSetDefault("runtime_security_config.hash_resolver.max_hash_burst", 1000) cfg.BindEnvAndSetDefault("runtime_security_config.hash_resolver.hash_algorithms", []string{"sha1", "sha256", "ssdeep"}) cfg.BindEnvAndSetDefault("runtime_security_config.hash_resolver.cache_size", 500) cfg.BindEnvAndSetDefault("runtime_security_config.hash_resolver.replace", map[string]string{}) diff --git a/pkg/security/config/config.go b/pkg/security/config/config.go index bf5222cfcd72f..fc9cbcecc6a4b 100644 --- a/pkg/security/config/config.go +++ b/pkg/security/config/config.go @@ -215,8 +215,6 @@ type RuntimeSecurityConfig struct { HashResolverMaxFileSize int64 // HashResolverMaxHashRate defines the rate at which the hash resolver may compute hashes HashResolverMaxHashRate int - // HashResolverMaxHashBurst defines the burst of files for which the hash resolver may compute a hash - HashResolverMaxHashBurst int // HashResolverHashAlgorithms defines the hashes that hash resolver needs to compute HashResolverHashAlgorithms []model.HashAlgorithm // HashResolverEventTypes defines the list of event which files may be hashed @@ -407,7 +405,6 @@ func NewRuntimeSecurityConfig() (*RuntimeSecurityConfig, error) { HashResolverEventTypes: parseEventTypeStringSlice(pkgconfigsetup.SystemProbe().GetStringSlice("runtime_security_config.hash_resolver.event_types")), HashResolverMaxFileSize: pkgconfigsetup.SystemProbe().GetInt64("runtime_security_config.hash_resolver.max_file_size"), HashResolverHashAlgorithms: parseHashAlgorithmStringSlice(pkgconfigsetup.SystemProbe().GetStringSlice("runtime_security_config.hash_resolver.hash_algorithms")), - HashResolverMaxHashBurst: pkgconfigsetup.SystemProbe().GetInt("runtime_security_config.hash_resolver.max_hash_burst"), HashResolverMaxHashRate: pkgconfigsetup.SystemProbe().GetInt("runtime_security_config.hash_resolver.max_hash_rate"), HashResolverCacheSize: pkgconfigsetup.SystemProbe().GetInt("runtime_security_config.hash_resolver.cache_size"), HashResolverReplace: pkgconfigsetup.SystemProbe().GetStringMapString("runtime_security_config.hash_resolver.replace"), diff --git a/pkg/security/resolvers/hash/resolver_linux.go b/pkg/security/resolvers/hash/resolver_linux.go index 5fdef9e8cb298..772cce4fb5285 100644 --- a/pkg/security/resolvers/hash/resolver_linux.go +++ b/pkg/security/resolvers/hash/resolver_linux.go @@ -126,6 +126,12 @@ func NewResolver(c *config.RuntimeSecurityConfig, statsdClient statsd.ClientInte } } + burst := 1 + // if the rate limiter is disabled, set the burst to 0 + if c.HashResolverMaxHashRate == 0 { + burst = 0 + } + r := &Resolver{ opts: ResolverOpts{ Enabled: true, @@ -135,7 +141,7 @@ func NewResolver(c *config.RuntimeSecurityConfig, statsdClient statsd.ClientInte }, cgroupResolver: cgroupResolver, statsdClient: statsdClient, - limiter: rate.NewLimiter(rate.Limit(c.HashResolverMaxHashRate), c.HashResolverMaxHashBurst), + limiter: rate.NewLimiter(rate.Limit(c.HashResolverMaxHashRate), burst), cache: cache, hashCount: make(map[model.EventType]map[model.HashAlgorithm]*atomic.Uint64), hashMiss: make(map[model.EventType]map[model.HashState]*atomic.Uint64), diff --git a/pkg/security/resolvers/hash/resolver_test.go b/pkg/security/resolvers/hash/resolver_test.go index bcd089855337c..83fba9c1737c5 100644 --- a/pkg/security/resolvers/hash/resolver_test.go +++ b/pkg/security/resolvers/hash/resolver_test.go @@ -52,7 +52,6 @@ func TestResolver_ComputeHashes(t *testing.T) { HashResolverEventTypes: []model.EventType{model.ExecEventType}, HashResolverHashAlgorithms: []model.HashAlgorithm{model.SHA1, model.SHA256, model.MD5}, HashResolverMaxHashRate: 1, - HashResolverMaxHashBurst: 1, HashResolverMaxFileSize: 1 << 20, }, args: args{ @@ -89,7 +88,6 @@ func TestResolver_ComputeHashes(t *testing.T) { HashResolverEventTypes: []model.EventType{model.FileOpenEventType}, HashResolverHashAlgorithms: []model.HashAlgorithm{model.SHA1, model.SHA256, model.MD5}, HashResolverMaxHashRate: 1, - HashResolverMaxHashBurst: 1, HashResolverMaxFileSize: 1 << 20, }, args: args{ @@ -122,7 +120,6 @@ func TestResolver_ComputeHashes(t *testing.T) { HashResolverEventTypes: []model.EventType{model.ExecEventType}, HashResolverHashAlgorithms: []model.HashAlgorithm{model.SHA1, model.SHA256, model.MD5}, HashResolverMaxHashRate: 1, - HashResolverMaxHashBurst: 1, HashResolverMaxFileSize: 1 << 10, }, args: args{ @@ -159,7 +156,6 @@ func TestResolver_ComputeHashes(t *testing.T) { HashResolverEventTypes: []model.EventType{model.ExecEventType}, HashResolverHashAlgorithms: []model.HashAlgorithm{model.SHA1, model.SHA256, model.MD5}, HashResolverMaxHashRate: 1, - HashResolverMaxHashBurst: 1, HashResolverMaxFileSize: 1 << 10, }, args: args{ @@ -192,7 +188,6 @@ func TestResolver_ComputeHashes(t *testing.T) { HashResolverEventTypes: []model.EventType{model.ExecEventType}, HashResolverHashAlgorithms: []model.HashAlgorithm{model.SHA1, model.SHA256, model.MD5}, HashResolverMaxHashRate: 0, - HashResolverMaxHashBurst: 0, HashResolverMaxFileSize: 1 << 10, }, args: args{ @@ -307,7 +302,6 @@ func BenchmarkHashFunctions(b *testing.B) { HashResolverEventTypes: []model.EventType{model.ExecEventType}, HashResolverHashAlgorithms: []model.HashAlgorithm{model.SHA1}, HashResolverMaxHashRate: math.MaxInt, - HashResolverMaxHashBurst: math.MaxInt, HashResolverMaxFileSize: math.MaxInt64, }, fileSizes: []fileCase{ @@ -364,7 +358,6 @@ func BenchmarkHashFunctions(b *testing.B) { HashResolverEventTypes: []model.EventType{model.ExecEventType}, HashResolverHashAlgorithms: []model.HashAlgorithm{model.SHA256}, HashResolverMaxHashRate: math.MaxInt, - HashResolverMaxHashBurst: math.MaxInt, HashResolverMaxFileSize: math.MaxInt64, }, fileSizes: []fileCase{ @@ -421,7 +414,6 @@ func BenchmarkHashFunctions(b *testing.B) { HashResolverEventTypes: []model.EventType{model.ExecEventType}, HashResolverHashAlgorithms: []model.HashAlgorithm{model.MD5}, HashResolverMaxHashRate: math.MaxInt, - HashResolverMaxHashBurst: math.MaxInt, HashResolverMaxFileSize: math.MaxInt64, }, fileSizes: []fileCase{ From bbc457034d8107e3df6d5636f46c730965be7162 Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Mon, 2 Dec 2024 10:21:16 +0100 Subject: [PATCH 58/59] [CWS-2966] add validation that `pid-per-tracer` is greater or equal to 1 in attach mode (#31636) --- cmd/cws-instrumentation/subcommands/tracecmd/trace.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/cws-instrumentation/subcommands/tracecmd/trace.go b/cmd/cws-instrumentation/subcommands/tracecmd/trace.go index c1b393d8721f1..3fa092606bc78 100644 --- a/cmd/cws-instrumentation/subcommands/tracecmd/trace.go +++ b/cmd/cws-instrumentation/subcommands/tracecmd/trace.go @@ -120,6 +120,10 @@ func Command() []*cobra.Command { // attach mode if n := len(params.PIDs); n > 0 { + if params.PIDPerTracer <= 0 { + return fmt.Errorf("%s option but be greater or equal to 1", pidPerTracer) + } + if n < params.PIDPerTracer { return ptracer.Attach(params.PIDs, params.ProbeAddr, opts) } From d06ed83faa07de5bbba50f5bb70ed0bbbffdac32 Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Mon, 2 Dec 2024 10:21:23 +0100 Subject: [PATCH 59/59] [CWS-2966] add missing cws-instrumentation flags in attach mode (#31637) --- .../subcommands/tracecmd/trace.go | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/cmd/cws-instrumentation/subcommands/tracecmd/trace.go b/cmd/cws-instrumentation/subcommands/tracecmd/trace.go index 3fa092606bc78..a8ad4238b2483 100644 --- a/cmd/cws-instrumentation/subcommands/tracecmd/trace.go +++ b/cmd/cws-instrumentation/subcommands/tracecmd/trace.go @@ -149,19 +149,17 @@ func Command() []*cobra.Command { go func(set []int) { defer wg.Done() - args := []string{"trace"} - - if params.ProcScanDisabled { - args = append(args, fmt.Sprintf(`--%s`, disableProcScanOpt)) - } - if params.Async { - args = append(args, fmt.Sprintf(`--%s`, asyncOpt)) + args := []string{ + "trace", + fmt.Sprintf(`--%s`, probeAddrOpt), + params.ProbeAddr, } + if params.Verbose { args = append(args, fmt.Sprintf(`--%s`, verboseOpt)) } - if params.StatsDisabled { - args = append(args, fmt.Sprintf(`--%s`, disableStatsOpt)) + if params.Debug { + args = append(args, fmt.Sprintf(`--%s`, debugOpt)) } if params.UID != -1 { args = append(args, fmt.Sprintf(`--%s`, uidOpt), fmt.Sprintf(`%d`, params.UID)) @@ -169,7 +167,21 @@ func Command() []*cobra.Command { if params.GID != -1 { args = append(args, fmt.Sprintf(`--%s`, gidOpt), fmt.Sprintf(`%d`, params.GID)) } - args = append(args, fmt.Sprintf(`--%s`, probeAddrOpt), params.ProbeAddr) + if params.Async { + args = append(args, fmt.Sprintf(`--%s`, asyncOpt)) + } + if params.StatsDisabled { + args = append(args, fmt.Sprintf(`--%s`, disableStatsOpt)) + } + if params.ProcScanDisabled { + args = append(args, fmt.Sprintf(`--%s`, disableProcScanOpt)) + } + if params.ScanProcEvery != "" { + args = append(args, fmt.Sprintf(`--%s`, scanProcEveryOpt), params.ScanProcEvery) + } + if params.SeccompDisabled { + args = append(args, fmt.Sprintf(`--%s`, disableSeccompOpt)) + } for _, pid := range set { args = append(args, fmt.Sprintf(`--%s`, pidOpt), fmt.Sprintf(`%d`, pid))