From dbbc997dfdb48d3216ed07108c9ef8a0cf44e9fb Mon Sep 17 00:00:00 2001 From: caffix Date: Mon, 25 Nov 2024 21:16:25 -0500 Subject: [PATCH] small changes --- engine/plugins/dns/apex.go | 2 +- engine/plugins/dns/ip.go | 4 ++-- engine/plugins/dns/subs.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/plugins/dns/apex.go b/engine/plugins/dns/apex.go index 2c02803f..ad6b849e 100644 --- a/engine/plugins/dns/apex.go +++ b/engine/plugins/dns/apex.go @@ -31,7 +31,7 @@ func (d *dnsApex) check(e *et.Event) error { return nil } - // determine which domain apex this name is a node in + // determine which domain apex is the parent of this name var apex *dbt.Entity best := len(fqdn.Name) for _, name := range d.plugin.apexList.Slice() { diff --git a/engine/plugins/dns/ip.go b/engine/plugins/dns/ip.go index b2073ef9..07eb2f17 100644 --- a/engine/plugins/dns/ip.go +++ b/engine/plugins/dns/ip.go @@ -57,7 +57,7 @@ func (d *dnsIP) check(e *et.Event) error { } if len(ips) > 0 { - d.process(e, fqdn.Name, ips, src) + d.process(e, fqdn.Name, ips) for _, v := range ips { ip, ok := v.ip.Asset.(*oamnet.IPAddress) @@ -169,7 +169,7 @@ func (d *dnsIP) store(e *et.Event, fqdn *dbt.Entity, src *et.Source, rr []*resol return ips } -func (d *dnsIP) process(e *et.Event, name string, addrs []*relIP, src *et.Source) { +func (d *dnsIP) process(e *et.Event, name string, addrs []*relIP) { for _, a := range addrs { ip := a.ip.Asset.(*oamnet.IPAddress) diff --git a/engine/plugins/dns/subs.go b/engine/plugins/dns/subs.go index 38ec0535..8479e41f 100644 --- a/engine/plugins/dns/subs.go +++ b/engine/plugins/dns/subs.go @@ -194,9 +194,9 @@ func (d *dnsSubs) query(e *et.Event, subdomain string, src *et.Source) []*relSub for i, t := range d.types { if rr, err := support.PerformQuery(subdomain, t.Qtype); err == nil && len(rr) > 0 { - d.plugin.apexList.Insert(subdomain) if records := d.store(e, subdomain, src, rr); len(records) > 0 { alias = append(alias, records...) + d.plugin.apexList.Insert(subdomain) } } else if i == 0 { // do not continue if we failed to obtain the NS record