Documentation ¶
Index ¶
- Variables
- type ATagsProcessor
- type ExtractProcessor
- type FilteringProcessor
- func (p *FilteringProcessor) CheckIfDrop(dm *dnsutils.DNSMessage) bool
- func (p *FilteringProcessor) DropQueryIPFilter(dm *dnsutils.DNSMessage) bool
- func (p *FilteringProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
- func (p *FilteringProcessor) LoadActiveFilters()
- func (p *FilteringProcessor) LoadDomainsList()
- func (p *FilteringProcessor) LoadQueryIPList()
- func (p *FilteringProcessor) LoadRcodes()
- func (p *FilteringProcessor) LoadrDataIPList()
- func (p *FilteringProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
- type GeoIPProcessor
- func (p *GeoIPProcessor) Close()
- func (p *GeoIPProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
- func (p *GeoIPProcessor) IsEnabled() bool
- func (p *GeoIPProcessor) Lookup(ip string) (GeoRecord, error)
- func (p *GeoIPProcessor) Open() (err error)
- func (p *GeoIPProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
- type GeoRecord
- type HashQueries
- type LatencyProcessor
- type MapQueries
- type MapTraffic
- type MaxminddbRecord
- type MlProcessor
- type NormalizeProcessor
- func (p *NormalizeProcessor) GetEffectiveTld(dm *dnsutils.DNSMessage) int
- func (p *NormalizeProcessor) GetEffectiveTldPlusOne(dm *dnsutils.DNSMessage) int
- func (p *NormalizeProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
- func (p *NormalizeProcessor) IsEnabled() bool
- func (p *NormalizeProcessor) LoadActiveProcessors()
- func (p *NormalizeProcessor) ProcessDNSMessage(dm *dnsutils.DNSMessage) int
- func (p *NormalizeProcessor) QnameLowercase(dm *dnsutils.DNSMessage) int
- func (p *NormalizeProcessor) QuietText(dm *dnsutils.DNSMessage) int
- func (p *NormalizeProcessor) RRLowercase(dm *dnsutils.DNSMessage) int
- func (p *NormalizeProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
- type ReducerProcessor
- func (p *ReducerProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
- func (p *ReducerProcessor) LoadActiveReducers()
- func (p *ReducerProcessor) ProcessDNSMessage(dm *dnsutils.DNSMessage) int
- func (p *ReducerProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
- func (p *ReducerProcessor) RepetitiveTrafficDetector(dm *dnsutils.DNSMessage) int
- type RelabelProcessor
- type SuspiciousTransform
- func (p *SuspiciousTransform) CheckIfSuspicious(dm *dnsutils.DNSMessage)
- func (p *SuspiciousTransform) InitDNSMessage(dm *dnsutils.DNSMessage)
- func (p *SuspiciousTransform) IsEnabled() bool
- func (p *SuspiciousTransform) ReadConfig()
- func (p *SuspiciousTransform) ReloadConfig(config *pkgconfig.ConfigTransformers)
- type Transforms
- func (p *Transforms) InitDNSMessageFormat(dm *dnsutils.DNSMessage)
- func (p *Transforms) LogError(msg string, v ...interface{})
- func (p *Transforms) LogInfo(msg string, v ...interface{})
- func (p *Transforms) Prepare() error
- func (p *Transforms) ProcessMessage(dm *dnsutils.DNSMessage) int
- func (p *Transforms) ReloadConfig(config *pkgconfig.ConfigTransformers)
- func (p *Transforms) Reset()
- type UserPrivacyProcessor
- func (s *UserPrivacyProcessor) AnonymizeIP(ip string) string
- func (s *UserPrivacyProcessor) HashIP(ip string) string
- func (s *UserPrivacyProcessor) MinimazeQname(qname string) string
- func (s *UserPrivacyProcessor) ReadConfig()
- func (s *UserPrivacyProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DnstapMessage = map[string]string{ "AUTH_QUERY": "AQ", "AUTH_RESPONSE": "AR", "RESOLVER_QUERY": "RQ", "RESOLVER_RESPONSE": "RR", "CLIENT_QUERY": "CQ", "CLIENT_RESPONSE": "CR", "FORWARDER_QUERY": "FQ", "FORWARDER_RESPONSE": "FR", "STUB_QUERY": "SQ", "STUB_RESPONSE": "SR", "TOOL_QUERY": "TQ", "TOOL_RESPONSE": "TR", "UPDATE_QUERY": "UQ", "UPDATE_RESPONSE": "UR", "DNSQueryType": "Q", "DNSResponseType": "R", } DNSQr = map[string]string{ "QUERY": "Q", "REPLY": "R", } IPversion = map[string]string{ "INET6": "6", "INET": "4", } Rcodes = map[string]string{ "NOERROR": "0", "FORMERR": "1", "SERVFAIL": "2", "NXDOMAIN": "3", "NOIMP": "4", "REFUSED": "5", "YXDOMAIN": "6", "YXRRSET": "7", "NXRRSET": "8", "NOTAUTH": "9", "NOTZONE": "10", "DSOTYPENI": "11", "BADSIG": "16", "BADKEY": "17", "BADTIME": "18", "BADMODE": "19", "BADNAME": "20", "BADALG": "21", "BADTRUNC": "22", "BADCOOKIE": "23", } )
View Source
var ( ReturnSuccess = 1 ReturnDrop = 2 ReturnError = 3 )
Functions ¶
This section is empty.
Types ¶
type ATagsProcessor ¶ added in v0.40.0
type ATagsProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
// contains filtered or unexported fields
}
func NewATagsTransform ¶ added in v0.43.0
func NewATagsTransform(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) ATagsProcessor
func (*ATagsProcessor) AddTags ¶ added in v0.40.0
func (p *ATagsProcessor) AddTags(dm *dnsutils.DNSMessage) int
func (*ATagsProcessor) InitDNSMessage ¶ added in v0.40.0
func (p *ATagsProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
func (*ATagsProcessor) IsEnabled ¶ added in v0.40.0
func (p *ATagsProcessor) IsEnabled() bool
func (*ATagsProcessor) ReloadConfig ¶ added in v0.40.0
func (p *ATagsProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
type ExtractProcessor ¶ added in v0.31.0
type ExtractProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
// contains filtered or unexported fields
}
func NewExtractTransform ¶ added in v0.43.0
func NewExtractTransform(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) ExtractProcessor
func (*ExtractProcessor) AddBase64Payload ¶ added in v0.31.0
func (p *ExtractProcessor) AddBase64Payload(dm *dnsutils.DNSMessage) []byte
func (*ExtractProcessor) InitDNSMessage ¶ added in v0.39.0
func (p *ExtractProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
func (*ExtractProcessor) IsEnabled ¶ added in v0.31.0
func (p *ExtractProcessor) IsEnabled() bool
func (*ExtractProcessor) ReloadConfig ¶ added in v0.38.0
func (p *ExtractProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
type FilteringProcessor ¶
type FilteringProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
// contains filtered or unexported fields
}
func NewFilteringTransform ¶ added in v0.43.0
func NewFilteringTransform(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) FilteringProcessor
func (*FilteringProcessor) CheckIfDrop ¶
func (p *FilteringProcessor) CheckIfDrop(dm *dnsutils.DNSMessage) bool
func (*FilteringProcessor) DropQueryIPFilter ¶ added in v0.39.0
func (p *FilteringProcessor) DropQueryIPFilter(dm *dnsutils.DNSMessage) bool
func (*FilteringProcessor) InitDNSMessage ¶ added in v0.39.0
func (p *FilteringProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
func (*FilteringProcessor) LoadActiveFilters ¶ added in v0.25.0
func (p *FilteringProcessor) LoadActiveFilters()
func (*FilteringProcessor) LoadDomainsList ¶
func (p *FilteringProcessor) LoadDomainsList()
func (*FilteringProcessor) LoadQueryIPList ¶ added in v0.39.0
func (p *FilteringProcessor) LoadQueryIPList()
func (*FilteringProcessor) LoadRcodes ¶
func (p *FilteringProcessor) LoadRcodes()
func (*FilteringProcessor) LoadrDataIPList ¶ added in v0.39.0
func (p *FilteringProcessor) LoadrDataIPList()
func (*FilteringProcessor) ReloadConfig ¶ added in v0.38.0
func (p *FilteringProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
type GeoIPProcessor ¶ added in v0.39.0
type GeoIPProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
// contains filtered or unexported fields
}
func NewDNSGeoIPTransform ¶ added in v0.43.0
func NewDNSGeoIPTransform(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) GeoIPProcessor
func (*GeoIPProcessor) Close ¶ added in v0.39.0
func (p *GeoIPProcessor) Close()
func (*GeoIPProcessor) InitDNSMessage ¶ added in v0.39.0
func (p *GeoIPProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
func (*GeoIPProcessor) IsEnabled ¶ added in v0.39.0
func (p *GeoIPProcessor) IsEnabled() bool
func (*GeoIPProcessor) Lookup ¶ added in v0.39.0
func (p *GeoIPProcessor) Lookup(ip string) (GeoRecord, error)
func (*GeoIPProcessor) Open ¶ added in v0.39.0
func (p *GeoIPProcessor) Open() (err error)
func (*GeoIPProcessor) ReloadConfig ¶ added in v0.39.0
func (p *GeoIPProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
type HashQueries ¶ added in v0.30.0
hash queries map
func NewHashQueries ¶ added in v0.30.0
func NewHashQueries(ttl time.Duration) HashQueries
func (*HashQueries) Delete ¶ added in v0.30.0
func (mp *HashQueries) Delete(key uint64)
func (*HashQueries) Get ¶ added in v0.30.0
func (mp *HashQueries) Get(key uint64) (value int64, ok bool)
func (*HashQueries) Set ¶ added in v0.30.0
func (mp *HashQueries) Set(key uint64, value int64)
func (*HashQueries) SetTTL ¶ added in v0.39.0
func (mp *HashQueries) SetTTL(ttl time.Duration)
type LatencyProcessor ¶ added in v0.30.0
type LatencyProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
// contains filtered or unexported fields
}
latency processor
func NewLatencyTransform ¶ added in v0.43.0
func NewLatencyTransform(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) *LatencyProcessor
func (*LatencyProcessor) DetectEvictedTimeout ¶ added in v0.30.0
func (s *LatencyProcessor) DetectEvictedTimeout(dm *dnsutils.DNSMessage)
func (*LatencyProcessor) MeasureLatency ¶ added in v0.30.0
func (s *LatencyProcessor) MeasureLatency(dm *dnsutils.DNSMessage)
func (*LatencyProcessor) ReloadConfig ¶ added in v0.38.0
func (s *LatencyProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
type MapQueries ¶ added in v0.30.0
queries map
func NewMapQueries ¶ added in v0.30.0
func NewMapQueries(ttl time.Duration, channels []chan dnsutils.DNSMessage) MapQueries
func (*MapQueries) Delete ¶ added in v0.30.0
func (mp *MapQueries) Delete(key uint64)
func (*MapQueries) Exists ¶ added in v0.30.0
func (mp *MapQueries) Exists(key uint64) (ok bool)
func (*MapQueries) Set ¶ added in v0.30.0
func (mp *MapQueries) Set(key uint64, dm dnsutils.DNSMessage)
func (*MapQueries) SetTTL ¶ added in v0.39.0
func (mp *MapQueries) SetTTL(ttl time.Duration)
type MapTraffic ¶ added in v0.31.0
func NewMapTraffic ¶ added in v0.31.0
func NewMapTraffic(ttl time.Duration, channels []chan dnsutils.DNSMessage, logInfo func(msg string, v ...interface{}), logError func(msg string, v ...interface{})) MapTraffic
func (*MapTraffic) ProcessExpiredKeys ¶ added in v0.31.0
func (mp *MapTraffic) ProcessExpiredKeys()
func (*MapTraffic) Run ¶ added in v0.31.0
func (mp *MapTraffic) Run()
func (*MapTraffic) Set ¶ added in v0.31.0
func (mp *MapTraffic) Set(key string, dm *dnsutils.DNSMessage)
func (*MapTraffic) SetTTL ¶ added in v0.39.0
func (mp *MapTraffic) SetTTL(ttl time.Duration)
type MaxminddbRecord ¶
type MaxminddbRecord struct { Continent struct { Code string `maxminddb:"code"` } `maxminddb:"continent"` Country struct { ISOCode string `maxminddb:"iso_code"` } `maxminddb:"country"` City struct { Names map[string]string `maxminddb:"names"` } `maxminddb:"city"` AutonomousSystemNumber int `maxminddb:"autonomous_system_number"` AutonomousSystemOrganization string `maxminddb:"autonomous_system_organization"` }
type MlProcessor ¶ added in v0.35.0
type MlProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
// contains filtered or unexported fields
}
func NewMachineLearningTransform ¶ added in v0.43.0
func NewMachineLearningTransform(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) MlProcessor
func (*MlProcessor) AddFeatures ¶ added in v0.35.0
func (p *MlProcessor) AddFeatures(dm *dnsutils.DNSMessage)
func (*MlProcessor) InitDNSMessage ¶ added in v0.39.0
func (p *MlProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
func (*MlProcessor) ReloadConfig ¶ added in v0.38.0
func (p *MlProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
type NormalizeProcessor ¶ added in v0.25.0
type NormalizeProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
// contains filtered or unexported fields
}
func NewNormalizeTransform ¶ added in v0.43.0
func NewNormalizeTransform( config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) NormalizeProcessor
func (*NormalizeProcessor) GetEffectiveTld ¶ added in v0.26.0
func (p *NormalizeProcessor) GetEffectiveTld(dm *dnsutils.DNSMessage) int
func (*NormalizeProcessor) GetEffectiveTldPlusOne ¶ added in v0.26.0
func (p *NormalizeProcessor) GetEffectiveTldPlusOne(dm *dnsutils.DNSMessage) int
func (*NormalizeProcessor) InitDNSMessage ¶ added in v0.39.0
func (p *NormalizeProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
func (*NormalizeProcessor) IsEnabled ¶ added in v0.25.0
func (p *NormalizeProcessor) IsEnabled() bool
func (*NormalizeProcessor) LoadActiveProcessors ¶ added in v0.31.0
func (p *NormalizeProcessor) LoadActiveProcessors()
func (*NormalizeProcessor) ProcessDNSMessage ¶ added in v0.39.0
func (p *NormalizeProcessor) ProcessDNSMessage(dm *dnsutils.DNSMessage) int
func (*NormalizeProcessor) QnameLowercase ¶ added in v0.43.0
func (p *NormalizeProcessor) QnameLowercase(dm *dnsutils.DNSMessage) int
func (*NormalizeProcessor) QuietText ¶ added in v0.26.0
func (p *NormalizeProcessor) QuietText(dm *dnsutils.DNSMessage) int
func (*NormalizeProcessor) RRLowercase ¶ added in v0.43.0
func (p *NormalizeProcessor) RRLowercase(dm *dnsutils.DNSMessage) int
func (*NormalizeProcessor) ReloadConfig ¶ added in v0.38.0
func (p *NormalizeProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
type ReducerProcessor ¶ added in v0.31.0
type ReducerProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
// contains filtered or unexported fields
}
func NewReducerTransform ¶ added in v0.43.0
func NewReducerTransform( config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) *ReducerProcessor
func (*ReducerProcessor) InitDNSMessage ¶ added in v0.39.0
func (p *ReducerProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
func (*ReducerProcessor) LoadActiveReducers ¶ added in v0.31.0
func (p *ReducerProcessor) LoadActiveReducers()
func (*ReducerProcessor) ProcessDNSMessage ¶ added in v0.39.0
func (p *ReducerProcessor) ProcessDNSMessage(dm *dnsutils.DNSMessage) int
func (*ReducerProcessor) ReloadConfig ¶ added in v0.38.0
func (p *ReducerProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
func (*ReducerProcessor) RepetitiveTrafficDetector ¶ added in v0.31.0
func (p *ReducerProcessor) RepetitiveTrafficDetector(dm *dnsutils.DNSMessage) int
type RelabelProcessor ¶ added in v0.43.0
type RelabelProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
RelabelingRules []dnsutils.RelabelingRule
// contains filtered or unexported fields
}
func NewRelabelTransform ¶ added in v0.43.0
func NewRelabelTransform(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) RelabelProcessor
func (*RelabelProcessor) InitDNSMessage ¶ added in v0.43.0
func (p *RelabelProcessor) InitDNSMessage(dm *dnsutils.DNSMessage)
func (*RelabelProcessor) IsEnabled ¶ added in v0.43.0
func (p *RelabelProcessor) IsEnabled() bool
func (*RelabelProcessor) Precompile ¶ added in v0.43.0
func (p *RelabelProcessor) Precompile()
func (*RelabelProcessor) ReloadConfig ¶ added in v0.43.0
func (p *RelabelProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
type SuspiciousTransform ¶ added in v0.25.0
type SuspiciousTransform struct { CommonQtypes map[string]bool LogInfo, LogError func(msg string, v ...interface{}) // contains filtered or unexported fields }
func NewSuspiciousTransform ¶ added in v0.43.0
func NewSuspiciousTransform(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) SuspiciousTransform
func (*SuspiciousTransform) CheckIfSuspicious ¶ added in v0.25.0
func (p *SuspiciousTransform) CheckIfSuspicious(dm *dnsutils.DNSMessage)
func (*SuspiciousTransform) InitDNSMessage ¶ added in v0.39.0
func (p *SuspiciousTransform) InitDNSMessage(dm *dnsutils.DNSMessage)
func (*SuspiciousTransform) IsEnabled ¶ added in v0.25.0
func (p *SuspiciousTransform) IsEnabled() bool
func (*SuspiciousTransform) ReadConfig ¶ added in v0.25.0
func (p *SuspiciousTransform) ReadConfig()
func (*SuspiciousTransform) ReloadConfig ¶ added in v0.38.0
func (p *SuspiciousTransform) ReloadConfig(config *pkgconfig.ConfigTransformers)
type Transforms ¶ added in v0.25.0
type Transforms struct { SuspiciousTransform SuspiciousTransform GeoipTransform GeoIPProcessor FilteringTransform FilteringProcessor UserPrivacyTransform UserPrivacyProcessor NormalizeTransform NormalizeProcessor LatencyTransform *LatencyProcessor ReducerTransform *ReducerProcessor ExtractProcessor ExtractProcessor MachineLearningTransform MlProcessor ATagsTransform ATagsProcessor RelabelTransform RelabelProcessor // contains filtered or unexported fields }
func NewTransforms ¶ added in v0.25.0
func NewTransforms(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, outChannels []chan dnsutils.DNSMessage, instance int) Transforms
func (*Transforms) InitDNSMessageFormat ¶ added in v0.39.0
func (p *Transforms) InitDNSMessageFormat(dm *dnsutils.DNSMessage)
func (*Transforms) LogError ¶ added in v0.25.0
func (p *Transforms) LogError(msg string, v ...interface{})
func (*Transforms) LogInfo ¶ added in v0.25.0
func (p *Transforms) LogInfo(msg string, v ...interface{})
func (*Transforms) Prepare ¶ added in v0.25.0
func (p *Transforms) Prepare() error
func (*Transforms) ProcessMessage ¶ added in v0.25.0
func (p *Transforms) ProcessMessage(dm *dnsutils.DNSMessage) int
func (*Transforms) ReloadConfig ¶ added in v0.38.0
func (p *Transforms) ReloadConfig(config *pkgconfig.ConfigTransformers)
func (*Transforms) Reset ¶ added in v0.25.0
func (p *Transforms) Reset()
type UserPrivacyProcessor ¶ added in v0.25.0
type UserPrivacyProcessor struct {
LogInfo, LogError func(msg string, v ...interface{})
// contains filtered or unexported fields
}
func NewUserPrivacyTransform ¶ added in v0.43.0
func NewUserPrivacyTransform(config *pkgconfig.ConfigTransformers, logger *logger.Logger, name string, instance int, outChannels []chan dnsutils.DNSMessage) UserPrivacyProcessor
func (*UserPrivacyProcessor) AnonymizeIP ¶ added in v0.25.0
func (s *UserPrivacyProcessor) AnonymizeIP(ip string) string
func (*UserPrivacyProcessor) HashIP ¶ added in v0.27.0
func (s *UserPrivacyProcessor) HashIP(ip string) string
func (*UserPrivacyProcessor) MinimazeQname ¶ added in v0.25.0
func (s *UserPrivacyProcessor) MinimazeQname(qname string) string
func (*UserPrivacyProcessor) ReadConfig ¶ added in v0.40.0
func (s *UserPrivacyProcessor) ReadConfig()
func (*UserPrivacyProcessor) ReloadConfig ¶ added in v0.38.0
func (s *UserPrivacyProcessor) ReloadConfig(config *pkgconfig.ConfigTransformers)
Click to show internal directories.
Click to hide internal directories.