address false positive vulnerability detection #1

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-09-24 14:08:36 +03:00
parent 2ee85d2e64
commit 7311f08884
4 changed files with 140 additions and 28 deletions
+69
View File
@@ -0,0 +1,69 @@
# -*- mode: python ; coding: utf-8 -*-
# Optimized PyInstaller spec file to reduce false positives
from PyInstaller.utils.hooks import collect_all
# Collect dependencies
datas = []
binaries = []
hiddenimports = ['constants', 'file_data', 'remote_command', 'remote_command_handler', 'user', 'security', 'cdn_manager', 'credentials', 'api_client', 'hardware_service']
# Collect required packages
for package in ['requests', 'boto3', 'msgpack', 'zmq', 'jwt', 'cryptography', 'yaml', 'loguru']:
tmp_ret = collect_all(package)
datas += tmp_ret[0]
binaries += tmp_ret[1]
hiddenimports += tmp_ret[2]
a = Analysis(
['start.py'],
pathex=[],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Exclude unnecessary modules to reduce size and false positives
'tkinter', 'matplotlib', 'PIL', 'numpy.testing', 'scipy.testing',
'pandas.tests', 'test', 'tests', 'testing',
# Additional exclusions to reduce behavioral triggers
'distutils', 'email', 'html', 'http.server', 'xmlrpc',
'multiprocessing.spawn', 'concurrent.futures', 'asyncio.windows_events'
],
noarchive=False,
optimize=2, # Enable bytecode optimization
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='azaion-loader',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False, # DISABLED: UPX compression triggers false positives
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None, # Set this to your code signing certificate
entitlements_file=None,
# version='version_info.txt', # Temporarily disabled - file doesn't exist
icon=None, # Add icon if available
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=False, # DISABLED: UPX compression triggers false positives
upx_exclude=[],
name='azaion-loader',
)