pycti 6.6.18__py3-none-any.whl → 6.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pycti might be problematic. Click here for more details.
- pycti/__init__.py +1 -1
- pycti/api/opencti_api_client.py +12 -0
- pycti/api/opencti_api_draft.py +19 -0
- pycti/api/opencti_api_notification.py +39 -0
- pycti/api/opencti_api_pir.py +37 -0
- pycti/api/opencti_api_playbook.py +20 -0
- pycti/api/opencti_api_public_dashboard.py +25 -0
- pycti/api/opencti_api_trash.py +42 -0
- pycti/api/opencti_api_work.py +19 -0
- pycti/api/opencti_api_workspace.py +24 -0
- pycti/entities/opencti_group.py +7 -1
- pycti/entities/opencti_identity.py +59 -0
- pycti/entities/opencti_indicator.py +37 -0
- pycti/entities/opencti_stix.py +4 -3
- pycti/entities/opencti_stix_core_object.py +327 -0
- pycti/entities/opencti_stix_core_relationship.py +83 -0
- pycti/entities/opencti_stix_domain_object.py +80 -0
- pycti/entities/opencti_stix_object_or_stix_relationship.py +40 -0
- pycti/entities/opencti_stix_sighting_relationship.py +81 -0
- pycti/entities/opencti_vulnerability.py +623 -36
- pycti/utils/constants.py +2 -1
- pycti/utils/opencti_stix2.py +194 -11
- pycti/utils/opencti_stix2_splitter.py +6 -3
- pycti/utils/opencti_stix2_utils.py +31 -4
- {pycti-6.6.18.dist-info → pycti-6.7.0.dist-info}/METADATA +1 -1
- {pycti-6.6.18.dist-info → pycti-6.7.0.dist-info}/RECORD +29 -23
- {pycti-6.6.18.dist-info → pycti-6.7.0.dist-info}/WHEEL +0 -0
- {pycti-6.6.18.dist-info → pycti-6.7.0.dist-info}/licenses/LICENSE +0 -0
- {pycti-6.6.18.dist-info → pycti-6.7.0.dist-info}/top_level.txt +0 -0
|
@@ -802,6 +802,87 @@ class StixSightingRelationship:
|
|
|
802
802
|
self.opencti.app_logger.error("Missing parameters: id")
|
|
803
803
|
return False
|
|
804
804
|
|
|
805
|
+
"""
|
|
806
|
+
Share element to multiple organizations
|
|
807
|
+
|
|
808
|
+
:param entity_id: the stix_sighting id
|
|
809
|
+
:param organization_id:s the organization to share with
|
|
810
|
+
:return void
|
|
811
|
+
"""
|
|
812
|
+
|
|
813
|
+
def organization_share(self, entity_id, organization_ids, sharing_direct_container):
|
|
814
|
+
query = """
|
|
815
|
+
mutation StixSightingRelationshipEdit($id: ID!, $organizationId: [ID!]!, $directContainerSharing: Boolean) {
|
|
816
|
+
stixSightingRelationshipEdit(id: $id) {
|
|
817
|
+
restrictionOrganizationAdd(organizationId: $organizationId, directContainerSharing: $directContainerSharing) {
|
|
818
|
+
id
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
"""
|
|
823
|
+
self.opencti.query(
|
|
824
|
+
query,
|
|
825
|
+
{
|
|
826
|
+
"id": entity_id,
|
|
827
|
+
"organizationId": organization_ids,
|
|
828
|
+
"directContainerSharing": sharing_direct_container,
|
|
829
|
+
},
|
|
830
|
+
)
|
|
831
|
+
|
|
832
|
+
"""
|
|
833
|
+
Unshare element from multiple organizations
|
|
834
|
+
|
|
835
|
+
:param entity_id: the stix_sighting id
|
|
836
|
+
:param organization_id:s the organization to share with
|
|
837
|
+
:return void
|
|
838
|
+
"""
|
|
839
|
+
|
|
840
|
+
def organization_unshare(
|
|
841
|
+
self, entity_id, organization_ids, sharing_direct_container
|
|
842
|
+
):
|
|
843
|
+
query = """
|
|
844
|
+
mutation StixSightingRelationshipEdit($id: ID!, $organizationId: [ID!]!, $directContainerSharing: Boolean) {
|
|
845
|
+
stixSightingRelationshipEdit(id: $id) {
|
|
846
|
+
restrictionOrganizationDelete(organizationId: $organizationId, directContainerSharing: $directContainerSharing) {
|
|
847
|
+
id
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
"""
|
|
852
|
+
self.opencti.query(
|
|
853
|
+
query,
|
|
854
|
+
{
|
|
855
|
+
"id": entity_id,
|
|
856
|
+
"organizationId": organization_ids,
|
|
857
|
+
"directContainerSharing": sharing_direct_container,
|
|
858
|
+
},
|
|
859
|
+
)
|
|
860
|
+
|
|
861
|
+
"""
|
|
862
|
+
Remove a stix_sighting object from draft (revert)
|
|
863
|
+
|
|
864
|
+
:param id: the stix_sighting id
|
|
865
|
+
:return void
|
|
866
|
+
"""
|
|
867
|
+
|
|
868
|
+
def remove_from_draft(self, **kwargs):
|
|
869
|
+
id = kwargs.get("id", None)
|
|
870
|
+
if id is not None:
|
|
871
|
+
self.opencti.app_logger.info("Draft remove stix_sighting", {"id": id})
|
|
872
|
+
query = """
|
|
873
|
+
mutation StixSightingRelationshipEditDraftRemove($id: ID!) {
|
|
874
|
+
stixSightingRelationshipEdit(id: $id) {
|
|
875
|
+
removeFromDraft
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
"""
|
|
879
|
+
self.opencti.query(query, {"id": id})
|
|
880
|
+
else:
|
|
881
|
+
self.opencti.app_logger.error(
|
|
882
|
+
"[stix_sighting] Cant remove from draft, missing parameters: id"
|
|
883
|
+
)
|
|
884
|
+
return None
|
|
885
|
+
|
|
805
886
|
"""
|
|
806
887
|
Delete a stix_sighting
|
|
807
888
|
|