Web Server Security

CS 6204 - Java and the WWW
Marc Abrams


References:


Web Assets and Risks

Discussion summarizes Yeager and McGrath, section 7.1.

Assets to Protect

Risks

Vulnerable points in Web:

Common Web Security Mechanisms

Threats to Internet Security

Threats to Web Server Software

Compare Web security to UNIX sendmail security.

sendmail...

In comparison, Web servers... There one additional problem in Web servers, with no parallel in sendmail, namely that every Web script (e.g., scripts that invoke external commands, perhaps through system call) on the server is a potential security hole.

Securing a Web Server

Restricting Access to Documents

Web servers use access control lists to enforce authorization to use Web documents.

In NCSA's httpd, user can create .htaccess file to control access:

The .htaccess file above only allows access either from hostnames that either end in .cs.vt.edu or .ee.vt.edu or from the host with IP address 128.173.40.105.

The lines are processed in order of appearance. Thus the "deny from all" will first prohibit access to any Internet host, and the subsequent "allow from" lines override the "deny from all."

How Password Protected Web Pages Work

NCSA's httpd uses basic authentication: use a simple password for authentication, and restrict document access according to user name, group membership, or user agent IP address. Example (for NCSA httpd, in .htaccess file for a directory) [from Stein, p. 141]:
AuthName      Saturn
AuthType      Basic
AuthUserFile  /usr/local/etc/httpd/conf/passwd
AuthGroupFile /usr/local/etc/httpd/conf/group

<Limit GET>
require user huey dewey louie
require group web-maintainers
</Limit>
The .htaccess file above says: When GET arrives for document with restricted access:

Password Files:

Web server maintains its own password file, separate from host password file. For example, in NCSA's httpd, use
htpasswd [-c] password_file user
to create a password file (if -c is present) or to add a user to the password file. The command prompts you for the password. The htpasswd program is in httpd's support directory.

Example:

Doing the above produces in file /usr/local/etc/httpd/conf/passwd something like: The password is transformed to the string "NVA3234NIITjij" by applying the Unix function crypt, defined in unistd.h (e.g., /usr/include/unistd.h).

Authentication Types (AuthType field):

The above is basic authentication.

There are alternatives to Basic authentication that use cryptography, so a sniffer cannot capture a uuencoded password and reuse it. (One is public key encryption. Another is to use passwords that are good for only one use, along with a card that a user possesses.)

Group Files:

A group file is created with a text editor. Each line consists of a group name followed by a colon followed by a comma separated list of user names:

Return to CS6204 home page.

Last modified on 30 September 1999.
Send comments to abrams@vt.edu.
[This is http://ei.cs.vt.edu/~jwww/courseNotes/server-sec.html.]