security_tips.xml.ko revision ed70c6537ec56d185d88a4aa7c0418d28bb7cdc7
<?xml version="1.0" encoding="EUC-KR" ?>
<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="/style/manual.ko.xsl"?>
<!-- English Revision: 105989:1657687 (outdated) -->
<!--
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.
-->
<manualpage metafile="security_tips.xml.meta">
<parentdocument href="./">Miscellaneous Documentation</parentdocument>
<title>���� ��</title>
<summary>
<p>�������� ��Ҷ� ������ �� ���� ��� ��Ʈ�� ���̴�.
� ���� �Ϲ����̰�, � ���� ����ġ���� �ش��ϴ� ���̴�.</p>
</summary>
<section id="uptodate"><title>�ֽ������� �����ϱ�</title>
<p>����ġ �������� ����� ���� ������ ����� ���� ������
��ü�� �����ϴ�. �׷��� ũ�� �۰� ��ǥ�� �߰ߵǴ� ��������
���� �� ���. �׷��� ����Ʈ��� �ֽŹ������� �����ϴ�
���� �߿��ϴ�. ����ġ���� ���� �������� �ٿ�ε��ߴٸ�,
���ο� ����� ���� ������Ʈ�� �˷��ִ� <a
href="http://httpd.apache.org/lists.html#http-announce">����ġ
������ ��ǥ ���ϸ�����Ʈ</a>�� �����ϱ� ������ ���Ѵ�.
����ġ ����Ʈ��� �����ϴ� ���� �����ڵ鵵 ����� ���񽺸�
�����Ѵ�.</p>
<p>���� ������ �ڵ嶧���� �������� ����� ���ϴ� ����
���� �ʴ�. �׺��� �߰� �ڵ�, CGI ��ũ��Ʈ, ���� �ü����
������ ����� ���ϴ� ��찡 ����. �׷��Ƿ� �׻� �����ϸ�
�ý����� ��� ����Ʈ��� ������Ʈ�ؾ� �Ѵ�.</p>
</section>
<section id="serverroot">
<title>ServerRoot ���丮 ����</title>
<p>���� root ����ڰ� ����ġ�� ������ ��, ��û�� �����ϱ�����
<directive module="mpm_common">User</directive> ���þ��
������ ����ڷ� ��ȯ�Ѵ�. root�� �����ϴ� ��ɾ �ִٸ�,
root �̿��� ����ڰ� �������� ���ϵ��� �����ؾ� �Ѵ�. ��
���ϵ��� root�� �� �� �־�� �ϰ�, ���丮�� ��� �������丮��
��������. ���� ���, ServerRoot�� /usr/local/apache��
����Ѵٸ� root ����ڰ� ������ ���� ���丮�� �����
�����Ѵ�:</p>
<example>
mkdir /usr/local/apache <br />
cd /usr/local/apache <br />
mkdir bin conf logs <br />
chown 0 . bin conf logs <br />
chgrp 0 . bin conf logs <br />
chmod 755 . bin conf logs
</example>
<p>�׷��� /, /usr, /usr/local �� root���� ������ �� �ִ�.
httpd ���������� ��ġ�Ҷ� ������ ���� ��ȣ�ؾ� �Ѵ�:</p>
<example>
cp httpd /usr/local/apache/bin <br />
chown 0 /usr/local/apache/bin/httpd <br />
chgrp 0 /usr/local/apache/bin/httpd <br />
chmod 511 /usr/local/apache/bin/httpd
</example>
<p>htdocs �������丮�� �ٸ� ����ڵ��� ������ �� �ֵ���
���� �� �ִ� -- root�� �װ��� �ִ� ������ ����������, ��������
�ʾƾ� �Ѵ�.</p>
<p>root�� �ƴ� ����ڰ� root�� �����ϰų� ���Ⱑ���� ������
������ �� �ִٸ� �ý����� root ������ ��ĥ �� �ִ�. ����
���, ������ httpd ���������� �����Ͽ��ٸ� ������ �����Ҷ�
������ �ڵ带 �����ϰ� �ȴ�. logs ���丮�� (root�� �ƴ�
����ڿ���) ���Ⱑ���ϴٸ� ������ �α������� �ٸ� �ý������Ϸ�
�ɺ���ũ�� �ɾ root�� ���Ͽ� ������ �ڷḦ ��� ��
�ִ�. �α������� (root�� �ƴ� ����ڿ���) ���Ⱑ���ϴٸ�
������ �α׿� �̻��� �ڷḦ ����� �� �ִ�.</p>
</section>
<section id="ssi">
<title>Server Side Includes</title>
<p>Server Side Includes (SSI)�� ���� ���ڿ��� ���Ȼ� ���
�������� �����̴�.</p>
<p>ù��° ������ ������ ���ϸ� �ø��� ���̴�. ����ġ�� ���Ͽ�
SSI ���þ �ִ��� ���ο� ������ ��� SSI ������ �м��ؾ�
�Ѵ�. ���� ���ϰ� ������, ������ ���� ����� ���� ����ϴ�
ȯ�濡���� �ɰ��� �� �ִ�.</p>
<p>��, SSI ������ �Ϲ����� CGI ��ũ��Ʈ�� ������ ������
�����. SSI ���Ͽ��� "exec cmd"�� ����ϸ� httpd.conf����
����ġ�� �����ϵ��� ������ ����ڿ� �׷� �������� CGI
��ũ��Ʈ�� ���α׷��� ������ �� �ִ�.</p>
<p>������ Ȱ���ϸ鼭 SSI ������ ������ ����Ű�� �����
�ִ�.</p>
<p>SSI ������ ������ �� �ִ� ���ظ� �ݸ��ϱ����� �������ڴ�
<a href="#cgi">�Ϲ����� CGI</a> �� �����ϴ� �������
<a href="/suexec.html">suexec</a>�� ����� �� �ִ�</p>
<p>.html�̳� .htm Ȯ���ڸ� SSI ���Ϸ� ����ϴ� ���� �����ϴ�.
Ư�� ���� ����� �����ϰų� ��ŷ��� ���� ���� ȯ�濡��
�����ϴ�. SSI ������ �Ϲ������� ���� ����ϴ� .shtml ����
������ Ȯ���ڸ� ������ �Ѵ�. �׷��� ���� ���ϸ� �ּ�ȭ�ϰ�
�����Ҹ� ���� ���� �� �ִ�.</p>
<p>�ٸ� ����� SSI �������� ��ũ��Ʈ�� ���α׷��� ��������
���ϵ��� ����� ���̴�. <directive
module="core">Options</directive> ���þ�� <code>Includes</code>
��� <code>IncludesNOEXEC</code>�� ����Ѵ�. �׷��� ��ũ��Ʈ��
<directive module="mod_alias">ScriptAlias</directive> ���þ��
������ ���丮�� �ִٸ� &lt;--#include virtual="..." --&gt;��
����Ͽ� CGI ��ũ��Ʈ�� ������ �� ������ �����϶�.</p>
</section>
<section id="cgi">
<title>�Ϲ����� CGI</title>
<p>�ᱹ ����� �׻� CGI ��ũ��Ʈ/���α׷��� ���ڸ� �ŷ��ؾ�
�ϰ�, ���ǰ� �Ǽ��̰� CGI�� �������� ���Ȼ� ������ �߰���
�� �־�� �Ѵ�. �⺻������ CGI ��ũ��Ʈ�� ������ �����
�������� �ý��ۿ��� � ��ɾ�� ������ �� �ֱ⶧����
�����ְ� Ȯ������ ������ �ſ� �����ϴ�.</p>
<p>��� CGI ��ũ��Ʈ�� ���� ����ڷ� ����DZ⶧���� �ٸ�
��ũ��Ʈ�� (���ǰ� �Ǽ��̰�) �浹�� ���ɼ��� �ִ�. ����
���, ����� A�� ����� B�� �ſ� �Ⱦ��Ͽ�, ����� B�� CGI
�����ͺ��̽��� ���������� ��ũ��Ʈ�� �ۼ��� �� �ִ�. ����ġ
1.2 ������� ���ԵǾ�� ����ġ �������� Ư���� ��(hook)����
�����ϴ� <a href="/suexec.html">suEXEC</a>�� ��ũ��Ʈ��
�ٸ� ����ڷ� �����ϴ� ����� �ϳ���. �ٸ� �������� ����
<a href="http://cgiwrap.unixtools.org/">CGIWrap</a>�� �ִ�.</p>
</section>
<section id="nsaliasedcgi">
<title>ScriptAlias���� ���� CGI</title>
<p>���� ������ �����Ҷ��� ����ڰ� � ���丮������
CGI ��ũ��Ʈ�� �����ϵ��� ����� �� �ִ�:</p>
<ul>
<li>����� ���ǰ� �Ǽ��̰� ����ڰ� �ý����� ��ݿ� �����Ű��
��ũ��Ʈ�� �ۼ����� �ʴ´ٰ� �ϴ´�.</li>
<li>�ý����� �ٸ� �κ��� ������ ���ؼ�, �������� ������
�ϳ� �� ���� ������ ���� ��ٰ� ���ϴ� ���.</li>
<li>����ڰ� ���, �Ƹ� �ƹ��� ������ �湮�����ʴ� ���.</li>
</ul>
</section>
<section id="saliasedcgi">
<title>ScriptAlias�� CGI</title>
<p>Ư�� ���丮������ CGI�� ������ �� �ֵ��� �����ϸ� ���ڴ�
�̵� ���丮�� ������ �� �ִ�. �� ���� scriptalias����
���� CGI���� Ȯ���� �����ϴ�. ��, �ŷ��ϴ� ����ڸ� ���丮��
������ �� �ְ�, ���ڰ� ���ο� CGI ��ũ��Ʈ/���α׷���
�������� ���Ȼ� ������ �˻��� ���̰� �ִٸ�.</p>
<p>��κ��� ����Ʈ�� scriptalias���� ���� CGI ��� ���
�� ����� ����Ѵ�.</p>
</section>
<section id="dynamic">
<title>���� ������ ���ϴ� �ٸ� ���</title>
<p>
mod_php, mod_perl, mod_tcl, mod_python ���� ������ �Ϻη�
�����ϴ� �Ӻ���� ��ũ��Ʈ�� ������ ���� ����ڷ� (<directive
module="mpm_common">User</directive> ���þ� ���) ����DZ⶧����,
��ũ��Ʈ ������ �����ϴ� ��ũ��Ʈ�� ���������� ���� ����ڰ�
������ �� �ִ� ��� �Ϳ� ������ �� �ִ�. � ��ũ��Ʈ ������
������� ������ ������, �����ϴٰ� �������� �ʴ� ���� ����.</p>
</section>
<section id="systemsettings">
<title>�ý��� ���� ��ȣ�ϱ�</title>
<p>������ ������ ������ ��Ϸ��� ����ڰ�
<code>.htaccess</code> ������ ����Ͽ� ����� ������ ���ȱ����
�����ϱ� �ٶ��� ���� ���̴�. �׷������� ������ ���� �����
�ִ�.</p>
<p>���� �������Ͽ� ������ �߰��Ѵ�</p>
<example>
&lt;Directory /&gt; <br />
AllowOverride None <br />
&lt;/Directory&gt;
</example>
<p>�׷��� ��밡���ϵ��� ��������� ����� ���丮�� �����ϰ��
<code>.htaccess</code> ������ ����� �� ���.</p>
</section>
<section id="protectserverfiles">
<title>�⺻������ ������ �ִ� ���� ��ȣ�ϱ�</title>
<p>������� ���� ����ġ�� �⺻ ���ٿ� ���� �߸� �˰��ִ�.
��, ������ �Ϲ����� URL ���� ��Ģ�� ����Ͽ� ������ ã��
�� �ִٸ�, Ư���� ��ġ�� ���� �ʴ��� Ŭ���̾�Ʈ���� ������
���񽺵� �� �ִ�.</p>
<p>���� ���, �Ʒ��� ���� ���:</p>
<example>
# cd /; ln -s / public_html <br />
<code>http://localhost/~root/</code> �� �����Ѵ�
</example>
<p>�׷��� Ŭ���̾�Ʈ�� ��ü ���Ͻý����� ���ƴٴ� �� �ִ�.
�̸� �������� ������������ ������ ���� ��ġ�� �Ѵ�:</p>
<example>
&lt;Directory /&gt; <br />
Order Deny,Allow <br />
Deny from all <br />
&lt;/Directory&gt;
</example>
<p>�׷��� ���Ͻý��� ��ġ�� ���� �⺻ ������ �źεȴ�.
���ϴ� ������ ������ �� �ֵ��� ������ ���� <directive
module="core">Directory</directive> ����� �߰��Ѵ�.</p>
<example>
&lt;Directory /usr/users/*/public_html&gt; <br />
Order Deny,Allow <br />
Allow from all <br />
&lt;/Directory&gt; <br />
&lt;Directory /usr/local/httpd&gt; <br />
Order Deny,Allow <br />
Allow from all <br />
&lt;/Directory&gt;
</example>
<p><directive module="core">Location</directive>�� <directive
module="core">Directory</directive> ���þ ���� ����ϴ�
��� Ư���� ���Ǹ� ��←��. ���� ���, <code>&lt;Directory
/&gt;</code>�� ������ �ź��ϴ��� <code>&lt;Location
/&gt;</code> ���þ �̸� ������ �� �ִ�</p>
<p><directive module="mod_userdir">UserDir</directive> ���þ
����ϴ� ��쿡�� �����϶�. ���þ "./" ���� �����ϸ�
root ����ڿ� ���� �ٷ� ���� ���� ���� ������ �߻��Ѵ�.
����ġ 1.3 �̻��� ����Ѵٸ� ���� �������Ͽ� �Ʒ� ���� �߰��ϱ�
������ ���Ѵ�:</p>
<example>
UserDir disabled root
</example>
</section>
<section id="watchyourlogs">
<title>�α� ���캸��</title>
<p>������ �������� ���� ���� �־�� �ִ��� �˷��� <a
href="/logs.html">�α�����</a>�� ������� �Ѵ�. �α�������
�̹� �Ͼ �ϸ��� ����������, ������ � ����� �־����
�˷��ְ� ���� �ʿ��� ��ŭ �������� Ȯ���ϰ� ���ش�.</p>
<p>�������� ��:</p>
<example>
grep -c "/jsp/source.jsp?/jsp/ /jsp/source.jsp??" access_log <br />
grep "client denied" error_log | tail -n 10
</example>
<p>ù��° ���� <a
href="http://online.securityfocus.com/bid/4876/info/">�߸��
Source.JSP ��û���� ���������� �˾Ƴ� �� �ִ� Tomcat��
�����</a>�� �̿��Ϸ��� ��� Ƚ���� �˷��ְ�, �ι�° ����
������ �źε� �ֱ� Ŭ���̾�Ʈ 10���� ������ ���� �����ش�:</p>
<example>
[Thu Jul 11 17:18:39 2002] [error] [client foo.bar.com] client denied
by server configuration: /usr/local/apache/htdocs/.htpasswd
</example>
<p>�� �� ���� �α������� �̹� �߻��� ��Ǹ��� �����Ѵ�.
�׷��� Ŭ���̾�Ʈ�� <code>.htpasswd</code> ���Ͽ� ������
�� �־�ٸ� <a href="/logs.html#accesslog">���� �α�</a>��
������ ���� ����� ���� ���̴�:</p>
<example>
foo.bar.com - - [12/Jul/2002:01:59:13 +0200] "GET /.htpasswd HTTP/1.1"
</example>
<p>��, ����� ���� �������Ͽ��� ���� �κ��� �ּ�ó������
���̴�:</p>
<example>
&lt;Files ".ht*"&gt; <br />
Order allow,deny <br />
Deny from all <br />
&lt;Files&gt;
</example>
</section>
</manualpage>