IBM HTTP Server(IHS)μ WebSphere Liberty νκ²½μμ
X-Powered-Byν€λ(μ: Servlet/3.1) λ ΈμΆμ μ°¨λ¨νλ λ°©λ²μ μ 리ν©λλ€. 보μ κ°νλ₯Ό μν΄ μΉ μλ²(IHS) λ¨μμμ νν°λ§κ³Ό WAS(Liberty) λ¨μμμ μμ± κΈμ§ μ€μ μ λͺ¨λ μ μ©νλ κ²μ κΆμ₯ν©λλ€.
0. λ°°κ²½ λ° μ λ΅ (Context)
보μ μ·¨μ½μ μ‘°μΉ μ, μ 보 λ ΈμΆ λ°©μ§λ λ€κ³μΈ΅ λ°©μ΄(Defense in Depth)κ° μ€μν©λλ€.
| κ³μΈ΅ | μν λ° μ€μμ± |
|---|---|
| 1. IHS (Web Server) | [νμ] μ΅μ λ°© λ°©μ΄μ . λ°±μλ WASκ° λ¬΄μμ΄λ μκ΄μμ΄ ν΄λΌμ΄μΈνΈλ‘ λκ°λ λͺ¨λ μλ΅μμ ν€λλ₯Ό κ°μ μμ ν©λλ€. |
| 2. Liberty (WAS) | [κΆμ₯] μμ€ μ°¨λ¨. λ΄λΆλ§μμ WASλ‘ μ§μ μ μνλ κ²½μ°λ μΉ μλ² μ€μ μ μ°ννλ κ²½μ°λ₯Ό λλΉν΄ ν€λ μμ± μ체λ₯Ό λ§μ΅λλ€. |
Test Environment
- Web Server: IBM HTTP Server v9.0 (Apache 2.4 Base)
- WAS: WebSphere Liberty Core 20.0.x
1. IBM HTTP Server (IHS) μ€μ
Apache κΈ°λ°μΈ IHSμμλ mod_headers λͺ¨λμ μ¬μ©νμ¬ μλ΅ ν€λλ₯Ό μ μ΄ν©λλ€.
httpd.conf μμ
μ€μ νμΌ(httpd.conf)μ μ΄μ΄ μλ λ΄μ©μ μ μ©ν©λλ€.
# 1. λͺ¨λ λ‘λ νμΈ (μ£Όμ ν΄μ νμ)
LoadModule headers_module modules/mod_headers.so
# 2. ν€λ μ κ±° μ€μ (Global μμ λλ VirtualHost λ΄λΆμ μμ±)
<IfModule mod_headers.c>
# 보μ μ‘°μΉ: κΈ°μ μ€ν μ 보 μ¨κΉ
Header unset X-Powered-By
# (μ ν) μΆκ°μ μΈ μ 보 λ
ΈμΆ ν€λ μ°¨λ¨
Header unset X-AspNet-Version
Header unset X-Runtime
</IfModule>
# 3. μλ² λ²μ μ 보 μ΅μν (OS μ 보 λ± μ¨κΉ)
ServerTokens Prod
./apachectl -tλ‘ λ¬Έλ²μ κ²μ¬νκ³ μ¬κΈ°λ(restart λλ graceful)ν΄μΌ ν©λλ€.
2. WebSphere Liberty μ€μ
Libertyλ server.xml νμΌ νλλ‘ λλΆλΆμ μ€μ μ μ²λ¦¬ν©λλ€. webContainer μμλ₯Ό μΆκ°νκ±°λ μμ νμ¬ ν€λ μμ±μ λΉνμ±νν©λλ€.
server.xml μμ
<server description="Liberty Server">
<!-- Feature Manager (κΈ°λ³Έ μ€μ ) -->
<featureManager>
<feature>servlet-3.1</feature>
</featureManager>
<!-- [보μ μ‘°μΉ] X-Powered-By ν€λ λΉνμ±ν μμ± μΆκ° -->
<webContainer disableXPoweredBy="true" />
</server>
Libertyλ λμ μ€μ μ μ§μνλ―λ‘ νμΌ μ μ₯ μ μ¦μ λ°μλμ§λ§, μ΄μ νκ²½μμλ νμ€ν μ μ©μ μν΄ μλ² μ¬κΈ°λμ κΆμ₯ν©λλ€.
3. κ²μ¦ (Verification)
curl λͺ
λ Ήμ΄λ₯Ό μ¬μ©νμ¬ μ‘°μΉ μ νμ μλ΅ ν€λλ₯Ό λΉκ΅ν©λλ€.
μ‘°μΉ μ (Before)
HTTP/1.1 200 OK
X-Powered-By: Servlet/3.1
Server: IBM_HTTP_Server/9.0.5...
...
μ‘°μΉ ν (After)
curl -I http://localhost:80/
HTTP/1.1 200 OK
Server: IBM_HTTP_Server <-- (Prod μ€μ μΌλ‘ λ²μ μ¨κΉ)
Content-Type: text/html
... <-- (X-Powered-By ν€λ μμ λ¨)
Next Step:
ν€λ μ‘°μΉκ° μλ£λμλ€λ©΄, HTTP λ©μλ μ ν(GET, POST μΈ μ°¨λ¨) λ° SSL/TLS νλ‘ν μ½ λ²μ (TLS 1.2 Only) μ€μ μ ν΅ν΄ μΉ μλΉμ€ 보μμ ν λ¨κ³ λ κ°νν΄ λ³΄μμμ€.