From 398074a69aa164aedbfd6a8c49f23c4386ef80ab Mon Sep 17 00:00:00 2001 From: msm-cert <156842376+msm-cert@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:20:38 +0000 Subject: [PATCH] Remove usage reports feature (#840) * Remove usage reports feature * Remove unused requests --------- Co-authored-by: msm --- USAGE_STATISTICS.md | 34 ---------------------------------- drakrun/drakrun/draksetup.py | 36 +----------------------------------- 2 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 USAGE_STATISTICS.md diff --git a/USAGE_STATISTICS.md b/USAGE_STATISTICS.md deleted file mode 100644 index 066d36def..000000000 --- a/USAGE_STATISTICS.md +++ /dev/null @@ -1,34 +0,0 @@ -Usage statistics -================ - -Installation report -------------------- - -By default, DRAKVUF Sandbox is sending anonymous usage statistics: - -* The random unique instance ID -* Installation ISO SHA256 SUM -* Kernel version, PDB name and GUID - -the main purposes for collecting such information are: - -* determining the popularity of DRAKVUF Sandbox -* improving compatibility with most popular Windows builds - -If for some reason you don't want to send any usage reports, -you could use `--no-report` switch with `draksetup postinstall` command. - -You can also execute this command in order to permanently disable reporting: - -``` -touch /etc/drakrun/no_usage_reports -``` - - -External interactions ---------------------- - -Please be aware that DRAKVUF Sandbox is also connecting to Microsoft Symbol -Server in order to download kernel's PDB. Moreover, your Windows guest may -also send some default telemetry reports unless configured accordingly. - diff --git a/drakrun/drakrun/draksetup.py b/drakrun/drakrun/draksetup.py index 3f029ebc8..a82b016bf 100644 --- a/drakrun/drakrun/draksetup.py +++ b/drakrun/drakrun/draksetup.py @@ -15,10 +15,8 @@ from pathlib import Path, PureWindowsPath import click -import requests from minio import Minio from minio.error import NoSuchKey -from requests import RequestException from tqdm import tqdm from drakrun.apiscout import ( @@ -540,16 +538,6 @@ def install( logging.info("-" * 80) -def send_usage_report(report): - try: - res = requests.post( - "https://drakvuf.cert.pl/usage/draksetup", json=report, timeout=5 - ) - res.raise_for_status() - except RequestException: - logging.exception("Failed to send usage report. This is not a serious problem.") - - def on_create_rekall_profile_failure( msg: str, should_raise: bool, @@ -723,13 +711,6 @@ def build_os_info( @click.command(help="Finalize sandbox installation") -@click.option( - "--report/--no-report", - "report", - default=True, - show_default=True, - help="Send anonymous usage report", -) @click.option( "--usermode/--no-usermode", "generate_usermode", @@ -737,13 +718,10 @@ def build_os_info( show_default=True, help="Generate user mode profiles", ) -def postinstall(report, generate_usermode): +def postinstall(generate_usermode): if not check_root(): return - if os.path.exists(os.path.join(ETC_DIR, "no_usage_reports")): - report = False - install_info = InstallInfo.load() storage_backend = get_storage_backend(install_info) @@ -800,18 +778,6 @@ def postinstall(report, generate_usermode): logging.info("Snapshotting persistent memory...") storage_backend.snapshot_vm0_volume() - if report: - send_usage_report( - { - "kernel": { - "guid": kernel_info.guid, - "filename": kernel_info.filename, - "version": kernel_info.version, - }, - "install_iso": {"sha256": install_info.iso_sha256}, - } - ) - if generate_usermode: # Restore a VM and create usermode profiles create_missing_profiles()