Jboss EAP 6 기초 보안
Jboss EAP 6 를 설치하고 난후에 해야할 기초 보안에 대해서 알아본다.
기본 페이지 비활성화 하기
Jboss EAP 6 를 설치하고 난후 도메인:포트 만 넣고 접속을 하면 다음과 같이 Jboss EAP 6 에서 제공하는 페이지가 나온다.
내가 설정하지도 않았는데도 위와같이 Jboss EAP 6 에서 기본적으로 제공을 해준다. 이것을 안나오게 하고 싶다면 standalone-*.xml, domain.xml 파일에서 virtual-server 의 enable-welcome-root 값을 false 로 변경해주면 된다.
1 2 3 4 5 |
364 <subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false"> 365 <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> 366 <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/> + 367 <virtual-server name="default-host" enable-welcome-root="true"> - 367 <virtual-server name="default-host" enable-welcome-root="false"> |
위와같이 고친후에 서버를 재시작하고 다시 접속을 하면 404 오류 페이지가 나온다.
jboss-cli 를 이용해서 다음과 같이 설정도 가능하다.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[root@localhost node01]# ./jboss-cli.sh Authenticating against security realm: ManagementRealm Username: admin Password: [standalone@0.0.0.0:10099 /] /subsystem=web/virtual-server=default-host:write-attribute(name=enable-welcome-root,value=false) { "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } } [standalone@0.0.0.0:10099 /] |
HTTP Header 에서 Server 값 변경하기
화면에는 잘 보이지 않지만, HTTP 프로토콜 보기에서 서버에서 응답한 헤더값을 보면 다음과 같이 나온다.
1 2 3 4 5 6 |
Content-Language:ko-KR Content-Length:930 Content-Type:text/html;charset=UTF-8 Date:Wed, 19 Jul 2017 14:50:53 GMT Server:Apache-Coyote/1.1 X-Powered-By:JSP/2.2 |
최대한 정보를 은닉하는 것이 보안상 권장하는 것으로 이것을 다른 값으로 바꿔 어떤 서버를 사용하는지 추론하지 못하도록 해야 한다.
역시, standalone-*.xml, domain.xml 혹은 host.xml 에서 다음과 같을 추가해준다.
1 2 3 4 5 |
<server xmlns="urn:jboss:domain:1.8"> .......... <system-properties> <property name="org.apache.coyote.http11.Http11Protocol.SERVER" value="PowerServer"/> </system-properties> |
jboss-cli 를 이용해서 다음과 같이 설정도 가능하다.
1 2 3 4 5 6 7 8 9 10 |
[root@localhost node01]# ./jboss-cli.sh Authenticating against security realm: ManagementRealm Username: admin Password: [standalone@0.0.0.0:10099 /] /system-property=org.apache.coyote.http11.Http11Protocol.SERVER:add(value="PowerServer") { "outcome" => "success", "response-headers" => {"process-state" => "reload-required"} } [standalone@0.0.0.0:10099 /] |
아니면 시작시에 -D 옵션으로 다음과 같이 주어도 적용된다.
1 |
./bin/standalone.sh ...(snip)... -Dorg.apache.coyote.http11.Http11Protocol.SERVER="PowerServer" |
HTTP Header 에서 X-Powered-By 값 변경하기
위 Jboss EAP 6 의 HTTP 응답 헤더를 보면 X-Powered-By 값이 보인다. 이 역시 서버 정보를 알려주는 것으로 보안상 안보이게 하는게 좋다.
역시, standalone-*.xml, domain.xml 혹은 host.xml 에서 다음과 같을 추가해준다.
1 2 3 4 |
<subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false"> <configuration> <jsp-configuration x-powered-by="false"/> </configuration> |
jboss-cli 를 이용해서 다음과 같이 설정도 가능하다.
1 2 3 4 5 6 7 8 9 10 11 12 |
[root@localhost node01]# ./jboss-cli.sh Authenticating against security realm: ManagementRealm Username: admin Password: [standalone@0.0.0.0:10099 /] /subsystem=web/configuration=jsp-configuration/:write-attribute(name=x-powered-by,value=false) { "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } } |
참고 사이트