Skip to content

Commit bb7380d

Browse files
authored
update txt.go
1 parent 6b3300a commit bb7380d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

engine/plugins/dns/txt.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (d *dnsTXT) lookup(e *et.Event, fqdn *dbt.Entity, since time.Time) []*resol
4848
var txtRecords []*resolve.ExtractedAnswer
4949

5050
n, ok := fqdn.Asset.(*oamdns.FQDN)
51-
if (!ok || n == nil) {
51+
if !ok || n == nil {
5252
return txtRecords
5353
}
5454

@@ -81,13 +81,16 @@ func (d *dnsTXT) store(e *et.Event, fqdn *dbt.Entity, rr []*resolve.ExtractedAns
8181
continue
8282
}
8383

84+
txtValue := record.Data
8485

85-
_, _ = e.Session.Cache().CreateEntityProperty(fqdn, &oamdns.BasicDNSRelation{
86-
Name: "TXT",
87-
Header: oamdns.RRHeader{
88-
RRType: int(record.Type),
89-
Class: 1,
86+
_, _ = session.Cache().CreateEntityProperty(fqdn, &oamdns.DNSRecordProperty{
87+
PropertyName: "dns_record",
88+
Header: oamdns.RRHeader{ // these fields come from the DNS record
89+
RRType: 16,
90+
Class: 1,
91+
TTL: 300,
9092
},
93+
Data: txtValue,
9194
})
9295
}
9396
}

0 commit comments

Comments
 (0)