Exemple #1
0
    def get_cuckoo_report(self, sample):
        """ Get the samples cuckoo_report or submit the sample for analysis by
            Cuckoo.

            @returns: CuckooReport
        """
        report = sample.cuckoo_report
        if report is not None:
            return report

        try:
            job_id = sample.submit_to_cuckoo()
        except CuckooSubmitFailedException as failed:
            logger.error("Submit to Cuckoo failed: %s", failed)
            # exception message intentionally not present in message
            # delivered back to client as to not disclose internal
            # information, should request user to contact admin instead
            return self.result(
                Result.failed,
                _("Behavioral analysis by Cuckoo has produced an error "
                  "and did not finish successfully"), False)

        logger.info('Sample submitted to Cuckoo. Job ID: %s. '
                    'Sample: %s', job_id, sample)
        raise PeekabooAnalysisDeferred()
Exemple #2
0
    def get_cuckoo_report(self, sample):
        """ Get the samples cuckoo_report or submit the sample for analysis by
            Cuckoo.

            @returns: CuckooReport
        """
        if sample.cuckoo_failed:
            return None

        report = sample.cuckoo_report
        if report is not None:
            return report

        try:
            job_id = sample.submit_to_cuckoo()
        except CuckooSubmitFailedException as failed:
            logger.error("Submit to Cuckoo failed: %s", failed)
            return None

        logger.info('Sample submitted to Cuckoo. Job ID: %s. '
                    'Sample: %s', job_id, sample)
        raise PeekabooAnalysisDeferred()
Exemple #3
0
    async def submit_to_cortex(self, sample, analyzer):
        """ Submit the sample to an actual Cortex analyzer to augment the
        report.

        @param sample: The sample to submit to Cortex.
        @type sample: Sample
        @param analyzer: The Cortex analyzer to submit to.
        @type analyzer: subclass of CortexAnalyzer
        @returns: None if submit failed
        @raises PeekabooAnalysisDeferred: if successfully submitted to abort
                                          ruleset run until result has been
                                          retrieved.
        """
        logger.debug("%d: Submitting to Cortex", sample.id)
        try:
            job_id = await self.cortex.submit(sample, analyzer)
        except CortexSubmitFailedException as failed:
            logger.error("%d: Submit to Cortex failed: %s", sample.id, failed)
            return None

        logger.info("%d: Sample submitted to Cortex. Job ID: %s", sample.id,
                    job_id)
        raise PeekabooAnalysisDeferred()
Exemple #4
0
    async def get_cuckoo_report(self, sample):
        """ Get the samples cuckoo_report or submit the sample for analysis by
            Cuckoo.

            @returns: CuckooReport
        """
        if sample.cuckoo_failed:
            return None

        report = sample.cuckoo_report
        if report is not None:
            return report

        logger.debug("%d: Submitting to Cuckoo", sample.id)
        try:
            job_id = await self.cuckoo.submit(sample)
        except CuckooSubmitFailedException as failed:
            logger.error("%d: Submit to Cuckoo failed: %s", sample.id, failed)
            return None

        logger.info("%d: Sample submitted to Cuckoo. Job ID: %s", sample.id,
                    job_id)
        raise PeekabooAnalysisDeferred()