1. web.xml 설정

보안 이슈로 인하여 특정 Method를 제한하는 경우가 있다.

-> JEUS에서 AP/WEB-INF/web.xml 파일에서 수정

vi web.xml


<web-app>
...
<security-constraint>
 <web-resource-collection>
 <web-resource-name>restricted methods</web-resource-name>
 <url-pattern>/*</url-pattern>
 <http-method>PUT</http-method>
 <http-method>DELETE</http-method>
 <http-method>OPTIONS</http-method>
 <http-method>TRACE</http-method>
 </web-resource-collection>
 <auth-constraint/>
 </security-constraint>
...
</web-app>

 

  • url-pattern : 특정 디렉토리에 인증(제한)을 걸 수 있게 경로 지정
  • http-method : 인증할 메서드를 지정
  • <auth-constraint/> : 모든 사용자 접근 불가

2. 주의사항

Jeus 6.0.0.9에서 Method 제한 설정을 한 경우, 제한하지 않은 Method 요청에 대해서도 보안 인증 창이 뜨는 경우가 있음

인증 요청 창

3. 해결 방법

AP/WEB-INF 디렉토리에 jeus-web-dd.xml 파일을 생성해주고 redeploy를 하면 해당 설정이 정상적으로 적용된다.

 (JEUS6.0 fix9는 AP를 deploy 할 때 jeus-web-dd.xml 파일이 없는 경우 자동으로 생성하지 않기 때문)

 

4. 테스트 방법

ip, was port로 telnet 접속 후 테스트할 [메소드] [경로] [HTTP/1.0] 입력하면 403 또는 405 에러 노출되면 메소드 제한이 잘 되고 있는 것이다.


telnet 192.168.0.100 8080 (telnet ip port(was))

OPTIONS /index.jsp HTTP/1.0

 

 

 

 

 

 

출처:Tmax Technet

+ Recent posts