Thanks to visit codestin.com
Credit goes to github.com

Skip to content

KeyError: 'created_by_ref' #4

Description

@Cyb3rWard0g
from attackcti import attack_client
from pandas import *
from pandas.io.json import json_normalize

lift = attack_client()
lift.get_all_techniques()
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-6-ef2a7b4f74a0> in <module>()
----> 1 lift.get_all_techniques()

/usr/local/lib/python3.6/site-packages/attackcti/attack_api.py in get_all_techniques(self)
    233         enterprise_techniques = self.get_all_enterprise_techniques()
    234         pre_techniques = self.get_all_pre_techniques()
--> 235         mobile_techniques = self.get_all_mobile_techniques()
    236         all_techniques = enterprise_techniques + pre_techniques + mobile_techniques
    237         return all_techniques

/usr/local/lib/python3.6/site-packages/attackcti/attack_api.py in get_all_mobile_techniques(self)
    389     def get_all_mobile_techniques(self):
    390         mobile_techniques = self.TC_MOBILE_SOURCE.query(Filter("type", "=", "attack-pattern"))
--> 391         mobile_techniques = self.parse_stix_objects(mobile_techniques, 'techniques')
    392         return mobile_techniques
    393 

/usr/local/lib/python3.6/site-packages/attackcti/attack_api.py in parse_stix_objects(self, stix_objects, stix_object_type)
     32                     'type': technique['type'],
     33                     'id': technique['id'],
---> 34                     'created_by_ref': technique['created_by_ref'],
     35                     'created': str(technique['created']),
     36                     'modified': str(technique['modified']),

~/Library/Python/3.6/lib/python/site-packages/stix2/base.py in __getitem__(self, key)
    176 
    177     def __getitem__(self, key):
--> 178         return self._inner[key]
    179 
    180     def __iter__(self):

KeyError: 'created_by_ref'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions