Securing Tomcat under Linux/Unix


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Securing Tomcat under Linux/Unix
# 1  
Old 01-08-2007
Question Securing Tomcat under Linux/Unix

Hi

This being my first post I have to say that you guys seem to have a nice community going.

My question is regarding securing Tomcat 5.0 on a Linuxbased system (Red Hat 9) and particularly concerning file access for Tomcat. The problem is that it is possible to gain access to any file on a system using badly coded JSP-pages, if these JSP-pages dump file contents to be viewed by the visitors. I have a particular page in our system in mind which accepts a request for a file, locates it and prints the contents onto the webpage. The issue that arises is of course that the page could be used to gain access to sensitive files such as password files, config files, etc. Although giving a JSP-page direct access to a file (without checking permissions and so on) being bad practise as such coding around the problem would take a bit of time (defining what files/paths are allowed for viewing, who can view the files, etc). The purpose of that page is to legitimately access cached reports already generated by the system and saved as files.

Just making sure the Tomcat user account can't be used to access any file outside the Tomcat directories would be just a bit too easy, the complication being that we DO need to access a few files reciding outside Tomcat. This is due to one of the encryption keys in symmetric encryption is stored in 2 different files in 2 different directories (with key 2 being in a database).

The solution I'm thinking about is to chroot Tomcat and mount (with -bind opion) the needed filesystems. But googling this gives posts indicating that chrooting Tomcat might require moving JVM files etc into the chrooted sandbox since Tomcat (or the JVM) might otherwise not be able to function properly.

I'd be very grateful for anyone pointing out an alternative solution to chroot for protecting files from "malicous" dumping by directory traversing using Tomcat or anyone pointing out how to make a chrooted Tomcat work as painlessly as possible.

Cheers
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Where is the best location to deploy an application on Tomcat over Linux?

Hi, I'm trying to figure out the best location to deploy an application on Tomcat over Linux server. The application structure is as follows: 1. WAR - the app itself. 2. conf - configuration files that are part of the product, not to be changed in deployment 3. local_conf - overriding... (0 Replies)
Discussion started by: moshebs
0 Replies

2. Solaris

Tomcat..Unable to deploy application remotely in tomcat

Hi, We have upgrade tomcat from 5.0.20 to 7.0.33 and made changes to server.xml file according to newer version.. how ever the upgrade went fine and now i am unable to deploy application remotely.. it is giving 403 access denied error.. we have seperate appbase directory mentioned in server.xml..... (0 Replies)
Discussion started by: phani4u
0 Replies

3. UNIX for Dummies Questions & Answers

linux tomcat load average issue

Hello I am running a liferay application in tomcat on one of my hosted linux machine having 4GB of ram and 1 CPU. I get the tomcat response really slow and with much digging I found that the cpu might be loaded and can be tracked with top command. The following is the output of top command:... (0 Replies)
Discussion started by: dhavaln
0 Replies

4. UNIX for Dummies Questions & Answers

TomCat access in an Remote Linux Server

Hi all, I Installed Tomcat in an remote linux server (/usr/tomcat)and start service, using ./startup.sh (and tried with ./catalina.sh too). //----------------------------------------------------------------// # ./startup.sh Using CATALINA_BASE: /usr/tomcat/apache-tomcat-6.0.16/ Using... (1 Reply)
Discussion started by: gothama
1 Replies

5. Shell Programming and Scripting

Problem with Unix script to start remote Tomcat

I have Tomcat installed on a Unix box and I need to start it remotely from another Unix box. Tomcat is started using a script. When this script is run locally everything is fine. When I run the same script from remote box, tomcat starts but the command running the script does not terminate.:( ... (2 Replies)
Discussion started by: shrgh
2 Replies

6. AIX

securing a shell

I would like to secure a shell script from being broken out of with Ctrl-C or equivalent. Once a user logs in, he should not be able to exit to the command prompt. any ideas. Thank you J (1 Reply)
Discussion started by: jhansrod
1 Replies

7. Linux

jsp not working on linux running tomcat server

hey there we cant seem to get jsp to load pages properly on linux running tomcat 4 server. everytime we run .jsp files, the source code comes up instead of the actual file contents. any suggestions?? cheers mile1982 (1 Reply)
Discussion started by: mile1982
1 Replies

8. Shell Programming and Scripting

Securing arguments

OK here is my problem. Ive been trying to write a script where i use the order "find". For example if i wont to find some file in the sql_work directory using the script. You use the command: loc sql_work "q*" in order to find all the queries in the directory. Is there any other way to do it,... (0 Replies)
Discussion started by: SolidSnake
0 Replies

9. UNIX for Dummies Questions & Answers

Beginner: Securing a Unix box

Newbie in the Unix world here....trying to load Solaris 2.8 AGAIN, and trying to secure the box this time. Any suggestions anyone? Any tips? Appreciate your help, gurus! TIA, trigeek8888 (2 Replies)
Discussion started by: trigeek8888
2 Replies
Login or Register to Ask a Question