Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'created_by_ref' #4

Closed
Cyb3rWard0g opened this issue Oct 23, 2018 · 0 comments
Closed

KeyError: 'created_by_ref' #4

Cyb3rWard0g opened this issue Oct 23, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@Cyb3rWard0g
Copy link
Collaborator

Cyb3rWard0g commented Oct 23, 2018

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'
Cyb3rWard0g added a commit that referenced this issue Oct 27, 2018
@Cyb3rWard0g Cyb3rWard0g added the bug Something isn't working label Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant