在服务器上验证移动应用程序客户端的方法
Ways for verify mobile application client on server
我正在寻找设计方法
手机APP <-->服务器API其中:
- 授权用户和应用程序使用 OAuth2.0 与服务器一起工作
- 在服务器上验证,它是合法的应用程序
我现在面临的问题:Oauth2.0术语中的应用程序是public个客户端:
没有办法保护应用程序包中的任何静态信息 - 任何人都可以提取此类信息并在假应用程序中重用它。
如果我添加一些额外的方法来在服务器上注册新的应用程序实例 - 没有什么能阻止假应用程序做同样的事情。
是否有任何方法可以在不涉及 REST API 的情况下在应用程序和服务器之间交换数据,或者获取有关调用应用程序的已验证信息。
我知道答案是特定于平台的 - 我对任何平台上的信息都很感兴趣,因为我可以搜索其他平台的模拟信息。
对于移动应用程序,请使用 授权代码流 (PKCE),它会生成一个运行时密码,因此无需随应用程序一起部署固定密码。
流氓应用可能会使用您应用的客户端 ID 和重定向 URI,但一种处理方法是使用声明的基于 HTTPS 方案的重定向,如Financial Grade APIs / Native Apps.
如果对这种方法感兴趣,我的博客有几个详细的例子:
访问 API 服务器的 WHO 和 WHAT 之间的区别
I'm looking for a way to design
Mobile APP <--> Server API which:
- authorize user and app for work with server using OAuth2.0 <--- WHO
- validate on server, that it's legitimate application <--- WHAT
在我深入探讨您的问题之前,我想首先澄清一个误解,这个误解是我在任何资历的开发人员中经常发现的,那就是 who 和 [=73] 之间的区别=]什么 正在访问 API 服务器
我写了一系列关于API和移动安全的文章,在文章Why Does Your Mobile App Need An Api Key?中你可以详细阅读who和之间的区别什么 正在访问您的 API 服务器,但我将在这里提取主要内容:
The what is the thing making the request to the API server. Is it really a genuine instance of your mobile app, or is it a bot, an automated script or an attacker manually poking around your API server with a tool like Postman?
The who is the user of the mobile app that we can authenticate, authorize and identify in several ways, like using OpenID Connect or OAUTH2 flows.
考虑 who 作为用户,您的 API 服务器将能够验证和授权对数据的访问,并考虑 what 作为代表用户提出该请求的软件。
因此,您需要记住,您知道请求中的 who 并不能保证请求确实来自 what 您的 API 服务器需要您的移动应用程序的真实且未修改版本。
可能的解决方案
And if I add some additional method for register new instance of application on Server - there is nothing stop fake application from doing the same thing.
Is there ANY way to exchange data between Application and Server without involving REST API, or get verified information aboute calling application.
如果您的API服务器可以高度确信请求确实来自它所期望的,那么您的移动应用程序的真实且未修改的版本注册应用程序的新实例并与 API 服务器交换数据可以确信没有坏人参与。
您可以求助于 UBA 和 RASP 解决方案来帮助您了解 什么 正在发出 API 请求:
UBA - User Behavior Analytics:
User behavior analytics (UBA) as defined by Gartner is a cybersecurity process about detection of insider threats, targeted attacks, and financial fraud. UBA solutions look at patterns of human behavior, and then apply algorithms and statistical analysis to detect meaningful anomalies from those patterns—anomalies that indicate potential threats. Instead of tracking devices or security events, UBA tracks a system's users. Big data platforms like Apache Hadoop are increasing UBA functionality by allowing them to analyze petabytes worth of data to detect insider threats and advanced persistent threats.
RASP:
Runtime application self-protection (RASP) is a security technology that uses runtime instrumentation to detect and block computer attacks by taking advantage of information from inside the running software.
RASP technology is said to improve the security of software by monitoring its inputs, and blocking those that could allow attacks, while protecting the runtime environment from unwanted changes and tampering.
UBA 基于负面识别模型,通过识别什么是坏的,而不是什么是好的,尽最大努力区分好坏,因此它们容易出现误报。 UBA 解决方案基于分析每个 API 请求,他们没有从移动应用程序及其设备上发生的事情收集客户端实时情报。
RASP 解决方案是客户端,API 服务器看不到它们正在检测和阻止的内容。一旦它们成为客户端,它们就可以在 API 服务器不知道发生的情况下被绕过,因此它将接受来自此绕过的 API 请求。
我建议您阅读 我提出的问题 How to secure an API REST for mobile app?,尤其是部分 加固和屏蔽移动应用程序、保护API服务器和可能更好的解决方案。
因此,链接答案中可能更好的解决方案部分提到了使用移动应用证明解决方案,该解决方案将结合云服务和移动应用之间的实时后台通信,以证明移动应用是真实且未修改的,并且即 运行 在受信任的设备中。然后 API 服务器将能够以非常高的置信度知道 发出请求的内容 确实是移动应用程序的真实且未修改的版本 运行 在受信任的设备中。
您想加倍努力吗?
在任何对安全问题的回答中,我总是喜欢引用 OWASP 基金会的出色工作。
对于APIS
The OWASP API Security Project seeks to provide value to software developers and security assessors by underscoring the potential risks in insecure APIs, and illustrating how these risks may be mitigated. In order to facilitate this goal, the OWASP API Security Project will create and maintain a Top 10 API Security Risks document, as well as a documentation portal for best practices when creating or assessing APIs.
对于移动应用程序
OWASP Mobile Security Project - Top 10 risks
The OWASP Mobile Security Project is a centralized resource intended to give developers and security teams the resources they need to build and maintain secure mobile applications. Through the project, our goal is to classify mobile security risks and provide developmental controls to reduce their impact or likelihood of exploitation.
OWASP - Mobile Security Testing Guide:
The Mobile Security Testing Guide (MSTG) is a comprehensive manual for mobile app security development, testing and reverse engineering.
我正在寻找设计方法
手机APP <-->服务器API其中:
- 授权用户和应用程序使用 OAuth2.0 与服务器一起工作
- 在服务器上验证,它是合法的应用程序
我现在面临的问题:Oauth2.0术语中的应用程序是public个客户端: 没有办法保护应用程序包中的任何静态信息 - 任何人都可以提取此类信息并在假应用程序中重用它。
如果我添加一些额外的方法来在服务器上注册新的应用程序实例 - 没有什么能阻止假应用程序做同样的事情。
是否有任何方法可以在不涉及 REST API 的情况下在应用程序和服务器之间交换数据,或者获取有关调用应用程序的已验证信息。
我知道答案是特定于平台的 - 我对任何平台上的信息都很感兴趣,因为我可以搜索其他平台的模拟信息。
对于移动应用程序,请使用 授权代码流 (PKCE),它会生成一个运行时密码,因此无需随应用程序一起部署固定密码。
流氓应用可能会使用您应用的客户端 ID 和重定向 URI,但一种处理方法是使用声明的基于 HTTPS 方案的重定向,如Financial Grade APIs / Native Apps.
如果对这种方法感兴趣,我的博客有几个详细的例子:
访问 API 服务器的 WHO 和 WHAT 之间的区别
I'm looking for a way to design
Mobile APP <--> Server API which:
- authorize user and app for work with server using OAuth2.0 <--- WHO
- validate on server, that it's legitimate application <--- WHAT
在我深入探讨您的问题之前,我想首先澄清一个误解,这个误解是我在任何资历的开发人员中经常发现的,那就是 who 和 [=73] 之间的区别=]什么 正在访问 API 服务器
我写了一系列关于API和移动安全的文章,在文章Why Does Your Mobile App Need An Api Key?中你可以详细阅读who和之间的区别什么 正在访问您的 API 服务器,但我将在这里提取主要内容:
The what is the thing making the request to the API server. Is it really a genuine instance of your mobile app, or is it a bot, an automated script or an attacker manually poking around your API server with a tool like Postman?
The who is the user of the mobile app that we can authenticate, authorize and identify in several ways, like using OpenID Connect or OAUTH2 flows.
考虑 who 作为用户,您的 API 服务器将能够验证和授权对数据的访问,并考虑 what 作为代表用户提出该请求的软件。
因此,您需要记住,您知道请求中的 who 并不能保证请求确实来自 what 您的 API 服务器需要您的移动应用程序的真实且未修改版本。
可能的解决方案
And if I add some additional method for register new instance of application on Server - there is nothing stop fake application from doing the same thing.
Is there ANY way to exchange data between Application and Server without involving REST API, or get verified information aboute calling application.
如果您的API服务器可以高度确信请求确实来自它所期望的,那么您的移动应用程序的真实且未修改的版本注册应用程序的新实例并与 API 服务器交换数据可以确信没有坏人参与。
您可以求助于 UBA 和 RASP 解决方案来帮助您了解 什么 正在发出 API 请求:
UBA - User Behavior Analytics:
User behavior analytics (UBA) as defined by Gartner is a cybersecurity process about detection of insider threats, targeted attacks, and financial fraud. UBA solutions look at patterns of human behavior, and then apply algorithms and statistical analysis to detect meaningful anomalies from those patterns—anomalies that indicate potential threats. Instead of tracking devices or security events, UBA tracks a system's users. Big data platforms like Apache Hadoop are increasing UBA functionality by allowing them to analyze petabytes worth of data to detect insider threats and advanced persistent threats.
RASP:
Runtime application self-protection (RASP) is a security technology that uses runtime instrumentation to detect and block computer attacks by taking advantage of information from inside the running software.
RASP technology is said to improve the security of software by monitoring its inputs, and blocking those that could allow attacks, while protecting the runtime environment from unwanted changes and tampering.
UBA 基于负面识别模型,通过识别什么是坏的,而不是什么是好的,尽最大努力区分好坏,因此它们容易出现误报。 UBA 解决方案基于分析每个 API 请求,他们没有从移动应用程序及其设备上发生的事情收集客户端实时情报。
RASP 解决方案是客户端,API 服务器看不到它们正在检测和阻止的内容。一旦它们成为客户端,它们就可以在 API 服务器不知道发生的情况下被绕过,因此它将接受来自此绕过的 API 请求。
我建议您阅读
因此,链接答案中可能更好的解决方案部分提到了使用移动应用证明解决方案,该解决方案将结合云服务和移动应用之间的实时后台通信,以证明移动应用是真实且未修改的,并且即 运行 在受信任的设备中。然后 API 服务器将能够以非常高的置信度知道 发出请求的内容 确实是移动应用程序的真实且未修改的版本 运行 在受信任的设备中。
您想加倍努力吗?
在任何对安全问题的回答中,我总是喜欢引用 OWASP 基金会的出色工作。
对于APIS
The OWASP API Security Project seeks to provide value to software developers and security assessors by underscoring the potential risks in insecure APIs, and illustrating how these risks may be mitigated. In order to facilitate this goal, the OWASP API Security Project will create and maintain a Top 10 API Security Risks document, as well as a documentation portal for best practices when creating or assessing APIs.
对于移动应用程序
OWASP Mobile Security Project - Top 10 risks
The OWASP Mobile Security Project is a centralized resource intended to give developers and security teams the resources they need to build and maintain secure mobile applications. Through the project, our goal is to classify mobile security risks and provide developmental controls to reduce their impact or likelihood of exploitation.
OWASP - Mobile Security Testing Guide:
The Mobile Security Testing Guide (MSTG) is a comprehensive manual for mobile app security development, testing and reverse engineering.