Skip to content

Commit

Permalink
Remove usage reports feature (#840)
Browse files Browse the repository at this point in the history
* Remove usage reports feature

* Remove unused requests

---------

Co-authored-by: msm <[email protected]>
  • Loading branch information
msm-cert and msm-code authored Jan 22, 2024
1 parent 23f5b15 commit 398074a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 69 deletions.
34 changes: 0 additions & 34 deletions USAGE_STATISTICS.md

This file was deleted.

36 changes: 1 addition & 35 deletions drakrun/drakrun/draksetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -723,27 +711,17 @@ 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",
default=True,
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)

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 398074a

Please sign in to comment.