'jboss'에 해당되는 글 1건

  1. 2009.03.26 [JBOSS/TOMCAT] JBOSS/TOMCAT 에서 심볼릭링크 디렉토리 허용 방법
2009. 3. 26. 14:50

[JBOSS/TOMCAT] JBOSS/TOMCAT 에서 심볼릭링크 디렉토리 허용 방법

TOMCAT이야 JSP 컨테이너로 잘 알고 있는 프로그램이고 JBOSS의 경우 Open Source WAS이다. JBOSS 중에서 JSP 컨테이너 부분은 TOMCAT을 사용하고 있다.

둘다 설정 파일 위치만 다르고 동일하기 때문에 이번 쓰래드는 JBOSS/TOMCAT으로 기술한다.

앞으로도 JBOSS와 TOMCAT에 둘다 적용 가능한 부분은 JBOSS/TOMCAT으로 JBOSS만 적용 되는 부분은 JBOSS로 TOMCAT에만 적용 되는 부분은 앞에 TOMCAT을 붙이겠다.

기본적으로 JBOSS/TOMCAT에서는 WEB Application 디렉터리 바깥으로 심볼릭 링크를 허용하지 않는다.
그러나 만약에 허용 하는 경우에는 Context의 allowLinking 값을 true로 설정하는 경우 외부의 심볼릭 링크를 허용하게 된다.

Default Context는 jboss-web.deployer/context.xml(TOMCAT의 경우 server.xml)에서 설정하게 되며, Web Application 별로 설정하고 싶은 경우에는 WEB-INF/context.xml에서 설정하게 된다.

참고로 심볼릭링크를 사용하는 경우 JBOSS나 TOMCAT을 구동하는 사용자가 해당 디렉터리를 읽을 수 잇는 권한이 설정 되어야 한다.


설정 예시

ROOT.war/WEB-INF/context.xml

<Context cookies="true" crossContext="true" allowLinking="true">
   <!-- Session persistence is disable by default. To enable for all web

   apps set the pathname to a non-empty value:

   <Manager pathname="SESSIONS.ser" />

   To enable session persistence for a single web app, add a

   WEB-INF/context.xml

   -->

   <Manager pathname="" />

   <!-- Install an InstanceListener to handle the establishment of the run-as

   role for servlet init/destroy events.

   -->

   <InstanceListener>org.jboss.web.tomcat.security.RunAsListener</InstanceListener>

  

</Context>



참고로 심볼릭 링크 허용은 보안상의 문제를 일으킬 수 있다. 그러므로 Default Context에 설정하기 보다는 필요한 Web Application에만 설정하도록 한다.

그리고 Windows에서는 이를 허용할 경우, JSP 소스가 노출되는 문제가 있으므로 설정해서는 안된다.


(*) 다큐먼트에 나와있는 주의 사항

NOTE: This flag MUST NOT be set to true on the Windows platform (or any other OS which does not have a case sensitive filesystem), as it will disable case sensitivity checks, allowing JSP source code disclosure, among other security problems.