feat(malwarebazaar): add external references and link indicators to malware family (#6940, #2044) - #7023
Open
romain-filigran wants to merge 5 commits into
Open
feat(malwarebazaar): add external references and link indicators to malware family (#6940, #2044)#7023romain-filigran wants to merge 5 commits into
romain-filigran wants to merge 5 commits into
Conversation
|
🔴 Connector Linter errors detected
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the external-import/malwarebazaar connector by enriching generated STIX objects with (1) MalwareBazaar sample-page external references and (2) optional Malware family creation from the signature field, linked from Indicators via an indicates relationship.
Changes:
- Add a MalwareBazaar sample-page
ExternalReferenceto each generated Indicator and File observable. - Create a Malware SDO when
signatureis present and link Indicator → Malware with anindicatesrelationship. - Update connector collection logic and README behavior documentation to reflect the new objects/relationships.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| external-import/malwarebazaar/src/malwarebazaar_connector/converter_to_stix.py | Adds external-reference creation, malware creation from signature, and an Indicator→Malware indicates relationship. |
| external-import/malwarebazaar/src/malwarebazaar_connector/connector.py | Includes the optional Malware and relationship in the outgoing STIX bundle. |
| external-import/malwarebazaar/README.md | Documents the updated behavior and entity mapping (Indicator + optional Malware). |
Comments suppressed due to low confidence (2)
external-import/malwarebazaar/src/malwarebazaar_connector/converter_to_stix.py:133
object_marking_refsshould be provided as a list. Usingself.tlp_markingdirectly is inconsistent with the rest of the repo and can lead to invalid STIX JSON. Useobject_marking_refs=[self.tlp_marking].
pattern_type="stix",
description=indicator_description,
labels=labels,
created_by_ref=self.author["id"],
object_marking_refs=self.tlp_marking,
external_references=[external_reference],
custom_properties={
external-import/malwarebazaar/src/malwarebazaar_connector/converter_to_stix.py:153
object_marking_refson the new Malware SDO should be a list. Useobject_marking_refs=[self.tlp_marking]to ensure valid STIX output and consistency with other connectors.
malware = stix2.Malware(
id=Malware.generate_id(signature),
name=signature,
is_family=True,
created_by_ref=self.author["id"],
object_marking_refs=self.tlp_marking,
)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR improves the
malwarebazaar(external-import) connector with two related enhancements.1. Add external references to indicators — closes #6940
The connector did not attach any External Reference to the entities it created, so
analysts could not navigate from an OpenCTI entity back to the corresponding
MalwareBazaar sample page.
MalwareBazaarexternal reference pointing tohttps://bazaar.abuse.ch/sample/{sha256}/on each Indicator and File observable.stix2.ExternalReference), not through directOpenCTI API calls, unlike the legacy
malwarebazaar-recent-additionsconnector.2. Create malware from the signature and link it to the indicator — closes #2044
The MalwareBazaar
signaturecolumn (malware family) was not exploited.MalwareSDO from thesignaturefield (deterministic id viaMalware.generate_id,is_family=True) when a signature is present.indicatesrelationship from the Indicator to the Malware.signature == nullcase (frequent) is handled and simply skips malware creation.Related issues
Checklist
Further comments