Skip to content

feat: add "privacy" security preset to disable Windows telemetry (#43)#63

Open
Prateek2007-cmd wants to merge 1 commit into
DotDev262:mainfrom
Prateek2007-cmd:feature/privacy-preset-43
Open

feat: add "privacy" security preset to disable Windows telemetry (#43)#63
Prateek2007-cmd wants to merge 1 commit into
DotDev262:mainfrom
Prateek2007-cmd:feature/privacy-preset-43

Conversation

@Prateek2007-cmd
Copy link
Copy Markdown

Summary

Closes #43

Adds a new "privacy" security preset to _securityPresets in SystemSettingsService.cs that disables common Windows telemetry and privacy-intrusive features via safe, non-destructive registry tweaks.

Changes

src/Services/System/SystemSettingsService.cs

Added a "privacy" entry to the _securityPresets dictionary with 8 registry tweaks:

Registry Key Value Name Value Purpose
HKLM\...\DataCollection AllowTelemetry 0 Disable Windows telemetry data collection
HKCU\...\AdvertisingInfo Enabled 0 Disable Advertising ID
HKLM\...\Windows\System EnableActivityFeed 0 Disable Activity History
HKLM\...\Windows\System UploadUserActivities 0 Disable Activity History cloud sync
HKCU\...\Privacy TailoredExperiencesWithDiagnosticDataEnabled 0 Disable tailored experiences
HKCU\...\Siuf\Rules NumberOfSIUFInPeriod 0 Disable feedback prompts
HKCU\...\InputPersonalization RestrictImplicitTextCollection 1 Disable text/ink data collection
HKCU\...\TrainedDataStore HarvestContacts 0 Disable contact harvesting

tests/WinHome.Tests/SystemSettingsServiceTests.cs

Added 3 new unit tests:

  • GetTweaksAsync_Should_Return_Privacy_Preset_Tweaks — verifies exactly 8 tweaks are returned
  • GetTweaksAsync_Privacy_Preset_Should_Contain_Expected_Registry_Keys — asserts each registry key/value individually
  • GetTweaksAsync_Should_Return_Empty_For_Unknown_Preset — edge case for unknown presets

Design Decisions

  • Standalone presetprivacy is independent from baseline/strict, so users can apply privacy tweaks without affecting security hardening and vice versa
  • All dword type — consistent with existing presets; no string-type values
  • Zero destructive modifications — all tweaks target telemetry/tracking features that are safe to disable
  • Preserves existing architecture — follows the exact same pattern as baseline and strict

Usage

security_preset: privacy

@Prateek2007-cmd
Copy link
Copy Markdown
Author

Hi @DotDev262👋

The implementation for this feature has been completed and submitted in this PR.

Kindly review the changes, and if everything looks good, please add the relevant labels such as gssoc:approved and other applicable GSSoC labels to the PR. Thank you!

@DotDev262
Copy link
Copy Markdown
Owner

Could you give an executed output screenshot

@Prateek2007-cmd
Copy link
Copy Markdown
Author

image Hi @DotDev262👋

I’ve completed the implementation and successfully verified the changes locally. All tests are passing successfully, including the related preset and registry behavior tests.

If everything looks good from your side, kindly review the PR and please add the relevant GSSoC labels such as gssoc:approved and other applicable labels. Thank you!

@DotDev262
Copy link
Copy Markdown
Owner

In the output , it tells the unit test hasn't tested the privacy profile , can you like execute it in a vm to see if it changes those registry values.

Iam asking in a vm since the tool can corrupt your windows install if the config is setup wrongly

@Prateek2007-cmd
Copy link
Copy Markdown
Author

That makes sense, thanks for pointing it out.

The current tests follow the same pattern used by the existing baseline and strict presets in the project. The unit tests verify that the privacy preset generates the correct registry tweak definitions (paths, keys, and values), while the actual registry application logic is already covered separately in RegistryServiceTests.

I avoided performing direct registry modification tests during unit testing to keep the test suite environment-safe and consistent with the existing architecture.

That said, I understand the concern regarding potentially unsafe registry configurations. I can additionally validate the preset behavior in an isolated VM environment and confirm that the registry values are applied correctly without affecting system stability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Settings] Add a Privacy Preset

2 participants