mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-23 06:48:47 +00:00
Renaming ignored user agents var (#320)
This commit is contained in:
parent
111d000c12
commit
fd48cc6d87
@ -230,7 +230,7 @@ func getTrafficFilteringOptions() *tapApi.TrafficFilteringOptions {
|
|||||||
filteringOptionsJson := os.Getenv(shared.MizuFilteringOptionsEnvVar)
|
filteringOptionsJson := os.Getenv(shared.MizuFilteringOptionsEnvVar)
|
||||||
if filteringOptionsJson == "" {
|
if filteringOptionsJson == "" {
|
||||||
return &tapApi.TrafficFilteringOptions{
|
return &tapApi.TrafficFilteringOptions{
|
||||||
HealthChecksUserAgentHeaders: []string{},
|
IgnoredUserAgents: []string{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var filteringOptions tapApi.TrafficFilteringOptions
|
var filteringOptions tapApi.TrafficFilteringOptions
|
||||||
@ -248,7 +248,7 @@ func filterItems(inChannel <-chan *tapApi.OutputChannelItem, outChannel chan *ta
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// TODO: move this to tappers https://up9.atlassian.net/browse/TRA-3441
|
// TODO: move this to tappers https://up9.atlassian.net/browse/TRA-3441
|
||||||
if isHealthCheckByUserAgent(message, filterOptions.HealthChecksUserAgentHeaders) {
|
if isIgnoredUserAgent(message, filterOptions.IgnoredUserAgents) {
|
||||||
continue
|
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" {
|
if item.Protocol.Name != "http" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -216,9 +216,9 @@ func getMizuApiFilteringOptions() (*api.TrafficFilteringOptions, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &api.TrafficFilteringOptions{
|
return &api.TrafficFilteringOptions{
|
||||||
PlainTextMaskingRegexes: compiledRegexSlice,
|
PlainTextMaskingRegexes: compiledRegexSlice,
|
||||||
HealthChecksUserAgentHeaders: config.Config.Tap.HealthChecksUserAgentHeaders,
|
IgnoredUserAgents: config.Config.Tap.IgnoredUserAgents,
|
||||||
DisableRedaction: config.Config.Tap.DisableRedaction,
|
DisableRedaction: config.Config.Tap.DisableRedaction,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,22 +21,22 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type TapConfig struct {
|
type TapConfig struct {
|
||||||
AnalysisDestination string `yaml:"dest" default:"up9.app"`
|
AnalysisDestination string `yaml:"dest" default:"up9.app"`
|
||||||
SleepIntervalSec int `yaml:"upload-interval" default:"10"`
|
SleepIntervalSec int `yaml:"upload-interval" default:"10"`
|
||||||
PodRegexStr string `yaml:"regex" default:".*"`
|
PodRegexStr string `yaml:"regex" default:".*"`
|
||||||
GuiPort uint16 `yaml:"gui-port" default:"8899"`
|
GuiPort uint16 `yaml:"gui-port" default:"8899"`
|
||||||
Namespaces []string `yaml:"namespaces"`
|
Namespaces []string `yaml:"namespaces"`
|
||||||
Analysis bool `yaml:"analysis" default:"false"`
|
Analysis bool `yaml:"analysis" default:"false"`
|
||||||
AllNamespaces bool `yaml:"all-namespaces" default:"false"`
|
AllNamespaces bool `yaml:"all-namespaces" default:"false"`
|
||||||
PlainTextFilterRegexes []string `yaml:"regex-masking"`
|
PlainTextFilterRegexes []string `yaml:"regex-masking"`
|
||||||
HealthChecksUserAgentHeaders []string `yaml:"ignored-user-agents"`
|
IgnoredUserAgents []string `yaml:"ignored-user-agents"`
|
||||||
DisableRedaction bool `yaml:"no-redact" default:"false"`
|
DisableRedaction bool `yaml:"no-redact" default:"false"`
|
||||||
HumanMaxEntriesDBSize string `yaml:"max-entries-db-size" default:"200MB"`
|
HumanMaxEntriesDBSize string `yaml:"max-entries-db-size" default:"200MB"`
|
||||||
DryRun bool `yaml:"dry-run" default:"false"`
|
DryRun bool `yaml:"dry-run" default:"false"`
|
||||||
EnforcePolicyFile string `yaml:"traffic-validation-file"`
|
EnforcePolicyFile string `yaml:"traffic-validation-file"`
|
||||||
EnforcePolicyFileDeprecated string `yaml:"test-rules,omitempty" readonly:""`
|
EnforcePolicyFileDeprecated string `yaml:"test-rules,omitempty" readonly:""`
|
||||||
ApiServerResources Resources `yaml:"api-server-resources"`
|
ApiServerResources Resources `yaml:"api-server-resources"`
|
||||||
TapperResources Resources `yaml:"tapper-resources"`
|
TapperResources Resources `yaml:"tapper-resources"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Resources struct {
|
type Resources struct {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
type TrafficFilteringOptions struct {
|
type TrafficFilteringOptions struct {
|
||||||
HealthChecksUserAgentHeaders []string
|
IgnoredUserAgents []string
|
||||||
PlainTextMaskingRegexes []*SerializableRegexp
|
PlainTextMaskingRegexes []*SerializableRegexp
|
||||||
DisableRedaction bool
|
DisableRedaction bool
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user