pycti.entities.opencti_case_incident

Classes

CaseIncident

Main CaseIncident class for OpenCTI

Module Contents

class pycti.entities.opencti_case_incident.CaseIncident(opencti)[source]

Main CaseIncident class for OpenCTI

Manages incident response cases in the OpenCTI platform.

Parameters:

opencti (OpenCTIApiClient) – instance of OpenCTIApiClient

Initialize the CaseIncident instance.

Parameters:

opencti (OpenCTIApiClient) – OpenCTI API client instance

opencti[source]
properties = Multiline-String[source]
Show Value
"""
            id
            standard_id
            entity_type
            parent_types
            spec_version
            created_at
            updated_at
            status {
                id
                template {
                  id
                  name
                  color
                }
            }
            createdBy {
                ... on Identity {
                    id
                    standard_id
                    entity_type
                    parent_types
                    spec_version
                    identity_class
                    name
                    description
                    roles
                    contact_information
                    x_opencti_aliases
                    created
                    modified
                    objectLabel {
                        id
                        value
                        color
                    }
                }
                ... on Organization {
                    x_opencti_organization_type
                    x_opencti_reliability
                }
                ... on Individual {
                    x_opencti_firstname
                    x_opencti_lastname
                }
            }
            objectOrganization {
                id
                standard_id
                name
            }
            objectMarking {
                id
                standard_id
                entity_type
                definition_type
                definition
                created
                modified
                x_opencti_order
                x_opencti_color
            }
            objectLabel {
                id
                value
                color
            }
            externalReferences {
                edges {
                    node {
                        id
                        standard_id
                        entity_type
                        source_name
                        description
                        url
                        hash
                        external_id
                        created
                        modified
                    }
                }
            }
            revoked
            confidence
            created
            modified
            name
            description
            rating
            severity
            priority
            response_types
            tasks {
                edges {
                    node {
                        name
                        description
                        due_date
                        status {
                          id
                          template {
                            id
                            name
                            color
                          }
                        }
                    }
                }
            }
            objects(all: true) {
                edges {
                    node {
                        ... on BasicObject {
                            id
                            entity_type
                            parent_types
                        }
                        ... on BasicRelationship {
                            id
                            entity_type
                            parent_types
                        }
                        ... on StixObject {
                            standard_id
                            spec_version
                            created_at
                            updated_at
                        }
                        ... on AttackPattern {
                            name
                        }
                        ... on Campaign {
                            name
                        }
                        ... on CourseOfAction {
                            name
                        }
                        ... on Individual {
                            name
                        }
                        ... on Organization {
                            name
                        }
                        ... on Sector {
                            name
                        }
                        ... on System {
                            name
                        }
                        ... on Indicator {
                            name
                        }
                        ... on Infrastructure {
                            name
                        }
                        ... on IntrusionSet {
                            name
                        }
                        ... on Position {
                            name
                        }
                        ... on City {
                            name
                        }
                        ... on Country {
                            name
                        }
                        ... on Region {
                            name
                        }
                        ... on Malware {
                            name
                        }
                        ... on ThreatActor {
                            name
                        }
                        ... on Tool {
                            name
                        }
                        ... on Vulnerability {
                            name
                        }
                        ... on Incident {
                            name
                        }
                        ... on Event {
                            name
                        }
                        ... on Channel {
                            name
                        }
                        ... on Narrative {
                            name
                        }
                        ... on Language {
                            name
                        }
                        ... on DataComponent {
                            name
                        }
                        ... on DataSource {
                            name
                        }
                        ... on StixCyberObservable {
                            observable_value
                        }
                        ... on StixCoreRelationship {
                            standard_id
                            spec_version
                            created_at
                            updated_at
                            relationship_type
                        }
                       ... on StixSightingRelationship {
                            standard_id
                            spec_version
                            created_at
                            updated_at
                        }
                    }
                }
            }
        """
properties_with_files = Multiline-String[source]
Show Value
"""
            id
            standard_id
            entity_type
            parent_types
            spec_version
            created_at
            updated_at
            status {
                id
                template {
                  id
                  name
                  color
                }
            }
            createdBy {
                ... on Identity {
                    id
                    standard_id
                    entity_type
                    parent_types
                    spec_version
                    identity_class
                    name
                    description
                    roles
                    contact_information
                    x_opencti_aliases
                    created
                    modified
                    objectLabel {
                        id
                        value
                        color
                    }
                }
                ... on Organization {
                    x_opencti_organization_type
                    x_opencti_reliability
                }
                ... on Individual {
                    x_opencti_firstname
                    x_opencti_lastname
                }
            }
            objectOrganization {
                id
                standard_id
                name
            }
            objectMarking {
                id
                standard_id
                entity_type
                definition_type
                definition
                created
                modified
                x_opencti_order
                x_opencti_color
            }
            objectLabel {
                id
                value
                color
            }
            externalReferences {
                edges {
                    node {
                        id
                        standard_id
                        entity_type
                        source_name
                        description
                        url
                        hash
                        external_id
                        created
                        modified
                        importFiles {
                            edges {
                                node {
                                    id
                                    name
                                    size
                                    metaData {
                                        mimetype
                                        version
                                    }
                                }
                            }
                        }
                    }
                }
            }
            revoked
            confidence
            created
            modified
            name
            description
            rating
            severity
            priority
            response_types
            objects(all: true) {
                edges {
                    node {
                        ... on BasicObject {
                            id
                            entity_type
                            parent_types
                        }
                        ... on BasicRelationship {
                            id
                            entity_type
                            parent_types
                        }
                        ... on StixObject {
                            standard_id
                            spec_version
                            created_at
                            updated_at
                        }
                        ... on AttackPattern {
                            name
                        }
                        ... on Campaign {
                            name
                        }
                        ... on CourseOfAction {
                            name
                        }
                        ... on Individual {
                            name
                        }
                        ... on Organization {
                            name
                        }
                        ... on Sector {
                            name
                        }
                        ... on System {
                            name
                        }
                        ... on Indicator {
                            name
                        }
                        ... on Infrastructure {
                            name
                        }
                        ... on IntrusionSet {
                            name
                        }
                        ... on Position {
                            name
                        }
                        ... on City {
                            name
                        }
                        ... on Country {
                            name
                        }
                        ... on Region {
                            name
                        }
                        ... on Malware {
                            name
                        }
                        ... on ThreatActor {
                            name
                        }
                        ... on Tool {
                            name
                        }
                        ... on Vulnerability {
                            name
                        }
                        ... on Incident {
                            name
                        }
                        ... on Event {
                            name
                        }
                        ... on Channel {
                            name
                        }
                        ... on Narrative {
                            name
                        }
                        ... on Language {
                            name
                        }
                        ... on DataComponent {
                            name
                        }
                        ... on DataSource {
                            name
                        }
                        ... on StixCyberObservable {
                            observable_value
                        }
                        ... on StixCoreRelationship {
                            standard_id
                            spec_version
                            created_at
                            updated_at
                            relationship_type
                        }
                       ... on StixSightingRelationship {
                            standard_id
                            spec_version
                            created_at
                            updated_at
                        }
                    }
                }
            }
            importFiles {
                edges {
                    node {
                        id
                        name
                        size
                        metaData {
                            mimetype
                            version
                        }
                        objectMarking {
                            id
                            standard_id
                            entity_type
                            definition_type
                            definition
                            created
                            modified
                            x_opencti_order
                            x_opencti_color
                        }
                    }
                }
            }
        """
static generate_id(name, created)[source]

Generate a STIX ID for a Case Incident object.

Parameters:
  • name (str) – the name of the Case Incident

  • created (str or datetime.datetime) – the creation date of the Case Incident

Returns:

STIX ID for the Case Incident

Return type:

str

static generate_id_from_data(data)[source]

Generate a STIX ID from Case Incident data.

Parameters:

data (dict) – Dictionary containing ‘name’ and ‘created’ keys

Returns:

STIX ID for the Case Incident

Return type:

str

list(**kwargs)[source]

List Case Incident objects.

Parameters:
  • filters (dict) – the filters to apply

  • search (str) – the search keyword

  • first (int) – return the first n rows from the after ID (or the beginning if not set)

  • after (str) – ID of the first row for pagination

Returns:

List of Case Incident objects

Return type:

list

read(**kwargs)[source]

Read a Case Incident object.

Parameters:
  • id (str) – the id of the Case Incident

  • filters (dict) – the filters to apply if no id provided

Returns:

Case Incident object

Return type:

dict or None

get_by_stix_id_or_name(**kwargs)[source]

Read a Case Incident object by stix_id or name.

Parameters:
  • stix_id (str) – the STIX ID of the Case Incident

  • name (str) – the name of the Case Incident

  • created (str) – the creation date of the Case Incident

Returns:

Case Incident object

Return type:

dict or None

contains_stix_object_or_stix_relationship(**kwargs)[source]

Check if a case incident already contains a thing (Stix Object or Stix Relationship).

Parameters:
  • id (str) – the id of the Case Incident

  • stixObjectOrStixRelationshipId (str) – the id of the Stix-Entity

Returns:

True if contained, False otherwise

Return type:

bool or None

create(**kwargs)[source]

Create a Case Incident object

Parameters:
  • stix_id – (optional) the STIX ID

  • createdBy – (optional) the author ID

  • objects – (optional) list of STIX object IDs contained in the case

  • objectMarking – (optional) list of marking definition IDs

  • objectLabel – (optional) list of label IDs

  • externalReferences – (optional) list of external reference IDs

  • revoked – (optional) whether the case is revoked

  • confidence – (optional) confidence level (0-100)

  • lang – (optional) language

  • created – (optional) creation date

  • modified – (optional) modification date

  • name – the name of the Case Incident (required)

  • description – (optional) description

  • content – (optional) content

  • severity – (optional) severity level

  • priority – (optional) priority level

  • x_opencti_stix_ids – (optional) list of additional STIX IDs

  • objectAssignee – (optional) list of assignee IDs

  • objectParticipant – (optional) list of participant IDs

  • objectOrganization – (optional) list of organization IDs

  • response_types – (optional) list of response types

  • x_opencti_workflow_id – (optional) workflow ID

  • x_opencti_modified_at – (optional) custom modification date

  • update (bool) – (optional) whether to update if exists (default: False)

  • files (list) – (optional) list of File objects to attach

  • filesMarkings (list) – (optional) list of lists of marking definition IDs for each file

Returns:

Case Incident object

Return type:

dict or None

add_stix_object_or_stix_relationship(**kwargs)[source]

Add a Stix-Entity object to Case Incident object (object_refs).

Parameters:
  • id (str) – the id of the Case Incident

  • stixObjectOrStixRelationshipId (str) – the id of the Stix-Entity

Returns:

True if successful, False otherwise

Return type:

bool

remove_stix_object_or_stix_relationship(**kwargs)[source]

Remove a Stix-Entity object from Case Incident object (object_refs).

Parameters:
  • id (str) – the id of the Case Incident

  • stixObjectOrStixRelationshipId (str) – the id of the Stix-Entity

Returns:

True if successful, False otherwise

Return type:

bool

import_from_stix2(**kwargs)[source]

Import a Case Incident object from a STIX2 object.

Parameters:
  • stixObject (dict) – the Stix-Object Case Incident

  • extras (dict) – additional parameters like created_by_id, object_marking_ids

  • update (bool) – whether to update existing object

Returns:

Case Incident object

Return type:

dict or None

delete(**kwargs)[source]

Delete a Case Incident object.

Parameters:

id (str) – the id of the Case Incident to delete

Returns:

None