Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage reports feature #840

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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