iOS 应用程序安全的最佳实践

本文介绍了iOS 应用程序安全的最佳实践的处理方法,对大家解决问题具有一定的参考价值

问题描述

在考虑 iPhone/iPad 应用程序安全性时,我可以注意到:

When thinking about iPhone/iPad applications security, I can notice that there is:

  • 广泛使用的黑客工具允许访问文件系统
  • 网络拦截,中间人攻击

==> 数据窃取威胁

还有:

  • 提供允许与朋友/社区免费共享付费应用的黑客工具(见 Cydia)
  • 提供允许在不付费的情况下购买应用的黑客工具(在 Cydia 中看到,听说它不适用于任何应用)

==> 收入损失威胁

所以我想知道 #1 在 iOS 应用程序中获得更好安全性的最佳做法是什么?此外,#2 减少收入损失和最大限度减少黑客风险的最佳方法是什么?

So I am wondering #1 what are best practices to get a better security in iOS application? Also, #2 what are best ways to reduce revenue loss and minimise hacking exposure?

对于#1我看过一些关于安全的 WWDC 幻灯片1 2 23 4+ 苹果文档

for #1 I've seen some WWDC slides about security 1 2 3 4 + apple docs

我可以说在这些最佳实践之间有:

and I can say that between theses best practices there are:

  • 使用提供数据保护的 API(如具有 NSFileProtectionKey 属性的 NSFileManager)
  • 使用钥匙串
  • 使用 SSL 和证书保护敏感数据

对于#2我认为使用基于免费应用的商业模式,然后在应用内购买并通过商店收据验证可以是收入损失最小的模式.

for #2 I think that using a business model based on free application, then in app purchase with Store Receipts verification can be the model with minimum revenue loss.

您在安全方面的最佳做法是什么,以及最大限度地减少应用黑客攻击机会的最佳方法是什么?

What are your best practices for security, and best way to minimise app hacking chances?

推荐答案

#1 在 iOS 应用程序中获得更好安全性的最佳实践是什么?

#1 what are best practices to get a better security in iOS application?

适当的数据安全高度依赖于信息的性质.它是长寿的还是短暂的?它是可以用来打开其他东西的通用凭证,还是单个数据?潜在的损失是隐私、财务还是安全?确定适当的保护措施需要具体案例,没有通用的答案.但是您要求最佳实践,并且有几个.它们都不是完美的或牢不可破的.但它们是最佳实践.以下是一些:

Appropriate data security is highly dependent on the nature of the information. Is it long-lived or short-lived? Is it a general credential that can be used to open other things, or a single piece of data? Is the potential loss privacy, financial, or safety? Determining the appropriate protections requires a specific case and has no general answer. But you ask for best practices and there are several. None of them are perfect or unbreakable. But they are best practice. Here are a few:

  • 在钥匙串中存储敏感信息
  • 尽可能将数据保护设置为 NSFileProtectionComplete.
  • 不要存储您实际上不需要的敏感数据,或存储时间超过您需要的时间.
  • 存储特定于应用程序的身份验证令牌而不是密码.
  • 使用 HTTPS 验证您正在联系的服务器.切勿接受无效或不受信任的证书.
  • 连接到您自己的服务器时,请验证该服务是否提供了已签署的证书,而不仅仅是受信任的证书".
  • Store sensitive information in Keychain
  • Set Data Protection to NSFileProtectionComplete wherever possible.
  • Do not store sensitive data you don't actually need, or for longer than you need.
  • Store application-specific authentication tokens rather than passwords.
  • Use HTTPS to verify the server you are contacting. Never accept an invalid or untrusted certificate.
  • When connecting to your own server, validate that the service presents a certificate that you have signed, not just "a trusted certificate."

这只是一小部分方法,但它们定下了基调:

This is just a smattering of approaches, but they set the basic tone:

  • 使用内置 API 来存储内容.随着 Apple 提高安全性,您可以免费获得这些好处.
  • 完全避免存储敏感信息,并尽量减少存储内容的敏感性.
  • 验证您与之通信的服务.

#2 减少收入损失和最大限度减少黑客风险的最佳方法是什么?

#2 what are best ways to reduce revenue loss and minimise hacking exposure?

这已经在 SO 上讨论过很多次了.此答案包含指向其他几个讨论的链接:

This has been discussed many times on SO. This answer includes links to several of the other discussions:

iPhone 应用到网页的安全 https 加密

简短的回答是:担心您的客户,而不是您的非客户.许多盗版者永远不会付钱给您,因此最好将您的时间和金钱花在帮助您的实际客户想要付钱给您的地方,并使他们更容易付钱.专注于赚更多的钱,而不是保护自己免受永远无法拥有的钱的伤害.永远不要在你惩罚非付费客户的过程中勾引付费客户.复仇是傻瓜游戏,浪费资源.

The short answer is: worry about your customers, not your non-customers. Many pirates will never, ever pay you money, so your time and money are better spent helping your actual customers want to pay you, and making it easy for them to do so. Focus on making more money rather than protecting yourself from money that you could never have. Never, ever, tick off a paying customer in your efforts to chastise a non-paying customer. Revenge is a sucker's game and a waste of resources.

有两种避免盗版的好方法:

There are two great ways to avoid piracy:

  • 不要发布.
  • 发布没人想要的垃圾.

您可以做一些值得做的基本事情,正如他们所说,为了让诚实的人保持诚实(有些在各种相关的讨论中进行了讨论).但不要彻夜难眠,担心如何阻止海盗.睡不着,担心如何取悦您的客户.

There are some basic things you can do that are worth it just, as they say, to keep honest people honest (some are discussed in the various linked discussions). But don't lie awake nights worrying about how to thwart pirates. Lie awake worrying about how to amaze your customers.

永远记住:Apple 在保护 iPhone 方面花费的资金比我们大多数人一生中见过的还要多.还是越狱了.考虑一下您的预算要实现的目标.

And always remember: Apple spends more money than most of us have ever seen in our lives trying to secure the iPhone. Still it's jailbroken. Think about what your budget is going to achieve.

这篇关于iOS 应用程序安全的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,WP2

admin_action_{$_REQUEST[‘action’]}

do_action( "admin_action_{$_REQUEST[‘action’]}" )动作钩子::在发送“Action”请求变量时激发。Action Hook: Fires when an ‘action’ request variable is sent.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$_REQUEST['action']引用从GET或POST请求派生的操作。源码(Source)更新版本源码位置使用被使用2.6.0 wp-admin/admin.php:...

日期:2020-09-02 17:44:16 浏览:1127

admin_footer-{$GLOBALS[‘hook_suffix’]}

do_action( "admin_footer-{$GLOBALS[‘hook_suffix’]}", string $hook_suffix )操作挂钩:在默认页脚脚本之后打印脚本或数据。Action Hook: Print scripts or data after the default footer scripts.目录锚点:#说明#参数#源码说明(Description)钩子名的动态部分,$GLOBALS['hook_suffix']引用当前页的全局钩子后缀。参数(Parameters)参数类...

日期:2020-09-02 17:44:20 浏览:1033

customize_save_{$this->id_data[‘base’]}

do_action( "customize_save_{$this->id_data[‘base’]}", WP_Customize_Setting $this )动作钩子::在调用WP_Customize_Setting::save()方法时激发。Action Hook: Fires when the WP_Customize_Setting::save() method is called.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_data...

日期:2020-08-15 15:47:24 浏览:775

customize_value_{$this->id_data[‘base’]}

apply_filters( "customize_value_{$this->id_data[‘base’]}", mixed $default )过滤器::过滤未作为主题模式或选项处理的自定义设置值。Filter Hook: Filter a Customize setting value not handled as a theme_mod or option.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_date['base'],指的是设置...

日期:2020-08-15 15:47:24 浏览:866

get_comment_author_url

过滤钩子:过滤评论作者的URL。Filter Hook: Filters the comment author’s URL.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/comment-template.php:32610...

日期:2020-08-10 23:06:14 浏览:904

network_admin_edit_{$_GET[‘action’]}

do_action( "network_admin_edit_{$_GET[‘action’]}" )操作挂钩:启动请求的处理程序操作。Action Hook: Fires the requested handler action.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$u GET['action']引用请求的操作的名称。源码(Source)更新版本源码位置使用被使用3.1.0 wp-admin/network/edit.php:3600...

日期:2020-08-02 09:56:09 浏览:848

network_sites_updated_message_{$_GET[‘updated’]}

apply_filters( "network_sites_updated_message_{$_GET[‘updated’]}", string $msg )筛选器挂钩:在网络管理中筛选特定的非默认站点更新消息。Filter Hook: Filters a specific, non-default site-updated message in the Network admin.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分$_GET['updated']引用了非默认的...

日期:2020-08-02 09:56:03 浏览:834

pre_wp_is_site_initialized

过滤器::过滤在访问数据库之前是否初始化站点的检查。Filter Hook: Filters the check for whether a site is initialized before the database is accessed.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/ms-site.php:93910...

日期:2020-07-29 10:15:38 浏览:809

WordPress 的SEO 教学:如何在网站中加入关键字(Meta Keywords)与Meta 描述(Meta Description)?

你想在WordPress 中添加关键字和meta 描述吗?关键字和meta 描述使你能够提高网站的SEO。在本文中,我们将向你展示如何在WordPress 中正确添加关键字和meta 描述。为什么要在WordPress 中添加关键字和Meta 描述?关键字和说明让搜寻引擎更了解您的帖子和页面的内容。关键词是人们寻找您发布的内容时,可能会搜索的重要词语或片语。而Meta Description则是对你的页面和文章的简要描述。如果你想要了解更多关于中继标签的资讯,可以参考Google的说明。Meta 关键字和描...

日期:2020-10-03 21:18:25 浏览:1622

谷歌的SEO是什么

SEO (Search Engine Optimization)中文是搜寻引擎最佳化,意思近于「关键字自然排序」、「网站排名优化」。简言之,SEO是以搜索引擎(如Google、Bing)为曝光媒体的行销手法。例如搜寻「wordpress教学」,会看到本站的「WordPress教学:12个课程…」排行Google第一:关键字:wordpress教学、wordpress课程…若搜寻「网站架设」,则会看到另一个网页排名第1:关键字:网站架设、架站…以上两个网页,每月从搜寻引擎导入自然流量,达2万4千:每月「有机搜...

日期:2020-10-30 17:23:57 浏览:1264