简体   繁体   English

如何使Java / Java EE应用程序的IP更安全?

[英]How can I make IP of my Java/Java EE app more secure?

We have an application (say core application) build using Java/Java EE/Spring batch. 我们有一个使用Java / Java EE / Spring批处理构建的应用程序(例如核心应用程序)。 This application contains all the business logic and is packaged into a jar file. 该应用程序包含所有业务逻辑,并打包到jar文件中。

Now, we have another web-application built using Spring MVC, Hibernate. 现在,我们有了另一个使用Spring MVC构建的Web应用程序Hibernate。 This web-application provides a UI to users to configure our core application. 该Web应用程序向用户提供UI,以配置我们的核心应用程序。 This web-application uses a jar of the core-application to perform business-tasks by referring the configuration. 该Web应用程序使用jar应用程序的核心,通过引用配置来执行业务任务。 Now, we want to distribute these applications as a product to various companies. 现在,我们希望将这些应用程序作为产品分发给各个公司。 But as we all know, jars/wars can be decompiled. 但是众所周知,罐子/战争可以反编译。

Hence, what can we do to save our IP? 因此,我们该怎么做才能节省IP?

Currently we are trying DashO (java obfuscator from Preempitve). 目前,我们正在尝试DashO(Preempitve的Java混淆器)。 Even after obfuscating, one can read the code using a decompiler. 即使经过混淆,也可以使用反编译器读取代码。 Even-though, the code is much more complex to read, business logic can be read. 即使读取代码复杂得多,也可以读取业务逻辑。

What are the best practises to secure our IP? 保护我们的IP的最佳做法是什么? What are the various methods to make our application more secure? 有什么方法可以使我们的应用程序更安全?

EDIT : Please note that we have to distribute a WAR to our clients, which is the main cause of worry. 编辑 :请注意,我们必须向我们的客户分发WAR,这是令人担忧的主要原因。

Are you trying to protect your server-side logic, or the client side logic, or both? 您是否要保护服务器端逻辑或/或客户端逻辑,或同时保护两者?

If it's the first, you're already done, because you can't decompile a file you don't have access to. 如果是第一个文件,则说明您已经完成,因为您无法反编译您无权访问的文件。

If it's the second, you're pretty much out of luck. 如果是第二秒,那么您很不走运。 Move sensitive logic from the client to the server, make the client simply a middleman who delivers user input and formats the server output in a pretty UI. 将敏感的逻辑从客户端转移到服务器,使客户端成为提供用户输入并在漂亮的UI中格式化服务器输出格式的中间人。 That way you won't care if someone sees your boring web service client. 这样,您就不会在乎是否有人看到您无聊的Web服务客户端。

Below are some of the ways you can secure your code. 以下是一些保护代码安全的方法。

  1. Use of Complex Obfuscators Go through this: 使用复杂的混淆器通过以下步骤:

[Complex Obfuscator Tools][1] [复杂的混淆器工具] [1]

There are similar tools which does much more than just java code mangling. 有一些类似的工具,其功能远不只是Java代码修改。

  1. Secure your network using SSL. 使用SSL保护您的网络。 Make the entire network path encrypted. 使整个网络路径加密。

  2. Use of Certificate Management enhances security and prevents unauthorized users from accessing your source code illegally. 使用证书管理可以增强安全性,并防止未经授权的用户非法访问您的源代码。

Let me know if you have any clarifications on the above. 如果您对以上内容有任何疑问,请告诉我。

Thanks. 谢谢。

Can you make parts of the app download from the web? 您可以从网络上下载部分应用程序吗? So war starts up, downloads futher modules from your server and then uses them. 因此战争开始了,从服务器上下载了更多模块,然后使用它们。 Also, would make sure download modules were not stored on disk anywhere. 另外,请确保下载模块未存储在磁盘上的任何位置。

Or how about if you build an API, and move important IP into the API? 或者,如果您构建一个API并将重要的IP移入该API呢?

Or how about moving parts of the code into native code? 还是将部分代码移入本地代码呢?

Obviscation is not security. 观察不是安全。 As my security buddy calls it, its "Security through Obscurity". 正如我的安全伙伴所说的那样,它的“通过隐秘实现安全”。

My short answer is that you should design your application(s) from the start with security in mind. 我的简短回答是,您应该从一开始就在设计应用程序时考虑安全性。 The long answer is that YOU need to secure your communications. 长答案是您需要确保通信安全。 For instance, you could require some sort of unique public/private key in order to access your web service, and make all your web services HTTPS so that hackers can't snoop through your packets as easily and pick out the protocols. 例如,您可能需要某种唯一的公用/专用密钥才能访问您的Web服务,并将所有Web服务设置为HTTPS,以使黑客无法轻松地窥探您的数据包并挑选协议。 We could call it a "license key". 我们可以称其为“许可证密钥”。 But, as everyone who knows anything about security will tell you, there really isn't any full-prof method, only ones that make it harder. 但是,正如每个对安全性一无所知的人都会告诉您的那样,实际上没有任何一种完全有效的方法,只有使它变得更加困难的方法。

I had a buddy that used to write Java Applet games that struggled with this. 我有个伙伴曾经写过与此相关的Java Applet游戏。 When he obviscated his code, thinking it would stop hackers from sending bogus scores, he found they just started de-compiling the code and calling the JARs directly. 当他放弃自己的代码,以为这将阻止黑客发送虚假分数时,他发现他们只是开始反编译代码并直接调用JAR。 Eventually, he re-wrote his entire score tracking system to be more "intelegent" such that it would know that you can't just score 10000000 points at once. 最终,他重新编写了自己的整个分数跟踪系统,使其更加“智能”,以至于它知道您不能一次获得10000000分。 Instead, the client had to send regular score updates, and the server had baked-in rules that prevented the scores from growing too fast. 取而代之的是,客户端必须发送定期的分数更新,而服务器具有固定的规则,可以防止分数增长过快。

Anyway, thats my $0.02 worth. 无论如何,那就是我的0.02美元。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM