示例#1
0
文件: parsers.py 项目: AInquel/crits
    def parse_threat_actors(self, threat_actors):
        """
        Parse list of Threat Actors.

        :param threat_actors: List of STIX ThreatActors.
        :type threat_actors: List of STIX ThreatActors.
        """
        for threat_actor in threat_actors: # for each STIX ThreatActor
            try: # create CRITs Actor from ThreatActor
                obj = Actor.from_stix(threat_actor)
                obj.add_source(self.source)
                obj.save(username=self.source_instance.analyst)
                self.imported.append((Actor._meta['crits_type'], obj))
            except Exception, e:
                self.failed.append((e.message, type(threat_actor).__name__,
                                    "")) # note for display in UI