{"record":{"id":"da14061fa61dabcb","repo":"owasp-amass/amass","slug":"asset-type-not-supported-s","errorCode":null,"errorMessage":"asset type not supported: %s","messagePattern":"asset type not supported: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"engine/plugins/horizontals/reg_records.go","lineNumber":42,"sourceCode":"\nfunc (h *horRegRec) check(e *et.Event) error {\n\tvar rlabel string\n\tt := e.Entity.Asset.AssetType()\n\n\t// check if scope expansion is allowed\n\tif e.Session.Config().Rigid {\n\t\treturn nil\n\t}\n\n\tswitch t {\n\tcase oam.AutnumRecord:\n\t\trlabel = \"registrant\"\n\tcase oam.DomainRecord:\n\t\trlabel = \"registrant_contact\"\n\tcase oam.IPNetRecord:\n\t\trlabel = \"registrant\"\n\tdefault:\n\t\treturn fmt.Errorf(\"asset type not supported: %s\", t)\n\t}\n\n\tcr, err := h.plugin.getContactRecord(e.Session, e.Entity, rlabel)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\torgs, locs := h.plugin.lookupContactRecordOrgsAndLocations(e.Session, cr)\n\tif len(orgs) == 0 && len(locs) == 0 {\n\t\treturn nil\n\t}\n\n\tswitch t {\n\tcase oam.AutnumRecord:\n\t\th.processAutnumRecord(e, orgs, locs)\n\tcase oam.DomainRecord:\n\t\th.processDomainRecord(e, orgs, locs)\n\tcase oam.IPNetRecord:","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/horizontals/reg_records.go#L24-L60","documentation":"The registration-records check in the horizontals plugin switches on the asset's OAM record type to pick a relation label (registrant / registrant_contact). If the entity's asset type is none of the supported kinds, it returns this error naming the unsupported type. It is an explicit guard that unsupported assets do not enter the registration-record pipeline.","triggerScenarios":"check() is invoked with an entity whose Asset concrete type is not oam.IdentifierRecord, oam.DomainRecord, or oam.IPNetRecord (e.g., oam.FQDN, oam.IPAddress, or another record type), hitting the default branch with the type name in %s.","commonSituations":"Event subscriptions wired too broadly so non-registration assets reach check(); a plugin refactor introduces a new OAM record type not yet handled; tests feeding synthetic entities of the wrong asset type; misconfigured scope pushing arbitrary assets into the handler.","solutions":["Filter events/assets upstream so only registration-record assets (Identifier/Domain/IPNet records) reach check().","Add a case for the new asset type in the switch if it should be supported (with an appropriate rlabel).","Log the unsupported type and return nil instead of an error if unsupported assets are expected and harmless.","Check the emitting plugin to see why it is delivering the wrong asset type to this handler."],"exampleFix":"// before\ndefault:\n\treturn fmt.Errorf(\"asset type not supported: %s\", t)\n// after\ndefault:\n\treturn fmt.Errorf(\"reg_records: asset type not supported: %s\", t) // and filter the subscription upstream so only registration records arrive\n","handlingStrategy":"type-guard","validationCode":"switch e.Entity.Asset.(type) {\ncase oam.IdentifierRecord, oam.DomainRecord, oam.IPNetRecord:\n\t// supported\ndefault:\n\t// skip before calling check()\n}","typeGuard":"func isRegistrationRecord(a oam.Asset) bool {\n\tswitch a.(type) {\n\tcase oam.IdentifierRecord, oam.DomainRecord, oam.IPNetRecord:\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":"if err := check(e); err != nil {\n\tif strings.Contains(err.Error(), \"asset type not supported\") {\n\t\t// expected for non-registration assets: skip\n\t\treturn nil\n\t}\n}","preventionTips":["Subscribe only to registration-record event types","Add cases for new OAM record types when introduced","Assert asset type before entering record processing","Log skipped asset types at debug level for visibility"],"tags":["go","type-safety","assets","plugin"],"backgroundTag":"unsupported-operation","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}