fix(misp): guard attribute label creation with convert_tag_to_label check (#6891)#6892
Merged
Conversation
|
The following packages appear to be unused:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a configuration mismatch in the MISP connector by ensuring attribute-level MISP tag → OpenCTI label creation respects the existing convert_tag_to_label (aka MISP_CREATE_TAGS_AS_LABELS) flag, aligning attribute handling with event-level behavior.
Changes:
- Wrap attribute-level
tag_converter.create_label(tag)usage behindif self.config.convert_tag_to_label:. - Prevent unintended label creation from attribute tags when the setting is disabled.
ncarenton
approved these changes
Jul 2, 2026
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
convert_tag_to_labelconfiguration flag inconvert_attribute.py, so labels are only created when the option is explicitly enabled.convert_tag_to_labelis already checked before callingcreate_label.Related issues
convert_tag_to_labelis set to false #6891Checklist
Further comments
Bug: Attribute tags were being converted to labels unconditionally — even when
convert_tag_to_labelwas set tofalsein the connector configuration. This caused unwanted labels to appear on imported STIX objects.Root cause: The
convert_attributeuse-case was missing theself.config.convert_tag_to_labelguard around theself.tag_converter.create_label(tag)call. Other code paths in the connector (e.g. event-level tag processing) already perform this check, so this was simply an oversight in the attribute-level path.Fix: Wrap the
create_labelcall and the subsequentattribute_labels.appendinside anif self.config.convert_tag_to_label:block, making the behaviour consistent across the connector.