Java Web development security

Source: Internet
Author: User
The development security standards are summarized as follows.

1. It is absolutely necessary to use Preprocessing for SQL operations. If you need to splice SQL statements, filter the input information. Selet, update, delete, insert, And, %, ', _, are all blocked.

2. Generally, SQL injection is used to search for vulnerabilities on the website's front-end webpage. We recommend that you create database operation users for front-end operations and back-end operations respectively. The front-end users only grant the required basic permissions. Background users can have loose permissions but can only target the current database. The root user cannot be used for database connection. Otherwise, the data is lost, and you have no place to cry.

3. the password of the User Login table must be encrypted. If you can, you can also encrypt the user name together. This is the last method just in case. When the other party looks at your user logon table, they do not know what it is.

4. JSP files are put in the specified folder, if you use struts, you can put the files used by struts in a folder under the WEB-INF directory, because the WEB-INF folder web browsing user is not visible.

5. You must perform type check for file uploads, such as JSP, PHP, and ASP.ProgramFiles cannot be uploaded. If you are using the JK connection made by Apache + Tomcat in Linux, you can directly upload the file to the Apache directory or use ln for soft connection, in case that the other party uploads the JSP file and you do not know it, the file is also passed to the Apache directory.

Specify the JSP file to a folder in Tomcat. The other party cannot access the uploaded JSP file in the browser.

6. log. We recommend that you add service access logs, record visitors' IP addresses, PASS Parameters, create logs for background operation users, and record their operation content. Well-developed log records can help you identify potential risks and problems that have already occurred.

If you think so much about it on the fly, you can gradually improve it after the writing is rough. Finally, I would like to advise my programmers and friends to keep a low profile and be steadfast in their work. If you are a netizen logging on to a hacker software this year, you may be hacked. When you find that the person who hacked your website is just an amateur internet user, I believe that you will be hacked by little baby and hate to find a piece of tofu. Don't forget it. In short, low-level problems will always fall in the idle state, so the spirit is better.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.