blob: 9549b5984e5ee390414d1bb56445e9f629d3d2b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sandbox/policy/features.h"
#include "base/win/windows_version.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
namespace sandbox {
namespace policy {
namespace features {
#if defined(TOOLKIT_QT) || (!defined(OS_MAC) && !defined(OS_FUCHSIA))
// Enables network service sandbox.
// (Only causes an effect when feature kNetworkService is enabled.)
const base::Feature kNetworkServiceSandbox{"NetworkServiceSandbox",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif // !defined(OS_MAC) && !defined(OS_FUCHSIA)
#if defined(OS_WIN)
// Emergency "off switch" for new Windows KTM security mitigation,
// sandbox::MITIGATION_KTM_COMPONENT.
const base::Feature kWinSboxDisableKtmComponent{
"WinSboxDisableKtmComponent", base::FEATURE_ENABLED_BY_DEFAULT};
// Experiment for Windows sandbox security mitigation,
// sandbox::MITIGATION_EXTENSION_POINT_DISABLE.
const base::Feature kWinSboxDisableExtensionPoints{
"WinSboxDisableExtensionPoint", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables GPU AppContainer sandbox on Windows.
const base::Feature kGpuAppContainer{"GpuAppContainer",
base::FEATURE_DISABLED_BY_DEFAULT};
// Enables GPU Low Privilege AppContainer when combined with kGpuAppContainer.
const base::Feature kGpuLPAC{"GpuLPAC", base::FEATURE_ENABLED_BY_DEFAULT};
#endif // defined(OS_WIN)
#if !defined(OS_ANDROID)
// Controls whether the isolated XR service is sandboxed.
const base::Feature kXRSandbox{"XRSandbox", base::FEATURE_ENABLED_BY_DEFAULT};
#endif // !defined(OS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Controls whether the Spectre variant 2 mitigation is enabled. We use a USE
// flag on some Chrome OS boards to disable the mitigation by disabling this
// feature in exchange for system performance.
const base::Feature kSpectreVariant2Mitigation{
"SpectreVariant2Mitigation", base::FEATURE_ENABLED_BY_DEFAULT};
// An override for the Spectre variant 2 default behavior. Security sensitive
// users can enable this feature to ensure that the mitigation is always
// enabled.
const base::Feature kForceSpectreVariant2Mitigation{
"ForceSpectreVariant2Mitigation", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_WIN)
bool IsNetworkServiceSandboxLPACEnabled() {
// Use LPAC for network sandbox instead of restricted token. Relies on
// NetworkServiceSandbox being also enabled.
const base::Feature kNetworkServiceSandboxLPAC{
"NetworkServiceSandboxLPAC", base::FEATURE_DISABLED_BY_DEFAULT};
// Since some APIs used for LPAC are unsupported below Windows 10, place a
// check here in a central place.
if (base::win::GetVersion() < base::win::Version::WIN10)
return false;
return base::FeatureList::IsEnabled(kNetworkServiceSandbox) &&
base::FeatureList::IsEnabled(kNetworkServiceSandboxLPAC);
}
#endif // defined(OS_WIN)
} // namespace features
} // namespace policy
} // namespace sandbox
|