{"id":6098,"date":"2012-09-23T14:45:43","date_gmt":"2012-09-23T18:45:43","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=6098"},"modified":"2024-10-09T15:37:17","modified_gmt":"2024-10-09T19:37:17","slug":"aperture-3-4-sandboxing-and-flickrexport","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2012\/09\/23\/aperture-3-4-sandboxing-and-flickrexport\/","title":{"rendered":"Aperture 3.4, Sandboxing, and FlickrExport"},"content":{"rendered":"<p><a href=\"http:\/\/support.apple.com\/kb\/DL1588\">Aperture 3.4<\/a> is now <a href=\"http:\/\/support.apple.com\/kb\/TS4391\">sandboxed<\/a> (via <a href=\"https:\/\/getsatisfaction.com\/connectedflow\/topics\/flickrexport_and_aperture_3_4\">Fraser Speirs<\/a>). This initially caused some problems because it did not migrate my <a href=\"http:\/\/connectedflow.com\/flickrexport\/aperture\/\">FlickrExport<\/a> preferences file from:<\/p>\n<pre>~\/Library\/Preferences\/com.connectedflow.flickrexportaperture.plist<\/pre>\n<p>to:<\/p>\n<pre>~\/Library\/Containers\/com.apple.Aperture\/Data\/Library\/Preferences\/com.connectedflow.flickrexportaperture.plist<\/pre>\n<p>FlickrExport thus didn&rsquo;t find its preferences. It lost its Flickr API token, thought I hadn&rsquo;t purchased, and lost my preferences for which keywords to hide. I re-added these, but it wasn&rsquo;t until after I&rsquo;d uploaded a set that I realized I had forgotten to re-enable the preferences to save the Flickr ID and URL back to Aperture. Thus, the options to replace photos and update metadata didn&rsquo;t work until I&rsquo;d copied and pasted all the photo IDs from the Web site. In retrospect, I should have moved the preferences file to the new location right after updating Aperture. Of course, I would have if I had known then that it was sandboxed.<\/p>\n<p>Knowing a bit about how Aperture works, I wondered how some of its features could be made to work in the <a href=\"http:\/\/developer.apple.com\/library\/mac\/documentation\/Security\/Conceptual\/AppSandboxDesignGuide\/AboutAppSandbox\/AboutAppSandbox.html\">App Sandbox<\/a>. The answer is that Apple plays by different rules. For example, my copy of Aperture isn&rsquo;t from the Mac App Store, but it has access to iCloud. Third-party applications need to use clunky UI workarounds and <a href=\"http:\/\/developer.apple.com\/library\/mac\/documentation\/Security\/Conceptual\/AppSandboxDesignGuide\/AppSandboxInDepth\/AppSandboxInDepth.html#\/\/apple_ref\/doc\/uid\/TP40011183-CH3-SW16\">security-scoped bookmarks<\/a> to access files outside of a document package; Apple simply gives Aperture a <code>com.apple.security.temporary-exception.files.absolute-path.read-write<\/code> entitlement with value <code>\/<\/code>, i.e. read-write access to the entire filesystem. Aperture also makes use of <code>com.apple.security.temporary-exception.sbpl<\/code>, which Daniel Jalkut noted is the <a href=\"http:\/\/www.red-sweater.com\/blog\/2438\/the-sandboxs-big-red-button\">Big Red Button<\/a>.<\/p>\n<p>Also note that, aside from &ldquo;com.apple.PhotoApps.AVCHDConverter.xpc&rdquo; (presumably a codec), Aperture does not use <a href=\"http:\/\/developer.apple.com\/library\/mac\/documentation\/MacOSX\/Conceptual\/BPSystemStartup\/Chapters\/CreatingXPCServices.html\">XPC services<\/a> for privilege separation. The main Aperture application has full hard drive access, as well as being a network client, a network server, and all the rest.<\/p>\n<p>With so many entitlements and temporary exceptions, it doesn&rsquo;t seem like &ldquo;sandboxing&rdquo; Aperture in this way provides many security benefits. Aperture isn&rsquo;t protected from bugs in itself. And a malicious plug-in could read my address book (or, indeed, any file on my hard drive) and upload it over the network. However, it does restrict what plug-ins can do a bit. For example, Aperture has temporary exceptions for sending Apple events to Mail and iTunes; other event targets are forbidden. This means, for example, that you can no longer write a plug-in that integrates Aperture with Photoshop or Acorn.<\/p>\n<p>Here&rsquo;s the full list of Aperture 3.4 entitlements:<\/p>\n<pre>icarus$ codesign -d --entitlements - \/Applications\/Aperture.app|bbedit\nExecutable=\/Applications\/Aperture.app\/Contents\/MacOS\/Aperture\n\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;!DOCTYPE plist PUBLIC \"-\/\/Apple\/\/DTD PLIST 1.0\/\/EN\" \"http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\"&gt;\n&lt;plist version=\"1.0\"&gt;\n&lt;dict&gt;\n    &lt;key&gt;com.apple.application-identifier&lt;\/key&gt;\n    &lt;string&gt;F9L2L89K5X.com.apple.Aperture&lt;\/string&gt;\n    &lt;key&gt;com.apple.private.icloud-account-access&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.app-sandbox&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.assets.movies.read-write&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.assets.music.read-only&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.assets.pictures.read-write&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.files.user-selected.read-write&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.library-repair.extensions&lt;\/key&gt;\n    &lt;array&gt;\n        &lt;string&gt;photolibrary&lt;\/string&gt;\n        &lt;string&gt;aplibrary&lt;\/string&gt;\n    &lt;\/array&gt;\n    &lt;key&gt;com.apple.security.library-repair.ostype&lt;\/key&gt;\n    &lt;array&gt;\n        &lt;string&gt;iPlb&lt;\/string&gt;\n    &lt;\/array&gt;\n    &lt;key&gt;com.apple.security.network.client&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.network.server&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.personal-information.addressbook&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.print&lt;\/key&gt;\n    &lt;true\/&gt;\n    &lt;key&gt;com.apple.security.temporary-exception.apple-events&lt;\/key&gt;\n    &lt;array&gt;\n        &lt;string&gt;com.apple.mail&lt;\/string&gt;\n        &lt;string&gt;com.apple.itunes&lt;\/string&gt;\n    &lt;\/array&gt;\n    &lt;key&gt;com.apple.security.temporary-exception.files.absolute-path.read-write&lt;\/key&gt;\n    &lt;string&gt;\/&lt;\/string&gt;\n    &lt;key&gt;com.apple.security.temporary-exception.mach-lookup.global-name&lt;\/key&gt;\n    &lt;array&gt;\n        &lt;string&gt;com.apple.photostream-agent&lt;\/string&gt;\n    &lt;\/array&gt;\n    &lt;key&gt;com.apple.security.temporary-exception.mach-lookup.global-name:before:10.8&lt;\/key&gt;\n    &lt;array&gt;\n        &lt;string&gt;com.apple.AOSNotification-FMM&lt;\/string&gt;\n    &lt;\/array&gt;\n    &lt;key&gt;com.apple.security.temporary-exception.sbpl&lt;\/key&gt;\n    &lt;string&gt;\n        (begin\n            (allow file-search)\n            (allow ipc-posix-sem)\n            (allow system-fsctl))\n    &lt;\/string&gt;\n    &lt;key&gt;com.apple.security.temporary-exception.shared-preference.read-only&lt;\/key&gt;\n    &lt;array&gt;\n        &lt;string&gt;com.apple.iPhoto&lt;\/string&gt;\n    &lt;\/array&gt;\n    &lt;key&gt;com.apple.security.temporary-exception.shared-preference.read-write&lt;\/key&gt;\n    &lt;array&gt;\n        &lt;string&gt;com.apple.Aperture&lt;\/string&gt;\n        &lt;string&gt;com.apple.iApps&lt;\/string&gt;\n        &lt;string&gt;com.apple.iLifePhotoStream&lt;\/string&gt;\n        &lt;string&gt;com.apple.iLifeAssetManagement.agent&lt;\/string&gt;\n        &lt;string&gt;com.apple.iLifeAssetManagement.crash&lt;\/string&gt;\n        &lt;string&gt;com.apple.iLifePhotoStream.importstatus&lt;\/string&gt;\n        &lt;string&gt;MobileMeAccounts&lt;\/string&gt;\n        &lt;string&gt;com.apple.ImageCapture2&lt;\/string&gt;\n        &lt;string&gt;com.apple.mcxprinting&lt;\/string&gt;\n    &lt;\/array&gt;\n&lt;\/dict&gt;\n&lt;\/plist&gt;\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>Aperture 3.4 is now sandboxed (via Fraser Speirs). This initially caused some problems because it did not migrate my FlickrExport preferences file from: ~\/Library\/Preferences\/com.connectedflow.flickrexportaperture.plist to: ~\/Library\/Containers\/com.apple.Aperture\/Data\/Library\/Preferences\/com.connectedflow.flickrexportaperture.plist FlickrExport thus didn&rsquo;t find its preferences. It lost its Flickr API token, thought I hadn&rsquo;t purchased, and lost my preferences for which keywords to hide. I re-added these, but [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2024-10-09T19:37:19Z","apple_news_api_id":"11fc501a-47b1-41bd-8a08-2f80ffa84e6c","apple_news_api_modified_at":"2024-10-09T19:37:19Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AEfxQGkexQb2KCC-A_6hObA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[114,38,116,115,30,32,53,2669,1227],"class_list":["post-6098","post","type-post","status-publish","format-standard","hentry","category-technology","tag-aperture","tag-apple","tag-flickr","tag-flickrexport","tag-mac","tag-macapp","tag-sandboxing","tag-security-scoped-bookmarks","tag-top-posts"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/6098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=6098"}],"version-history":[{"count":6,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/6098\/revisions"}],"predecessor-version":[{"id":6104,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/6098\/revisions\/6104"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=6098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=6098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=6098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}