You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2b4cd37
Browse filesBrowse the repository at this point in the historyBrowse files
Add a preference to enable EnhancedSecurity by default for system apps
https://bugs.webkit.org/show_bug.cgi?id=327709
rdar://190130548
Reviewed by Per Arne Vollan.
Add an internal preference, EnhancedSecurityEnabledByDefaultForSystemApps, that
makes EnhancedSecurity the default for WebViews in system apps: Apple apps that
ship with the OS, excluding Safari and web apps. It is off by default, so this
change has no effect until it is enabled. It can be enabled for testing with the
WebKitDebugEnhancedSecurityEnabledByDefaultForSystemApps user default.
Also add the opt-out mentioned in 323340@main. A process with the
com.apple.private.security.webkit.disable-enhanced-security-default entitlement
does not get EnhancedSecurity by default from either preference. Explicitly
requested EnhancedSecurity or Lockdown Mode is unaffected.
A testing-only WKProcessPool SPI simulates the entitlement. Unlike the Lockdown
Mode testing SPI, it is ignored outside test runners
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/EnhancedSecurity.mm
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.h:
* Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm:
(WebKit::isSystemApplicationOrRunningTest):
* Source/WebKit/Shared/WebPreferencesDefaultValues.cpp:
(WebKit::isSafariOrWebApp):
* Source/WebKit/Shared/WebPreferencesDefaultValues.h:
* Source/WebKit/UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::isEnhancedSecurityEnabledByDefault const):
* Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm:
(+[WKProcessPool _setHasEnhancedSecurityDefaultOptOutEntitlementForTesting:]):
(+[WKProcessPool _clearHasEnhancedSecurityDefaultOptOutEntitlementForTesting]):
(-[WKProcessPool _setHasEnhancedSecurityDefaultOptOutEntitlementForTesting:]):
(-[WKProcessPool _clearHasEnhancedSecurityDefaultOptOutEntitlementForTesting]):
* Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::hasEnhancedSecurityDefaultOptOutEntitlementForTesting):
(WebKit::WebProcessPool::setHasEnhancedSecurityDefaultOptOutEntitlementForTesting):
(WebKit::hasEnhancedSecurityDefaultOptOutEntitlement):
(WebKit::shouldEnableEnhancedSecurityByDefault):
(WebKit::WebProcessPool::shouldEnableEnhancedSecurityByDefault const):
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::defaultEnhancedSecurity):
(WebKit::shouldEnableEnhancedSecurityByDefault):
(WebKit::WebProcessPool::setHasEnhancedSecurityDefaultOptOutEntitlementForTesting):
(WebKit::WebProcessPool::establishRemoteWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::prewarmProcess):
(WebKit::WebProcessPool::shouldEnableEnhancedSecurityByDefault const):
* Source/WebKit/UIProcess/WebProcessPool.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/EnhancedSecurity.mm:
(TestWebKitAPI::enableEnhancedSecurityTestFeature):
(TestWebKitAPI::TEST(EnhancedSecurity, SystemAppsDefaultEnablesEnhancedSecurity)):
(TestWebKitAPI::TEST(EnhancedSecurity, SystemAppsDefaultOverridesSecurityRestrictionModeNone)):
(TestWebKitAPI::TEST(EnhancedSecurity, SystemAppsDefaultOverridesNavigationSecurityRestrictionModeNone)):
(TestWebKitAPI::TEST(EnhancedSecurity, LockdownModeTakesPrecedenceOverSystemAppsDefault)):
(TestWebKitAPI::TEST(EnhancedSecurity, NavigationLockdownModeTakesPrecedenceOverSystemAppsDefault)):
(TestWebKitAPI::TEST(EnhancedSecurity, SystemLockdownModeTakesPrecedenceOverSystemAppsDefault)):
(TestWebKitAPI::TEST(EnhancedSecurity, ForceDisabledOverridesSystemAppsDefault)):
(TestWebKitAPI::TEST(EnhancedSecurity, OptOutEntitlementDisablesSystemAppsDefault)):
(TestWebKitAPI::TEST(EnhancedSecurity, OptOutEntitlementDisablesPlatformDefault)):
(TestWebKitAPI::TEST(EnhancedSecurity, OptOutEntitlementDisablesBothDefaults)):
(TestWebKitAPI::TEST(EnhancedSecurity, OptOutEntitlementDoesNotOverrideExplicitEnhancedSecurity)):
Canonical link: https://commits.webkit.org/324274@main
humanReadableName: "Enhanced Security enabled by default for system apps"
2143
+
humanReadableDescription: "Enables Enhanced Security by default for WebViews that do not explicitly set it in Apple apps that ship with the OS, excluding web browsers"
0 commit comments