Bug 219041

Summary: [macOS] Issue sandbox extension to Web Inspector service
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Per Arne Vollan <pvollan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
bfulgham: review+
Patch none

Description Per Arne Vollan 2020-11-17 11:25:31 PST
In preparation of blocking this service in the WebContent process, a sandbox extension should be issued if Safari's Develop menu is enabled.
Comment 1 Radar WebKit Bug Importer 2020-11-17 11:25:50 PST
<rdar://problem/71495287>
Comment 2 Per Arne Vollan 2020-11-17 11:39:02 PST
Created attachment 414359 [details]
Patch
Comment 3 Brent Fulgham 2020-11-18 16:52:28 PST
Comment on attachment 414359 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=414359&action=review

r=me

> Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm:209
> +    if (!CFPreferencesGetAppIntegerValue(CFSTR("ShowDevelopMenu"), CFSTR("com.apple.Safari.SandboxBroker"), nullptr))

It's a shame we couldn't reuse WIRRemoteInspectorEnabledKey here (i.e., define this differently on non-IOS_FAMILY).

> Tools/MiniBrowser/MiniBrowser.entitlements:29
> +		<string>com.apple.Safari.SandboxBroker</string>

Do we need this for WebKitTestRunner?
Comment 4 Per Arne Vollan 2020-11-19 09:03:21 PST
Created attachment 414589 [details]
Patch
Comment 5 Per Arne Vollan 2020-11-19 09:04:17 PST
(In reply to Brent Fulgham from comment #3)
> Comment on attachment 414359 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=414359&action=review
> 
> r=me
> 
> > Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm:209
> > +    if (!CFPreferencesGetAppIntegerValue(CFSTR("ShowDevelopMenu"), CFSTR("com.apple.Safari.SandboxBroker"), nullptr))
> 
> It's a shame we couldn't reuse WIRRemoteInspectorEnabledKey here (i.e.,
> define this differently on non-IOS_FAMILY).
> 
> > Tools/MiniBrowser/MiniBrowser.entitlements:29
> > +		<string>com.apple.Safari.SandboxBroker</string>
> 
> Do we need this for WebKitTestRunner?

I don't believe so, since WebKitTestRunner is not sandboxed, AFAIK.

Thanks for reviewing!
Comment 6 EWS 2020-11-19 09:32:47 PST
Committed r270035: <https://trac.webkit.org/changeset/270035>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 414589 [details].