Lion 的新安全模型将如何影响 Python 等事物?
我很好奇 OS X Lion 中的新安全模型将如何影响未来。具体来说,我质疑权利和沙盒。
这不是这些是否是好主意的问题。相反,这是对未来会发生什么的最佳猜测的问题。
我对Python之类的东西很好奇。我的公司制作了一个小型 Python 应用程序,用于紧急情况,无需基于网络的软件。这包括读取和写入文件系统。
我们的应用程序没有任何权利,即因为它只是 Python 代码,而且我们不进行任何 Cocoa 包装。当 Mac App Store 要求所有应用程序都必须进行沙箱处理并列出其权利的要求生效时,我想知道苹果是否会推出操作系统更新并说:“从现在开始,这就是我们确保安全的方式,如果您的应用程序不符合我们的安全模型,它不会运行,因为它不安全。”
我对此心情复杂。一方面,我认为这对于让消费者的机器更加安全非常有用。更少的流氓代码和所有腐烂的东西。另一方面,我认为,这将使许多开发人员的开发变成人间地狱。
我还想知道如果 Leopard 或 Snow Leopard 发布相同的更新,是否应该为 Lion 发布这样的更新。我的想法不是 Leopard,因为它比当前操作系统落后两代。 Snow Leopard 完全取决于苹果想要支持旧操作系统多久。
因此,现在我向苹果开发者开放,让他们就这个话题发表自己的看法,或许还能产生以前没有的想法。
I'm curious to know how the new security model in OS X Lion will affect the future. Specifically, I'm questioning Entitlements and Sandboxing.
This isn't a question of whether or not these are good ideas. Rather, this is a question of best guess of what will happen in the future.
I'm curious about things like Python. My company makes a small Python App for emergency situations with out web-based software. This includes reading and writing to the file system.
Our app has no entitlements, namely because it's just Python code and we don't do any Cocoa wrapping. When the Mac App Store requirements that all apps have to be sandboxed and list their entitlements go into effect, I wonder if Apple will roll out an update to the operating system and say, "this is how we do security from now on and if your application doesn't meet our security model, it won't run because it's not secure."
I have mixed emotions about this. On the one hand, I think it's great for making consumer's machines more secure. Less rogue code and all that rot. On the other hand, it's going to make development a living hell for a lot of developers, methinks.
I also wonder if such an update should come out for Lion if the same update will be released for either Leopard or Snow Leopard. My thought would be not Leopard as it is two generations behind the current OS. Snow Leopard all depends on how long Apple wants to support an older OS.
So now I open it up to Apple developers to speak their minds on this topic and perhaps generate thoughts where previously there were none.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您可以将 Python 与脚本一起嵌入并使用类似 py2app,我想你可以添加/编辑 Info.plist 以满足 Apple 的签名要求。同样,对于权利,我想您可以 编辑 .app 的entitlements.plist。我认为沙箱执行器 sandboxd 不是特定于语言的,它只是允许/阻止进程对设备和文件的访问(例如,通过不授予受限文件描述符)。请记住,嵌入式 Python 解释器默认情况下可能需要访问某些权限才能进行初始化(因为它可能不是在创建时考虑到沙箱)。
对于 iOS 设备(必须经过沙盒处理才能在商店中销售),Apple 的政策(iOS 开发者计划协议第 3.3.2 节)是:
如果可能的话,上述解决方案似乎可以满足此要求(假设对 OS X 应用程序也有类似的规定)。但是,如果您对在 App Store 上分发您的应用程序不感兴趣,我认为您没有什么可担心的。我非常怀疑他们很快就会要求代码签名或授权才能在您的计算机上运行应用程序(而只是将 App Store 上出售的应用程序沙箱化,使其成为获取应用程序的“安全”场所)。
If you could embed Python along with your script and package it into a .app using something like py2app, I would imagine you could add/edit the Info.plist to satisfy Apple's requirements for signing. Similarly for entitlements, I would imagine you could edit the .app's entitlements.plist. I think the sandbox enforcer sandboxd is not language specific, it just allows/blocks the process's access to devices and files (for example, by not granting restricted file descriptors). Keep in mind, it's possible that an embedded Python interpreter would by default need access to some entitlements for initialization (because it may not be created with sandboxing in mind).
For iOS devices (which must be sandboxed to be sold on the store), Apple's policy (iOS developer program agreement section 3.3.2) is:
It seems that the above solution, if possible, would satisfy this requirement (assuming a similar stipulation would be made for OS X apps). However, if you are not interested in distributing your app on the App Store, I don't think you have anything to worry about. I very much doubt they will require code signing or entitlements for running applications on your computer anytime soon (instead just sandboxing those sold on the App Store, making it the 'safe' place to get apps).