diff --git a/agent/main.go b/agent/main.go index d315a5ffd..71efb4709 100644 --- a/agent/main.go +++ b/agent/main.go @@ -230,7 +230,7 @@ func getTrafficFilteringOptions() *tapApi.TrafficFilteringOptions { filteringOptionsJson := os.Getenv(shared.MizuFilteringOptionsEnvVar) if filteringOptionsJson == "" { return &tapApi.TrafficFilteringOptions{ - HealthChecksUserAgentHeaders: []string{}, + IgnoredUserAgents: []string{}, } } var filteringOptions tapApi.TrafficFilteringOptions @@ -248,7 +248,7 @@ func filterItems(inChannel <-chan *tapApi.OutputChannelItem, outChannel chan *ta continue } // TODO: move this to tappers https://up9.atlassian.net/browse/TRA-3441 - if isHealthCheckByUserAgent(message, filterOptions.HealthChecksUserAgentHeaders) { + if isIgnoredUserAgent(message, filterOptions.IgnoredUserAgents) { continue } @@ -256,7 +256,7 @@ func filterItems(inChannel <-chan *tapApi.OutputChannelItem, outChannel chan *ta } } -func isHealthCheckByUserAgent(item *tapApi.OutputChannelItem, userAgentsToIgnore []string) bool { +func isIgnoredUserAgent(item *tapApi.OutputChannelItem, userAgentsToIgnore []string) bool { if item.Protocol.Name != "http" { return false } diff --git a/cli/cmd/tapRunner.go b/cli/cmd/tapRunner.go index 0839498c7..98c3ead0c 100644 --- a/cli/cmd/tapRunner.go +++ b/cli/cmd/tapRunner.go @@ -216,9 +216,9 @@ func getMizuApiFilteringOptions() (*api.TrafficFilteringOptions, error) { } return &api.TrafficFilteringOptions{ - PlainTextMaskingRegexes: compiledRegexSlice, - HealthChecksUserAgentHeaders: config.Config.Tap.HealthChecksUserAgentHeaders, - DisableRedaction: config.Config.Tap.DisableRedaction, + PlainTextMaskingRegexes: compiledRegexSlice, + IgnoredUserAgents: config.Config.Tap.IgnoredUserAgents, + DisableRedaction: config.Config.Tap.DisableRedaction, }, nil } diff --git a/cli/config/configStructs/tapConfig.go b/cli/config/configStructs/tapConfig.go index 5bf777d28..00be5a1e5 100644 --- a/cli/config/configStructs/tapConfig.go +++ b/cli/config/configStructs/tapConfig.go @@ -21,22 +21,22 @@ const ( ) type TapConfig struct { - AnalysisDestination string `yaml:"dest" default:"up9.app"` - SleepIntervalSec int `yaml:"upload-interval" default:"10"` - PodRegexStr string `yaml:"regex" default:".*"` - GuiPort uint16 `yaml:"gui-port" default:"8899"` - Namespaces []string `yaml:"namespaces"` - Analysis bool `yaml:"analysis" default:"false"` - AllNamespaces bool `yaml:"all-namespaces" default:"false"` - PlainTextFilterRegexes []string `yaml:"regex-masking"` - HealthChecksUserAgentHeaders []string `yaml:"ignored-user-agents"` - DisableRedaction bool `yaml:"no-redact" default:"false"` - HumanMaxEntriesDBSize string `yaml:"max-entries-db-size" default:"200MB"` - DryRun bool `yaml:"dry-run" default:"false"` - EnforcePolicyFile string `yaml:"traffic-validation-file"` - EnforcePolicyFileDeprecated string `yaml:"test-rules,omitempty" readonly:""` - ApiServerResources Resources `yaml:"api-server-resources"` - TapperResources Resources `yaml:"tapper-resources"` + AnalysisDestination string `yaml:"dest" default:"up9.app"` + SleepIntervalSec int `yaml:"upload-interval" default:"10"` + PodRegexStr string `yaml:"regex" default:".*"` + GuiPort uint16 `yaml:"gui-port" default:"8899"` + Namespaces []string `yaml:"namespaces"` + Analysis bool `yaml:"analysis" default:"false"` + AllNamespaces bool `yaml:"all-namespaces" default:"false"` + PlainTextFilterRegexes []string `yaml:"regex-masking"` + IgnoredUserAgents []string `yaml:"ignored-user-agents"` + DisableRedaction bool `yaml:"no-redact" default:"false"` + HumanMaxEntriesDBSize string `yaml:"max-entries-db-size" default:"200MB"` + DryRun bool `yaml:"dry-run" default:"false"` + EnforcePolicyFile string `yaml:"traffic-validation-file"` + EnforcePolicyFileDeprecated string `yaml:"test-rules,omitempty" readonly:""` + ApiServerResources Resources `yaml:"api-server-resources"` + TapperResources Resources `yaml:"tapper-resources"` } type Resources struct { diff --git a/tap/api/options.go b/tap/api/options.go index aff071bf3..22772f0ef 100644 --- a/tap/api/options.go +++ b/tap/api/options.go @@ -1,7 +1,7 @@ package api type TrafficFilteringOptions struct { - HealthChecksUserAgentHeaders []string - PlainTextMaskingRegexes []*SerializableRegexp - DisableRedaction bool + IgnoredUserAgents []string + PlainTextMaskingRegexes []*SerializableRegexp + DisableRedaction bool }