opencti icon indicating copy to clipboard operation
opencti copied to clipboard

Creating a relationship with a set label doesn't work

Open yassine-ouaamou opened this issue 1 year ago • 0 comments

Description

When creating a new relationship with a new label, the label is created but not set. If we run the script a second time, then it's set.

Environment

Testing

Reproducible Steps

relationship = stix2.Relationship(
    source_ref="campaign--a872c9d5-8f10-5099-b639-d11529567bde", 
    target_ref="location--11e2ee06-8112-54b5-b210-33603d2473f7", 
    relationship_type="targets", 
    labels=["my_label"]
)

When creating an indicator for example, it works perfectly:

indicator = stix2.Indicator(
    name="cardioschool34.com",
    description="Malicious SSL connections",
    pattern_type="stix",
    pattern="[domain-name:value = 'cardioschool34.com']",
    labels=["my_other_label"],
)

Expected Output

Relationship with a label

Actual Output

No label set on the relationship

Additional information

Seen with @SouadHadjiat

yassine-ouaamou avatar May 30 '24 16:05 yassine-ouaamou