Skip to content

Commit 8677f98

Browse files
Andreabsclifton
Andrea
authored andcommitted
[VPN] enable Mitigation Policy for Windows Services
Resolves brave/brave-browser#39230
1 parent 547f375 commit 8677f98

File tree

2 files changed

+12
-0
lines changed
  • browser/brave_vpn/win

2 files changed

+12
-0
lines changed

browser/brave_vpn/win/brave_vpn_helper/main.cc

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ const char kLogFile[] = "log-file";
2929
} // namespace
3030

3131
int main(int argc, char* argv[]) {
32+
// Process Mitigation Redirection Policy
33+
PROCESS_MITIGATION_REDIRECTION_TRUST_POLICY signature = {0};
34+
DWORD dwSize = sizeof(signature);
35+
signature.EnforceRedirectionTrust = 1;
36+
SetProcessMitigationPolicy(ProcessRedirectionTrustPolicy, &signature, dwSize);
37+
3238
// Initialize the CommandLine singleton from the environment.
3339
base::CommandLine::Init(argc, argv);
3440
auto* command_line = base::CommandLine::ForCurrentProcess();

browser/brave_vpn/win/brave_vpn_wireguard_service/main.cc

+6
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ std::optional<int> ProcessUserLevelCommands(
7171
}
7272

7373
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) {
74+
// Process Mitigation Redirection Policy
75+
PROCESS_MITIGATION_REDIRECTION_TRUST_POLICY signature = {0};
76+
DWORD dwSize = sizeof(signature);
77+
signature.EnforceRedirectionTrust = 1;
78+
SetProcessMitigationPolicy(ProcessRedirectionTrustPolicy, &signature, dwSize);
79+
7480
// Initialize the CommandLine singleton from the environment.
7581
base::CommandLine::Init(0, nullptr);
7682
auto* command_line = base::CommandLine::ForCurrentProcess();

0 commit comments

Comments
 (0)