.net - 在“dotnet”核心3.0 cli util中禁用遥测?
问题描述
dotnet
如何在 linux中完全禁用(或防火墙)cli util 遥测?
设置环境变量:
echo "export DOTNET_CLI_TELEMETRY_OPTOUT=1"
仅在使用参数开始时有助于禁用遥测dotnet
:
dotnet build
dotnet pack
dotnet run
但如果是前。使用参数调用dotnet
:
dotnet new
dotnet nuget
...
无论如何都会发送遥测数据。(文档:https ://docs.microsoft.com/en-us/dotnet/core/tools/telemetry#collected-options )
任何想法,选项?nftables/proxychains 的白色规则?
解决方案
我正在阅读和解释https://docs.microsoft.com/en-us/dotnet/core/tools/telemetry#collected-options不同:
某些命令发送附加数据。
在我看来,这意味着“如果启用遥测,这些命令会发送额外的数据。如果禁用遥测,则不会发送任何数据”。
Telemetry的实现似乎符合我的理解:
首先,环境变量用于启用(或实际上禁用)遥测:
Enabled = !environmentProvider.GetEnvironmentVariableAsBool(TelemetryOptout, false) && PermissionExists(sentinel);
然后,公共 APIEnabled
用来决定做任何事情:
public void TrackEvent(string eventName, IDictionary<string, string> properties,
IDictionary<string, double> measurements)
{
if (!Enabled)
{
return;
}
//continue the task in different threads
_trackEventTask = _trackEventTask.ContinueWith(
x => TrackEventTask(eventName, properties, measurements)
);
}
public void Flush()
{
if (!Enabled || _trackEventTask == null)
{
return;
}
_trackEventTask.Wait();
}
public void ThreadBlockingTrackEvent(string eventName, IDictionary<string, string> properties, IDictionary<string, double> measurements)
{
if (!Enabled)
{
return;
}
TrackEventTask(eventName, properties, measurements);
}
在我看来,一切都应该是无操作的。如果您能找到任何相反的证据,请按照您链接的页面的建议进行操作:
保护您的隐私对我们很重要。如果您怀疑遥测正在收集敏感数据或数据处理不安全或不当,请在 dotnet/cli 存储库中提出问题或发送电子邮件至 dotnet@microsoft.com 进行调查。
我已使用此脚本来检查在以前版本的 .NET Coretdcpdump
中没有显示任何发送到的遥测数据:dc.services.visualstduio.com
我还没有测试过 .NET Core 3.0。
推荐阅读
- java - 如何提高 Flink 中数据流实现的不同计数?
- azure-virtual-machine - 如何防止本地用户将数据从 Azure 虚拟机下载到外部
- r - 读取受密码保护的 MS-Word 文件
- elasticsearch - 从封闭列表中搜索,并仅形成该列表
- python-3.x - 尝试导入 torchvision 时出现导入错误
- reactjs - 注册表单作为组件传递给路由时出错
- symfony - 无法刷新令牌,因为用户已更改 Syfmony 4 - EquatableInterface 问题
- package - 包限定名称。Package::<&var> 与 &Package::var 之间的差异(如果有的话)?
- android - SMS Retriever API 总是导致超时,尽管消息格式正确
- javascript - 取两个数学随机值并将它们添加到循环中