Skip to content

Commit

Permalink
[client] Adapt from new API
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-julien committed Jul 5, 2023
1 parent 1444c48 commit 236fcb8
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion pycti/entities/opencti_case_incident.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_case_rfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_case_rft.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_observed_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_opinion.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_stix_core_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def __init__(self, opencti, file):
result_name
result
}
... on ThreatActorGroup {
... on ThreatActor {
name
description
aliases
Expand Down
4 changes: 2 additions & 2 deletions pycti/entities/opencti_stix_core_relationship.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down Expand Up @@ -287,7 +287,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_stix_domain_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def __init__(self, opencti, file):
result_name
result
}
... on ThreatActorGroup {
... on ThreatActor {
name
description
aliases
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_stix_object_or_stix_relationship.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def __init__(self, opencti):
}
}
}
... on ThreatActorGroup {
... on ThreatActor {
name
description
aliases
Expand Down
4 changes: 2 additions & 2 deletions pycti/entities/opencti_stix_sighting_relationship.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down Expand Up @@ -246,7 +246,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 1 addition & 1 deletion pycti/entities/opencti_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(self, opencti):
... on Malware {
name
}
... on ThreatActorGroup {
... on ThreatActor {
name
}
... on Tool {
Expand Down
2 changes: 0 additions & 2 deletions pycti/entities/opencti_threat_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def __init__(self, opencti):
resource_level
primary_motivation
secondary_motivations
personal_motivations
importFiles {
edges {
node {
Expand Down Expand Up @@ -301,7 +300,6 @@ def create(self, **kwargs):
:param str resource_level: (optional) describe the actors resource_level in text
:param str primary_motivation: (optional) describe the actors primary_motivation in text
:param list secondary_motivations: (optional) describe the actors secondary_motivations in list of string
:param list personal_motivations: (optional) describe the actors personal_motivations in list of strings
:param bool update: (optional) choose to updated an existing Threat-Actor entity, default `False`
"""
return self.threat_actor_group.create(**kwargs)
Expand Down
7 changes: 0 additions & 7 deletions pycti/entities/opencti_threat_actor_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def __init__(self, opencti):
resource_level
primary_motivation
secondary_motivations
personal_motivations
importFiles {
edges {
node {
Expand Down Expand Up @@ -303,7 +302,6 @@ def create(self, **kwargs):
:param str resource_level: (optional) describe the actors resource_level in text
:param str primary_motivation: (optional) describe the actors primary_motivation in text
:param list secondary_motivations: (optional) describe the actors secondary_motivations in list of string
:param list personal_motivations: (optional) describe the actors personal_motivations in list of strings
:param bool update: (optional) choose to updated an existing Threat-Actor-Group entity, default `False`
"""

Expand All @@ -328,7 +326,6 @@ def create(self, **kwargs):
resource_level = kwargs.get("resource_level", None)
primary_motivation = kwargs.get("primary_motivation", None)
secondary_motivations = kwargs.get("secondary_motivations", None)
personal_motivations = kwargs.get("personal_motivations", None)
x_opencti_stix_ids = kwargs.get("x_opencti_stix_ids", None)
granted_refs = kwargs.get("objectOrganization", None)
update = kwargs.get("update", False)
Expand Down Expand Up @@ -371,7 +368,6 @@ def create(self, **kwargs):
"resource_level": resource_level,
"primary_motivation": primary_motivation,
"secondary_motivations": secondary_motivations,
"personal_motivations": personal_motivations,
"x_opencti_stix_ids": x_opencti_stix_ids,
"update": update,
}
Expand Down Expand Up @@ -457,9 +453,6 @@ def import_from_stix2(self, **kwargs):
secondary_motivations=stix_object["secondary_motivations"]
if "secondary_motivations" in stix_object
else None,
personal_motivations=stix_object["personal_motivations"]
if "personal_motivations" in stix_object
else None,
x_opencti_stix_ids=stix_object["x_opencti_stix_ids"]
if "x_opencti_stix_ids" in stix_object
else None,
Expand Down
1 change: 0 additions & 1 deletion pycti/utils/opencti_stix2.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,6 @@ def import_object(
"malware": self.opencti.malware.import_from_stix2,
"malware-analysis": self.opencti.malware_analysis.import_from_stix2,
"threat-actor": self.opencti.threat_actor.import_from_stix2,
"threat-actor-group": self.opencti.threat_actor_group.import_from_stix2,
"tool": self.opencti.tool.import_from_stix2,
"narrative": self.opencti.narrative.import_from_stix2,
"vulnerability": self.opencti.vulnerability.import_from_stix2,
Expand Down

0 comments on commit 236fcb8

Please sign in to comment.