add privacy statement to CLI (#695)

This commit is contained in:
bmc-msft 2021-03-19 12:52:37 -04:00 committed by GitHub
parent d57abb6956
commit 14b295f337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 6 deletions

View File

@ -87,8 +87,9 @@ jobs:
python setup.py sdist bdist_wheel python setup.py sdist bdist_wheel
pip install -r ./requirements.txt ../../artifacts/sdk/*.whl pip install -r ./requirements.txt ../../artifacts/sdk/*.whl
pip install six pip install six
pyinstaller onefuzz/__main__.py --onefile --name onefuzz --additional-hooks-dir extra/pyinstaller --hidden-import='pkg_resources.py2_warn' --exclude-module tkinter --exclude-module PySide2 --exclude-module PIL.ImageDraw --exclude-module Pillow --clean pyinstaller onefuzz/__main__.py --onefile --name onefuzz --additional-hooks-dir extra/pyinstaller --hidden-import='pkg_resources.py2_warn' --exclude-module tkinter --exclude-module PySide2 --exclude-module PIL.ImageDraw --exclude-module Pillow --clean --add-data "onefuzz/data/privacy.txt;onefuzz/data" --add-data "onefuzz/data/licenses.json;onefuzz/data"
./dist/onefuzz.exe --version ./dist/onefuzz.exe --version
./dist/onefuzz.exe privacy_statement
mkdir -p ${GITHUB_WORKSPACE}/artifacts/windows-cli/ mkdir -p ${GITHUB_WORKSPACE}/artifacts/windows-cli/
mkdir -p ${GITHUB_WORKSPACE}/artifacts/sdk/ mkdir -p ${GITHUB_WORKSPACE}/artifacts/sdk/
cp dist/*.tar.gz dist/*.whl ${GITHUB_WORKSPACE}/artifacts/sdk/ cp dist/*.tar.gz dist/*.whl ${GITHUB_WORKSPACE}/artifacts/sdk/

View File

@ -1,4 +1,7 @@
include LICENSE include LICENSE
include *.txt include *.txt
include *.md include *.md
graft examples include extra/pyinstaller/*.py
include onefuzz/data/privacy.txt
include onefuzz/data/licenses.json
graft examples

View File

@ -0,0 +1,8 @@
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("onefuzz")

View File

@ -6,6 +6,7 @@
import json import json
import logging import logging
import os import os
import pkgutil
import re import re
import subprocess # nosec import subprocess # nosec
import uuid import uuid
@ -14,7 +15,6 @@ from shutil import which
from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar
from uuid import UUID from uuid import UUID
import pkg_resources
import semver import semver
from memoization import cached from memoization import cached
from onefuzztypes import ( from onefuzztypes import (
@ -1530,8 +1530,17 @@ class Onefuzz:
def licenses(self) -> object: def licenses(self) -> object:
""" Return third-party licenses used by this package """ """ Return third-party licenses used by this package """
stream = pkg_resources.resource_stream(__name__, "data/licenses.json") data = pkgutil.get_data("onefuzz", "data/licenses.json")
return json.load(stream) if data is None:
raise Exception("missing licenses.json")
return json.loads(data)
def privacy_statement(self) -> bytes:
""" Return OneFuzz privacy statement """
data = pkgutil.get_data("onefuzz", "data/privacy.txt")
if data is None:
raise Exception("missing licenses.json")
return data
def logout(self) -> None: def logout(self) -> None:
""" Logout of Onefuzz """ """ Logout of Onefuzz """

View File

@ -0,0 +1,14 @@
The software may collect information about you and your use of the software and
send it to Microsoft. Microsoft may use this information to provide services
and improve our products and services. You may turn off the telemetry as
described in the repository. There are also some features in the software that
may enable you and Microsoft to collect data from users of your applications.
If you use these features, you must comply with applicable law, including
providing appropriate notices to users of your applications together with a
copy of Microsoft's privacy statement. Our privacy statement is located at
https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data
collection and use in the help documentation and our privacy statement. Your
use of the software operates as your consent to these practices.
Instructions on how to turn off telemetry:
* https://github.com/microsoft/onefuzz/blob/main/docs/telemetry.md#how-to-disable-sending-telemetry-to-microsoft

View File

@ -44,5 +44,7 @@ setuptools.setup(
install_requires=requirements, install_requires=requirements,
zip_safe=False, zip_safe=False,
include_package_data=True, include_package_data=True,
package_data={"": ["*.md", "*.txt", "data/licenses.json"]}, package_data={
"": ["*.md", "*.txt", "onefuzz/data/licenses.json", "onefuzz/data/privacy.txt"]
},
) )