简体   繁体   English

使用Java Servlet API存储敏感

[英]Store sensitive using Java Servlet API

I have web app which is running on Java Servlet web container,specifically on IBM WebSphere.My question is: whether there is the recommended way (as part of Java Servlet API) to store a sensitive data, like user password for example. 我有一个运行在Java Servlet Web容器上运行的Web应用程序,特别是在IBM WebSphere上。我的问题是:是否存在推荐的方法(作为Java Servlet API的一部分)存储敏感数据,例如用户密码。 I can write my own solution from scratch at any time,just was wondering if there is more standard way to achieve the same. 我可以随时从头开始编写自己的解决方案,只是想知道是否有更多的标准方法可以实现相同的目的。

What kind : 什么种类

  • configuration data like database user+password, 配置数据,例如数据库用户名+密码,
  • or mass data like member accounts? 还是像会员帐户这样的海量数据?

Configuration data can be stored outside the application (war), as JNDI data source and such. 配置数据可以作为JNDI数据源等存储在应用程序之外(战争)。 This would mean that the developers need no access to deployment configuration, and the deployment configuration can have its passwords updated regularly. 这意味着开发人员无需访问部署配置,并且可以定期更新部署配置的密码。

For mass data: passwords should be stored as encrypted seeds (irreversible), taking care not to use an unsuitable encryption (for instance passwords with same prefix being encrypted to the same prefix). 对于海量数据:密码应作为加密种子(不可逆)存储,请注意不要使用不合适的加密(例如,将具有相同前缀的密码加密为相同前缀)。

For things like patient records address data might be encrypted decryptable, so a dump exposes less info. 对于诸如患者记录之类的东西,地址数据可能是可解密的,因此转储公开的信息较少。

Use one or more database user accounts with restricted rights. 使用一个或多个具有受限权限的数据库用户帐户。

Take care of backups: a total database dump is a very attractive treasure. 做好备份工作:总的数据库转储是非常诱人的财富。 After compression it might be encrypted, in the same pipe. 压缩后,可能会在同一管道中对其进行加密。

I am not sure what kind of password and user name you mean but if your web app has the connection with database, you can log into admin console and set up connection using JNDI. 我不确定您指的是哪种密码和用户名,但是如果您的Web应用程序具有与数据库的连接,则可以登录到管理控制台并使用JNDI设置连接。

Here is the path: 这是路径:

Resoucrs>Data sources > your_DataSource(set up your data source) > JAAS - J2C authentication data > Your_user (Set up your user, store user and password) 资源>数据源> your_DataSource(设置数据源)> JAAS-J2C认证数据> Your_user(设置用户,存储用户和密码)

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

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