MCPcopy
hub / github.com/owasp-amass/amass / submitIPAddress

Method submitIPAddress

engine/plugins/horizontals/plugin.go:190–214  ·  view source on GitHub ↗
(e *et.Event, asset *oamnet.IPAddress, src *et.Source)

Source from the content-addressed store, hash-verified

188}
189
190func (h *horizPlugin) submitIPAddress(e *et.Event, asset *oamnet.IPAddress, src *et.Source) {
191 ctx, cancel := context.WithTimeout(e.Session.Ctx(), 30*time.Second)
192 defer cancel()
193
194 // ensure we do not work on an IP address that was processed previously
195 _, err := e.Session.DB().FindEntitiesByContent(ctx, oam.IPAddress, e.Session.StartTime(), 1, dbt.ContentFilters{
196 "address": asset.Address.String(),
197 })
198 if err == nil {
199 return
200 }
201
202 addr, err := e.Session.DB().CreateAsset(ctx, asset)
203 if err == nil && addr != nil {
204 _, _ = e.Session.DB().CreateEntityProperty(ctx, addr, &oamgen.SourceProperty{
205 Source: src.Name,
206 Confidence: src.Confidence,
207 })
208 _ = e.Dispatcher.DispatchEvent(&et.Event{
209 Name: addr.Asset.Key(),
210 Entity: addr,
211 Session: e.Session,
212 })
213 }
214}
215
216func (h *horizPlugin) getContactRecord(sess et.Session, ent *dbt.Entity, label string) (*dbt.Entity, error) {
217 since, err := support.TTLStartTime(sess.Config(),

Callers

nothing calls this directly

Calls 6

CreateAssetMethod · 0.80
CtxMethod · 0.65
DBMethod · 0.65
StartTimeMethod · 0.65
DispatchEventMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected