반응형

출처: http://woony5231.tistory.com/entry/%EB%A7%88%EC%9D%B4%ED%94%8C%EB%9E%AB%ED%8F%BC%EC%9D%B4%EB%9E%80



PID Developer's Guide.pdf




마이플랫폼(MiPlatform)은 클라이언트/서버 환경의 웹의 클라이언트 환경을 대체할 대표적인 대안인 X-Internet 기반의


제품으로 국내 유일의 유무선 통합 UI 개발/운용 환경이다.

포레스트 리서치가 주창한 X-인터넷 개념 (eXecutable은 물론 eXtended Internet까지 확장된 개념)을 가장 완벽하게


재현해낸 솔루션으로 4GL 수준의 강력하고 풍부한 사용자 인터페이스(UI) 및 용이한 애플리케이션 개발 환경을 제공하고,


한번의 응용프로그램 개발로 웹은 물론 PDA, Smart Phone 등 다양한 채널을 통합관리 할 수 있으며, 또한 바코드 리더기 등


다양한 외부 장비와의 손쉬운 인터페이스를 제공한다.

이 밖에 다양한 출력 포맷 및 미려한 리포트 디자인을 지원하는 리포팅 툴을 기본 내장하였으며 필요한 경우 별도의 3rd Party


제품과의 손쉬운 연계가 가능하여 개발에서부터 화면 배포, 최종 출력까지 모든 프로세스를 통합 관리하는 솔루션이다.







효과적인 모바일 서비스 지원하는 X-인터넷 솔루션

투비소프트는 자사의 X-인터넷 솔루션인 ‘마이플랫폼’이


마이크로소프트 인터넷 익스플로러 대신, 자체 개발한 비즈니스 전용 브라우저를

 

기반으로 하고 있어 윈도우 운영체제에 독립적이라는 것을 특장점으로


내세우고 있다.


또 한 번의 웹 애플리케이션 개발로 클라이언트-서버 환경은 물론 모바일 환경


에서도 사용할 수 있도록 해주는 국내 유일한 X-인터넷 솔루션이라는 것 역시


투비소프트의 자랑으로, 특히 네트워크 트래픽을 최소화해 유무선 네트워크 환경에서


쾌적한 애플리케이션 사용을 보장하고 있다.


사용자 삽입 이미지

다른 국내 X-인터넷 솔루션들이 웹 브라우저(IE)를 기반으로 하고 있는데 비해


투비소프트에서 자체 개발한 비즈니스 전용 브라우저를 기반으로 하고 있는


마이플랫폼 3.1은 특히 신속한 데이터 조회를 필요로 하는 금융권에 적합하다. 

또한 직원들의 모바일을 통한 적재적시의 업무처리와 이용자(고객)들에게


다양한 모바일 서비스를 지원하고자 하는 물류, 통신, 제조, 의료, 대학 및


공공 기관으로 다양하게 도입돼 이용되고 있다. 

자체 개발한 비즈니스 전용 브라우저를 기반으로 한 마이플랫폼은 소스 코드가 윈도우 OS에 독립적이기 때문에 다양한


OS로의 이식이 가능하다. 따라서 한 번의 개발로 웹과 클라이언트 서버는 물론 동시에 다양한 모바일 서비스를 지원하는


국내 유일한 X-인터넷 솔루션이라 게 마이플랫폼의 특장점이다.

투비소프트 부설연구소 이우철 팀장은 “웹 브라우저를 기반으로 한 다른 솔루션들의 경우 웹 브라우저에 독립적이지 못하다.


예를 들면 웹 내에 버그가 생길 경우 웹이 고쳐져야만 해결되는 것처럼 웹이 제공 못하는 기능도 있는데, 마이플랫폼은 기본


OS에 독립적이란 게 다른 솔루션과의 가장 큰 차별점”이라고 설명한다. 

마이플랫폼 3.1은 자체 개발한 X-인터넷 개발툴인 PID(Presentation Interface Developer)툴을 지원함으로써


비주얼 베이직, 델파이, 파워빌더와 유사한 인터페이스 및 기능을 제공한다.


특히 PID툴은 개발자들이 소스 코드에 대한 개발 단계별 결과 값을 확인할 수 있어 개발 과정에서의 잘못된 부분을 찾는 데


용이한 라인 디버깅(Line Debugging) 기능과 다양한 프로젝트 폼의 조합을 지원하는 MDI(Multi Documents Interface) 등을


지원함으로써 개발자들의 손쉬운 업무 실현을 돕는다. 

실제로 중앙대병원은 다양한 의료 장비와 기존 시스템 자원(컴포넌트)과의 연동을 목적으로 마이플랫폼을 도입해


종합의료정보시스템을 운영중인데, 중앙대병원의 개발자들은 MDI를 이용해 손쉬운 개발과 다양한 응용을 함으로써


개발 생산성을 극대화하고 있다. 


투비소프트 이우철 팀장은 “개발 생산성의 핵심은 버그를 찾아내는 속도인데, PID 툴에서 디버깅에 대해서도 추적할 수 있는


라인디버깅 기능을 지원하기 때문에 개발 생산성을 높이는 데 효과적”이라며, “마이플랫폼은 코드 시작과 끝을 찾아내는 기능을


지원하는 국내 유일한 X-인터넷 솔루션” 이라고 강조한다. 

 

 

네트워크 트래픽 ‘최소화’로 모바일 환경에서도 ‘탁월’

마이플랫폼 3.1은 최대 80% 데이터 압축으로 네트워크 부하를 감소하고 캐싱 기능을 통해 네트워크 트래픽을 최소화한다.


또 자체 개발한 브라우저를 기반으로 하고 있기 때문에 개발자가 구현한 화면 산출물에 대한 최적화가 가능하다는 게 이우철


팀장의 설명. 

현재 조흥은행은 유무선 통합 뱅킹 서비스인 ‘원클릭’ 서비스에 마이플랫폼을 도입해 이용중이다. 기존에 인터넷 뱅킹 시


데이터 조회 속도가 느려 업무를 보는데 고객들이 불편을 겪었지만, 현재 마이플랫폼의 캐싱 기능으로 화면에 부하가 없고,


기존에 비해 데이터 패킷 양이 7배 정도 줄어들어 인터넷 환경이 좋지 않거나 원격지에서도 쾌적하게 사용할 수 있다. 

조흥은행 관계자는 “투비소프트의 마이플랫폼을 이용해 인터넷 뱅킹 애플리케이션을 개발했는데, 속도가 빠른 편이다.


남극에 파견돼 있는 연구소에서도 인터넷 뱅킹으로 편리하고 빠르게 계좌 데이터 조회 등 인터넷으로 뱅킹 서비스를 제공받고


있다”고 전했다. 

또한 SK텔레콤은 기업전용 모바일 플랫폼인 BCP(Business Common Platform)에 마이플랫폼을 도입했다. 마이플랫폼은


네트워크로 보내지는 데이터를 압축, 전송함으로써 트래픽을 최소화하기 때문에 기업들은 마이플랫폼을 이용해 개발한


데스크톱이나 서버용 애플리케이션을 다시 PDA용으로 전환할 필요 없이 기존에 개발한 애플리케이션을 그대로 모바일


환경에서 사용할 수 있어 시간과 비용, 안정성 측면에서 효과적이다. 

대출영업 모바일 시스템에 마이플랫폼을 적용한 한미은행 역시 직원들에게 PDA를 지급, 고객들에게 직접 화면을 보여주면서


설명, 계약 업무를 수행하고 있으며 기업은행, 제일화재, 대한생명 등도 투비소프트의 마이플랫폼으로 유무선을 연동해 타


업체와 차별화된 모바일 서비스로 경쟁력을 강화하고 있다. 

마이플랫폼은 암호화해 데이터를 주고받는 강력한 보안인 SSL을 기본 지원함은 물론, 멀티 모니터와 다양한 벤더의 보안


모듈과 연동할 수 있도록 지원한다. 강력한 보안 기능은 투비소프트 마이플랫폼이 금융권 고객을 다수 확보하고 있다는


데서도 알 수 있는 것. 

 

 

 

다양한 기기와 연동 가능한 오픈 아키텍처

버추얼 엔진을 기반으로 하는 마이플랫폼은 통신과 일부 컴포넌트를 고객 환경에 맞게 커스터마이징할 수 있다. 모바일 기기를


비롯한 외부기기들과 연동이 가능하며 통신 모듈을 따로 구축할 수 있어 기업들은 통신 부문을 제외하고 애플리케이션을


개발한 후, 추후 마이플랫폼의 통신 모듈을 연동시키면 된다. 때문에 개발자들의 업무 집중 효과도 높다는 설명이다.

또한 보통 웹 애플리케이션에서는 액티브X를 기반으로 그리드, 에디트 박스 등 컨트럴 패널이나 메뉴를 교체하기 위해서는


소스를 바꿔야 하지만, 컴포넌트 방식인 마이플랫폼은 화면 소스를 바꾸지 않고도 컨트롤 메뉴 교체가 가능하다.

그 밖에도 마이플랫폼 3.1은 개발자들에게 4GL 수준의 다양한 UI 컴포넌트를 제공함으로써 개발자들이 손쉬운 애플리케이션을


개발하도록 해 개발 생산성을 향상시킬 수 있다. 또 차트와 OLAP, 리포팅 툴이 내장돼 있어서 각 나라별, 연도별 대화방식으로


데이터를 보고 분석할 수 있고 편리한 프리젠테이션과 보고서 기능 등을 제공하고 있다.

이우철 팀장은 “X-인터넷 솔루션의 중요한 경쟁력은 그리드 기능이다. 마이플랫폼은 고객들이 원하는 그리드 안에서의 기본적인


엑셀 기능은 모두 지원하며 멀티헤더 구현이 가능하다는 점에서 다른 솔루션들과 차별점을 지닌다” 고 전한다. 

차트는 별도로 구매해 연동시키면 데이터 바인딩이 가능하지만, 리포팅 툴은 다른 제품이 별도 판매를 하는데 반해 마이플랫폼은


기본으로 내장하고 있어 비용상 경제적이라고 이우철 팀장은 덧붙인다. 

또 마이플랫폼은 ‘마이푸쉬 서버’와의 통신 기능이 기본 제공되는데, 이는 비즈니스 서비스에서 생성된 데이터를 클라이언트에


메시지 형태로 신속하게 전송해준다. 예를 들어 증권사에서 주식 시세가 바뀔 때마다 사용자의 클라이언트 화면에 신속하게


알려줄 수 있는 것이 마이푸쉬 서버로, 이 제품은 별도 판매된다. 

이우철 팀장은 “마이플랫폼은 ‘클라이언트 툴’ 이므로 서버가 무엇이든 다 접목시킬 수 있다. 마이푸쉬 서버처럼 패키지 형태로


구축하면 개발 기간이 줄고, 비용도 감소해 훨씬 효과적”이라고 강조한다.

또 RFID가 화두인 제조나 물류, 유통업체에서는 마이플랫폼이 내장돼 있는 ‘마이 RFID’를 도입함으로써 마이플랫폼과 RFID를


동시에 구현할 수 있다. 

투비소프트는 올해 마이플랫폼이 어떤 환경에서도 신속하게 구축될 수 있도록 하기 위해 마이크로소프트 환경에 독립적인


개발 방향을 강화한다는 방침이다. 

투비소프트 마이플랫폼 3.1
모바일을 비롯한 외부기기들과의 연동이 가능하고, 데이터 압축으로 네트워크 트래픽을 최소화함으로써 한 번 개발된 애플리케이션을 변환 없이 모바일에서도 사용할 수 있다. PID툴, 라인디버깅 기능, 다양한 UI 컴포넌트를 제공한다.

+ 유무선 연동 및 모바일 서비스 지원; 자체 개발한 PID툴 지원; 라인 디버깅 기능 및 MDI 제공; 네트워크 트래픽 최소화; 4GL 수준의 다양한 UI 컴포넌트 제공; 리포팅툴 기본 탑재 

- 윈도우 OS에 대한 종속성을 벗어난다는 취지에서 사용하고 있는 전용 브라우저가 기업 고객들에게는 또다른 구속이 될 수도 있다

비교 대상 쉬프트정보통신 가우스 닷넷 4.0

문의 투비소프트
02-2140-7700 www.tobesoft.com




사용자 삽입 이미지




사용자 삽입 이미지


반응형
반응형

출처 : http://fendee.egloos.com/7097191


삭제 방지용으로 내용 붙여 넣는다.


<form method="post" enctype="text/html" action="<%=Request.ServerVariables("SCRIPT_NAME")%>?t2=t2&t3=t3">
  <input type="text" name="t1" value="t1">
  <input type="text" name="t4" value="t4">
  <input type="submit" value="확인">
</form>

<br>전송방식 : <%=Request.ServerVariables ("REQUEST_METHOD")%>
<br>쿼리 스트링: <%=Request.ServerVariables ("QUERY_STRING")%>
<br>IP주소 : <%=Request.ServerVariables ("REMOTE_ADDR")%>
<br>브라우저 : <%=Request.ServerVariables ("HTTP_USER_AGENT")%>
<br>로그온ID : <%=Request.ServerVariables ("LOGON_USER")%>
<hr>
<br>서버 포트 : <%=Request.ServerVariables ("SERVER_PORT")%>
<br>웹 서버 : <%=Request.ServerVariables ("SERVER_SOFTWARE")%>

<hr>

출력결과:

전송방식 : POST 
쿼리 스트링: t2=t2&t3=t3 
IP주소 : 127.0.0.1 
브라우저 : Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727) 
로그온ID : 
--------------------------------------------------------------------------------
서버 포트 : 8080 
웹 서버 : Microsoft-IIS/5.1

--------------------------------------------------------------------------------

설명:
Request.ServerVariables("QUERY_STRING") 은 쿼리스트링으로(get) 넘어온 모든 값을 보여준다.
Request.ServerVariables("LOGON_USER") 는 윈도우 인증으로 로그인이 된 경우의 사용자 아이디를 보여준다.


반응형
반응형

출처: http://visu4l.tistory.com/419


Tomcat 혹은 그외에 웹서버에 SSL을 적용시키기 전에 개발자들이 테스트용으로 사용하는 Trial SSL에 대해 설명한다.



1. 테스트 인증서 생성


명령어 : keytool -genkey -keyalg rsa -alias [Alias_Name] -keystore [KeyStore_File_Name]


keytool 명령은 java jdk 디렉토리 하위 bin 디렉토리에 있다. path가 지정되어있지 않으면 

해당 디렉토리로 이동후 실행하거나 절대경로로 실행해주어야 한다.

저는 path가 지정되어 있어 keytool 명령어로 실행한다.





인증서 생성시 물어보는 질문들은 다음과 같다.


> 키저장소 비밀번호 입력

> 새 비밀번호 다시 입력:

> 이름과 성을 입력하십시오. (인증서가 사용될 도메인을 입력하면된다.)

> 조직 단위 이름을 입력하십시오

> 조직 이름을 입력하십시오

> 구/군시 이름을 입력하십시오

> 시/도 이름을 입력하십시오

> 이 조직의 두 자리 국가 코드를 입력하십시오




2. csr 파일 생성


명령어 : keytool -certreq -alias [Alias_Name] -keyalg rsa -file [CSR_File_name] -keystore [KeyStore_File]



csr 파일을 확인해보면 아래와 같은 형태의 파일이 생성이 된다.






3. Trial SSL 인증서 발급받기


Trial SSL 인증서를 발급 받는 기관은 여러곳이 있지만 여기에선 시만텍을 사이트를 이용한다.

아래 사이트 접속

Trial 인증서 발급 받기


사이트를 그대로 따라가면 됩니다. Continue~




두번째에서 사용자 등록을 하는데 Email은 정확히 적으셔야합니다.

아래는 그다음은 알아서 등록 Continue~



다음으로 CSR을 등록하라는 페이지가 나왔는데 위해서 만들어두었던 csr.txt파일에 내용을 그대로 복사 후 Continue~



그러면 끝났습니다. 동의하고 Submit하면 

끝났습니다.

이제 메일을 확인해보시면 됩니다.



이제 인증서가 3가지 종류가 필요합니다.

1). 인증기관에서 발급받은 인증서

2). 루트인증서 (최상위 인증기관 인증서)

3). 체인인증서 (중간기관 인증서)


1). 인증기관에서 발급받은 인증서 


메일을 확인 해보면 시만텍에서 메일이 와있을겁니다. 본문 혹은 첨부파일에 


-----BEGIN CERTIFICATE-----

....

-----END CERTIFICATE-----


요런 형태의 시만텍 인증서가 있을겁니다.



그내용을 그대로 복사후 cert.pem 파일에 저장합니다.



2). 루트인증서


다시 메일을 확인해서 차근히 읽어 봅시다


Step 1. Download and install the Test Root CA Certificate.

Open the link below and follow the steps to install the Root certificate in your internet browser:
https://knowledge.verisign.com/support/ssl-certificates-support/index?page=content&id=SO10670


Root CA 파일 다운로드 링크가 걸린 부분이 있을겁니다. 저 링크를 타고 이동합니다.

혹시나 링크가 계속 변경될수 있으니 메일에 있는 링크로 이동하시기 바랍니다.


링크로 이동하면 다음과 같은 페이지가 보입니다.

페이지에서 중간에 

"How to install the trial root CA Certificate into ~~" 부분 뒤에 "SO10~~"링크를 클릭합니다.

아무 거나 들어가셔도 됩니다.


그러면 다음과 같은 화면이 나오고 중간에 "Download Secure Site Trial Root Certificate" 링크를 클릭합니다.


그러면 아래와 같이 또다른 인증서가 보입니다.

해당 인증거를 복사후 TrialRoot.pem 파일로 저장합니다.

파일이름은 알아서 정하면됩니다. 구분만 잘 할수 있으면 됩니다.



3). 체인인증서


다시 메일로 가서


Step 2. Download the Trial SSL Intermediate CA Certificate.

To download the Trial Intermediate CA on each Web server you are testing with, go to:
https://knowledge.verisign.com/support/ssl-certificates-support/index?page=content&id=AR1737


위부분을 찾습니다. 똑같이 링크로 이동

이번에는 바로 인증서가 나올겁니다.


똑같이 복사 후 저장 

저는 TrialIntermediate.pem 라는 이름으로 저장했습니다.






4. Trial SSL 인증서 합치기


keytool -import -alias Root -trustcscerts -file TrialRoot.pem -keystore testserver


keytool -import -alias Intermediate -trustcscerts -file TrialIntermediate.pem -keystore testserver


keytool -import -alias testserver -trustcscerts -file cert.pem -keystore testserver


3개에 인증서를 합치면 아래 와 같이 메시지가 나옵니다.





5. Tomcat Server 설정

Tomcat 폴더에 conf/server.xml 파일을 수정합니다.


<Connector 

sslProtocol="TLS" clientAuth="false" 

keystorePass="암호"

keystoreFile="C:/Users/Administrator/testserver" 

secure="true" scheme="https" maxThreads="150" 

SSLEnabled="true"  port="443"/>


keystorePass에 처음에 생성했던 keystore에 암호를 입력

keystoreFile에 keystore 파일 위치(절대경로)



이렇게 설정까지 하면 준비가 끝났다.


https://localhost 로 접속하면 이후부터는 ssl통신이 이루어진다.


만약에 접속후 아래와 같이 오류나 나더라도 무시하고 계속하면 됩니다.

이유는 해당 인증서가 신뢰된 인증서는 아니기때문입니다.


그렇다고 ssl통신이 안되는것은 아닙니다.




반응형
반응형

출처:https://geekflare.com/apache-tomcat-hardening-and-security-guide/


Apache Tomcat Hardening and Security Guide



Tomcat is one of the most popular Servlet and JSP Container servers. It’s used by some of following high traffic websites:

  • LinkedIn.com
  • Dailymail.co.uk
  • Comcast.net
  • Wallmart.com
  • Reuters.com
  • Meetup.com
  • Webs.com

Below diagram shows the market position of Tomcat in terms of popularity and traffic compared.

Having default configuration may have much sensitive information, which helps hacker to prepare for an attack the Tomcat server. This practical guide provides you the necessary skill set to secure Apache Tomcat server.

It was great to see the overwhelming response on my article about Apache Web Server Hardening and Security Guide. In this article, I will talk about how to harden and secure Apache Tomcat server. Following are tested on Tomcat 6.x and I don’t see any reason it won’t work with Tomcat 5.x, 7.x or 8.x

Audience

This is designed for Middleware Administrator, Application Support, System Analyst or anyone working or eager to learn Tomcat Hardening and Security. Fair knowledge of Tomcat & UNIX command is mandatory.

BONUS (Download in PDF Format): Tomcat Security & Hardening Guide

Pre-requisite

We require some tool to examine HTTP Headers for verification. Let’s do this by install firebug add-on in Firefox.

  • Click on Install Now
  • Restart Firefox
  • You can see firebug icon at right top bar

We will use this icon to open firebug console to view HTTP Headers information.

There are many online tools also available which helps to check in HTTP header information. Below are some of them you can try out.

Note: as a best practice, you must take backup of any file you are about to modify.

We will call Tomcat Installation folder as $tomcat throughout this guidelines.

1. Remove Server Banner

Removing Server Banner from HTTP Header is one of the first things to do as hardening. Having server banner expose the product you are using and leads to information leakage vulnerability.

Implementation:

  • Go to $tomcat/conf folder
  • Modify server.xml by using vi
  • Add following under Connector port and save the file
Server =” “

Ex: –

<Connector port="8080" protocol="HTTP/1.1" 
connectionTimeout="20000" 
Server =" " 
redirectPort="8443" />

Verification:

  • Open Firefox with firebug
  • Access Tomcat application
  • You will notice Server value is blank now.

2. Starting Tomcat with a Security Manager

Security Manager protects you from an untrusted applet running in your browser. Running Tomcat with a security manager is definitely better than running without one. Tomcat has very good documentation on Tomcat Security Manager

Implementation:

All you got to do is to start tomcat with –security argument.

Chandans:bin root# ./startup.sh -security
Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Using Security Manager Chandans:bin root#

3. Enable access log logging

The default configuration doesn’t capture access logs. The access log is very useful in troubleshooting to check request type, requester IP address, status code, etc.

Implementation:

  • Go to $tomcat/conf
  • Modify server.xml by using vi
  • Go to the end of the file and uncomment Valve entry for valves.AccessLogValue
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" 
prefix="localhost_access_log."
suffix=".txt"
pattern="common" resolveHosts="false"/>
  • Restart Tomcat server and you should see localhost_access_log is created under $tomcat/logs folder

4. Enforced HTTPS

It’s good to force redirect all HTTP requests to HTTPS to ensure web application data transmission are over SSL Certification.

Implementation:

  • Go to $tomcat/conf folder
  • Modify web.xml by using vi
  • Add following before </web-app> syntax
<security-constraint> 
<web-resource-collection> 
<web-resource-name>Protected Context</web-resource-name> 
<url-pattern>/*</url-pattern>
</web-resource-collection> 
<user-data-constraint> 
<transport-guarantee>CONFIDENTIAL</transport-guarantee> 
</user-data-constraint> 
</security-constraint>
  • Restart Tomcat and access web application to verify.

Note: ensure Tomcat is configured to run on SSL else it will break the application accessibility.

5. Add Secure flag in cookie

It is possible to steal or manipulate web application session and cookies without having a Secure flag in HTTP Header as Set-Cookie.

Implementation:

  • Go to $tomcat/conf folder
  • Modify server.xml by using vi
  • Add following in Connector port
Secure=”true

Ex:

<Connector port="8080" protocol="HTTP/1.1" 
connectionTimeout="20000" 
Server=" " 
Secure="true" 
redirectPort="8443" />

Verification:

  • Open Firefox with firebug
  • Access your application and check HTTP response header, you should see Secure flag

6. Add HttpOnly in cookie

Best practice to have this enabled at application code level. However, due to bad programming or developer’s unawareness, it comes to Web Infrastructure.

Implementation:

  • Go to $tomcat/conf folder
  • Modify context.xml by using vi
  • Add following  in Context directive
usehttponly=”true”

Ex:-

<context usehttponly="true">
...
</context>

7. Enable Secure Socket Layer (SSL)

To enable Tomcat to listen over HTTPS protocol, you must configure tomcat with SSL. If you are new to SSL, you can refer to Beginner’s Guide to SSL. This assumes you have SSL Certificate imported under keystore.

Implementation:

  • Go to $tomcat/conf folder
  • Modify server.xml by using vi
  • Add following under Connector port
SSLEnabled=”true” scheme=”https” keystoreFile="conf/keystore" keystorePass="password"

Ex:

<Connector port="8080" protocol="HTTP/1.1" 
connectionTimeout="20000" 
Server=" " 
Secure="true" 
SSLEnabled="true" scheme="https" keystoreFile="conf/keystore" keystorePass="password" clientAuth=”false” sslProtocol=”SSLv3” 
redirectPort="8443" />

8. Run Tomcat from non-privileged account

It’s good to use a separate non-privileged user for Tomcat. The idea here is to protect other services running in case of any security hole.

Implementation:

  • Create a UNIX user
  • Change $tomcat ownership to newly created UNIX user

9. Remove default/unwanted applications

By default, Tomcat comes with following web applications, which may or not be required in a production environment. You can delete them to keep it clean and avoid any known security risk with Tomcat default application.

  • ROOT – Default welcome page
  • Docs – Tomcat documentation
  • Examples – JSP and servlets for demonstration
  • Manager, host-manager – Tomcat administration

10. Change SHUTDOWN port and Command

By default, tomcat is configured to be shutdown on 8005 port. Do you know you can shutdown tomcat instance by doing a telnet to IP:port and issuing SHUTDOWN command?

Chandans # telnet localhost 8005
Trying ::1... telnet:
connect to address ::1:
Connection refused Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SHUTDOWN Connection closed by foreign host.
Chandans #

You see having default configuration leads to high-security risk. It’s recommended to change tomcat shutdown port and default command to something unpredictable.

Implementation:

  • Go to $tomcat/conf folder
  • Modify server.xml by using vi
<Server port="8005" shutdown="SHUTDOWN">

8005 – Change to some other unused port

SHUTDOWN – Change to something complicated

Ex-

<Server port="8867" shutdown="NOTGONNAGUESS">

11. Replace default 404, 403, 500 page

Having default page for not found, forbidden, server error exposes Tomcat version and that leads to security risk if you are running with vulnerable version. Let’s look at default 404 page.

To mitigate, you can first create a general error page and configure web.xml to redirect to general error page.

Implementation:

  • Go to $tomcat/webapps/$application
  • Create an error.jsp file
#vi error.jsp 
<html>
<head> 
<title>404-Page Not Found</title>
</head>
<body> That's an error! </body>
</html>
  • Go to $tomcat/conf folder
  • Add following in web.xml by using vi. Ensure you add before </web-app> syntax
<error-page> 
<error-code>404</error-code> 
<location>/error.jsp</location>
</error-page>
<error-page> 
<error-code>403</error-code> 
<location>/error.jsp</location>
</error-page>
<error-page> 
<error-code>500</error-code> 
<location>/error.jsp</location>
</error-page>
  • Restart tomcat server. Now, let’s test it.

As you can see tomcat information is no more exposed.

You can do this for java.lang.Exception as well. This will help in not exposing tomcat version information if any java lang exception.

Just add following in web.xml and restart tomcat server.

<error-page> 
<exception-type>java.lang.Exception</exception-type> 
<location>/error.jsp</location>
</error-page>

I hope above guide gives you an idea no securing Tomcat. If you like this, please share with your friends.

반응형

+ Recent posts