transformers

package
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RETURN_SUCCESS = 1
	RETURN_DROP    = 2
	RETURN_ERROR   = 3
)

Functions

This section is empty.

Types

type FilteringProcessor

type FilteringProcessor struct {
	// contains filtered or unexported fields
}

func NewFilteringProcessor

func NewFilteringProcessor(config *dnsutils.ConfigTransformers, logger *logger.Logger, name string) FilteringProcessor

func (*FilteringProcessor) CheckIfDrop

func (p *FilteringProcessor) CheckIfDrop(dm *dnsutils.DnsMessage) bool

func (*FilteringProcessor) LoadActiveFilters added in v0.25.0

func (p *FilteringProcessor) LoadActiveFilters()

func (*FilteringProcessor) LoadDomainsList

func (p *FilteringProcessor) LoadDomainsList()

func (*FilteringProcessor) LoadQueryIpList

func (p *FilteringProcessor) LoadQueryIpList()

func (*FilteringProcessor) LoadRcodes

func (p *FilteringProcessor) LoadRcodes()

func (*FilteringProcessor) LogError

func (p *FilteringProcessor) LogError(msg string, v ...interface{})

func (*FilteringProcessor) LogInfo

func (p *FilteringProcessor) LogInfo(msg string, v ...interface{})

func (*FilteringProcessor) Run

func (p *FilteringProcessor) Run()

type GeoIpProcessor

type GeoIpProcessor struct {
	// contains filtered or unexported fields
}

func NewDnsGeoIpProcessor

func NewDnsGeoIpProcessor(config *dnsutils.ConfigTransformers, logger *logger.Logger) GeoIpProcessor

func (*GeoIpProcessor) Close

func (p *GeoIpProcessor) Close()

func (*GeoIpProcessor) IsEnabled

func (p *GeoIpProcessor) IsEnabled() bool

func (*GeoIpProcessor) LogError

func (p *GeoIpProcessor) LogError(msg string, v ...interface{})

func (*GeoIpProcessor) LogInfo

func (p *GeoIpProcessor) LogInfo(msg string, v ...interface{})

func (*GeoIpProcessor) Lookup

func (p *GeoIpProcessor) Lookup(ip string) (GeoRecord, error)

func (*GeoIpProcessor) Open

func (p *GeoIpProcessor) Open() (err error)

type GeoRecord

type GeoRecord struct {
	Continent      string
	CountryISOCode string
	City           string
	ASN            string
	ASO            string
}

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 NormalizeProcessor added in v0.25.0

type NormalizeProcessor struct {
	// contains filtered or unexported fields
}

func NewNormalizeSubprocessor added in v0.25.0

func NewNormalizeSubprocessor(config *dnsutils.ConfigTransformers) NormalizeProcessor

func (*NormalizeProcessor) IsEnabled added in v0.25.0

func (s *NormalizeProcessor) IsEnabled() bool

func (*NormalizeProcessor) Lowercase added in v0.25.0

func (s *NormalizeProcessor) Lowercase(qname string) string

type PublicSuffixProcessor added in v0.25.0

type PublicSuffixProcessor struct {
	// contains filtered or unexported fields
}

func NewPublicSuffixSubprocessor added in v0.25.0

func NewPublicSuffixSubprocessor(config *dnsutils.ConfigTransformers) PublicSuffixProcessor

func (*PublicSuffixProcessor) GetEffectiveTld added in v0.25.0

func (s *PublicSuffixProcessor) GetEffectiveTld(qname string) (string, error)

func (*PublicSuffixProcessor) GetEffectiveTldPlusOne added in v0.25.0

func (s *PublicSuffixProcessor) GetEffectiveTldPlusOne(qname string) (string, error)

func (*PublicSuffixProcessor) IsEnabled added in v0.25.0

func (s *PublicSuffixProcessor) IsEnabled() bool

type SuspiciousTransform added in v0.25.0

type SuspiciousTransform struct {
	CommonQtypes map[string]bool
	// contains filtered or unexported fields
}

func NewSuspiciousSubprocessor added in v0.25.0

func NewSuspiciousSubprocessor(config *dnsutils.ConfigTransformers, logger *logger.Logger, name string) SuspiciousTransform

func (*SuspiciousTransform) CheckIfSuspicious added in v0.25.0

func (p *SuspiciousTransform) CheckIfSuspicious(dm *dnsutils.DnsMessage)

func (*SuspiciousTransform) IsEnabled added in v0.25.0

func (p *SuspiciousTransform) IsEnabled() bool

func (*SuspiciousTransform) LogError added in v0.25.0

func (p *SuspiciousTransform) LogError(msg string, v ...interface{})

func (*SuspiciousTransform) LogInfo added in v0.25.0

func (p *SuspiciousTransform) LogInfo(msg string, v ...interface{})

func (*SuspiciousTransform) ReadConfig added in v0.25.0

func (p *SuspiciousTransform) ReadConfig()

type Transforms added in v0.25.0

type Transforms struct {
	SuspiciousTransform   SuspiciousTransform
	GeoipTransform        GeoIpProcessor
	FilteringTransform    FilteringProcessor
	UserPrivacyTransform  UserPrivacyProcessor
	NormalizeTransform    NormalizeProcessor
	PublicSuffixTransform PublicSuffixProcessor
	// contains filtered or unexported fields
}

func NewTransforms added in v0.25.0

func NewTransforms(config *dnsutils.ConfigTransformers, logger *logger.Logger, name string) Transforms

func (*Transforms) GetEffectiveTld added in v0.25.0

func (p *Transforms) GetEffectiveTld(dm *dnsutils.DnsMessage) int

func (*Transforms) GetEffectiveTldPlusOne added in v0.25.0

func (p *Transforms) GetEffectiveTldPlusOne(dm *dnsutils.DnsMessage) int

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) Reset added in v0.25.0

func (p *Transforms) Reset()

type UserPrivacyProcessor added in v0.25.0

type UserPrivacyProcessor struct {
	// contains filtered or unexported fields
}

func NewUserPrivacySubprocessor added in v0.25.0

func NewUserPrivacySubprocessor(config *dnsutils.ConfigTransformers) UserPrivacyProcessor

func (*UserPrivacyProcessor) AnonymizeIP added in v0.25.0

func (s *UserPrivacyProcessor) AnonymizeIP(ip string) string

func (*UserPrivacyProcessor) MinimazeQname added in v0.25.0

func (s *UserPrivacyProcessor) MinimazeQname(qname string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL