Tomcat 8 ·Î ³Ñ¾î¿À¸é¼ manager ÆäÀÌÁö Á¢±ÙÀ» À§ÇÑ Æнº¿öµå ¾ÏÈ£È ¹æ¹ý¿¡ Á¶±Ý º¯È°¡ ÀÖ¾ú´Ù. ÀÌ¿¡ ´ëÇؼ ±â¼úÇÑ´Ù.
Manager ÆäÀÌÁö Á¢±Ù ±ÇÇÑ – context.xml
±âº»°ªÀ¸·Î /manager ÆäÀÌÁö¿¡ ´ëÇÑ Á¢±ÙÀº localhost ·Î Á¦ÇÑÀÌ °É·Á ÀÖ´Ù. ÀÌ°ÍÀº manager ¾Û¿¡ ´ëÇÑ context.xml ÆÄÀÏ¿¡ ¼³Á¤µÇ¾î ÀÖ´Â ³»¿ëÀε¥, ÆÄÀÏ °æ·Î´Â $CATALINA_HOME/webpps/manager/META-INF/context.xml ÀÌ´Ù. ´ÙÀ½°ú °°ÀÌ Á¢±Ù Á¦ÇÑµÈ ºÎºÐ¿¡¼ ¿ÜºÎÁ¢¼ÓÀ» À§ÇÑ ¼³Á¤À» ÇØÁØ´Ù.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <Context antiResourceLocking="false" privileged="true" > <!--<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />--> <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/> </Context> |
Valve ¸¦ ÀÌ¿ëÇؼ RemoteAddrValve ¿¡ ´ëÇؼ Á¢±Ù ¾ÆÀÌÇÇ ÁÖ¼Ò°¡ ÀûÇô ÀÖ´Ù. ¿©±â¼´Â Á¢±Ù Á¦ÇÑÀ» ÇØÁ¦ÇØÁÖ°í ÀÖ´Ù. ÇÏÁö¸¸ product ȯ°æ¿¡¼´Â Àý´ë·Î ÀÌ·¸°Ô ÇÏÁö¸»°í Á¢±Ù °¡´ÉÇÑ IP ÁÖ¼Ò¸¦ ÀÔ·ÂÇØÁÖµµ·Ï ÇÏÀÚ.
¾ÏÈ£È ¾Ë°í¸®Áò Á¤ÀÇ – server.xml
¾ÏÈ£È ¾Ë°í¸®Áò¿¡´Â md5, sha-256, sha-512 µîÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù. À̸¦ À§Çؼ server.xml À» ¼öÁ¤ÇØ Áà¾ß ÇÑ´Ù.
| <!-- Use the LockOutRealm to prevent attempts to guess user passwords via a brute-force attack --> <Realm className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"> <CredentialHandler className="org.apache.catalina.realm.MessageDigestCredentialHandler" algorithm="SHA-256" /> </Realm> </Realm> <Host name="localhost" appBase="webapps" |
CredentialHandler ¸¦ ÅëÇؼ algorithmÀ» SHA-256 À¸·Î Á¤ÀÇÇØÁÖ°í ÀÖ´Ù. Áß¿äÇÑ °ÍÀº ¾îµð´Ù°¡ ÇØÁÖ³ÄÇÏ´Â °ÍÀÓÀ¸·Î À§¿¡ ¿¹Á¦¸¦ À¯½ÉÈ÷ º¸°í Á¤È®ÇÑ À§Ä¡¿¡ À̸¦ Ãß°¡ÇØÁà¾ß ÇÑ´Ù.
¾ÏÈ£ÈµÈ ½ºÆ®¸µ ¾ò±â – digest.sh
ÀÌÁ¦ ¾ÏÈ£ÈµÈ ½ºÆ®¸µÀ» ¾ò¾î¾ß ÇÑ´Ù. ÀÌ´Â $CATALINA_HOME/bin/digest.sh ½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇؼ ¼Õ½±°Ô ¾òÀ» ¼ö ÀÖ´Ù. ÁÖÀÇÇÒ °ÍÀº ¾ÏÈ£È ¾Ë°í¸®Áò¿¡ ¸Â´Â ¾ÏÈ£ÈµÈ ½ºÆ®¸µÀ» ¾ò±âÀ§Çؼ ¾Ë°í¸®ÁòÀ» ¿É¼ÇÀ¸·Î ¾Ë·ÁÁà¾ß ÇÑ´Ù.
| $ cd $CATALINA_HOME/bin $ ./digest.sh -a SHA-256 -h org.apache.catalina.realm.MessageDigestCredentialHandler mysecret_password mysecret_password:249e4fb699eb5680ebf9551ca3b09794247295d704ca012a4cd6bb504aacfb54$1$392dc582e928d6068af8f17b19599e4831d5eb4cfc416bf2cf62b4ccafa7e755 |
°á°ú¿¡¼ ÄÝ·Ð(:)À» ±âÁØÀ¸·Î ¾ÕÀº Æò¹® ¹®ÀÚ¿, µÚ´Â ¾ÏÈ£ÈµÈ ¹®ÀÚ¿À» º¸¿©ÁØ´Ù.
manager ÀÎÁõ ¼³Á¤ – tomcat-users.xml
ÀÌÁ¦ manager ÀÎÁõÀ» À§ÇÑ ¼³Á¤À» ÇØÁØ´Ù. ÀÌ´Â tomcat-users.xml ÇØÁִµ¥, ´ÙÀ½°ú °°ÀÌ ÇØÁØ´Ù.
| <tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0"> <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-status"/> <user username="admin" password="249e4fb699eb5680ebf9551ca3b09794247295d704ca012a4cd6bb504aacfb54$1$392dc582e928d6068af8f17b19599e4831d5eb4cfc416bf2cf62b4ccafa7e755" roles="manager-gui,manager-script,manager-status"/> </tomcat-users> |
À§¿Í °°ÀÌ ¾ÏÈ£ÈµÈ ½ºÆ®¸µÀ» password ÀÎÀÚ·Î ÁÖ¸é µÈ´Ù.
ÀÌ·¸°Ô Tomcat 8.5 ¿¡ ´ëÇÑ /manager ÀÎÁõ ¾ÏÈ£ ¹®ÀÚ¿ ¾ÏÈ£È Çϱ⿡ ´ëÇØ ¾Ë¾Æ ºÃ´Ù.