Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit f8eafca

Browse files
authored
Update and rename add_tag_to_malware.py to add_label_to_malware.py (#142)
1 parent 1167aa0 commit f8eafca

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
)
1616

1717
# Create the tag (if not exists)
18-
tag = opencti_api_client.label.create(
19-
tag_type="Malware-Type",
20-
value="Ranswomware",
18+
label = opencti_api_client.label.create(
19+
value="Ransomware",
2120
color="#ffa500",
2221
)
2322

2423
# Add the tag
25-
opencti_api_client.stix_domain_object.add_label(id=malware["id"], tag_id=tag["id"])
24+
opencti_api_client.stix_domain_object.add_label(id=malware["id"], label_id=label["id"])
2625

2726
# Print
2827
malware = opencti_api_client.malware.read(id=malware["id"])

0 commit comments

Comments
 (0)