As you know that every web application becomes vulnerable when they are exposed to the Internet. Fortunately, there are a number of best practices and coutner measures that web developers can utilize when they build their apps. This post will list some proven counter measures that enhance web apps security significantly.
Network security checklist
- Most of the web applications reside behind perimeter firewalls, routers and various types of filtering devices. Always make sure that your perimeter devices used for filtering traffic are stateful packet inspection device.
- Routers and firewalls should be configured to allow necessary types of traffic such as http or https. Block all other unnecessary types of traffic that you do not need to support your web applications.
- Just like inbound traffic you need to allow outbound traffic. Configure your router and firewall for the necessary outbound traffic from your web applications.
- Make sure your perimeter devices (firewall, routers etc.) are equipped with appropriate DOS (denial of service) countermeasures. If you are using Cisco routers, you can use rate-limit commands in order to limit the committed access rate.
- If you are using load balancers, check out whether it is disclosing any information about your internal networks.
- Think about implementing a network intrusion system and establish appropriate policies and procedures to review logs for attack signature.
- Disable telnet access to all of your network devices for remote access. Use SSH for only for the devices that you need to access for the Internet.
- Make a password change policy for all of your remote access devices and also allow only specific IP addresses to access your network remotely.
- Conduct network vulnerability scans regularly.
- Every time you make major changes to your network, you may arrange for a penetration test by a third party organization. Make a plan to conduct penetration test at least each year.
Web Server checklist
- Whenever your software vendor release software updates or any security patches, apply it to your network after appropriate testing.
- Check your server configuration to ensure that it is not disclosing any sensitive information about the install application software in your server.
- Disallow servers to show directory listing and parent path.
- Disable the unnecessary services on your servers.
- If your software vendor recommends you to use specific security settings, implement it appropriately.
- Disable or delete guest accounts, unnecessary groups and users.
- Enable OS auditing system and web server logging.
- Remove unnecessary modules or extension from your web servers.
- Remove default website and sample contents, if there is any, from all of your web servers.
- Configure authentication mechanism properly in your server directories.
- Always use SSL when you think your traffic is sensitive and vulnerable to eavesdroppers. Make sure you use the appropriate key length for encryption ad use only SSLv3.
- Deploy web contents in a virtual root that do not have any administrative utilities. This virtual root can be a separate drive or separate disk.
- Disable directory listing and parent path in your web server.
- Check your current error message pages in your server. If it is leaking any information about your server, customize it.
- Make sure all the accounts running HTTP service do not have high level privileged.
- Create access control list for all of your web directories and files.
- If your servers have WebDAV (Web Distributed Authoring and Versioning) disable it or delete it if you do not need it. If you have to keep WebDAV, apply proper access restrictions to it.
- Disable web publishing functionalities (such as iPlanet products) if you have any.
- Apply and fine tune your web servers security modules( UrlSCAN in IIS or Mod-security in Apache)
- Scan your server with popular scanners in order to identify vulnerabilities and mitigate the risks.
- Think about using host based intrusion detection system along with network intrusion system. Make a policy to review the logs.
Database Server security checklist
- Check that if your database is running with the least possible privilege for the services it delivers.
- Update your database software with latest and appropriate patches from your vendor.
- Remove all sample and guest accounts from your database.
- The dynamic sites need to communicate with the database server to generate request contents by the users. Restrict traffic FLOW between database and web server using IP packet filtering.
- Use appropriate authentication mechanism between your web servers and database servers.
- If your database has a default account, you can either change it or use a separate password.
- Make sure database users are granted privileges according to their roles and requirements.
- Delete extended stored procedures and relevant libraries from our database if you do not need them.
- Do not embed database user passwords in the application codes.
- Plan for a database audit.
- Change database passwords after predefined period. After predefined period.
Application security
- Create a thereat model of your application and approve it by the management and IS security team.
- Segregate the application development environment from the production environment. Never use the production data in the test environment for testing purpose.
- Make sure your application’s authentication system match industries best practices.
- Use ACL to control access to application directories and files.
- Use proper input validation technique output encoding in the server side.
- Secure the source codes and files of your web applications.
- Remove temporary files from your application servers.
- Cookies and session management should be implemented according the best practices of your application development platform. Implement a session expiration timeout and avoid allowing multiple concurrent sessions.
- Assign a new session ID when users login and have a logout option.
- Allow least privilege to the application users.
- Implement a CAPTCHA and email verification system if you allow your users to create account with your application.
- Use appropriate encryption algorithm to meet your data security requirements.
- Always place the ‘includes’ files (the files required by the server side scripts) outside the virtual root directory. Apply ACL to your include files if possible. Rename the includes files into .asp in your IIS server.
- Identify the vulnerable API or function calls and avoid them if there is a work around for it.
- Parameterized SQL queries to prevent SQL injection.
- Enable error handling and security logging features.
- Run a security audit on your source codes.
- Perform a black box test on our application. If you do not have any penetration tester in your organization, which is more likely, you can hire a professional penetration tester.
- Change administration and other privileged passwords regularly.
- Conduct web application vulnerability scan regularly to identify application layer vulnerabilities of your application.
- Always conduct a proper penetration test before moving your application from the development environment to the production environment. Also, run a pen test when you make signification modification to the application.
Are you an application security professional looking for work? Make sure to check the application security jobs available right now