owasp-amass/amass · error

failed to extract the AutonomousSystem asset

Error message

failed to extract the AutonomousSystem asset

What it means

Thrown by the ipverse scrape plugin's check method when the event's Entity.Asset cannot be asserted to *oamnet.AutonomousSystem. The plugin only handles ASN assets and pre-loads ASNs; events carrying other asset types fail this assertion. It indicates the plugin received an asset type it was not designed to process.

Source

Thrown at engine/plugins/scrape/ipverse.go:79

		Transforms:   []string{string(oam.Netblock)},
		EventType:    oam.AutonomousSystem,
		Callback:     v.check,
	}); err != nil {
		return err
	}

	v.log.Info("Plugin started")
	return nil
}

func (v *ipverse) Stop() {
	v.log.Info("Plugin stopped")
}

func (v *ipverse) check(e *et.Event) error {
	as, ok := e.Entity.Asset.(*oamnet.AutonomousSystem)
	if !ok {
		return errors.New("failed to extract the AutonomousSystem asset")
	}

	if _, found := v.asns[as.Number]; found {
		return nil
	}

	rec := v.query(e.Session, e.Entity)
	if rec == nil {
		return nil
	}
	v.asns[as.Number] = struct{}{}

	for _, cidr := range append(rec.CIDRs.IPv4, rec.CIDRs.IPv6...) {
		_ = support.AddNetblock(e.Session, cidr, as.Number, v.source)
	}
	return nil
}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Verify the upstream plugin emits AutonomousSystem assets before ipverse runs
  2. Check the ASN is being produced (e.g. by a reverse-whois/ASN plugin) before ipverse checks its cache
  3. Restrict the events routed to ipverse to ASN-related asset types
  4. Return nil for non-ASN assets if the plugin should skip them silently

Example fix

// before
as, ok := e.Entity.Asset.(*oamnet.AutonomousSystem)
if !ok {
	return errors.New("failed to extract the AutonomousSystem asset")
}
// after
as, ok := e.Entity.Asset.(*oamnet.AutonomousSystem)
if !ok {
	return nil // skip non-ASN assets
}
Defensive patterns

Strategy: type-guard

Validate before calling

if as, ok := e.Entity.Asset.(*oamnet.AutonomousSystem); !ok {
	return nil // not an ASN; skip
}

Type guard

func isAutonomousSystem(e *et.Event) (*oamnet.AutonomousSystem, bool) {
	as, ok := e.Entity.Asset.(*oamnet.AutonomousSystem)
	return as, ok
}

Try / catch

if err := plugin.Check(e); err != nil {
	if strings.Contains(err.Error(), "failed to extract the AutonomousSystem asset") {
		continue // skip non-ASN events
	}
	return err
}

Prevention

When it happens

Trigger: An event with an asset other than *oamnet.AutonomousSystem (e.g. FQDN, IPAddress) is passed to ipverse.check, so the type assertion as, ok := e.Entity.Asset.(*oamnet.AutonomousSystem) fails.

Common situations: Custom pipelines sending IP/FQDN events to the ipverse plugin; broad event subscriptions; chaining plugins whose output asset types do not match ipverse's expected ASN input.

Understand the failure class

Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.

Related errors


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/873beeb6a88446b0. Report an issue: GitHub.