Home arrow JavaScript arrow Page 3 - Securing Your Web Server
JAVASCRIPT

Securing Your Web Server


In this third part of a five-part series that focuses on protecting your web server, you will learn about syslog and process accounting. This article is excerpted from chapter four of Securing Ajax Applications: Ensuring the Safety of the Dynamic Web, written by Christopher Wells (O'Reilly, 2007; ISBN: 0596529317). Copyright © 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

Author Info:
By: O'Reilly Media
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
September 25, 2008
TABLE OF CONTENTS:
  1. · Securing Your Web Server
  2. · Syslog con
  3. · Process accounting
  4. · Keeping Up to Date

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Securing Your Web Server - Process accounting
(Page 3 of 4 )

After syslog is configured, you should also enable process accounting. Process accounting is good for recording all commands users execute on the system. On my Ubuntu install I use apt-get to install the base process accounting (acct) package.

  apt-get install acct

  Selecting previously deselected package acct.
  (Reading database ... 16507 files and directories currently installed.)
  Unpacking acct (from .../acct_6.3.99+6.4pre1-4ubuntu1_i386.deb) ...
  Setting up acct (6.3.99+6.4pre1-4ubuntu1) ...
  Starting process accounting: Turning on process accounting, file set to '/var/log/
  account/pacct'.

After downloading and installing acct, you need to create an accounting database.

  touch /var/log/account/pacct
  chown root /var/account/pacct
  chmod 0644 /var/log/account/pacct

The acct database is stored in binary as a single file /var/log/account/pacct, so it is not easily editable. This forces an attacker to delete the whole file to cover her tracks. The deletion of the file, however, by itself confirms that something suspicious happened.

Now, if you ever want to audit what a particular user has done, you can do so by running:

  lastcomm [user-name]

Windows

Many have complained about Windows and how it handles logs. The complaints stem from the fact that most logging is disabled by default, and that the locations for the log files can be problematic for some situations. Even with these limitations, some prudent steps can be taken to help ensure that the system retains some valuable log information.

You should enable security auditing. Windows does not enable security auditing by default. To do so, two configuration changes are required.

On Windows you can enable audit logging by changing the policy settings located at Start -> Settings -> Control Panel -> Administrative Tools -> Local Security Policy.

Minimally, you should enable auditing for the following events:

  1. Logon and logoff
  2. User and group management
  3. Security policy changes
  4. Restart, shutdown, and system

You can also enable auditing of any file or directory structure by setting its properties (Security -> Advanced Settings -> Auditing).

A logging server

The best idea is to dedicate a server on your network, harden it, and send log messages to it from all your other machines. This way, the logs do not get compromised when the server does.

Having a centralized, hardened, logging server is ideal for log management. You can harden the server to allow only logging from specific IP addresses and to lock down all the listening ports except for the one for syslog. Having the logs stored in a different location than the web server means an attacker may be able to add false messages, but he won’t be able to destroy any logged messages.

Syslogd will accept logging messages remotely if it is instructed to do so on startup with the –r (for remote) startup option.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials