Ejemplo n.º 1
0
 def test_build_analyzer(self, mock_print: mock.MagicMock):
     """Verify that a valid zipfile is generated for analyzer Lambda function."""
     build._build_analyzer(self._tempdir)
     self._verify_filenames(
         os.path.join(self._tempdir, build.ANALYZE_ZIPFILE + '.zip'),
         {
             'yara_python-3.6.3.egg-info/',
             '__init__.py',
             'analyzer_aws_lib.py',
             'binary_info.py',
             'common.py',
             'compiled_yara_rules.bin',
             'file_hash.py',
             'libpython3.5m.so.1.0',
             'main.py',
             'yara.so',
             'yara_analyzer.py',
             'yara_python-3.6.3.egg-info/dependency_links.txt',
             'yara_python-3.6.3.egg-info/installed-files.txt',
             'yara_python-3.6.3.egg-info/not-zip-safe',
             'yara_python-3.6.3.egg-info/PKG-INFO',
             'yara_python-3.6.3.egg-info/SOURCES.txt',
             'yara_python-3.6.3.egg-info/top_level.txt'
         }
     )
     mock_print.assert_called_once()
Ejemplo n.º 2
0
    def test_build_analyzer(self, mock_print: mock.MagicMock):
        """Verify that a valid zipfile is generated for analyzer Lambda function."""
        build._build_analyzer(self._tempdir)
        self._verify_filenames(
            os.path.join(self._tempdir, build.ANALYZE_ZIPFILE + '.zip'),
            {
                # Python source files
                '__init__.py',
                'analyzer_aws_lib.py',
                'binary_info.py',
                'common.py',
                'file_hash.py',
                'main.py',
                'yara_analyzer.py',

                # Compiled rules file
                'compiled_yara_rules.bin',

                # Natively compiled binaries
                'libarchive.so.13',
                'liblzo2.so.2',
                'libyara.so.3',
                'yara.so',
                'yextend'
            })
        mock_print.assert_called_once()
Ejemplo n.º 3
0
    def test_build_analyzer(self, mock_print: mock.MagicMock):
        """Verify that a valid zipfile is generated for analyzer Lambda function."""
        build._build_analyzer(self._tempdir)
        self._verify_filenames(
            os.path.join(self._tempdir, build.ANALYZE_ZIPFILE + '.zip'),
            {
                # Python source files
                '__init__.py',
                'analyzer_aws_lib.py',
                'binary_info.py',
                'common.py',
                'file_hash.py',
                'main.py',
                'yara_analyzer.py',

                # Compiled rules file
                'compiled_yara_rules.bin',

                # Natively compiled binaries
                'cryptography/',
                'libarchive.so.13',
                'libs/',
                'libs/bayshore_file_type_detect.o',
                'libs/bayshore_file_type_detect.yara',
                'libs/bayshore_yara_wrapper.o',
                'libs/bzl.o',
                'libs/pdf_parser.o',
                'libs/zl.o',
                'libfontconfig.so.1',
                'libfreetype.so.6',
                'libjbig.so.2.0',
                'libjpeg.so.62',
                'liblcms2.so.2',
                'liblzma.so.5',
                'liblzo2.so.2',
                'libopenjpeg.so.2',
                'libpcrecpp.so.0',
                'libpoppler.so.46',
                'libpng12.so.0',
                'libstdc++.so.6',
                'libtiff.so.5',
                'libyara.so.3',
                'libxml2.so.2',
                'pdftotext',
                'upx',
                'yara.so',
                'yextend',

                # Licenses
                'UPX_LICENSE',
                'YARA_LICENSE',
                'YARA_PYTHON_LICENSE',
                'YEXTEND_LICENSE'
            },
            subset=True
        )
        mock_print.assert_called_once()
Ejemplo n.º 4
0
    def test_build_analyzer(self, mock_print: mock.MagicMock):
        """Verify that a valid zipfile is generated for analyzer Lambda function."""
        build._build_analyzer(self._tempdir)
        self._verify_filenames(
            os.path.join(self._tempdir, build.ANALYZE_ZIPFILE + '.zip'),
            {
                # Python source files
                '__init__.py',
                'analyzer_aws_lib.py',
                'binary_info.py',
                'common.py',
                'file_hash.py',
                'main.py',
                'yara_analyzer.py',

                # Compiled rules file
                'compiled_yara_rules.bin',

                # Natively compiled binaries
                'libarchive.so.13',
                'libs/',
                'libs/bayshore_file_type_detect.o',
                'libs/bayshore_file_type_detect.yara',
                'libs/bayshore_yara_wrapper.o',
                'libs/bzl.o',
                'libs/pdf_parser.o',
                'libs/zl.o',
                'liblzo2.so.2',
                'libstdc++.so.6',
                'libyara.so.3',
                'yara.so',
                'yextend',

                # Licenses
                'YARA_LICENSE',
                'YARA_PYTHON_LICENSE',
                'YEXTEND_LICENSE'
            }
        )
        mock_print.assert_called_once()