Exemplo n.º 1
0
    def process_raw(self,
                    ctx,
                    evidence_uuid,
                    pipeline,
                    data,
                    raw,
                    return_result=False,
                    autosave=True):
        pipeline = self._get_pipeline(pipeline)
        if not pipeline:
            return

        # StringIO for raw data
        stream = StringIO.StringIO(snappy.uncompress(base64.b64decode(raw)))

        # Perform the actual processing
        bundle = Bundle(self.server, evidence_uuid, pipeline, data, stream)
        try:
            bundle = pipeline.process(bundle)
        except Exception as e:
            bundle.add_exception(e, traceback=''.join(traceback.format_exc()))

        data = bundle.data
        if autosave:
            data = self._save_result(evidence_uuid, data, wait=return_result)

        if return_result:
            return data
Exemplo n.º 2
0
    def process_url(self,
                    ctx,
                    evidence_uuid,
                    pipeline,
                    data,
                    url,
                    return_result=False,
                    autosave=True):
        pipeline = self._get_pipeline(pipeline)
        if not pipeline:
            return

        # TODO: Load Stream from the url
        stream = None

        # Perform the actual processing
        bundle = Bundle(self.server, evidence_uuid, pipeline, data, stream)
        try:
            bundle = pipeline.process(bundle)
        except Exception as e:
            bundle.add_exception(e, traceback=''.join(traceback.format_exc()))

        data = bundle.data
        if autosave:
            data = self._save_result(evidence_uuid, data, wait=return_result)

        if return_result:
            return data
Exemplo n.º 3
0
    def process_raw(self, ctx, evidence_uuid, pipeline, data, raw, return_result=False, autosave=True):
        pipeline = self._get_pipeline(pipeline)
        if not pipeline:
            return

        # StringIO for raw data
        stream = StringIO.StringIO(snappy.uncompress(base64.b64decode(raw)))

        # Perform the actual processing
        bundle = Bundle(self.server, evidence_uuid, pipeline, data, stream)
        try:
            bundle = pipeline.process(bundle)
        except Exception as e:
            bundle.add_exception(e, traceback=''.join(traceback.format_exc()))

        data = bundle.data
        if autosave:
            data = self._save_result(evidence_uuid, data, wait=return_result)

        if return_result:
            return data
Exemplo n.º 4
0
    def process_url(self, ctx, evidence_uuid, pipeline, data, url, return_result=False, autosave=True):
        pipeline = self._get_pipeline(pipeline)
        if not pipeline:
            return

        # TODO: Load Stream from the url
        stream = None

        # Perform the actual processing
        bundle = Bundle(self.server, evidence_uuid, pipeline, data, stream)
        try:
            bundle = pipeline.process(bundle)
        except Exception as e:
            bundle.add_exception(e, traceback=''.join(traceback.format_exc()))

        data = bundle.data
        if autosave:
            data = self._save_result(evidence_uuid, data, wait=return_result)

        if return_result:
            return data