Changeset 286004 in webkit
- Timestamp:
- Nov 18, 2021, 7:56:37 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb (modified) (36 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r286003 r286004 1 2021-11-18 Per Arne Vollan <pvollan@apple.com> 2 3 [iOS] Block access to unused resources in the Networking process' sandbox 4 https://bugs.webkit.org/show_bug.cgi?id=233129 5 <rdar://problem/85411927> 6 7 Reviewed by Brent Fulgham. 8 9 Based on telemetry, block access to unused resources in the Networking process' sandbox on iOS. 10 11 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 12 1 13 2021-11-18 Per Arne Vollan <pvollan@apple.com> 2 14 -
trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb
r285412 r286004 64 64 (define-once (allow-network-common) 65 65 ;; <rdar://problem/8645367> 66 (allow system-socket (with telemetry) (require-all (socket-domain AF_SYSTEM) (socket-protocol 2))) 67 (allow network-outbound (with telemetry) 68 (control-name "com.apple.network.statistics") 66 (allow system-socket (require-all (socket-domain AF_SYSTEM) (socket-protocol 2))) 67 (allow network-outbound 69 68 (control-name "com.apple.netsrc")) 70 69 71 (allow sysctl-read (with telemetry) 72 (sysctl-name "kern.ipc.maxsockbuf") 73 (sysctl-name "kern.nisdomainname") 74 (sysctl-name-prefix "net.routetable.") 75 (sysctl-name "net.statistics")) 70 (allow sysctl-read 71 (sysctl-name-prefix "net.routetable.")) 76 72 77 73 ;; <rdar://problem/10642881> 78 (allow file-read* (with telemetry)74 (allow file-read* 79 75 (literal "/private/var/preferences/com.apple.networkd.plist")) 80 76 81 77 ;; <rdar://problem/27580907> 82 (allow file-read* (with telemetry)78 (allow file-read* 83 79 (literal "/private/var/Managed Preferences/mobile/com.apple.SystemConfiguration.plist")) 84 80 85 81 ;; <rdar://problem/13679154> 86 ( allowfile-read* (with telemetry)82 (deny file-read* (with telemetry) 87 83 (literal "/private/var/preferences/com.apple.NetworkStatistics.plist")) 88 84 … … 92 88 93 89 ;; <rdar://problem/7693463> 94 ( allowsystem-socket (with telemetry) (socket-domain AF_ROUTE))90 (deny system-socket (with telemetry) (socket-domain AF_ROUTE)) 95 91 96 92 (if gizmo? … … 105 101 (allow mach-lookup (global-name "com.apple.dnssd.service")))) ;; <rdar://problem/55562091> 106 102 103 (deny mach-lookup (with telemetry) 104 (global-name "com.apple.SystemConfiguration.helper") 105 (global-name "com.apple.SystemConfiguration.SCNetworkReachability") 106 (global-name "com.apple.SystemConfiguration.DNSConfiguration") 107 (global-name "com.apple.SystemConfiguration.PPPController")) 107 108 ;; <rdar://problem/10962803> 108 109 ;; <rdar://problem/13238730> 109 110 (allow mach-lookup (with telemetry) 110 111 (global-name "com.apple.SystemConfiguration.configd") 111 (global-name "com.apple.SystemConfiguration.helper")112 (global-name "com.apple.SystemConfiguration.SCNetworkReachability")113 (global-name "com.apple.SystemConfiguration.DNSConfiguration")114 (global-name "com.apple.SystemConfiguration.PPPController")115 112 (global-name "com.apple.SystemConfiguration.NetworkInformation")) 116 113 117 114 ;; <rdar://problem/11792470> 118 115 ;; <rdar://problem/13305819> 119 ( allowmach-lookup (with telemetry)116 (deny mach-lookup (with telemetry) 120 117 (global-name "com.apple.commcenter.xpc") 121 118 (global-name "com.apple.commcenter.cupolicy.xpc")) 122 119 123 ( allowmach-lookup (with telemetry)120 (deny mach-lookup (with telemetry) 124 121 (global-name "com.apple.securityd") 122 (global-name "com.apple.symptomsd")) 123 (allow mach-lookup 125 124 (global-name "com.apple.trustd")) 126 ( allowfile-read* (with telemetry)125 (deny file-read* (with telemetry) 127 126 (literal "/private/var/preferences/com.apple.security.plist")) 128 127 … … 130 129 (allow mach-lookup (with telemetry) 131 130 (global-name "com.apple.usymptomsd") 132 (global-name "com.apple.symptomsd")133 131 (global-name "com.apple.symptoms.symptomsd.managed_events")) ; <rdar://problem/32768772> 134 132 … … 141 139 ) 142 140 143 (allow mach-lookup (with telemetry)141 (allow mach-lookup 144 142 (global-name "com.apple.AppSSO.service-xpc")) 145 ( allowipc-posix-shm-read-data (with telemetry)143 (deny ipc-posix-shm-read-data (with telemetry) 146 144 (ipc-posix-name "/com.apple.AppSSO.version")) 147 145 … … 153 151 154 152 ;; <rdar://problem/9193431> 155 ( allowmach-lookup (with telemetry)153 (deny mach-lookup (with telemetry) 156 154 (global-name "com.apple.networkd")) 157 155 … … 164 162 (require-entitlement "com.apple.networkd.persistent_interface") 165 163 (require-entitlement "com.apple.networkd_privileged")) 166 ( allowmach-lookup (with telemetry)164 (deny mach-lookup (with telemetry) 167 165 (global-name "com.apple.networkd_privileged"))) 168 166 169 167 ;; <rdar://problem/20201593> 170 ( allowmach-lookup (with telemetry)168 (deny mach-lookup (with telemetry) 171 169 (global-name "com.apple.ak.anisette.xpc") 172 170 (global-name "com.apple.ak.auth.xpc")) 173 171 174 172 ;; <rdar://problem/15897781> 175 ( allowmach-lookup (with telemetry)173 (deny mach-lookup (with telemetry) 176 174 (global-name "com.apple.nsurlsessiond")) 177 175 (allow file-issue-extension … … 187 185 188 186 ;; <rdar://problem/15608009> 189 ( allowmach-lookup (with telemetry)187 (deny mach-lookup (with telemetry) 190 188 (global-name "com.apple.nsurlstorage-cache")) 191 189 190 (deny mach-lookup (with telemetry) 191 (global-name "com.apple.cfnetwork.AuthBrokerAgent")) 192 192 ;; <rdar://problem/10423007> 193 193 (allow mach-lookup (with telemetry) 194 (global-name "com.apple.cfnetwork.AuthBrokerAgent")195 194 (global-name "com.apple.cfnetwork.cfnetworkagent")) 196 195 … … 199 198 (home-prefix "/Library/Logs/CrashReporter/CFNetwork_")) 200 199 201 ( allowmach-lookup (with telemetry)200 (deny mach-lookup (with telemetry) 202 201 (global-name "com.apple.cookied")) 203 202 204 203 ;; <rdar://problem/17910466> 205 (allow mach-lookup (with telemetry)204 (allow mach-lookup 206 205 (global-name "com.apple.accountsd.accountmanager")) 207 206 208 207 ;; GSS-API 209 (allow mach-lookup (with telemetry)208 (allow mach-lookup 210 209 (global-name "com.apple.GSSCred")) 211 210 … … 213 212 (mobile-keybag-access) 214 213 215 (allow mach-lookup (with telemetry)214 (allow mach-lookup 216 215 (global-name "com.apple.nehelper")) 217 216 … … 231 230 232 231 (define-once (managed-configuration-read-public) 233 (allow file-read* (with telemetry)232 (allow file-read* 234 233 (well-known-system-group-container-subpath "/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/PublicInfo") 235 234 (front-user-home-subpath "/Library/ConfigurationProfiles/PublicInfo") 236 235 (front-user-home-subpath "/Library/UserConfigurationProfiles/PublicInfo")) 237 ( allowmach-lookup (with telemetry)236 (deny mach-lookup (with telemetry) 238 237 (global-name "com.apple.managedconfiguration.profiled.public"))) 239 238 … … 253 252 254 253 (define-once (mobile-keybag-access) 255 (allow iokit-open (with telemetry)254 (allow iokit-open 256 255 (iokit-user-client-class "AppleKeyStoreUserClient") ;; Needed by NSURLCache 257 256 )) … … 300 299 301 300 (define required-etc-files 302 (literal "/private/etc/fstab" 303 "/private/etc/hosts" 304 "/private/etc/group" 301 (literal "/private/etc/hosts" 305 302 "/private/etc/passwd" 306 "/private/etc/protocols"307 303 "/private/etc/services")) 308 304 309 305 (define-once (allow-multi-instance-xpc-services) 310 306 ;; <rdar://problem/46716068> 311 ( allowmach-lookup307 (deny mach-lookup 312 308 (with telemetry) 313 309 (with message "Create a radar and set it as a blocker to rdar://problem/48527566") … … 316 312 )) 317 313 318 (allow sysctl-read (with telemetry)319 (sysctl-name "kern.bootsessionuuid"))320 321 314 (deny file-map-executable) 322 315 (deny file-write-mount file-write-unmount) … … 324 317 (vnode-type DIRECTORY)) 325 318 326 (mobile-preferences-read "com.apple.security")327 328 319 (with-elevated-precedence 329 320 ;; System files. 330 (allow file-read* (with telemetry)321 (allow file-read* 331 322 (subpath "/usr/lib" 332 323 "/usr/share" 333 "/private/var/db/timezone")) 324 "/private/var/db/timezone") 325 "/private/var/preferences/Logging")) 326 334 327 (allow-read-and-issue-generic-extensions 335 328 (subpath "/Library/RegionFeatures" 336 329 "/System/Library")) 337 330 338 (allow file-map-executable (with telemetry)331 (allow file-map-executable 339 332 (subpath "/System/Library") 340 333 (subpath "/usr/lib")) … … 342 335 (allow file-read-metadata (with telemetry) 343 336 (vnode-type SYMLINK)) 344 345 (allow file-read* (with telemetry)346 (subpath "/private/var/preferences/Logging"))347 337 348 338 (allow user-preference-read (preference-domain "kCFPreferencesAnyApplication")) … … 354 344 (allow managed-preference-read (preference-domain "kCFPreferencesAnyApplication")) 355 345 356 ( allowfile-read-metadata (with telemetry)346 (deny file-read-metadata (with telemetry) 357 347 (home-literal "/Library/Caches/powerlog.launchd")) 358 348 … … 366 356 367 357 (with-filter (global-name-prefix "") 368 ( allowmach-lookup (with telemetry)358 (deny mach-lookup (with telemetry) 369 359 (extension "com.apple.security.exception.mach-lookup.global-name"))) 370 360 (with-filter (local-name-prefix "") 371 ( allowmach-lookup (with telemetry)361 (deny mach-lookup (with telemetry) 372 362 (extension "com.apple.security.exception.mach-lookup.local-name")) 373 363 ) … … 399 389 ) 400 390 401 (allow file-read* (with telemetry) 402 required-etc-files 391 (allow file-read* 392 required-etc-files) 393 394 (allow file-read* (with telemetry) (with message "Allowing read access to root") 403 395 (literal "/")) 404 396 405 (allow mach-lookup (with telemetry)397 (allow mach-lookup 406 398 (global-name "com.apple.logd") 407 399 (global-name "com.apple.logd.events")) … … 414 406 (allow system-sched 415 407 (require-entitlement "com.apple.private.kernel.override-cpumon")) 416 417 (allow sysctl-read (with telemetry)418 (sysctl-name "hw.busfrequency")419 (sysctl-name "hw.busfrequency_compat")420 (sysctl-name "hw.byteorder")421 (sysctl-name "hw.cachelinesize")422 (sysctl-name "hw.cachelinesize_compat")423 (sysctl-name "hw.cpufamily")424 (sysctl-name "hw.cpufrequency")425 (sysctl-name "hw.cpufrequency_compat")426 (sysctl-name "hw.cpufrequency_max")427 (sysctl-name "hw.cpusubtype")428 (sysctl-name "hw.cputhreadtype")429 (sysctl-name "hw.cputype")430 (sysctl-name "hw.l1dcachesize")431 (sysctl-name "hw.l1dcachesize_compat")432 (sysctl-name "hw.l1icachesize")433 (sysctl-name "hw.l1icachesize_compat")434 (sysctl-name "hw.l2cachesize")435 (sysctl-name "hw.l2cachesize_compat")436 (sysctl-name "hw.l2settings")437 (sysctl-name "hw.l3cachesize")438 (sysctl-name "hw.l3cachesize_compat")439 (sysctl-name "hw.l3settings")440 (sysctl-name "hw.logicalcpu")441 (sysctl-name "hw.logicalcpu_max")442 (sysctl-name "hw.pagesize")443 (sysctl-name "hw.physicalcpu")444 (sysctl-name "hw.physicalcpu_max")445 (sysctl-name "hw.physmem")446 (sysctl-name "hw.tbfrequency")447 (sysctl-name "hw.tbfrequency_compat")448 (sysctl-name "hw.usermem")449 (sysctl-name "hw.vectorunit")450 (sysctl-name "kern.boottime")451 (sysctl-name "kern.clockrate")452 (sysctl-name "kern.development")453 (sysctl-name "kern.hostid")454 (sysctl-name "kern.maxproc")455 (sysctl-name "kern.maxvnodes")456 (sysctl-name-prefix "kern.monotonicclock")457 (sysctl-name "kern.monotoniclock_offset_usecs")458 (sysctl-name "kern.ngroups")459 (sysctl-name "kern.saved_ids")460 (sysctl-name "kern.usrstack")461 (sysctl-name "kern.usrstack64")462 (sysctl-name "kern.waketime")463 (sysctl-name "security.mac.sandbox.sentinel")464 (sysctl-name "vm.loadavg")465 (sysctl-name-prefix "kern.argmax")466 )467 408 468 409 (with-filter (system-attribute apple-internal) … … 472 413 (sysctl-name "vm.footprint_suspend"))) 473 414 474 (allow mach-lookup (with telemetry)475 (global-name "com.apple.system.logger"))476 477 415 ;; Needed by WebKit LOG macros and ASL logging. 478 ( allowfile-read-metadata (with telemetry)416 (deny file-read-metadata (with telemetry) 479 417 (literal "/private/var/run/syslog")) 480 418 481 419 ;; ObjC map_images needs to send logging data to syslog. <rdar://problem/39778918> 482 420 (with-filter (system-attribute apple-internal) 483 (allow network-outbound (with telemetry)421 (allow network-outbound 484 422 (literal "/private/var/run/syslog") 485 423 ) 486 424 ) 487 425 488 (allow mach-lookup (with telemetry)426 (allow mach-lookup 489 427 (global-name "com.apple.system.notification_center")) 490 (allow ipc-posix-shm-read* (with telemetry)428 (allow ipc-posix-shm-read* 491 429 (ipc-posix-name "apple.shm.notification_center")) ;; Needed by os_log_create 492 430 493 ( allowmach-lookup (with telemetry)431 (deny mach-lookup (with telemetry) 494 432 (global-name "com.apple.distributed_notifications@1v3")) 495 433 496 434 (managed-configuration-read-public) 497 435 498 ( allowmach-lookup (with telemetry)436 (deny mach-lookup (with telemetry) 499 437 (global-name "com.apple.ctkd.token-client")) 500 438 … … 502 440 (info-type "net.link.addr")) 503 441 504 (allow mach-lookup (with telemetry)442 (allow mach-lookup 505 443 (global-name "com.apple.system.libinfo.muser")) 506 444 507 445 (allow mach-task-name (target self)) 508 446 509 ( allowprocess-info* (with telemetry))510 (allow process-info-pidinfo (target self))447 (deny process-info* (with telemetry)) 448 (allow process-info-pidinfo) 511 449 (allow process-info-pidfdinfo (target self)) 512 450 (allow process-info-pidfileportinfo (target self)) … … 524 462 (deny lsopen) 525 463 526 (deny sysctl*) 527 (allow sysctl-read (with telemetry)464 (deny sysctl*) (with telemetry) 465 (allow sysctl-read 528 466 (sysctl-name 529 "hw.activecpu" ;; Needed by JSC engine. 530 "hw.availcpu" 531 "hw.cacheconfig" ;; <rdar://problem/78213563> 532 "hw.cachelinesize" ;; <rdar://problem/15721872> 533 "hw.cachesize" ;; <rdar://problem/78213563> 534 "hw.cpu64bit_capable" 535 "hw.cpufamily" ;; <rdar://problem/15721872> 536 "hw.cpusubfamily" 537 "hw.l1dcachesize" ;; <rdar://problem/15721872> 538 "hw.l1icachesize" ;; <rdar://problem/15721872> 539 "hw.l2cachesize" ;; <rdar://problem/15721872> 540 "hw.l3cachesize" ;; <rdar://problem/15721872> 541 "hw.logicalcpu" ;; <rdar://problem/15721872> 542 "hw.logicalcpu_max" ;; <rdar://problem/15721872> 467 "hw.activecpu" 468 "hw.machine" 469 "hw.memsize" 543 470 "hw.ncpu" 544 "hw.machine" ;; Needed by CFNetwork (CFURLProtocols) 545 "hw.memsize" 546 "hw.model" ;; Needed for bundle loading 547 "hw.ncpu" ;; <rdar://problem/76782530> 548 "hw.nperflevels" ;; <rdar://problem/76782530> 549 "hw.pagesize" ;; <rdar://problem/76782530> 550 "hw.pagesize_compat" ;; Needed by bmalloc 551 "hw.physicalcpu" ;; <rdar://problem/76782530> 552 "hw.physicalcpu_max" ;; <rdar://problem/76782530> 553 "hw.physmem" ;; <rdar://problem/76782530> 554 "kern.bootargs" ;; Needed for bundle loading 471 "hw.pagesize_compat" 555 472 "kern.hostname" 556 "kern.hv_vmm_present"557 473 "kern.maxfilesperproc" 558 "kern.memorystatus_level" 559 "kern.osproductversion" ;; Needed by CFNetwork (HSTS store and others) 560 "kern.ostype" ;; Needed by NSURLSession 561 "kern.osrelease" ;; Ditto. 562 "kern.osvariant_status" ;; Needed for bundle loading 563 "kern.osversion" ;; Needed by WebKit and ASL logging. 564 "kern.secure_kernel" ;; Needed by XPC bundle resolution 565 "kern.tcsm_available" ;; Needed for IndexedDB support 474 "kern.osproductversion" 475 "kern.osrelease" 476 "kern.ostype" 477 "kern.osvariant_status" 478 "kern.osversion" 479 "kern.secure_kernel" 566 480 "kern.version" 567 "sysctl.name2oid"568 481 "vm.footprint_suspend") 569 482 (sysctl-name-prefix "kern.proc.pid.") 570 (sysctl-name-prefix "hw.optional.") ;; <rdar://problem/70973527>571 (sysctl-name-prefix "hw.perflevel") ;; <rdar://problem/76782530>572 483 ) 573 484 … … 587 498 588 499 ;; IOKit user clients 589 ( allowiokit-open (with telemetry)500 (deny iokit-open (with telemetry) 590 501 (iokit-user-client-class "RootDomainUserClient") ;; Needed by PowerObserver 591 502 ) 592 503 593 504 ;; Various services required by CFNetwork and other frameworks 594 ( allowmach-lookup (with telemetry)505 (deny mach-lookup (with telemetry) 595 506 (global-name "com.apple.PowerManagement.control")) 596 507 … … 601 512 "/systemgroup.com.apple.nsurlstoragedresources/Library/dafsaData.bin") 602 513 603 (allow file-read-data (with telemetry)514 (allow file-read-data 604 515 (literal "/usr/local/lib/log") ; <rdar://problem/36629495> 605 516 ) 606 517 607 518 ;; Security framework 608 ( allowmach-lookup (with telemetry)519 (deny mach-lookup (with telemetry) 609 520 (global-name "com.apple.ocspd") 610 521 (global-name "com.apple.securityd")) 611 522 612 523 ;; PassKit framework 613 (allow mach-lookup (with telemetry)524 (allow mach-lookup 614 525 (global-name "com.apple.passd.in-app-payment") 615 526 (global-name "com.apple.passd.library")) 616 527 528 (deny mach-lookup (with telemetry) 529 (global-name "com.apple.FileCoordination") 530 (global-name "com.apple.dmd.policy")) 531 617 532 (allow mach-lookup (with telemetry) 618 (global-name "com.apple.FileCoordination")619 (global-name "com.apple.dmd.policy")620 533 (global-name "com.apple.siri.context.service") 621 534 (global-name "com.apple.ctcategories.service")) … … 646 559 647 560 ;; For reporting progress for active downloads <rdar://problem/44405661> 648 (allow mach-lookup (with telemetry)561 (allow mach-lookup 649 562 (global-name "com.apple.ProgressReporting")) 650 563 … … 653 566 (global-name "com.apple.nesessionmanager.content-filter")) 654 567 655 ;; Various shared memory accesses required by system frameworks656 (allow ipc-posix-shm-read-data (with telemetry)657 (ipc-posix-name "/com.apple.AppSSO.version"))658 659 568 ;; Access to ContainerManager 660 569 (allow mach-lookup (with telemetry) 661 570 (global-name "com.apple.containermanagerd")) 662 (allow ipc-posix-sem-open (with telemetry)571 (allow ipc-posix-sem-open 663 572 (ipc-posix-name "containermanagerd.fb_check")) 664 573 665 (allow file-read* (with telemetry) 666 (literal "/dev/aes_0") 667 (literal "/dev/random") 574 (allow file-read* 668 575 (literal "/dev/urandom")) 669 670 (allow file-read* file-write-data (with telemetry)671 (literal "/dev/null")672 (literal "/dev/zero"))673 576 674 577 (if (system-attribute apple-internal) … … 683 586 684 587 ;; Access to MobileGestalt 685 ( allowmach-lookup (with telemetry)588 (deny mach-lookup (with telemetry) 686 589 (global-name "com.apple.mobilegestalt.xpc")) 687 (allow file-read* (with telemetry)590 (allow file-read* 688 591 (well-known-system-group-container-literal "/systemgroup.com.apple.mobilegestaltcache/Library/Caches/com.apple.MobileGestalt.plist")) 689 592 (allow iokit-get-properties … … 691 594 692 595 ;; Needed for TCC. 693 (allow mach-lookup (with telemetry)596 (allow mach-lookup 694 597 (global-name "com.apple.tccd")) 695 598 … … 702 605 SYS___disable_threadsignal 703 606 SYS___mac_syscall 607 SYS___semwait_signal 608 SYS_abort_with_payload 704 609 SYS_access 705 610 SYS_bind … … 716 621 SYS_csops 717 622 SYS_csops_audittoken 623 SYS_dup 718 624 SYS_exit 719 625 SYS_fcntl … … 757 663 SYS_lseek 758 664 SYS_lstat64 665 SYS_lstat64_extended 759 666 SYS_madvise 760 667 SYS_memorystatus_control … … 774 681 SYS_os_fault_with_payload 775 682 SYS_pathconf 683 SYS_persona 776 684 SYS_pipe 777 685 SYS_pread … … 785 693 SYS_psynch_mutexdrop 786 694 SYS_psynch_mutexwait 695 SYS_psynch_rw_rdlock 696 SYS_psynch_rw_unlock 787 697 SYS_pwrite_nocancel 788 698 SYS_read … … 798 708 SYS_sem_close 799 709 SYS_sem_open 710 SYS_sendmsg 800 711 SYS_sendmsg_nocancel 801 712 SYS_sendto … … 809 720 SYS_shutdown 810 721 SYS_sigaction 722 SYS_sigaltstack 723 SYS_sigprocmask 811 724 SYS_socket 812 725 SYS_socketpair
Note:
See TracChangeset
for help on using the changeset viewer.