![]() |
Web Development »
Web Security »
Security
Intermediate
How to make your app secureBy Salil KhedkarIf you are into development or quality assurance of enterprise solutions, you must be aware of the security aspect of your application. This article provides a checklist for the same... |
C#, SQL, Windows, .NET, ASP.NET, Visual Studio, SQL 2000, Architect, DBA, Dev, QA
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
Do you develop web centric applications? Are you developing an enterprise software solution? Is your application n-tier? Do your software components collaborate from different machines? Are you worried about whether your application is secure? Do you want to know how the external auditors hired by your client certify your app to be secure? Are you into Quality Assurance and need to make sure whether the app you are testing is secure?
Well, this article is here to answer these questions. I have tried to be less verbose, so that after a quick read you will be aware of the most important concepts about this subject.
SQL injections: If the queries inside your code execute directly against the user input, the user can provide malicious input which can do nasty things with your database. For example a user types �A ; DELETE * FROM VENDORS� in the vendor name UI field. Your code will execute something like �SELECT * FROM VENDORS WHERE VENDORNAME = A ; DELETE * FROM VENDORS�. The solution is to use validated data and/or using parameterized queries.
The access to each module or page of your application should be authenticated. For example: a user should not be able to just specify a URL and access a page directly. You can choose from various authentication mechanisms like Windows authentication, Active directory, Digital Certificates or go ahead and implement your custom authentication logic.
Most people use XML files, registry entries or plain old text files to store CONFIG related info. It should however be kept in mind that the CONFIG data is easily accessible to prying eyes. If you are storing database username passwords or any such sensitive data in these files or the registry, please encrypt it.
The intermediate (cache) and final data storage files that your app might be generating must be stored inside folders which have appropriate access rights. For example: you can make the folder accessible only to the administrator and run your app with the administrator account so that it can access the folder but nobody else except the admin can touch it.
For web based systems HTTPS can ensure that the data being transmitted to the client browser is encrypted so that someone can�t just sniff your packets and get access to the data. All web based systems use URLs to pass application flags, IDs and sometimes small footprint data like user name. Avoid using any such human readable data in the URL. Encrypt the URL so that a user can�t just change a parameter in the URL and gets his hand on someone else�s data.
If your app enforces the following password policies, there are chances of a smart user looking into his boss' private data:
After your application session expires after a user logs out, make sure to clean the IIS session too and vice versa.
If your app has mechanisms like search where the number of results can potentially be very large, it is a good practice to guard your server with some kind of upper limit. For example you can limit your searches to return only 100 items from the result set at a time. This will save your server boggled down for a single user.
Well, this is obvious but often not carefully done. Do audit all the security related operations and provide basic reports for the admin to monitor. This will help find out the mischief early. Also log information regarding crashes/exceptions along with the corresponding user input. In case of malicious entries, this will enable to resolve the issue faster.
If you are not working in a managed environment like .NET or Java, you might run into buffer overruns. This happens when you write beyond your array boundaries or to an illegitimate memory location. This may cause corruption of the data in your process memory which can either result in a crash or security vulnerability.
Use the firewall configuration to let only those IP addresses connect to your Web Server / App Server machine which are legitimate. Keep only the valid ports open and disable all others.
Use the firewall to close all inbound and outbound unused ports. If you must expose a web server use the DMZ configuration wherein say only HTTP/FTP access is allowed to the web server machine and from the WS machine only your app port access is allowed inside the network.
If you follow these guidelines and follow good coding practices, securing your application is fairly straightforward. Depending upon the type of your application (for example utility v/s banking) you can fine tune what all you need to do.
If you found this article useful, you will also find this excellent article helpful: Improving Web Application Security: Threats and Countermeasures.
| You must Sign In to use this message board. | ||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 27 Jan 2005 Editor: Rinish Biju |
Copyright 2005 by Salil Khedkar Everything else Copyright © CodeProject, 1999-2009 Web16 | Advertise on the Code Project |