Linux Security HOWTO <AUTHOR>Kevin Fenzi, <tt>kevin@tummy.com</tt> &ero; Dave Wreski, <tt>dave@linuxsecurity.com</tt> <DATE>v1.1.1, 17 March 2000 <TRANS>The Linux Japanese FAQ Project <TDATE>31 March 2000 <ABSTRACT> <!-- This document is a general overview of security issues that face the administrator of Linux systems. It covers general security philosophy and a number of specific examples of how to better secure your Linux system from intruders. Also included are pointers to security-related material and programs. --> このドキュメントでは, Linux システムの管理者が遭遇するセキュリティ関連事項についての 一般的な解説を行います. このドキュメントでは, セキュリティに対する一般的な考え方と, Linux システムを侵入者からより安全にする方法の具体例を扱っています. また, セキュリティ関連の情報やプログラムへのポインタも含まれています. <!-- Improvements, constructive criticism, additions and corrections are gratefully accepted. Please mail your feedback to both authors, with "Security HOWTO" in the subject. --> 改善, 建設的な批判, 追加, 訂正は歓迎します. フィードバックを著者両方に送ってください. その際にはサブジェクトに「Security HOWTO」という文字列を入れてください. </ABSTRACT> <TOC> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Introduction --> <SECT> はじめに <P> <!-- This document covers some of the main issues that affect Linux security. General philosophy and net-born resources are discussed. --> このドキュメントでは, Linux のセキュリティに関わる主な話題をいくつか扱います. 一般的な考え方とネット上で生まれたリソースについて議論します. <P> <!-- A number of other HOWTO documents overlap with security issues, and those documents have been pointed to wherever appropriate. --> 他の HOWTO ドキュメントの多くとセキュリティの話題で重なる部分がありますが, こういったドキュメントは適当な場所で示します. <P> <!-- This document is <em>not</em> meant to be a up to date exploits document. Large numbers of new exploits happen all the time. This document will tell you where to look for such up to date information, and will give some general methods to prevent such exploits from taking place. --> このドキュメントは, 最新の問題を扱うものでは「ありません」. 常に新しい被害がたくさん起きています. このドキュメントは最新の情報をどこで見れば良いのかを示し, そのような悪用をされないための一般的な方法を示します. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> New Versions of this Document --> <SECT1>このドキュメントの最新版について <P> <!-- New versions of this document will be periodically posted to <it>comp.os.linux.answers</it>. They will also be added to the various sites that archive such information, including: --> このドキュメントの最新版は定期的に <it>comp.os.linux.answers</it> に投稿されます. また, 以下に示すような, ドキュメント関連の情報を集めているサイトにも置かれるでしょう: <P> <tt> <htmlurl url="http://www.linuxdoc.org/" name="http://www.linuxdoc.org/"> </tt> <P> <!-- In addition, you should generally be able to find this document on the Linux World Wide Web home page via: --> また, Linux のウェブページでも本ドキュメントを見つけることができるでしょう. <P> <tt> <htmlurl url="http://metalab.unc.edu/mdw/linux.html" name="http://metalab.unc.edu/mdw/linux.html"> </tt> <P> <!-- Finally, the very latest version of this document should also be available in various formats from: --> 最後に, 本ドキュメントの最新版(各種形式があります)は <P> <tt> <htmlurl url="http://scrye.com/~kevin/lsh/" name="http://scrye.com/~kevin/lsh/"> </tt> <P> <!-- or --> や <P> <htmlurl url="http://www.linuxsecurity.com/docs/Security-HOWTO" name="http://www.linuxsecurity.com/Security-HOWTO"> <P> <!-- or --> または <P> <htmlurl url="http://www.tummy.com/security-howto" name="http://www.tummy.com/security-howto"> <P> といったサイトで入手できます. <P> 訳注: 和訳は <htmlurl url="http://www.linux.or.jp/JF/JFdocs/Security-HOWTO.html" name="http://www.linux.or.jp/JF/JFdocs/Security-HOWTO.html"> にあります. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Feedback --> <SECT1> フィードバック <P> <!-- All comments, error reports, additional information and criticism of all sorts should be directed to: --> コメント, 誤りの報告, 追加情報, 批判などは以下のメールアドレスに送ってください: <P> <tt> <htmlurl url="mailto:kevin@tummy.com" name="kevin@tummy.com"> </tt> <P> <!-- and --> および <P> <tt> <htmlurl url="mailto:dave@linuxsecurity.com" name="dave@linuxsecurity.com"> </tt> <P> <!-- <em>Note</em>: Please send your feedback to <em>both</em> authors. Also, be sure and include "Linux" "security", or "HOWTO" in your subject to avoid Kevin's spam filter. --> <em>注意</em>: フィードバックは<em>両方の</em>著者に送ってください. また, Kevin が使っているスパムフィルタを避けるため, サブジェクトには "Linux", "security", "HOWTO" のいずれかを必ず入れてください. <P> 訳注: 日本語訳に関する誤りの指摘や, フィードバックはしたいけれど英語は苦手だという方は JF プロジェクト(<tt><JF@linux.or.jp></tt>) までご連絡ください. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Disclaimer --> <SECT1>免責事項 <P> No liability for the contents of this document can be accepted. Use the concepts, examples and other content at your own risk. Additionally, this is an early version, possibly with many inaccuracies or errors. <P> A number of the examples and descriptions use the RedHat(tm) package layout and system setup. Your mileage may vary. <P> As far as we know, only programs that, under certain terms may be used or evaluated for personal purposes will be described. Most of the programs will be available, complete with source, under <url url="http://www.gnu.org/copyleft/gpl.html" name="GNU"> terms. <p> <em/訳注/: 日本語訳も挙げておきますが, これはあくまで参考です. <p> 本ドキュメントの内容についての責任は一切持ちません. あなた自身の責任で概念, 実行例, その他の内容を利用してください. また, 本ドキュメントは書いたばかりのバージョンなので, おそらく不正確な部分や間違いがあると思われます. <p> 例および説明の多くは Red Hat (tm) パッケージに基づいています. 読者の使用しているパッケージによって手順が変わることがあるでしょう. <p> 筆者の知っている限りで, 個人目的で使用あるいは評価ができる使用条件のプログラムについて解説します. ほとんどのプログラムは <url url="http://www.gnu.org/copyleft/gpl.html" name="GNU"> の条項に従い, 完全なソースコード付きで配布されています. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Copyright Information --> <SECT1>著作権表示 <P> This document is copyrighted (c)1998-2000 Kevin Fenzi and Dave Wreski, and distributed under the following terms: <P> <ITEMIZE> <ITEM> Linux HOWTO documents may be reproduced and distributed in whole or in part, in any medium, physical or electronic, as long as this copyright notice is retained on all copies. Commercial redistribution is allowed and encouraged; however, the authors would like to be notified of any such distributions. <ITEM> All translations, derivative works, or aggregate works incorporating any Linux HOWTO documents must be covered under this copyright notice. That is, you may not produce a derivative work from a HOWTO and impose additional restrictions on its distribution. Exceptions to these rules may be granted under certain conditions; please contact the Linux HOWTO coordinator at the address given below. <ITEM> If you have questions, please contact Tim Bynum, the Linux HOWTO coordinator, at </ITEMIZE> <P> <tt> <htmlurl url="mailto:tjbynum@metalab.unc.edu" name="tjbynum@metalab.unc.edu"> </tt> <P> <em/訳注/: 日本語訳も挙げておきますが, これはあくまで参考です. <P> <P> Copyright (c)1998-2000 Kevin Fenzi and Dave Wreski <P> このドキュメントは Kevin Fenzi と Dave Wreski の著作物であり, 以下の条項に基づいて配布されています: <P> <itemize> <ITEM> Linux HOWTO ドキュメントは, この著作権表示が全ての複製物に残されている限り, 全体あるいは一部分を複製・配布すること, 任意の物理メディアや電子メディアで複製・配布することができます. 商業的な再配布は奨励されていますが, このような配布を行う場合には著者らに連絡することを希望します. <ITEM>翻訳, 派生物, Linux HOWTO ドキュメントのいずれかを集めた収集物全ては この著作権表示に従わなければなりません. つまり, HOWTO ドキュメントから派生したドキュメントを作り, これに制限を追加することはできません. 特定の条件の下では, これらの規則には例外が認められます. 以下にアドレスを示す Linux HOWTO の世話人と相談してください. <ITEM>疑問点があれば, Linux HOWTO の世話人である Tim Bynum までご連絡ください. アドレスは以下に示します. </ITEMIZE> <P> <tt> <htmlurl url="mailto:tjbynum@metalab.unc.edu" name="tjbynum@metalab.unc.edu"> </tt> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> 日本語訳について <p> 日本語訳は Linux Japanese FAQ Project が行いました (藤原輝嘉 <fujiwara@linux.or.jp> (日本語訳), 長谷川靖 <yaz-hase@qb3.so-net.ne.jp> (校正), 関戸幸一 <sekido@mbox.kyoto-inet.or.jp> (校正, 訳注), 菱川功 <ike@whitedragon.org> (校正, 訳注), 高城正平 <takavoid@palette.plala.or.jp> (校正) 森本 淳 <morimoto@xantia.citroen.org> (v1.1.1 追従) ). 日本語訳に関する権利は原文に準ずるものとします. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT> 概要 <!-- Overview --> <P> <!-- This document will attempt to explain some procedures and commonly-used software to help your Linux system be more secure. It is important to discuss some of the basic concepts first, and create a security foundation, before we get started. --> 本ドキュメントでは, Linux システムをより安全にするための方法と, よく使われるソフトウェアについて解説します. 具体的な内容に入る前に, 基本的な概念について議論し, セキュリティの基礎を押えておくことにしましょう. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> なぜセキュリティが必要なのか <!-- Why Do We Need Security? --> <P> <!-- In the ever-changing world of global data communications, inexpensive Internet connections, and fast-paced software development, security is becoming more and more of an issue. Security is now a basic requirement because global computing is inherently insecure. As your data goes from point A to point B on the Internet, for example, it may pass through several other points along the way, giving other users the opportunity to intercept, and even alter, it. Even other users on your system may maliciously transform your data into something you did not intend. Unauthorized access to your system may be obtained by intruders, also known as "crackers", who then use advanced knowledge to impersonate you, steal information from you, or even deny you access to your own resources. If you're wondering what the difference is between a "Hacker" and a "Cracker", see Eric Raymond's document, "How to Become A Hacker", available at <htmlurl url="http://www.netaxs.com/~esr/faqs/hacker-howto.html" name="http://www.netaxs.com/~esr/faqs/hacker-howto.html">. --> 常に変化し続ける, グローバルなデータ通信, 安価なインターネット接続, 速いペースのソフトウェア開発の世界の中で, セキュリティはより重要になりつつあります. グローバルコンピューティングは本質的に危険なので, セキュリティは今や基本的な要件です. 例えばデータが A 地点から B 地点までインターネット上で送られる場合を考えると, データは経路の途中で他の地点を通るので, 他人がデータを傍受や改竄さえしてしまう可能性があります. 同じシステム上のユーザでさえ, あなたのデータを悪意を持って意図しないようなものに変えてしまうかもしれません. 「クラッカー」として知られる侵入者に, システムのアクセス権を不正に得られてしまうかもしれません. クラッカーはあなたになりすますために高度な知識を用い, あなたからデータを盗んだり, あなたが自分自身のデータにアクセスできないようにしてしまいます. あなたが「ハッカー」と「クラッカー」の違いが分かっていないようであれば, Eric Raymond 氏の書かれた「ハッカーになる方法(How to Become A Hacker)」 をご覧ください. (<htmlurl url="http://www.netaxs.com/~esr/faqs/hacker-howto.html" name="http://www.netaxs.com/~esr/faqs/hacker-howto.html"> で入手できます) <P> 訳注: 「ハッカーになる方法 (How to Become A Hacker)」の日本語訳は <htmlurl url="http://www.linux.or.jp/JF/JFdocs/hacker.txt" name="http://www.linux.or.jp/JF/JFdocs/hacker.txt"> または <htmlurl url="http://www.post1.com/home/hiyori13/freeware/hacker.html" name="http://www.post1.com/home/hiyori13/freeware/hacker.html"> で入手できます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> どの程度安全なら安全なのか? <!-- How Secure Is Secure? --> <P> <!-- First, keep in mind that no computer system can ever be completely secure. All you can do is make it increasingly difficult for someone to compromise your system. For the average home Linux user, not much is required to keep the casual cracker at bay. However, for high-profile Linux users (banks, telecommunications companies, etc), much more work is required. --> 最初に, 完全に安全なコンピュータシステムは存在しないことを覚えておいてください. できるのは, 何者かがシステムを悪用するのをより困難にすることだけです. 普通の Linux のホームユーザならば, 偶然やってくるクラッカーを防ぐのはそれほど大変ではありません. とはいえ, Linux を重要な仕事に使っている場合(銀行, 通信業者など)には, ずっと多くの作業が必要になるでしょう. <p> <!-- Another factor to take into account is that the more secure your system is, the more intrusive your security becomes. You need to decide where in this balancing act your system will still usable, and yet secure for your purposes. For instance, you could require everyone dialing into your system to use a call-back modem to call them back at their home number. This is more secure, but if someone is not at home, it makes it difficult for them to login. You could also setup your Linux system with no network or connection to the Internet, but this limits it's usefulness. --> 考慮に入れるべき別の要素として, セキュリティを高めれば高めるほど, セキュリティが邪魔になることが挙げられます. そこで, 目的に対して十分使いやすくかつ安全なシステムとなるよう バランスをとってやらなければなりません. 例えば, あなたのシステムに電話回線で接続してくるユーザ全てに コールバックモデムを使ってもらい, 彼らの家にコールバックするようにすることができます. これにより安全な運用をおこなえますが, ユーザが家にいないようなケースではログインが困難になってしまいます. Linux システムをネットワークやインターネットに繋がない設定も可能ですが, これでは便利さも損なわれてしまいます. <p> <!-- If you are a medium to large-sized site, you should establish a security policy stating how much security is required by your site and what auditing is in place to check it. You can find a well-known security policy example at <htmlurl url="http://www.faqs.org/rfcs/rfc2196.html" name="http://www.faqs.org/rfcs/rfc2196.html">. It has been recently updated, and contains a great framework for establishing a security policy for your company. --> 中〜大規模のサイトならば, サイトがどの程度のセキュリティを必要としていて, これをチェックするためどんな監査を行うのかという セキュリティポリシーを決めるべきです. 有名なセキュリティポリシーの例は <htmlurl url="http://core.ring.gr.jp/pub/doc/rfc/rfc2196.txt" name="http://core.ring.gr.jp/pub/doc/rfc/rfc2196.txt">です. これは最近改定されており, 会社のセキュリティポリシーを作る際の良い枠組になります. <P> 訳注: 日本語訳が <htmlurl url="http://www.ipa.go.jp/SECURITY/rfc/RFC2196-00JA.html" name="http://www.ipa.go.jp/SECURITY/rfc/RFC2196-00JA.html"> にあります. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> 何を守るのか? <!-- What Are You Trying to Protect? --> <P> <!-- Before you attempt to secure your system, you should determine what level of threat you have to protect against, what risks you should or should not take, and how vulnerable your system is as a result. You should analyze your system to know what you're protecting, why you're protecting it, what value it has, and who has responsibility for your data and other assets. --> システムを安全にしようとする前に, まず, どの程度のレベルの脅威から自身を守るのか, どの程度のリスクを冒すべきなのか (あるいは冒すべきでないのか), 結果的にシステムはどの程度脆弱なままにするのかを決めなくてはなりません. 何を守るのか, なぜそれを守るのか, それにどんな価値があるのか, データや他の財産に対しての責任は誰が負うのかを知るために, システムを解析すべきです. <P><ITEMIZE><ITEM> <!-- <em>Risk</em> is the possibility that an intruder may be successful in attempting to access your computer. Can an intruder read or write files, or execute programs that could cause damage? Can they delete critical data? Can they prevent you or your company from getting important work done? Don't forget: someone gaining access to your account, or your system, can also impersonate you. --> <em>リスク</em>とは, 侵入者がシステムへのアクセスに成功する可能性です. 侵入者はファイルの読み書きをしたり, 害をなすプログラムを実行できるでしょうか? 重要なデータを消すことができるでしょうか? 重要な仕事の妨害ができるでしょうか? 忘れてはならないのは, 誰かがあなたのアカウントやシステムへのアクセス権を手に入れてしまえば, その人はあなたになりきることができてしまうということです. <P> <!-- Additionally, having one insecure account on your system can result in your entire network being compromised. If you allow a single user to login using a <tt>.rhosts</tt> file, or to use an insecure service such as <tt>tftp</tt>, you risk an intruder getting 'his foot in the door'. Once the intruder has a user account on your system, or someone else's system, it can be used to gain access to another system, or another account. --> 加えて, 安全でないアカウントがシステム上にひとつあれば, 結果的にネットワーク全体が悪用される可能性があります. <tt>.rhost</tt> ファイルを使ったログインを許可しているユーザがいたり, <tt>tftp</tt> のような安全でないサービスを使っている場合, 侵入者がこれらを利用して「ドアの中に足を踏み入れる」危険を背負うことになります. いったん侵入者があなたや他の誰かのシステムのアカウントを手に入れれば, それは他のシステムや他のアカウントにアクセスするために利用されるかもしれません. <P><ITEM> <!-- <em>Threat</em> is typically from someone with motivation to gain unauthorized access to your network or computer. You must decide whom you trust to have access to your system, and what threat they could pose. --> <em>脅威</em>は概して, 誰かがネットワークやコンピュータに許可なしにアクセスしようとすることから 生じます. 誰を信用してあなたのシステムにアクセスさせるのか, そしてその人がどのような脅威をもたらすのかを考えておかなければなりません. <P> <!-- There are several types of intruders, and it is useful to keep their different characteristics in mind as you are securing your systems. --> 侵入者にはいくつかのタイプがあります. その特徴を知っておくと, システムを安全にするのに役立つでしょう. <P> <ITEMIZE> <!-- <item><bf>The Curious</bf> - This type of intruder is basically interested in finding out what type of system and data you have. </item> --> <ITEM><bf>好奇心</bf> - このタイプの侵入者は基本的に, あなたがどんなシステムやデータを持っているのかを知ることに興味を持っています. </item> <!-- <ITEM><bf>The Malicious</bf> - This type of intruder is out to either bring down your systems, or deface your web page, or otherwise force you to spend time and money recovering from the damage he has caused. </item> --> <ITEM><bf>悪意</bf> - このタイプの侵入者は, あなたのシステムをダウンさせたり, ウェブページに落書きをするなど, 復旧に金や時間がかかることをしようとします. </ITEM> <!-- <ITEM><bf>The High-Profile Intruder</bf> - This type of intruder is trying to use your system to gain popularity and infamy. He might use your high-profile system to advertise his abilities. </item> --> <ITEM><bf>名声</bf> - このタイプの侵入者は, 名声や悪名を得るためにシステムに侵入しようとします. 自分の能力を宣伝するために, 名の通ったシステムに侵入しようとします. </item> <!-- <ITEM><bf>The Competition</bf> - This type of intruder is interested in what data you have on your system. It might be someone who thinks you have something that could benefit him, financially or otherwise. </item> --> <ITEM><bf>競争相手</bf> - このタイプの侵入者は, あなたがシステム上にどんなデータを置いているのかに興味を持っています. この侵入者は, あなたが金銭的あるいはそれ以外の方法で利益をもたらす何かを 持っていると思っているのでしょう. </item> <!-- <ITEM><bf>The Borrowers</bf> - This type of intruder is interested in setting up shop on your system and using its resources for their own purposes. He typically will run chat or irc servers, porn archive sites, or even DNS servers. </item> --> <ITEM><bf>借用</bf> - このタイプの侵入者はあなたのシステムに作業場を作り, その資源を自分のために使うことに興味を持っています. 彼らは普通はチャットや IRC サーバ, ポルノアーカイブのサーバ, 果てには DNS サーバまで実行します. <!-- <ITEM><bf>The Leapfrogger</bf> - This type of intruder is only interested in your system to use it to get into other systems. If your system is well-connected or a gateway to a number of internal hosts, you may well see this type trying to compromise your system. --> <ITEM><bf>踏台</bf> - このタイプの侵入者は, あなたのシステムを使って他のシステムに侵入することしか考えていません. あなたのシステムの接続状態が良かったり, 多数の内部システムに継っているゲートウェイならば, このタイプの侵入者によく狙われるかもしれません. </ITEMIZE><P><ITEM> <!-- Vulnerability describes how well-protected your computer is from another network, and the potential for someone to gain unauthorized access. --> システムの脆弱さは, あなたのコンピュータが他のネットワークからどの程度守られているかということや, 誰かが不正なアクセスをする潜在的な可能性を示します. <P> <!-- What's at stake if someone breaks into your system? Of course the concerns of a dynamic PPP home user will be different from those of a company connecting their machine to the Internet, or another large network. --> 何者かがシステムに侵入した場合, 何が問題となるのでしょうか? 当然ながら, 家庭から PPP でダイアルアップ接続しているユーザの問題と, 会社のマシンをインターネットや他の大規模ネットワークに 繋いでいる人々の問題は異なります. <P> <!-- How much time would it take to retrieve/recreate any data that was lost? An initial time investment now can save ten times more time later if you have to recreate data that was lost. Have you checked your backup strategy, and verified your data lately? --> 失ったデータを復旧あるいは再び作成するのにどれくらいの時間が必要でしょうか? ちゃんと初期投資をしておけば, 後で失ったデータを再作成するはめになったときにかかる時間は 10 分の 1 に節約できます. バックアップの計画をチェックし, あとでデータの検証をしていますか? </ITEMIZE> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> セキュリティポリシーの作成 <!-- Developing A Security Policy --> <P> <!-- Create a simple, generic policy for your system that your users can readily understand and follow. It should protect the data you're safeguarding as well as the privacy of the users. Some things to consider adding are: who has access to the system (Can my friend use my account?), who's allowed to install software on the system, who owns what data, disaster recovery, and appropriate use of the system. --> ユーザが容易に理解して守ることができる, 簡単で一般的な方針を決めましょう. この方針は大切なデータやユーザのプライバシーを守ってくれるでしょう. これに加えて考えるべきことは, 誰がシステムにアクセスできるのか (自分の友人に自分のアカウントを使わせていいのでしょうか?), 誰がシステムにソフトウェアをインストールすることができるのか, 誰がどのデータを所有するのか, それから事故時の復旧やシステムの適切な使いかたについてです. <p> <!-- A generally-accepted security policy starts with the phrase --> 一般に受け入れられているセキュリティポリシーは次の言葉から始まります. <P> <!-- <quote><bf> "That which is not permitted is prohibited"</bf> </quote> --> <quote><bf> "許されていないことは禁止されている"</bf> </quote> <P> <!-- This means that unless you grant access to a service for a user, that user shouldn't be using that service until you do grant access. Make sure the policies work on your regular user account. Saying, "Ah, I can't figure out this permissions problem, I'll just do it as root" can lead to security holes that are very obvious, and even ones that haven't been exploited yet. --> これは, あるサービスをユーザに対して認めていない場合, 許可を出すまではユーザはそのサービスを使うべきではないということです. 正規ユーザアカウントに適用するポリシーを確認しましょう. 「えっと, パーミッションの問題がわからないので, root で実行しよう」 などと言うことは, 明らかなセキュリティホールになりますし, 今まで不正使用されたことのないセキュリティホールにさえなるかもしれません. <P> <!-- <htmlurl url="ftp://www.faqs.org/rfcs/rfc1244.html" name="rfc1244"> is a document that describes how to create your own network security policy. --> <htmlurl url="ftp://core.ring.gr.jp/pub/doc/RFC/rfc1244.txt" name="rfc1244"> は独自のネットワークセキュリティポリシーを作るための指針が 書かれたドキュメントです. <P> <!-- <htmlurl url="ftp://www.faqs.org/rfcs/rfc1281.html" name="rfc1281"> is a document that shows an example security policy with detailed descriptions of each step. --> <htmlurl url="ftp://core.ring.gr.jp/pub/doc/RFC/rfc1281.txt" name="rfc1281"> はセキュリティポリシーの例を示したドキュメントであり, 各ステップの詳細な説明が付いています. <P> <!-- Finally, you might want to look at the COAST policy archive at <htmlurl url="ftp://coast.cs.purdue.edu/pub/doc/policy" name="ftp://coast.cs.purdue.edu/pub/doc/policy"> to see what some real-life security policies look like. --> 最後に, <htmlurl url="ftp://coast.cs.purdue.edu/pub/doc/policy" name="ftp://coast.cs.purdue.edu/pub/doc/policy"> にある COAST ポリシーアーカイブを調べ, 実生活でのセキュリティポリシーがどのようなものかを見ると良いでしょう. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> 自分のサイトを安全にすることの意義 <!-- Means of Securing Your Site --> <P> <!-- This document will discuss various means with which you can secure the assets you have worked hard for: your local machine, your data, your users, your network, even your reputation. What would happen to your reputation if an intruder deleted some of your users' data? Or defaced your web site? Or published your company's corporate project plan for next quarter? If you are planning a network installation, there are many factors you must take into account before adding a single machine to your network. --> 本ドキュメントでは, あなたが作ってきた貴重な財産 (ローカルマシン, データ, ユーザ, ネットワーク, あなたの評判) を守るための方法を議論します. 侵入者があなたのユーザのデータを消してしまったら, あなたの評判はどうなるでしょう? あなたのウェブページに落書きをされてしまったらどうなるでしょう? また, あなたの会社の次の四半期の計画をばらされてしまったら? ネットワークのインストールを考えているならば, 1 台のマシンをネットワークにつなぐ前に, 考慮すべき要素はたくさんあります. <P> <!-- Even if you have a single dialup PPP account, or just a small site, this does not mean intruders won't be interested in your systems. Large, high-profile sites are not the only targets -\- many intruders simply want to exploit as many sites as possible, regardless of their size. Additionally, they may use a security hole in your site to gain access to other sites you're connected to. --> あなたがダイアルアップ PPP アカウントを使っていたり, ごく小規模なサイトを運営している場合であっても, 侵入者があなたのシステムに興味を持たないとは限りません. 標的にされるのは, 大規模で有名なサイトだけではありません. 多くの侵入者は規模に関係なくできるだけ多くのサイトを不正使用しようとします. 加えて, 侵入者はあなたが接続する先のサイトにアクセスするため, あなたのサイトのセキュリティホールを突くかもしれません. <P> <!-- Intruders have a lot of time on their hands, and can avoid guessing how you've obscured your system just by trying all the possibilities. There are also a number of reasons an intruder may be interested in your systems, which we will discuss later. --> 侵入者は時間を持て余しており, あなたがどんなにシステムを隠蔽しても, 推測するのではなく, 単に全ての可能性を試してしまいます. 侵入者があなたのシステムに興味を持つ理由は他にもたくさんありますが, それについては後で議論します. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT2> ホストのセキュリティ <!-- Host Security --> <P> <!-- Perhaps the area of security on which administrators concentrate most is host-based security. This typically involves making sure your own system is secure, and hoping everyone else on your network does the same. Choosing good passwords, securing your host's local network services, keeping good accounting records, and upgrading programs with known security exploits are among the things the local security administrator is responsible for doing. Although this is absolutely necessary, it can become a daunting task once your network becomes larger than a few machines. --> 管理者が最も集中するセキュリティの分野は, おそらく個々のホストに基づく部分でしょう. これは基本的に, 自分自身のシステムの安全を確保し, 自分のネットワーク上の他のホストも同様であろうと期待することです. 良いパスワードを選び, LAN へのサービスを安全に行い, きちんとログを取り, セキュリティに問題があることが知られているプログラムの バージョンアップを行うのは, ローカルのネットワーク管理者が責任を持って行うべきことです. これは絶対に必要なことなのですが, ネットワークの規模が数台規模より大きくなると実施が大変になってしまいます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT2> ローカル・ネットワークのセキュリティ <!-- Local Network Security --> <P> <!-- Network security is as necessary as local host security. With hundreds, thousands, or more computers on the same network, you can't rely on each one of those systems being secure. Ensuring that only authorized users can use your network, building firewalls, using strong encryption, and ensuring there are no "rogue" (that is, unsecured) machines on your network are all part of the network security administrator's duties. --> ネットワークのセキュリティは, 手元にあるホストのセキュリティと同じく必要なことです. 何百, 何千, あるいはそれ以上のコンピュータが同じネットワークにある場合, そのそれぞれが安全であると信頼することはできません. 許可されたユーザしか自分のネットワーク資源にアクセスできないようにし, 防火壁を構築し, 強力な暗号を使用し, 「たちの悪い」マシンや安全でないマシンがネットワーク上に無いようにすることは, 全てネットワーク管理者の任務です. <P> <!-- This document will discuss some of the techniques used to secure your site, and hopefully show you some of the ways to prevent an intruder from gaining access to what you are trying to protect. --> 本ドキュメントではサイトを安全にするために使われる技術のいくつかについて議論し, 守るべきものを侵入者にアクセスさせないようにする方法をいくつか示します. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT2> 隠蔽によるセキュリティ <!-- Security Through Obscurity --> <P> <!-- One type of security that must be discussed is "security through obscurity". This means, for example, moving a service that has known security vunerabilities to a non-standard port in hopes that attackers won't notice it's there and thus won't exploit it. Rest assured that they can determine that it's there and will exploit it. Security through obscurity is no security at all. Simply because you may have a small site, or a relatively low profile, does not mean an intruder won't be interested in what you have. We'll discuss what you're protecting in the next sections. --> 議論すべきセキュリティのタイプの 1 つは「隠蔽によるセキュリティ」です. これは例えば, セキュリティ的な弱点が知られているサービスを標準でないポートに移動させ, 攻撃者に存在がばれないようにして悪用を避けようとするものです. このようなものは心配しなくても攻撃者が見つけて悪用してくれます. 隠蔽によるセキュリティは, セキュリティ的には全く無意味です. 単に小規模なサイトや比較的無名なサイトであるからといって, 侵入者があなたの持っているものに興味を持たないわけではありません. 次の章で, あなたが守るものについて議論します. <p> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> 本ドキュメントの構成 <!-- Organization of This Document --> <P> <!-- This document has been divided into a number of sections. They cover several broad security issues. The first, <ref id="physical-security"name="Physical Security">, covers how you need to protect your physical machine from tampering. The second, <ref id="local-security" name="Local Security">, describes how to protect your system from tampering by local users. The third, <ref id="file-security" name="Files and Filesystem Security">, shows you how to setup your filesystems and permissions on your files. The next, <ref id="password-security" name="Password Security and Encryption">, discusses how to use encryption to better secure your machine and network. <ref id="kernel-security" name="Kernel Security"> discusses what kernel options you should set or be aware of for a more secure system. <ref id="network-security" name="Network Security">, describes how to better secure your Linux system from network attacks. <ref id="secure-prep" name="Security Preparation">, discusses how to prepare your machine(s) before bringing them on-line. Next, <ref id="after-breakin" name="What To Do During and After a Break-in">, discusses what to do when you detect a system compromise in progress or detect one that has recently happened. In <ref id="sources" name="Security Resources">, some primary security resources are enumerated. The Q and A section <ref id="q-and-a" name="Frequently Asked Questions">, answers some frequently asked questions, and finally a conclusion in <ref id="conclusion" name="Conclusion"> section. answers some frequently-asked questions, and finally a conclusion in <ref id="conclusion" name="Conclusion">. --> 本ドキュメントはいくつもの章に分かれています. 各章でセキュリティのおおまかな話題を押さえます. 最初の話題は <ref id="physical-security" name="物理的なセキュリティ">で, マシンそのものを物理的にいじられないようにするための方法です. 第 2 の話題は <ref id="local-security" name="ローカルのセキュリティ">で, ローカルユーザがシステムを改竄するのを防ぐ方法です. 3 番目の話題は <ref id="file-security" name="ファイルとファイルシステムのセキュリティ"> で, ファイルシステムとファイルのパーミッションの設定の方法を示します. 次の話題は <ref id="password-security" name="パスワードのセキュリティと暗号化">で, マシンやネットワークをより安全にするための暗号の使い方を議論します. <ref id="kernel-security" name="カーネルのセキュリティ">では, マシンをより安全にするために設定あるいは 意識すべきカーネルオプションについて議論します. <ref id="network-security" name="ネットワークのセキュリティ">では, Linux システムを外部ネットワークからの攻撃に対して より安全にする方法を解説します. <ref id="secure-prep" name="セキュリティの準備">では, マシンをネットワークに繋ぐ前の準備のやりかたについて議論します. 次の<ref id="after-breakin" name="システムに侵入された/されている場合の対応"> では, システムに侵入されつつあることや 侵入が最近に起こったことに気づいた場合にすべきことを議論します. <ref id="sources" name="セキュリティに関する情報源">では, セキュリティに関する基本的な情報源をいくつか示し, Q & A の章である<ref id="q-and-a" name="よく聞かれる質問"> ではよく聞かれる質問いくつかに対する回答を示します. 最後に <ref id="conclusion" name="最後に"> にて結びの言葉を述べます. <P> <!-- The two main points to realize when reading this document are: --> 本ドキュメントを読んで理解していただきたいポイントは主に 2 つあります. <P> <ITEMIZE> <ITEM> <!-- Be aware of your system. Check system logs such as <tt>/var/log/messages</tt> and keep an eye on your system, and --> システムに注意を払いましょう. <tt>/var/log/messages</tt> 等のシステムログをチェックし, システムを見張りましょう. <ITEM> <!-- Keep your system up-to-date by making sure you have installed the current versions of software and have upgraded per security alerts. Just doing this will help make your system markedly more secure. --> 最新バージョンのソフトウェアをインストールし, セキュリティの警告が出されればソフトウェアをアップグレードして, システムを常に最新の状態にしましょう. 単純にこうするだけで, システムは劇的に安全になります. </ITEMIZE> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Physical Security<label id="physical-security"> --> <SECT> 物理的なセキュリティ<label id="physical-security"> <p> <!-- The first layer of security you need to take into account is the physical security of your computer systems. Who has direct physical access to your machine? Should they? Can you protect your machine from their tampering? Should you? --> 最初に考慮すべきセキュリティの層は, コンピュータシステムの物理的なセキュリティです. 誰がマシンへ直接触ることができるのか? 触ることができるべきなのか? また, 彼らがマシンをいじれないよう守れるのか? あるいは守るべきなのか? <P> <!-- How much physical security you need on your system is very dependent on your situation, and/or budget. --> 物理的なセキュリティがどの程度必要になるかは, 大抵の場合, 状況や予算によって決まります. <P> <!-- If you are a home user, you probably don't need a lot (although you might need to protect your machine from tampering by children or annoying relatives). If you are in a lab, you need considerably more, but users will still need to be able to get work done on the machines. Many of the following sections will help out. If you are in an office, you may or may not need to secure your machine off-hours or while you are away. At some companies, leaving your console unsecured is a termination offense. --> もしあなたがマシンを自分の家で使っているのならば, たぶん注意すべきことはあまりないでしょう (子供やうるさい親戚からマシンを守る必要はあるかもしれませんが). 研究室ならば, かなり注意しなければならないでしょうが, ユーザはそのマシンで仕事をできる必要があります. そのためには以下の各章が参考になるでしょう. あなたがオフィスにいるならば, 終業後やあなたが席を離れているときに マシンを安全にしておく必要があるかもしれませんし, その必要は無いかもしれません. 会社によっては, コンソールを放置することはクビにされる程の規則違反です. <P> <!-- Obvious physical security methods such as locks on doors, cables, locked cabinets, and video surveillance are all good ideas, but beyond the scope of this document. :) --> ドアの施錠やケーブル, 鍵付きのキャビネット, ビデオ監視装置等のわかりやすい物理的な防御方法は全て良い考えなのですが, このドキュメントの守備範囲ではありません :-) <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Computer locks --> <SECT1>コンピュータへの施錠 <P> <!-- Many modern PC cases include a "locking" feature. Usually this will be a socket on the front of the case that allows you to turn an included key to a locked or unlocked position. Case locks can help prevent someone from stealing your PC, or opening up the case and directly manipulating/stealing your hardware. They can also sometimes prevent someone from rebooting your computer from their own floppy or other hardware. --> 最近の PC ケースの多くには「鍵」が付いています. 普通はケースの前面に鍵穴があり, 鍵を施錠か解除の位置にセットできるようになっています. ケースの鍵によって, 何者かが PC を盗んだり, ケースを開けて直接ハードウェアをいじったり盗んだりすることを防ぐことができます. ケースによっては, 他の誰かのフロッピーディスクや他の機器によるマシンの再起動を防ぐことができます. <P> <!-- These case locks do different things according to the support in the motherboard and how the case is constructed. On many PC's they make it so you have to break the case to get the case open. On some others, they make it so that it will not let you plug in new keyboards and they will not let you plug in new keyboards or mice. Check your motherboard or case instructions for more information. This can sometimes be a very useful feature, even though the locks are usually very low-quality and can easily be defeated by attackers with locksmithing. --> マザーボードのサポートやケースの作りによっては, ケースの鍵で色々なことができます. 多くの PC ではケースを開けるためにはこれを壊さなくてはなりません. また, 新しいキーボードやマウスを挿せないものもあります. 詳しくはマザーボードやケースの説明書を読んでください. 通常, 鍵の質はとても低く, 攻撃者は偽造によって簡単に破ることができるのですが, それでも鍵はとても便利な機能になり得ます. <P> <!-- Some machines (most notably SPARCs and macs) have a dongle on the back that, if you put a cable through, attackers would have to cut the cable or break the case to get into it. Just putting a padlock or combo lock through these can be a good deterrent to someone stealing your machine. --> マシンによっては(特に Sun SPARC や Macintosh), 背面にドングル(dongle) が付いていて, これを通してケーブルを繋げば, ケーブルを切るかケースを壊さなければ攻撃者はケーブルを繋ぐことができません. これらに単に南京錠や連結錠を付けることで, マシンを盗もうとしている人への大きな抑止効果が得られます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> BIOS Security --> <SECT1>BIOS のセキュリティ <P> <!-- The BIOS is the lowest level of software that configures or manipulates your x86-based hardware. LILO and other Linux boot methods access the BIOS to determine how to boot up your Linux machine. Other hardware that Linux runs on has similar software (OpenFirmware on Macs and new Suns, Sun boot PROM, etc...). You can use your BIOS to prevent attackers from rebooting your machine and manipulating your Linux system. --> BIOS はもっともハードウェアに近いレベルのソフトウェアで, x86 ベースのハードウェアの設定及び操作を行います. LILO 等のブートローダは, BIOS にアクセスして Linux マシンをどうやってブートさせるか指示します. Linux の他のプラットフォームでも同様のソフトウェアがあります (Mac や 新しい Sun の OpenFirmware, Sun の boot PROM 等). BIOS の設定で, 攻撃者がマシンを再起動して Linux システムを操作するのを防ぐことができます. <P> <!-- Many PC BIOSs let you set a boot password. This doesn't provide all that much security (the BIOS can be reset, or removed if someone can get into the case), but might be a good deterrent (i.e. it will take time and leave traces of tampering). Similarly, on S/Linux (Linux for SPARC(tm) processor machines), your EEPROM can be set to require a boot-up password. This might slow attackers down. --> 多くの PC BIOS では起動パスワードの設定をすることができます. これはそんなに安全ではありません (BIOS はリセットすることができますし, ケースを開けられるなら取り外すこともできるでしょう) が, 抑止効果は大きいでしょう (時間かせぎにもなりますし, システムをいじった痕跡も残るからです). 同様に S/Linux (SPARC(tm)プロセッサのマシン用の Linux)では, EEPROM を設定して起動パスワードをかけることができます. これで侵入者を足止めできるかもしれません. <P> <!-- Many x86 BIOSs also allow you to specify various other good security settings. Check your BIOS manual or look at it the next time you boot up. For example, some BIOSs disallow booting from floppy drives and some require passwords to access some BIOS features. --> 多くの x86 マシンの BIOS では, この他にも役立つセキュリティ設定を色々指定できます. BIOS のマニュアルを調べるか, 次回のマシン起動時にチェックしてみましょう. 例えば, フロッピーディスクでの起動を禁止できる BIOS もありますし, 一部の設定にパスワードをかけることができる BIOS もあります. <P> <!-- <em>Note</em>: If you have a server machine, and you set up a boot password, your machine will not boot up unattended. Keep in mind that you will need to come in and supply the password in the event of a power failure. ;( --> <em>注意</em>: サーバマシンを管理していて, 起動パスワードを設定している場合, 人がいないとマシンは起動しません. 停電などの時は, マシンの所に行ってパスワードを打ち込んでやる必要があることを覚えておきましょう. ;-( <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Boot Loader Security --> <SECT1>ブートローダのセキュリティ <P> <!-- The various Linux boot loaders also can have a boot password set. LILO, for example, has <tt>password</tt> and <tt>restricted</tt> settings; <tt>password</tt> requires password at boot time, whereas <tt>restricted</tt> requires a boot-time password only if you specify options (such as <tt>single</tt>) at the <tt>LILO </tt> prompt. --> 色々なブートローダにも起動パスワードを設定することができます. 例えば LILO を使っている場合には, <tt>password</tt> と <tt>restricted</tt> の設定を調べてみましょう. <tt>password</tt> は起動時にパスワードを要求するようにします. <tt>restricted</tt> の場合は, <tt>LILO </tt> プロンプトに対してオプション (<tt>single</tt>等) を指定した場合だけ起動パスワードを要求するようになります. <P> <!-- From the lilo.conf man page: <tscreen><verb> password=password The per-image option `password=...' (see below) applies to all images. restricted The per-image option `restricted' (see below) applies to all images. password=password Protect the image by a password. restricted A password is only required to boot the image if parameters are specified on the command line (e.g. single). </verb></tscreen> --> lilo.conf のオンラインマニュアルより: <tscreen><verb> password=password 起動イメージごとのオプション `password=...' (下記参照) を すべてのイメージに適用します. restricted 起動イメージごとのオプション `restricted' (下記参照) を すべてのイメージに適用します. password=password イメージをパスワードで保護します. restricted 起動イメージにコマンドラインでパラメータを指定したとき (例: single) だけパスワードを要求します. </verb></tscreen> <P> <!-- Keep in mind when setting all these passwords that you need to remember them. :) Also remember that these passwords will merely slow the determined attacker. They won't prevent someone from booting from a floppy, and mounting your root partition. If you are using security in conjunction with a boot loader, you might as well disable booting from a floppy in your computer's BIOS, and password-protect the BIOS. --> パスワードを設定したら, これを忘れてはならないことに注意してください. :-) また, 気合いの入った攻撃者に対しては, このようなパスワードは単なる足止め程度にしかならないことも忘れてはいけません. この方法では誰かがフロッピーディスクから起動して ルートパーティションをマウントすることを防ぐことはできません. ブートローダと組み合わせたセキュリティ手法を使う場合には, コンピュータの BIOS でフロッピーディスクからの起動を無効にすることができますし, BIOS をパスワード保護することもできます. <P> <!-- If anyone has security-related information from a different boot loader, we would love to hear it. (<tt>grub</tt>, <tt>silo</tt>, <tt>milo</tt>, <tt>linload</tt>, etc). --> LILO 以外のブートローダ(<tt>grub</tt>, <tt>silo</tt>, <tt>milo</tt>, <tt>linload</tt> 等)のセキュリティ関連情報をご存知ならば, ぜひお知らせください. <P> <!-- <em>Note</em>: If you have a server machine, and you set up a boot password, your machine will <em>not</em> boot up unattended. Keep in mind that you will need to come in and supply the password in the event of a power failure. ;( --> <em>注意</em>: サーバマシンにパスワードを設定した場合, 人がいないとマシンは起動<em>しなくなります</em>. 停電などの場合でも, マシンのところに行ってパスワードを打ち込まなければならないことは 覚えておきましょう. ;-( <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> xlock and vlock --> <SECT1>xlock と vlock <P> <!-- If you wander away from your machine from time to time, it is nice to be able to "lock" your console so that no one can tamper with, or look at, your work. Two programs that do this are: <tt>xlock</tt> and <tt>vlock</tt>. --> 頻繁にマシンから離れて出歩くならば, コンソールに「鍵」を掛け, 誰もマシンをいじったり, 作業の様子を覗けないようにしておくと良いでしょう. このようなプログラムとして, <tt>xlock</tt> と <tt>vlock</tt> の 2 つを紹介します. <p> <!-- <tt>xlock</tt> is a X display locker. It should be included in any Linux distributions that support X. Check out the man page for it for more options, but in general you can run <tt>xlock</tt> from any xterm on your console and it will lock the display and require your password to unlock. --> <tt>xlock</tt> は X のディスプレイをロックします. X をサポートしている Linux ディストリビューションならば, 普通 xlock はインストールされているでしょう. オプションについてはオンラインマニュアルを参照してほしいのですが, 大まかに説明すると, ロックしたいコンソール上の xterm から <tt>xlock</tt> を起動すると, ディスプレイがロックされ, パスワードを入力しないと解除できなくなります. <P> <!-- <tt>vlock</tt> is a simple little program that allows you to lock some or all of the virtual consoles on your Linux box. You can lock just the one you are working in or all of them. If you just lock one, others can come in and use the console; they will just not be able to use your virtual console until you unlock it. <tt>vlock</tt> ships with redhat Linux, but your mileage may vary. --> <tt>vlock</tt> は Linux の仮想コンソールの一部 あるいは全てをロックするための簡単なプログラムです. 現在作業中のコンソールを 1 つだけロックすることもできますし, 全てをロックすることもできます. 仮想コンソールを 1 つロックしている場合, 他の人はコンソールを使うことができます. ですが, ロックされている仮想端末はロックが解除されるまでは使うことができません. <tt>vlock</tt> は Red Hat Linux には入っていますが, 入っていないディストリビューションもあるかもしれません. <P> <!-- Of course locking your console will prevent someone from tampering with your work, but won't prevent them from rebooting your machine or otherwise disrupting your work. It also does not prevent them from accessing your machine from another machine on the network and causing problems. --> 当然ながら, コンソールをロックすれば何者かにあなたの作業をいじられるのを 防ぐことはできますが, マシンを再起動されたりしてやりかけの作業が壊されることは防げません. また, ネットワーク上の他のマシンからコンソールを ロックしたマシンにアクセスして問題を起こすことを防ぐこともできません. <P> <!-- More importantly, it does not prevent someone from switching out of the X Window System entirely, and going to a normal virtual console login prompt, or to the VC that X11 was started from, and suspending it, thus obtaining your privileges. For this reason, you might consider only using it while under control of xdm. --> さらに重要な点としては, 誰かが X ウィンドウシステムから完全に抜けて 通常の仮想コンソールのログインプロンプトに行くことや, X11 を起動した仮想コンソールに行き X をサスペンドさせ, ユーザの権限を奪ってしまうことを防げない点が挙げられます. ですから, 完全に xdm の制御下において使うことだけを考えるのがよいでしょう. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Detecting Physical Security Compromises --> <SECT1>物理的な攻撃を受けたことの発見 <p> <!-- The first thing to always note is when your machine was rebooted. Since Linux is a robust and stable OS, the only times your machine should reboot is when <em>you</em> take it down for OS upgrades, hardware swapping, or the like. If your machine has rebooted without you doing it, that may be a sign that an intruder has compromised it. Many of the ways that your machine can be compromised require the intruder to reboot or power off your machine. --> まずは, マシンをいつ再起動したのか必ず記録するようにしましょう. Linux は頑健で安定な OS ですから, <em>あなた</em>がマシンを再起動するのは OS のアップグレードやハードウェアの交換等の時だけでしょう. あなたが知らないうちにマシンが再起動されていたら, これは侵入者に悪用されたことの印かもしれません. 侵入者がマシンに物理的な攻撃をする手段の多くは, マシンを再起動したり, 電源を切ったりしなければならないからです. <P> <!-- Check for signs of tampering on the case and computer area. Although many intruders clean traces of their presence out of logs, it's a good idea to check through them all and note any discrepancy. --> ケースやコンピュータ周辺をいじられた兆候が無いかどうかチェックしましょう. 侵入者は普通ログから痕跡を消しますが, これらを全てチェックし, 矛盾が無いか調べるのも良いでしょう. <P> <!-- It is also a good idea to store log data at a secure location, such as a dedicated log server within your well-protected network. Once a machine has been compromised, log data becomes of little use as it most likely has also been modified by the intruder. --> ログのデータを安全な場所 (きちんと守られたネットワーク内部の専用のログサーバ等) に置くのも良い考えです. あるマシンが悪用された場合には, ログデータはほとんど役に立たなくなるからです. というのも, 侵入者は大抵ログも書き換えてしまうからです. <P> <!-- The syslog daemon can be configured to automatically send log data to a central syslog server, but this is typically sent unencrypted, allowing an intruder to view data as it is being transferred. This may reveal information about your network that is not intended to be public. There are syslog daemons available that encrypt the data as it is being sent. --> syslog デーモンを設定して, ログを自動的に中央のログサーバに送るようにすることもできますが, これは通常は暗号化されずに送られます. したがって, 侵入者は転送されているデータを見ることができます. これにより, 公にするつもりのないネットワーク関係の情報が洩れてしまうかもしれません. データを送る際に暗号化することができる syslog デーモンもあります. <P> <!-- Also be aware that faking syslog messages is easy -\- with an exploit program having been published. Syslog even accepts net log entries claiming to come from the local host without indicating their true origin. --> syslog のメッセージの偽造は容易である点にも注意してください. これを悪用するためのプログラムも出回っています. syslog はローカルホストから出されたと言っている ネットワーク経由のログエントリであっても, 本当の送信元を示すことなく受け付けてしまいます. <P> <!-- Some things to check for in your logs: --> ログを調べる際には以下の点に注意します. <!-- <ITEMIZE> <ITEM>Short or incomplete logs. <ITEM>Logs containing strange timestamps. <ITEM>Logs with incorrect permissions or ownership. <ITEM>Records of reboots or restarting of services. <ITEM>missing logs. <ITEM><tt>su</tt> entries or logins from strange places. </ITEMIZE> --> <ITEMIZE> <ITEM>ログが短かったり, 不完全ではないか <ITEM>ログに記録されている時間はおかしくないか <ITEM>ログのパーミッションや所有者はおかしくないか <ITEM>システムそのものや, サービスの再起動は記録されていないか <ITEM>無くなっているログはないか <ITEM>おかしな場所から <tt>su</tt> やログインが行われていないか </ITEMIZE> <P> <!-- We will discuss system log data <ref id="logs" name="later"> in the HOWTO. --> システムログデータについては, この HOWTO 内の <ref id="logs" name="後の章">で説明します. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Local Security<label id="local-security"> --> <SECT> ローカルのセキュリティ<label id="local-security"> <P> <!-- The next thing to take a look at is the security in your system against attacks from local users. Did we just say <em>local</em> users? Yes! --> 次にローカルユーザの攻撃に対するシステムのセキュリティについて考えます. そうです, <em>ローカル</em>のユーザに対してです. <P> <!-- Getting access to a local user account is one of the first things that system intruders attempt while on their way to exploiting the root account. With lax local security, they can then "upgrade" their normal user access to root access using a variety of bugs and poorly setup local services. If you make sure your local security is tight, then the intruder will have another hurdle to jump. --> ローカルユーザのアカウントの獲得は, 攻撃者が root のアカウントを破ろうとする際に最初に考えることの一つです. ローカルに対するセキュリティが甘ければ, 様々なバグやローカル向けのサービスのまずい設定を利用して, 一般ユーザの権限から root ユーザの権限へ 「アップグレード」することができるのです. ローカルに対するセキュリティが強固であれば, 侵入者が越えなければならないハードルはまだ残ることになります. <P> <!-- Local users can also cause a lot of havoc with your system even (especially) if they really are who they say they are. Providing accounts to people you don't know or for whom you have no contact information is a very bad idea. --> ローカルユーザは, たとえ身元を詐称していなくてもシステムに被害を与えることができます. 知らない人, 連絡先のわからない人にアカウントを与えるのは, 非常に危険なことです. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Creating New Accounts --> <SECT1>新規アカウントの作成 <P> <!-- You should make sure you provide user accounts with only the minimal requirements for the task they need to do. If you provide your son (age 10) with an account, you might want him to only have access to a word processor or drawing program, but be unable to delete data that is not his. --> アカウントを発行する際は, そのユーザが行う必要のある作業に対し, 必要最小限のアカウントを与えていることに留意すべきです. 息子 (10 才) にアカウントを与えるのならば, ワープロやお絵描きプログラムにはアクセスできるけれど, 自分のものでないファイルを削除できないユーザにすべきでしょう. <P> <!-- Several good rules of thumb when allowing other people legitimate access to your Linux machine: --> 他人に Linux マシンに対して合理的にアクセスをしてもらうための, 便利な経験則があります. <p> <!-- <ITEMIZE> <ITEM> Give them the minimal amount of privileges they need. <ITEM> Be aware when/where they login from, or should be logging in from. <ITEM> Make sure you remove inactive accounts <ITEM> The use of the same userid on all computers and networks is advisable to ease account maintence, and permits easier analysis of log data. <ITEM> The creation of group userid's should be absolutely prohibited. User accounts also provide accountability, and this is not possible with group accounts. </ITEMIZE> --> <ITEMIZE> <ITEM> 必要最小限の権限しか与えないようにします <ITEM> いつ, どこからログインしたか, あるいはどこからログインすべきかに注意を払います <ITEM> 使われていないアカウントは削除したかどうか確認します <ITEM> 全てのコンピュータとネットワークで同じユーザ ID を使うとよいでしょう. これにより, アカウントの管理, ログデータの解析が容易になります. <ITEM> グループユーザ ID の作成は絶対に禁止すべきです. ユーザアカウントでは責任の所在が明らかですが, グループアカウントではそうではないからです. </ITEMIZE> <P> <!-- Many local user accounts that are used in security compromises have not been used in months or years. Since no one is using them they, provide the ideal attack vehicle. --> セキュリティを破るときに使われるローカルユーザのアカウントの多くは, 何ヵ月あるいは何年も使われていないものです. 誰も使っていないために, 理想的な攻撃の道具になってしまうのです. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Root Security<label id="root-security"> --> <SECT1> root のセキュリティ<label id="root-security"> <p> <!-- The most sought-after account on your machine is the root (superuser) account. This account has authority over the entire machine, which may also include authority over other machines on the network. Remember that you should only use the root account for very short, specific tasks, and should mostly run as a normal user. Even small mistakes made while logged in as the root user can cause problems. The less time you are on with root privileges, the safer you will be. --> あなたのマシンで最も欲しがられるアカウントは, root (ユーパーユーザ) のアカウントです. このアカウントはマシン全体に対する権限を持ち, ネットワーク上の他のマシンに対する権限を持つこともあります. root のアカウントはできるだけ短時間の, 特定の作業だけで使用し, それ以外の時は一般ユーザとしてマシンを使用すべきです. root ユーザでログインしているとちょっとしたミスでも問題を起こしかねません. root 権限を持っている時間は短ければ短いほど安全です. <P> <!-- Several tricks to avoid messing up your own box as root: --> root 権限でマシンを壊してしまわないための仕掛けもいくつかあります. <ITEMIZE> <ITEM> <!-- When doing some complex command, try running it first in a non-destructive way...especially commands that use globbing: e.g., if you want to do <tt>rm foo*.bak</tt>, first do <tt>ls foo*.bak</tt> and make sure you are going to delete the files you think you are. Using <tt>echo</tt> in place of destructive commands also sometimes works. --> 複雑なコマンドを実行するとき, 特に globbing を使う(* や ? などのワイルドカードを使用する)場合は, 失敗しても悲惨な結果にならない方法を最初にとりましょう. 例えば <tt>rm foo*.bak</tt> を実行したい場合は, まず <tt>"ls foo*.bak"</tt> を実行し, 考えているファイルだけが消されるようになっているか確認するのです. 危険なコマンドの代わりに <tt>echo</tt> が使えることもあります. <ITEM> <!-- Provide your users with a default alias to the rm command to ask for Provide your users with a default alias to the <tt>rm</tt> command to ask for confirmation for deletion of files. --> ユーザに対して <tt>rm</tt> コマンドのエイリアスを設定しておき, ファイルの削除の際に確認を行うようにします. <ITEM> <!-- Only become root to do single specific tasks. If you find yourself trying to figure out how to do something, go back to a normal user shell until you are <em>sure</em> what needs to be done by root. --> 特定の作業 1 つを行うためだけに root になりましょう. 自分が, どうやって作業しようか考えているような状態だとしたら, root でやらなければならないことが<em>はっきり</em>するまでは, 一般ユーザに戻りましょう. <ITEM> <!-- The command path for the root user is very important. The command path (that is, the <tt>PATH</tt> environment variable) specifies the directories in which the shell searches for programs. Try to limit the command path for the root user as much as possible, and <em>never</em> include <tt>.</tt> (which means "the current directory") in your PATH. Additionally, never have writable directories in your search path, as this can allow attackers to modify or place new binaries in your search path, allowing them to run as root the next time you run that command. --> root ユーザのコマンドパスはとても重要です. コマンドパス (つまり PATH 環境変数) はシェルがプログラムを探すディレクトリを指定します. root ユーザ用のコマンドパスはできる限り制限すべきですし, <em>絶対に</em> '.' (これは「カレントディレクトリ」を意味します) を PATH の指定に入れてはいけません. さらに, 書き込み可能なディレクトリを検索パスに入れてはいけません. というのも, そうなっていると攻撃者が検索パス上のファイルを書き換えたり置き換えたりでき, あなたがそのコマンドを次に使ったときに root 権限で動作させることができるからです. <ITEM> <!-- Never use the rlogin/rsh/rexec suite of tools (called the r-utilities) as root. They are subject to many sorts of attacks, and are downright dangerous when run as root. Never create a <tt>.rhosts</tt> file for root. --> root で rlogin/rsh/rexec コマンド群 (いわゆる r-ユーティリティ) を使ってはいけません. これらのコマンドは色々な攻撃の対象となるので, root のときに実行するのは実に危険です. root ユーザ用の <tt>.rhosts</tt> ファイルは決して作ってはいけません. <ITEM> <!-- The <tt>/etc/securetty</tt> file contains a list of terminals that root can login from. By default (on Red Hat Linux) this is set to only the local virtual consoles(vtys). Be very wary of adding anything else to this file. You should be able to login remotely as your regular user account and then <tt>su</tt> if you need to (hopefully over <tt><ref id="ssh" name="ssh"></tt> or other encrypted channel), so there is no need to be able to login directly as root. --> <tt>/etc/securetty</tt> には root がログインできる端末のリストが書かれています. (Red Hat Linux の)デフォルトでは, これにはローカルの仮想端末 (vty) だけが設定されています. このファイルにそれ以外の端末を追加するときには, 細心の注意を払ってください. 必要がある時でも一般ユーザとして (できれば <tt><ref id="ssh" name="ssh"></tt> 等の暗号化チャネル経由で) リモートログインし, それから <tt>su</tt> することができるはずなので, 直接 root としてログインできる必要はありません. <item> <!-- Always be slow and deliberate running as root. Your actions could affect a lot of things. Think before you type! --> root での作業は, 必ずゆっくり, 慎重に行いましょう. 作業の結果は大きな影響をもたらすかもしれません. コマンドを打ち込む前に, まず考えましょう! </ITEMIZE> <P> <!-- If you absolutely positively need to allow someone (hopefully very trusted) to have root access to your machine, there are a few tools that can help. <tt>sudo</tt> allows users to use their password to access a limited set of commands as root. This would allow you to, for instance, let a user be able to eject and mount removable media on your Linux box, but have no other root privileges. <tt>sudo</tt> also keeps a log of all successful and unsuccessful sudo attempts, allowing you to track down who used what command to do what. For this reason <tt>sudo</tt> works well even in places where a number of people have root access, because it helps you keep track of changes made. --> どうしても誰か (できれば非常に信頼している人) に root 権限を与える必要がある場合にも, これを補助するツールがあります. <tt>sudo</tt> を使えば, ユーザのパスワードを使って, 制限されたコマンド群を root の権限で使用させることができます. これにより, 例えば Linux マシンのリムーバブルメディアを ユーザにイジェクトやマウントをさせるけれど, それ以外の root 権限は与えないようにすることができます. <tt>sudo</tt> は成功・失敗を含めて全ての <tt>sudo</tt> の試みをログに取ることができるので, 誰が何のためにどのコマンドを使ったか調査することができます. このため, <tt>sudo</tt> は多くのユーザが root 権限を持つような環境でもうまく利用することができます. なぜなら, システムに対して行われた変更を調べやすくしてくれるからです. <P> <!-- Although <tt>sudo</tt> can be used to give specific users specific privileges for specific tasks, it does have several shortcomings. It should be used only for a limited set of tasks, like restarting a server, or adding new users. Any program that offers a shell escape will give root access to a user invoking it via <tt>sudo</tt>. This includes most editors, for example. Also, a program as innocuous as <tt>/bin/cat</tt> can be used to overwrite files, which could allow root to be exploited. Consider <tt>sudo</tt> as a means for accountability, and don't expect it to replace the root user and still be secure. --> <tt>sudo</tt> を使って特定のユーザに特定目的のための 特定の権限を与えることができますが, sudo には欠点がいくつかあります. sudo は, サーバの再起動やユーザの新規追加など, 限られた作業の組に対してだけ使うべきです. シェルエスケープができる任意のプログラムは, これを <tt>sudo</tt> を通して使ったユーザに root 権限を与えてしまいます. 例えば, 大部分のエディタがこれに該当します. また, /bin/cat のように無害なプログラムであっても ファイルの上書きに使うことができるので, これを使って root 権限が破られることもあり得ます. <tt>sudo</tt> は権限を使わせるための手段と考えるべきであり, root ユーザをより安全にするために置き換えるものと期待してはいけません. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Files and Filesystem Security<label id="file-security"> --> <SECT> ファイルとファイルシステムのセキュリティ<label id="file-security"> <p> <!-- A few minutes of preparation and planning ahead before putting your systems online can help to protect them and the data stored on them. --> システムをネットワークに繋ぐ前に少し準備と計画を行うだけで, システムとその中のデータを守るのに役立つでしょう. <ITEMIZE> <ITEM> <!-- There should never be a reason for users' home directories to allow SUID/SGID programs to be run from there. Use the <tt>nosuid</tt> option in <tt>/etc/fstab</tt> for partitions that are writable by others than root. You may also wish to use <tt>nodev</tt> and <tt>noexec</tt> on users' home partitions, as well as <tt>/var</tt>, thus prohibiting execution of programs, and creation of character or block devices, which should never be necessary anyway. --> ユーザのホームディレクトリに SUID/SGID したプログラムを置いて実行させる理由は全くありません. root 以外のユーザが書き込み可能なパーティションに対しては <tt>/etc/fstab</tt> で <tt>nosuid</tt> オプションを使いましょう. また, ユーザのホームパーティションや <tt>/var</tt> では <tt>nodev</tt> や <tt>noexec</tt> を使おうと考えるかもしれません. これらのオプションはプログラムの実行や, キャラクタデバイス・ブロックデバイスの作成を禁止します. これらはいずれにせよ必要無いはずです. <ITEM> <!-- If you are exporting filesystems using NFS, be sure to configure /etc/exports with the most restrictive access possible. This means <tt>/etc/exports</tt> with the most restrictive access possible. This means not using wildcards, not allowing root write access, and exporting read-only wherever possible. --> NFS を用いてファイルシステムをエクスポートしている場合は必ず, アクセスをできる限り厳しく設定してください. つまり <tt>/etc/exports</tt> でできる限り厳しいアクセス制限を行ってください. これはワイルドカードを使わないこと, root での書き込みアクセスを許可しないこと, できる限り読み取り専用でエクスポートするということです. <ITEM> <!-- Configure your users' file-creation <tt>umask</tt> to be as restrictive as possible. See <ref id="umask" name="umask settings">. --> ファイル作成の <tt>umask</tt> をできる限り厳しく設定してください. <ref id="umask" name="umask の設定"> をご覧ください. <ITEM> <!-- If you are mounting filesystems using a network filesystem such as NFS, be sure to configure /etc/exports with suitable restrictions. Typically, using `nodev', `nosuid', and perhaps `noexec', are desirable. --> NFS 等のネットワークファイルシステムを用いて ファイルシステムをマウントしているならば, 必ず /etc/exports で適切な制限を付けた設定にしてください. 普通は `nodev', `nosuid', それから多分 `noexec' が望ましいでしょう. <ITEM> <!-- Set filesystem limits instead of allowing <tt>unlimited</tt> as is the default. You can control the per-user limits using the resource-limits PAM module and <tt>/etc/pam.d/limits.conf</tt>. For example, limits for group <tt>users</tt> might look like this: --> デフォルトの <tt>unlimited</tt> を認めるのではなく, ファイルシステムに制限値を設定しましょう. リソース制限を行う PAM モジュールと <tt>/etc/pam.d/limits.conf</tt> を使って, ユーザ別に制御することができます. 例えば, グループ <tt>users</tt> の制限は以下のようになります: <P> <tscreen><verb> @users hard core 0 @users hard nproc 50 @users hard rss 5000</verb></tscreen> <P> <!-- This says to prohibit the creation of core files, restrict the number of processes to 50, and restrict memory usage per user to 5M. --> この設定は, コアファイルの作成を禁止し, プロセスの数を 50 に制限し, メモリの使用量をユーザ 1 人あたり 5MB に制限するものです. <P> <ITEM> <!-- The <tt>/var/log/wtmp</tt> and <tt>/var/run/utmp</tt> files contain the login records for all users on your system. Their integrity must be maintained because they can be used to determine when and from where a user (or potential intruder) has entered your system. These files should also have 644 permissions, without affecting normal system operation. --> <tt>/var/log/wtmp</tt>, <tt>/var/run/utmp</tt> ファイルには, システムの全てのユーザのログイン記録が記録されています. このファイルは絶対いじられないようにしなくてはなりません. というのも, このファイルを使ってユーザ (あるいは侵入者である可能性がある人) がいつ, どこからシステムに入ったのかを知ることができるからです. このファイルのパーミッションは 644 にすべきです. この設定は通常のシステム操作に影響を与えません. <P><ITEM> <!-- The immutable bit can be used to prevent accidentally deleting or overwriting a file that must be protected. It also prevents someone from creating a symbolic link to the file (such symbolic links have been the source of attacks involving deleting <tt>/etc/passwd</tt> or <tt>/etc/shadow</tt>). See the <tt>chattr</tt>(1) man page for information on the immutable bit. --> immutable ビットを使うと, 守らなくてはならないファイルを事故で消したり上書きすることを防ぐことができます. このビットを使って, 誰かがこのファイルに対するシンボリックリンクを作成するのを防ぐこともできます (こういったシンボリックリンクは今まで <tt>/etc/passwd</tt> や <tt>/etc/shadow</tt> の削除を含む攻撃の手段となってきました). immutable ビットの情報については, オンラインマニュアルの <tt>chattr(1)</tt> を参照してください. <P><ITEM> <!-- SUID and SGID files on your system are a potential security risk, and should be monitored closely. Because these programs grant special privileges to the user who is executing them, it is necessary to ensure that insecure programs are not installed. A favorite trick of crackers is to exploit SUID-root programs, then leave a SUID program as a backdoor to get in the next time, even if the original hole is plugged. --> SUID, SGID されたファイルがシステムにあると セキュリティにとっては潜在的に危険なので, これらのファイルはきちんと監視していなければなりません. このようなプログラムは実行したユーザに特別な権限を与えるので, 安全でないプログラムが絶対にインストールされないようにする必要があります. クラッカーが好んで使うトリックとして, root に SUID されたプログラムをいじり, 元のセキュリティホールが塞がれても次回に使える裏口として, SUID されたプログラムを残しておく方法があります. <P> <!-- Find all SUID/SGID programs on your system, and keep track of what they are, so you are aware of any changes which could indicate a potential intruder. Use the following command to find all SUID/SGID programs on your system: --> システム上の SUID/SGID されたプログラムを全て見つけ, それらがどうなっているかを監視します. 侵入者の可能性を示すこれらのファイルの変化に注意してください. システム上の SUID/SGID されたプログラムを全て見つけるには 以下のコマンドを使います: <P><tscreen><verb> root# find / -type f \( -perm -04000 -o -perm -02000 \) </verb></tscreen> <P> <!-- The Debian distribution runs a job each night to determine what SUID files exist. It then compares this to the previous night's run. You can look in <tt>/var/log/setuid*</tt> for this log. --> Debian ディストリビューションは, SUID されたファイルが存在するかどうかを調べるジョブを毎晩実行します. そして, これを昨晩の実行結果と比較します. このログは <tt>/var/log/setuid*</tt> で参照できます. <P> <!-- You can remove the SUID or SGID permissions on a suspicious program with <tt>chmod</tt>, then restore them back if you absolutely feel it is necessary. --> 怪しいプログラムは <tt>chmod</tt> を使って SUID や SGID のパーミッションを取り除くことができます. どうしても必要だと思った時にはパーミッションを戻すこともできます. <P> <ITEM> <!-- World-writable files, particularly system files, can be a security hole if a cracker gains access to your system and modifies them. Additionally, world-writable directories are dangerous, since they allow a cracker to add or delete files as he wishes. To locate all world-writable files on your system, use the following command:<P> --> 全てのユーザーが書き込み可能なファイル(特にシステムファイル)は, クラッカーがあなたのシステムにアクセスして, 修正することにより セキュリティホールとなりえます. さらに, 誰もが書き込めるディレクトリというものも, クラッカーが自由にファイルの追加・削除ができるため危険です. システム上にあるこのようなファイルの位置を特定するには, 以下のコマンドを使います:<P> <tscreen><verb> root# find / -perm -2 ! -type l -ls </verb></tscreen> <!-- and be sure you know why those files are writable. In the normal course of operation, several files will be world-writable, including some from <tt>/dev</tt>, and symbolic links, thus the <tt>! -type l</tt> which excludes these from the previous <tt>find</tt> command. --> それから, どうしてこれらのファイルが書き込み可能になったのかを確かめてください. 普通に操作している場合でも, <tt>/dev</tt> のいくつかのファイルやシンボリックリンク等を含めて, 誰でも書き込めるファイルがいくつかあります. したがって, <tt>! -type l</tt> を用いて, 先の <tt>find</tt> コマンドの結果からこれらを取り除いてください. <ITEM> <P> <!-- Unowned files may also be an indication an intruder has accessed your system. You can locate files on your system that have no owner, or belong to no group with the command:<P> --> 所有者のいないファイルも侵入者がシステムにアクセスした可能性を示します. 所有者がいないファイルや, どのグループにも属していないファイルは, 以下のコマンドで見つけることができます:<P> <tscreen><verb> root# find / -nouser -o -nogroup -print </verb></tscreen> <P> <ITEM> <!-- Finding <tt>.rhosts</tt> files should be a part of your regular system administration duties, as these files should not be permitted on your system. Remember, a cracker only needs one insecure account to potentially gain access to your entire network. You can locate all .rhosts files on your system with the following command: --> <tt>.rhosts</tt> ファイルを見つけることも, システム管理者の日常業務の一部です. このファイルをシステムに設置するのは許可すべきでないからです. クラッカーがネットワーク全体にアクセスする可能性を得るためには, 安全でないアカウントが 1 つだけあれば良いということを忘れないでください. システム上の全ての <tt>.rhosts</tt> ファイルは以下のコマンドで見つけることができます: <tscreen><verb> root# find /home -name .rhosts -print </verb></tscreen> <ITEM> <P> <!-- Finally, before changing permissions on any system files, make sure you understand what you are doing. Never change permissions on a file because it seems like the easy way to get things working. Always determine why the file has that permission before changing it. --> 最後になりますが, システムファイルのパーミッションの変更は, しようとしていることを必ず理解してからにしてください. 何かを動かすための楽な方法だからといって, ファイルのパーミッションを変えてはいけません. パーミッションを変える前には, ファイルのパーミッションがそうなっている理由を必ず理解してください. <P> </ITEMIZE> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1>Umask Settings<label id="umask"> --> <SECT1>umask の設定<label id="umask"> <P> <!-- The <tt>umask</tt> command can be used to determine the default file creation mode on your system. It is the octal complement of the desired file mode. If files are created without any regard to their permissions settings, the user could inadvertently give read or write permission to someone that should not have this permission. Typical <tt>umask</tt> settings include <tt>022</tt>, <tt>027</tt>, and <tt>077</tt> (which is the most restrictive). Normally the umask is set in <tt>/etc/profile</tt>, so it applies to all users on the system. The file creation mask can be calculated by subtracting the desired value from 777. In other words, a umask of 777 would cause newly-created files to contain no read, write or execute permission for anyone. A mask of 666 would cause newly-created files to have a mask of 111. For example, you may have a line that looks like this: --> <tt>umask</tt> コマンドを使って, システムのデフォルトのファイル生成モードを決めることができます. umask 値は設定したいファイルモードの 8 進数での補数になります. パーミッションに関する指定を何も行わずにファイルを生成すると, パーミッションを与えるべきでない何者かに対して 読み書きのパーミッションを意図せずに与えてしまうかもしれません. 通常は <tt>umask</tt> 値の設定は <tt>022</tt>, <tt>027</tt>, <tt>077</tt> です. <tt>077</tt> は最も厳しい設定です. 通常は umask 値は <tt>/etc/profile</tt> で設定され, システムの全ユーザに適用されます. ファイル生成マスクは, 777 から希望の値を引き算することによって計算することができます. 言い換えると, umask 値が 777 であれば, 新しく生成されるファイルは誰に対しても 読み書きと実行のパーミッションを持ちません. マスクが 666 ならば, 新しく生成されるファイルのモードは 111 となります. 例えば, 以下のような行を設定できます: <P> <tscreen><verb> # Set the user's default umask umask 033 </verb></tscreen> <!-- Be sure to make root's umask <tt>077</tt>, which will disable read, write, and execute permission for other users, unless explicitly changed using <tt>chmod</tt>. In this case, newly-created directories would have 744 permissions, obtained by subtracting 033 from 777. Newly-created files using the 033 umask would have permissions of 644. --> ただし, root ユーザの umask 値は必ず <tt>077</tt> にしてください. こうしておくと, <tt>chmod</tt> を使って明示的に変えない限り, 他のユーザの読み書きと実行は無効になります. umask 値に 033 を設定した場合には, 新しく生成されるディレクトリのパーミッションは 744 になります. この値は 777 から 033 を引いて得られたものです. umask 値 033 を用いて新しく生成されるファイルはパーミッション 644 を持ちます. <P> <!-- If you are using Red Hat, and adhere to their user and group ID creation scheme (User Private Groups), it is only necessary to use <tt>002</tt> for a <tt>umask</tt>. This is due to the fact that the default configuration is one user per group. --> Red Hat を使っており, Red Hat のユーザ ID, グループ ID の作成方法 (User Private Groups) に従う場合, <tt>umask</tt> には <tt>002</tt> だけ設定していれば十分です. その理由は, デフォルトの設定で 1 グループに 1 ユーザしかいないためです. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> File Permissions --> <SECT1>ファイルのパーミッション <P> <!-- It's important to ensure that your system files are not open for casual editing by users and groups who shouldn't be doing such system maintenance. --> システム管理を行うべきでないユーザやグループの権限では システムファイルを変更できないようにしておくのは重要なことです. <P> <!-- Unix separates access control on files and directories according to three characteristics: owner, group, and other. There is always exactly one owner, any number of members of the group, and everyone else. --> UNIX は ファイルとディレクトリのアクセス制御を 3 つの特性 (所有者, グループ, 全員)に分離しています. 常に一人だけを指す所有者, 任意の人数を指せるグループ, そしてそれ以外の全員です. <P> <!-- A quick explanation of Unix permissions: --> 以下で UNIX のパーミッションを簡単に説明します: <P> <!-- Ownership - Which user(s) and group(s) retain(s) control of the permission settings of the node and parent of the node --> 所有権 (ownership) - あるノードやその親ノードのパーミッション設定をどのユーザ, グループが行うことができるのかを示します. <P> <!-- Permissions - Bits capable of being set or reset to allow certain types of access to it. Permissions for directories may have a different meaning than the same set of permissions on files. --> パーミッション(permissions) - ファイルに対して行うことができる アクセスの種類を決めるビット列. 組合せが同じでも, ディレクトリのパーミッションは ファイルのパーミッションとは意味が異なることがあります. <P> <!-- <bf>Read:</bf> <ITEMIZE> <ITEM>To be able to view contents of a file <ITEM>To be able to read a directory </ITEMIZE> --> 読み出し(read): <ITEMIZE> <ITEM>ファイルの内容を見ることができる <ITEM>ディレクトリの内容を見ることができる </ITEMIZE> <P> <!-- <bf>Write:</bf> <ITEMIZE> <ITEM>To be able to add to or change a file <ITEM>To be able to delete or move files in a directory </ITEMIZE> --> 書き込み(write): <ITEMIZE> <ITEM>ファイルの内容の追加, 修正ができる <ITEM>ディレクトリのファイルの消去やファイル移動ができる </ITEMIZE> <P> <!-- <bf>Execute:</bf> <ITEMIZE> <ITEM>To be able to run a binary program or shell script <ITEM>To be able to search in a directory, combined with read permission </ITEMIZE> --> 実行(execute): <ITEMIZE> <ITEM>バイナリのプログラムやシェルスクリプトを実行できる <ITEM>読み出しのパーミッションと組み合わせて, ディレクトリ内を調べることができる </ITEMIZE> <P> <descrip> <!-- <tag/Save Text Attribute: (For directories)/ --> <tag/テキスト保存属性: (ディレクトリ用)/ <!-- The "sticky bit" also has a different meaning when applied to directories than when applied to files. If the sticky bit is set on a directory, then a user may only delete files that the he owns or for which he has explicit write permission granted, even when he has write access to the directory. This is designed for directories like <tt>/tmp</tt>, which are world-writable, but where it may not be desirable to allow any user to delete files at will. The sticky bit is seen as a <tt>t</tt> in a long directory listing. --> ディレクトリに適用する場合, 「sticky ビット」の意味はファイルに適用する場合と異なります. sticky ビットがディレクトリに設定されている場合に削除できるファイルは, そのディレクトリへの書き込み権限があったとしても, 自分が所有しているファイルか 明示的に書き込み許可が与えられているファイルだけです. このビットは <tt>/tmp</tt> のようなディレクトリのために用意されたものです. このようなディレクトリは誰でも書き込みはできますが, 誰でも自由にファイル消去を認めるのは望ましくありません. ディレクトリを詳細表示すると, sticky ビットは <tt>t</tt> で表されます. </descrip> <P> <descrip> <!-- <tag/SUID Attribute: (For Files)/ --> <tag/SUID 属性: (ファイル用)/ <!-- This describes set-user-id permissions on the file. When the set user ID access mode is set in the owner permissions, and the file is executable, processes which run it are granted access to system resources based on user who owns the file, as opposed to the user who created the process. This is the cause of many "buffer overflow" exploits. --> これはファイルへの SUID パーミッションを示します. ユーザ ID 設定アクセスモードが所有者のパーミッションで設定されており, かつそのファイルが実行可能であれば, これを実行したプロセスは, プロセスを起動したユーザではなく, ファイルを所有しているユーザに基づいてシステムのリソースにアクセスできます. これは各種 'buffer overflow' 攻撃の原因となります. </descrip> <descrip> <!-- <tag/SGID Attribute: (For Files)/ --> <tag/SGID 属性: (ファイル用)/ <!-- If set in the group permissions, this bit controls the "set group id" status of a file. This behaves the same way as SUID, except the group is affected instead. The file must be executable for this to have any effect. --> グループのパーミッションで設定されていれば, このビットはファイルの「グループ ID 設定」状態を制御します. これは SUID と同じように動作しますが, ユーザではなくグループが影響を受ける点が異なります. このビットに効果を持たせるためには, やはりファイルは実行可能でなければいけません. </descrip> <P> <descrip> <!-- <tag/SGID Attribute: (For directories)/ --> <tag/SGID 属性: (ディレクトリ用)/ <!-- If you set the SGID bit on a directory (with <tt>chmod g+s <it>directory</it></tt>), files created in that directory will have their group set to the directory's group. --> (<tt>chmod g+s <it>directory</it></tt> を行って) ディレクトリに SGID ビットを設定した場合, このディレクトリに作られたファイルは ディレクトリのグループに設定されたグループを持ちます. </descrip> <P> <!-- You - The owner of the file<P> Group - The group you belong to<P> Everyone - Anyone on the system that is not the owner or a member of the group<P> --> あなた - ファイルの所有者<P> グループ - あなたが所属するグループ<P> 全員 - 所有者でもグループのメンバでもない, システム上の全員<P> <P> <!-- <bf>File Example:</bf> --> <bf>ファイルの例:</bf> <P> <!-- <tscreen><verb> -rw-r–– 1 kevin users 114 Aug 28 1997 .zlogin 1st bit - directory? (no) 2nd bit - read by owner? (yes, by kevin) 3rd bit - write by owner? (yes, by kevin) 4th bit - execute by owner? (no) 5th bit - read by group? (yes, by users) 6th bit - write by group? (no) 7th bit - execute by group? (no) 8th bit - read by everyone? (yes, by everyone) 9th bit - write by everyone? (no) 10th bit - execute by everyone? (no) </verb></tscreen> --> <tscreen><verb> -rw-r--r-- 1 kevin users 114 Aug 28 1997 .zlogin 1番目のビット - ディレクトリか? (no) 2番目のビット - 所有者が読み出せるか? (yes, ユーザ kevin が可能) 3番目のビット - 所有者が書き込めるか? (yes, ユーザ kevin が可能) 4番目のビット - 所有者が実行できるか? (no) 5番目のビット - グループは読み出せるか (yes, users グループが可能) 6番目のビット - グループは書き込めるか? (no) 7番目のビット - グループは実行できるか? (no) 8番目のビット - 誰でも読み出せるか? (yes, 誰でも可能) 9番目のビット - 誰でも書き込めるか? (no) 10番目のビット- 誰でも実行できるか? (no) </verb></tscreen> <P> <!-- The following lines are examples of the minimum sets of permissions that are required to perform the access described. You may want to give more permission than what's listed here, but this should describe what these minimum permissions on files do:<P> --> 以下の行は, アクセス権の説明に必要な最小限のパーミッションを集めた例です. 実際には, ここに示した以上のパーミッションを与えることが必要かもしれませんが, これらのファイルに関する最小限のパーミッションが意味するところは 次のようなものです:<P> <!-- <tscreen><verb> -r–––– Allow read access to the file by owner –w–––- Allows the owner to modify or delete the file (Note that anyone with write permission to the directory the file is in can overwrite it and thus delete it) –-x––– The owner can execute this program, but not shell scripts, which still need read permission –-s––– Will execute with effective User ID = owner –––-s– Will execute with effective Group ID = group -rw–––T No update of "last modified time". Usually used for swap files –-t––– No effect. (formerly sticky bit) </verb></tscreen> --> <tscreen><verb> -r-------- 所有者に読み込みアクセスを許可します --w------- 所有者にファイルの修正と削除を許可します (そのファイルが入っているディレクトリの書き込みパーミッショ ンを持つユーザは, ファイルの上書きや削除を行うことができます) ---x------ このプログラムの実行を許可します. シェルスクリプトの場合は これだけでは足りず, さらに読み込みパーミッションが必要です. ---s------ 「実効ユーザ ID = 所有者」として実行を行います -------s-- 「実効グループ ID = グループ」として実行を行います -rw------T 「最終更新時刻」を更新しません. 通常はスワップファイルだけ に使います. ---t------ 無意味です(以前 sticky ビットだったものです). </verb></tscreen> <!-- <bf>Directory Example:</bf> --> <bf>ディレクトリの例:</bf> <!-- <tscreen><verb> drwxr-xr-x 3 kevin users 512 Sep 19 13:47 .public_html/ 1st bit - directory? (yes, it contains many files) 2nd bit - read by owner? (yes, by kevin) 3rd bit - write by owner? (yes, by kevin) 4th bit - execute by owner? (yes, by kevin) 5th bit - read by group? (yes, by users 6th bit - write by group? (no) 7th bit - execute by group? (yes, by users) 8th bit - read by everyone? (yes, by everyone) 9th bit - write by everyone? (no) 10th bit - execute by everyone? (yes, by everyone) </verb></tscreen> --> <tscreen><verb> drwxr-xr-x 3 kevin users 512 Sep 19 13:47 .public_html/ 1番目のビット - ディレクトリか? (yes, たくさんのファイルがある) 2番目のビット - 所有者は読み出せるか? (yes, ユーザ kevin が可能) 3番目のビット - 所有者は書き込めるか? (yes, ユーザ kevin が可能) 4番目のビット - 所有者は実行できるか? (yes, ユーザ kevin が可能) 5番目のビット - グループは読み出せるか?(yes, users グループが可能) 6番目のビット - グループは書き込めるか?(no) 7番目のビット - グループは実行できるか?(yes, users グループが可能) 8番目のビット - 誰でも読み出しできるか?(yes, 誰でも可能) 9番目のビット - 誰でも書き込めるか? (no) 10番目のビット- 誰でも実行できるか? (yes, 誰でも可能) </verb></tscreen> <P> <!-- The following lines are examples of the minimum sets of permissions that are required to perform the access described. You may want to give more permission than what's listed, but this should describe what these minimum permissions on directories do:<P> --> 以下の行は, アクセス権の説明に必要な最小限のパーミッションを集めた例です. 示したもの以外にも多くのパーミッションが必要だと思うかもしれませんが, これはこれらのファイルに対する最小限のパーミッションで記述できるはずです:<P> <!-- <tscreen><verb> dr–––– The contents can be listed, but file attributes can't be read d–x––– The directory can be entered, and used in full execution paths dr-x––– File attributes can be read by owner d-wx––– Files can be created/deleted, even if the directory isn't the current one d–––x-t Prevents files from deletion by others with write access. Used on /tmp d–-s–s– No effect </verb></tscreen> --> <tscreen><verb> dr-------- 内容は表示できますが, ファイルの属性は読み出せません d--x------ ディレクトリに入れ, 実行時に絶対パスの一部として使うことが できます. dr-x------ 所有者がファイル属性を読み出すことができます d-wx------ カレントディレクトリでなくても, ファイルの生成/削除が行え ます d------x-t 書き込み許可があっても他人はファイルを消すことを禁止します. /tmp で使われます. d---s--s-- 無意味です. </verb></tscreen> <p> <!-- System configuration files (usually in <tt>/etc</tt>) are usually mode <tt>640</tt> (<tt>-rw-r-\-\-\-\-</tt>), and owned by root. Depending on your site's security requirements, you might adjust this. Never leave any system files writable by a group or everyone. Some configuration files, including <tt>/etc/shadow</tt>, should only be readable by root, and directories in <tt>/etc</tt> should at least not be accessible by others. --> システム設定ファイル (普通は <tt>/etc</tt> にあります) は通常, モードが <tt>640</tt> (-rw-r-----) で, root が所有者です. これはサイトにおけるセキュリティの要求にしたがって調整することができます. システムファイルはグループのメンバーないしは万人に 書き込めるようにしていてはいけません. 一部のファイル (<tt>/etc/shadow</tt> 等) は root にしか読めない状態でなければなりませんし, 少なくとも <tt>/etc</tt> 内にあるディレクトリは その他のユーザがアクセスできてはいけません. <P> <descrip> <!-- <tag /SUID Shell Scripts/ --> <tag /SUID されたシェルスクリプト/ <!-- SUID shell scripts are a serious security risk, and for this reason the kernel will not honor them. Regardless of how secure you think the shell script is, it can be exploited to give the cracker a root shell. --> SUID されたシェルスクリプトはセキュリティに重大な危険を及ぼすので, カーネルはこれを無視します. そのシェルスクリプトがどれだけ安全だと思っていても, クラッカーに root のシェルを奪われてしまう可能性があります. </descrip> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Integrity Checking --> <SECT1>システム整合性のチェック <P> <!-- Another very good way to detect local (and also network) attacks on your system is to run an integrity checker like <tt>Tripwire</tt>, <tt>Aide</tt> or <tt>Osiris</tt>. These integrety checkers run a number of checksums on all your important binaries and config files and compares them against a database of former, known-good values as a reference. Thus, any changes in the files will be flagged. --> ローカルからの (そしてネットワークからの) システムに対する攻撃を発見する別の良い方法は, <tt>Tripwire</tt>, <tt>Aide</tt>, <tt>Osiris</tt> のような, システムがいじられていないかどうかをチェックする プログラムを実行することです. これらは重要なバイナリや設定ファイル全てのチェックサムを取り, 参照値として正しいことが分かっている以前の値のデータベースと比較します. したがって, これらのファイルの変更は全て知ることができます. <P> <!-- It's a good idea to install these sorts of programs onto a floppy, and then physically set the write protect on the floppy. This way intruders can't tamper with the integrety checker itself or change the database. Once you have something like this setup, it's a good idea to run it as part of your normal security administration duties to see if anything has changed. --> この手のプログラムをフロッピーディスクにインストールし, このフロッピーを物理的に書き込み禁止にしておくとよいでしょう. こうしておけば, 侵入者にはシステム整合性チェックプログラムや データベースを改竄することが不可能になります. いったんこの手のものを設定したら, これを通常のセキュリティ管理作業の一部として実行し, 何か変更がなされていないかチェックするとよいでしょう. <P> <!-- You can even add a <tt>crontab</tt> entry to run the checker from your floppy every night and mail you the results in the morning. Something like: --> 毎晩 フロッピーディスク上のチェックプログラムを実行し, 朝にその結果をメールで送るように <tt>crontab</tt> を設定することもできます. 設定は以下のようになります. <tscreen><verb> # set mailto MAILTO=kevin # run Tripwire 15 05 * * * root /usr/local/adm/tcheck/tripwire </verb></tscreen> <!-- will mail you a report each morning at 5:15am. --> 実行結果は午前 5 時 15 分にメールで送られます. <P> <!-- Integrety checkers can be a godsend to detecting intruders before you would otherwise notice them. Since a lot of files change on the average system, you have to be careful what is cracker activity and what is your own doing. --> 整合性チェックプログラムは, いざとなってから気づくより前に侵入者を発見する天の配剤になり得ます. 一般的なシステムでは多くのファイルが変更されますので, クラッカーの動きや, 自分自身が行ったことに注意していなくてはなりませんから. <P> <!-- You can find <tt>Tripwire</tt> at <htmlurl url="http://www.tripwiresecurity.com" name="http://www.tripwiresecurity.com">, free of charge. Manuals and support can be purchased. --> <tt>Tripwire</tt> のオープンソースなバージョンは <htmlurl url="http://www.tripwiresecurity.com" name="http://www.tripwiresecurity.com">にあります. 無料です. マニュアルとサポートは有料で入手することができます. <P> <!--O <tt>Aide</tt> can be found at <htmlurl url="http://www.cs.tut.fi/~rammer/aide.html" name="http://www.cs.tut.fi/~rammer/aide.html">. --> <tt>Aide</tt> は <htmlurl url="http://www.cs.tut.fi/~rammer/aide.html" name="http://www.cs.tut.fi/~rammer/aide.html"> にあります. <P> <!--O <tt>Osiris</tt> can be found at <htmlurl url="http://www.shmoo.com/osiris/" name="http://www.shmoo.com/osiris/">. --> <tt>Osiris</tt> は <htmlurl url="http://www.shmoo.com/osiris/" name="http://www.shmoo.com/osiris/"> からどうぞ. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Trojan Horses --> <SECT1>トロイの木馬 <P> <!-- "Trojan Horses" are named after the fabled ploy in Homer's "Iliad". The idea is that a cracker distributes a program or binary that sounds great, and encourages other people to download it and run it as root. Then the program can compromise their system while they are not paying attention. While they think the binary they just pulled down does one thing (and it might very well), it also compromises their security. --> 「トロイの木馬 (Trojan Horse)」はホメーロスのイーリアスに書かれている 有名な計略に由来する名前です. 基本的な考え方は, 便利そうなプログラムやバイナリを用意しておき, これを他人にダウンロードさせて root ユーザとして実行させるというものです. これによって, 相手が気づかないうちにシステムを悪用することができます. 手に入れたバイナリが仕事をしている (とても役立っているかもしれません) と思っている間に, このバイナリが同時にセキュリティも破ってしまうのです. <P> <!-- You should take care of what programs you install on your machine. Redhat provides MD5 checksums and PGP signatures on it's RPM files so you can verify you are installing the real thing. Other distributions have similar methods. You should never run any unfamiliar binary, for which you don't have the source, as root! Few attackers are willing to release source code to public scrutiny. --> したがって, マシンにプログラムをインストールする時には注意が必要です. Red Hat は MD5 チェックサムと PGP 署名を施した RPM ファイルを提供し, ユーザが本物のパッケージを入手しているのかどうかを チェックできるようにしています. 他のディストリビューションにも同様の仕組みがあります. 素性が知れず, ソースも提供されていないバイナリを root 権限で実行してはいけません! 誰もが調査できるようなソースコードを公開する攻撃者はほとんどいません. <P> <!-- Although it can be complex, make sure you are getting the source for a program from its real distribution site. If the program is going to run as root, make sure either you or someone you trust has looked over the source and verified it. --> 手間はかかるかもしれませんが, プログラムのソースコードはその正式の公開サイトから入手するべきです. プログラムを root 権限で実行するならば, あなたか, あなたが信頼している人がソースコードを見て, 検査すべきです. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Password Security and Encryption <label id="password-security"> --> <sect1>パスワードのセキュリティと暗号化 <label id="password-security"> <P> <!-- One of the most important security features used today are passwords. It is important for both you and all your users to have secure, unguessable passwords. Most of the more recent Linux distributions include <tt>passwd</tt> programs that do not allow you to set a easily guessable password. Make sure your <tt>passwd</tt> program is up to date and has these features. --> 現在用いられているセキュリティ機能のうち最も重要なもののひとつが パスワードです. あなたとあなたのマシンのユーザの両方が, パスワードを安全で推測しにくいものにしておくことが大事です. 最近の Linux ディストリビューションのほとんどには, 簡単に推測できるパスワードは設定できないようになっている <tt>passwd</tt> プログラムが入っています. <tt>passwd</tt> プログラムが最新のもので, このような機能を持っているかどうか確かめておきましょう. <P> <!-- In-depth discussion of encryption is beyond the scope of this document, but an introduction is in order. Encryption is very useful, possibly even necessary in this day and age. There are all sorts of methods of encrypting data, each with its own set of characteristics. --> 暗号化についての突っ込んだ議論は本書の範囲を越えてしまいますが, 入門程度ならば良いでしょう. 暗号化は大変便利ですし, たぶん今日では必須とさえ言えるでしょう. 非常に多くの種類のデータ暗号化の方法がありますが, それぞれが特徴を持っています. <P> <!-- Most Unicies (and Linux is no exception) primarily use a one-way encryption algorithm, called DES (Data Encryption Standard) to encrypt your passwords. This encrypted password is then stored in (typically) <tt>/etc/passwd</tt> (or less commonly) <tt>/etc/shadow</tt>. When you attempt to login, the password you type in is encrypted again and compared with the entry in the file that stores your passwords. If they match, it must be the same password, and you are allowed access. Although DES is a two-way encryption algorithm (you can code and then decode a message, given the right keys), the variant that most unices use is one-way. This means that it should not be possible to reverse the encryption to get the password from the contents of <tt>/etc/passwd</tt> (or <tt>/etc/shadow</tt>). --> ほとんどの UNIX(Linux も例外ではありません)は, DES (Data Encryption Standard) と呼ばれる片方向の暗号化アルゴリズムを主に使ってパスワードを暗号化しています. 暗号化されたパスワードは(普通)<tt>/etc/passwd</tt> か (少し一般的でないですが) <tt>/etc/shadow</tt> に保存されます. ユーザがログインしようとすると, 入力したパスワードは再び暗号化され, パスワードを格納しているファイルの該当項目と比較されます. これらが一致すればパスワードは同じはずなので, ログインが許可されます. DES は双方向の暗号化アルゴリズム (正しいキーを与えれば, 暗号化も復号化もできる)なのですが, ほとんどの UNIX が使っているのは DES の一種で片方向のアルゴリズムです. つまり, <tt>/etc/passwd</tt> (または <tt>/etc/shadow</tt>) の内容からパスワードを得るために暗号を解読することは不可能なはずです. <P> <!-- Brute force attacks, such as "Crack" or "John the Ripper" (see Section <ref id="crack">) can often guess passwords unless your password is sufficiently random. PAM modules (see below) allow you to use a different encryption routine with your passwords (MD5 or the like). You can use Crack to your advantage, as well. Consider periodically running Crack against your own password database, to find insecure passwords. Then contact the offending user, and instruct him to change his password. --> パスワードが十分にランダムでない場合, "Crack" や "John the Ripper" (<ref id="crack"> 章を参照)のような力任せの攻撃でもパスワードを推測できます. PAM モジュール (後述) を利用すれば, 別の暗号化ルーチン (MD5 など) を使用できます. Crack にも良い使い方があります. パスワードデータベースに対して定期的に Crack を実行し, 安全でないパスワードを見つけるのです. そして問題のあるユーザと話をして, パスワードを変えるように指導します. <P> <!-- You can go to <htmlurl url="http://consult.cern.ch/writeup/security/security_3.html" name="http://consult.cern.ch/writeup/security/security_3.html"> for information on how to choose a good password. --> 良いパスワードの決め方に関する情報については <htmlurl url="http://consult.cern.ch/writeup/security/security_3.html" name="http://consult.cern.ch/writeup/security/security_3.html"> を参照してください. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> PGP and Public-Key Cryptography --> <SECT1> PGP 及び公開鍵暗号 <P> <!-- Public-key cryptography, such as that used for PGP, uses one key for encryption, and one key for decryption. Traditional cryptography, however, uses the same key for encryption and decryption; this key must be known to both parties, and thus somehow transferred from one to the other securely. --> PGP 等に使われている公開鍵暗号は, ある鍵を暗号化に使い, 別の鍵を復号化に使う暗号です. 従来の暗号は, 暗号化と復号化に同じ鍵を使っていました. この鍵は通信の両側が知っていなければならず, 何らかの安全な方法で相手に送らなければなりませんでした. <P> <!-- Public key encryption alleviates the need to securely transmit the key that is used for encryption by using two seperate keys, a public key > To alleviate the need to securely transmit the encryption > key, public-key encryption uses two separate keys: a public key and a private key. Each person's public key is available by anyone to do the encryption, while at the same time each person keeps his or her private key to decrypt messages encrypted with the correct public key. --> 暗号に使った鍵を安全に転送する必要性を無くすため, 公開鍵暗号では 2 つの別々の鍵(公開鍵と秘密鍵)を用います. 各自が持っている公開鍵は誰でも使うことができ, 暗号化はこれを使って行います. 一方, 各自は自分の秘密鍵を持っており, 正しい公開鍵を使って暗号化されたメッセージはこれを使って復号化します. <P> <!-- There are advantages to both public key and private key cryptography, and you can read about those differences in <url url="http://www.rsa.com/rsalabs/newfaq/" name="the RSA Cryptography FAQ">, listed at the end of this section. --> 公開鍵を使う暗号にも秘密鍵を使う暗号にも利点はあります. これらの違いについては, このセクションの最後に示す <url url="http://www.rsa.com/rsalabs/newfaq/" name="the RSA Cryptography FAQ"> に説明があります. <P> <!-- PGP (Pretty Good Privacy) is well-supported on Linux. Versions 2.6.2 and 5.0 are known to work well. For a good primer on PGP and how to use it, take a look a the PGP FAQ. <htmlurl url="http://www.pgp.com/service/export/faq/55faq.cgi" name="http://www.pgp.com/service/export/faq/55faq.cgi"> --> PGP (Pretty Good Privacy) は Linux でちゃんとサポートされています. バージョン 2.62 と 5.0 の動作が確認されています. PGP への入門や使い方については, PGP FAQ を見ると良いでしょう. <htmlurl url="http://www.pgp.com/service/export/faq/55faq.cgi" name="http://www.pgp.com/service/export/faq/55faq.cgi"> <P> <!-- Be sure to use the version that is applicable to your country. Due to export restrictions by the US Government, strong-encryption is prohibited from being transferred in electronic form outside the country. --> 必ず, あなたの国で利用できるバージョンを使ってください. これはアメリカ合衆国政府による輸出制限のためであり, 強力な暗号を電子的に国外へ転送することが禁止されているからです. <P> <!-- US export controls are now managed by EAR (Export Administration Regulations). They are no longer governed by ITAR. --> 現在は輸出の管理は EAR(Export Administration Regulations)が行っています. もはや ITAR (訳注: International Traffic in Arms Regulations の略称) では管理されていません. <P> <!-- There is also a step-by-step guide for configuring PGP on Linux available at <htmlurl url="http://mercury.chem.pitt.edu/~angel/LinuxFocus/English/November1997/article7.html" name="http://mercury.chem.pitt.edu/~angel/LinuxFocus/English/November1997/article7.html">. It was written for the international version of PGP, but is easily adaptable to the United States version. You may also need a patch for some of the latest versions of Linux; the patch is available at <htmlurl url="ftp://metalab.unc.edu/pub/Linux/apps/crypto" name="ftp://metalab.unc.edu/pub/Linux/apps/crypto">. --> Linux での PGP の設定に関するステップバイステップのガイドも <htmlurl url="http://mercury.chem.pitt.edu/~angel/LinuxFocus/English/November1997/article7.html" name="http://mercury.chem.pitt.edu/~angel/LinuxFocus/English/November1997/article7.html"> にあります. これは PGP の国際バージョン用に書かれたものですが, アメリカ合衆国バージョンにも簡単に適用できます. 最新バージョンの Linux の一部ではパッチが必要になることがあります. このパッチは <htmlurl url="ftp://metalab.unc.edu/pub/Linux/apps/crypto" name="ftp://metalab.unc.edu/pub/Linux/apps/crypto"> で入手できます. <P> <!-- There is a project working on a free re-implementation of pgp with open source. GnuPG is a complete and free replacement for PGP. Because it does not use IDEA or RSA it can be used without any restrictions. GnuPG is nearly in compliance with <htmlurl url="http://www.faqs.org/rfcs/rfc2440.html" name="OpenPGP">. See the GNU Privacy Guard web page for more information: <htmlurl url="http://www.gnupg.org" name="http://www.gnupg.org/">. --> PGP をオープンソースでフリーに実装し直そうとしているプロジェクトがあります. GnuPG は PGP に置き換えることができる, 既に完成しているフリーなプログラムです. GnuPG は IDEA も RSA も使っていないので, 制限無しに使用することができます. GnuPG は <htmlurl url="http://core.ring.gr.jp/pub/doc/rfc/rfc2440.txt" name="OpenPGP"> にほぼ準拠しています. 詳しくは GNU Privacy Guard の WWW ページ (<htmlurl url="http://www.gnupg.org/" name="http://www.gnupg.org/">) をご覧ください. <P> 訳注 (略語の意味): <!-- Thanks to 菱川さん --> <ITEMIZE> <ITEM><bf>IDEA</bf>: International Data Encryption Algorithm の略. 128 ビットの秘密鍵を用いた暗号アルゴリズムで, スイスの Ascom-Tech 社が特許権を持っています. <ITEM><bf>RSA</bf>: 公開鍵を用いた暗号化, 電子署名に使われているアルゴリズムで, 名称は 3 人の開発者(Rivest, Shamir, Adleman)の頭文字からとられています. 米国では 1983 年に特許の認可を受けています. </ITEMIZE> <P> <!-- More information on cryptography can be found in the RSA cryptography FAQ, available at <htmlurl url="http://www.rsa.com/rsalabs/newfaq/" name="http://www.rsa.com/rsalabs/newfaq/">. Here you will find information on such terms as "Diffie-Hellman", "public-key cryptography", "digital certificates", etc. --> 暗号に関する詳しい情報は RSA cryptography FAQ に書かれています. これは <htmlurl url="http://www.rsa.com/rsalabs/newfaq/" name="http://www.rsa.com/rsalabs/newfaq/"> から入手できます. このドキュメントには "Diffie-Hellman 法", "公開鍵暗号", "電子認証" といった用語に関する情報が載っています. <P> 訳注: 日本語訳は <htmlurl url="http://www.rsa-japan.co.jp/faq/index.html" name="http://www.rsa-japan.co.jp/faq/index.html"> にあります. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> SSL, S-HTTP, HTTPS and S/MIME --> <SECT1> SSL, S-HTTP, HTTPS, S/MIME <P> <!-- Often users ask about the differences between the various security and encryption protocols, and how to use them. While this isn't an encryption document, it is a good idea to explain briefly what each protocol is, and where to find more information. --> ユーザは各種セキュリティと暗号化プロトコルの違いや, これらの使い方についてよく質問してきます. このドキュメントは暗号化に関するものではないのですが, 各プロトコルの内容を簡単に説明し, 情報のありかを紹介しておくのも悪くないと思います. <ITEMIZE> <!-- <ITEM><bf>SSL:</bf> - SSL, or Secure Sockets Layer, is an encryption method developed by Netscape to provide security over the Internet. It supports several different encryption protocols, and provides client and server authentication. SSL operates at the transport layer, creates a secure encrypted channel of data, and thus can seamlessly encrypt data of many types. This is most commonly seen when going to a secure site to view a secure online document with Communicator, and serves as the basis for secure communications with Communicator, as well as many other Netscape Communications data encryption. More information can be found at <htmlurl url="http://www.consensus.com/security/ssl-talk-faq.html" name="http://www.consensus.com/security/ssl-talk-faq.html">. Information on Netscape's other security implementations, and a good starting point for these protocols is available at <htmlurl url="http://home.netscape.com/info/security-doc.html" name="http://home.netscape.com/info/security-doc.html">. --> <ITEM><bf>SSL:</bf> - SSL (あるいは Secure Sockets Layer)は Netscape が開発した暗号化手法で, インターネット上でセキュリティを提供します. SSL はいくつかの異なる暗号化プロトコルと クライアントとサーバの認証手法を提供します. SSL はトランスポート層を操作し, データの安全な暗号化チャネルを生成するので, 各種データをシームレスに暗号化することができます. SSL は Communicator で安全なサイトに行き, 安全なオンラインドキュメントにアクセスした時に見られます. 他のたくさんの Netscape Communicator のデータ暗号化と同様に, これは Communicator を使った安全な通信の基本部分として用意されています. 詳しい情報は <htmlurl url="http://www.consensus.com/security/ssl-talk-faq.html" name="http://www.consensus.com/security/ssl-talk-faq.html"> にあります. Netscape の他のセキュリティ機構の実装と, これらのプロトコルの手引きについては, <htmlurl url="http://home.netscape.com/info/security-doc.html" name="http://home.netscape.com/info/security-doc.html"> で入手できます. <P> <!-- <ITEM><bf>S-HTTP:</bf> - S-HTTP is another protocol that provides security services across the Internet. It was designed to provide confidentiality, authentication, integrity, and non-repudiability &lsqb cannot be mistaken for someone else] while supporting multiple key-management mechanisms and cryptographic algorithms via option negotiation between the parties involved in each transaction. S-HTTP is limited to the specific software that is implementing it, and encrypts each message individually. &lsqb From RSA Cryptography FAQ, page 138] --> <ITEM><bf>S-HTTP:</bf> - S-HTTP はインターネット上での 安全なサービスを提供する別のプロトコルです. このプロトコルは, 機密性 (confidentiality), 認証 (authentication), 完全性 (integrity), 否認防止性 [ 他の誰かと間違うことがあり得ないこと] を与えるために設計されており, また, 各トランザクションにおける通信相手とのオプションの ネゴシエーションを通じて, 複数の鍵管理機構と暗号化アルゴリズムをサポートします. S-HTTP は, これを実装している特定のソフトウェアでしか使えません. また, それぞれのメッセージを独立に暗号化します. &lsqb RSA Cryptography FAQ の 138 ページより] <P> <!-- <ITEM><bf>S/MIME:</bf> - S/MIME, or Secure Multipurpose Internet Mail Extension, is an encryption standard used to encrypt electronic mail and other types of messages on the Internet. It is an open standard developed by RSA, so it is likely we will see it on Linux one day soon. More information on S/MIME can be found at <htmlurl url="http://home.netscape.com/assist/security/smime/overview.html" name="http://home.netscape.com/assist/security/smime/overview.html">. --> <ITEM><bf>S/MIME:</bf> - S/MIME (すなわち Secure Multipurpose Internet Mail Extension)は, 暗号化電子メールやその他の種類のインターネット上のメッセージで使われる 暗号化の標準です. これは RSA が開発したオープンな標準なので, Linux 用のものもたぶん近いうちに登場するでしょう. S/MIME に関する詳しい情報は <htmlurl url="http://home.netscape.com/assist/security/smime/overview.html" name="http://home.netscape.com/assist/security/smime/overview.html"> にあります. </ITEMIZE> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Linux IPSEC Implementations --> <SECT1> Linux における IPSEC の実装 <P> <!-- Along with CIPE, and other forms of data encryption, there are also several other implementations of IPSEC for Linux. IPSEC is an effort by the IETF to create cryptographically-secure communications at the IP network level, and to provide authentication, integrity, access control, and confidentiality. Information on IPSEC and Internet draft can be found at <htmlurl url="http://www.ietf.org/html.charters/ipsec-charter.html" name="http://www.ietf.org/html.charters/ipsec-charter.html">. You can also find links to other protocols involving key management, and an IPSEC mailing list and archives. --> CIPE や他の形式のデータ暗号化とともに, Linux 用の IPSEC の実装も複数個あります. IPSEC は IETF が作った規格で, 暗号化された安全な通信経路を IP ネットワークレベルで作り, また認証, 完全性, アクセス制御, 機密性も提供します. IPSEC の情報とインターネットドラフトは <htmlurl url="http://www.ietf.org/html.charters/ipsec-charter.html" name="http://www.ietf.org/html.charters/ipsec-charter.html"> にあります. 鍵管理を含めて他のプロトコルへのリンク, IPSEC のメーリングリストやアーカイブもあります. <P> <!-- The x-kernel Linux implementation, which is being developed at the University of Arizona, uses an object-based framework for implementing network protocols called x-kernel, and can be found at <htmlurl url="http://www.cs.arizona.edu/xkernel/hpcc-blue/linux.html" name="http://www.cs.arizona.edu/xkernel/hpcc-blue/linux.html">. Most simply, the x-kernel is a method of passing messages at the kernel level, which makes for an easier implementation. --> University of Arizona で開発された x-kernel Linux という実装は, オブジェクトベースのフレームワークを使って x-kernel と呼ばれるネットワークプロトコルを実装しています. これは <htmlurl url="http://www.cs.arizona.edu/xkernel/hpcc-blue/linux.html" name="http://www.cs.arizona.edu/xkernel/hpcc-blue/linux.html"> にあります. 大雑把に言うと, x-kernel はカーネルレベルでのメッセージパッシングの手法であり, これにより実装が容易になっています. <P> <!-- Another freely-available IPSEC implementation is the Linux FreeS/WAN IPSEC. Their web page states, <quote>"These services allow you to build secure tunnels through untrusted networks. Everything passing through the untrusted net is encrypted by the IPSEC gateway machine and decrypted by the gateway at the other end. The result is Virtual Private Network or VPN. This is a network which is effectively private even though it includes machines at several different sites connected by the insecure Internet." </quote> --> これとは別のフリーに利用できる IPSEC の実装は Linux FreeS/WAN IPSEC です. その WWW ページを引用すると <quote> 「これらのサービスを用いると, 信頼できないネットワーク上に安全なトンネルを構築することができます. 信頼できないネットワークを通るデータは全て IPSEC ゲートウェイマシンにより暗号化され, その反対の端のゲートウェイによって復号化されます. これにより仮想プライベートネットワーク (Virtual Private Network, VPN) ができます. これは, 安全でないインターネットで接続された異なる複数のサイトを含んでいても, 実質的にプライベートなネットワークです」 </quote> とのことです. <!-- <P>It's available for download from <htmlurl url="http://www.xs4all.nl/~freeswan/" name="http://www.xs4all.nl/~freeswan/">, and has just reached 1.0 at the time of this writing. --> <P>これは <htmlurl url="http://www.xs4all.nl/~freeswan/" name="http://www.xs4all.nl/~freeswan/"> で入手することができます. このドキュメントの執筆中にちょうどバージョン 1.0 になりました. <!-- As with other forms of cryptography, it is not distributed with the kernel by default due to export restrictions. --> 他の形式の暗号と同様に輸出が制限されているため, デフォルトではカーネルと共に配布されていません. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> <tt>ssh</tt> (Secure Shell) and <tt>stelnet</tt><label id="ssh"> --> <SECT1> <tt>ssh</tt> (Secure Shell) と <tt>stelnet</tt><label id="ssh"> <P> <!-- <tt>ssh</tt> and <tt>stelnet</tt> are suite's of programs that allow you to login to remote systems and have a encrypted connection. --> <tt>ssh</tt> と <tt>stelnet</tt> は, リモートのシステムにログインし, 暗号化された接続を行うためのプログラム群です. <P> <!-- <tt>openssh</tt> is a suite of programs used as a secure replacement for <tt>rlogin</tt>, <tt>rsh</tt> and <tt>rcp</tt>. It uses public-key cryptography to encrypt communications between two hosts, as well as to authenticate users. It can be used to securely login to a remote host or copy data between hosts, while preventing man-in-the-middle attacks (session hijacking) and DNS spoofing. It will perform data compression on your connections, and secure X11 communications between hosts. --> <tt>openssh</tt> は <tt>rlogin</tt>, <tt>rsh</tt>, <tt>rcp</tt> の安全な代用品として使われるプログラム群です. <tt>ssh</tt> は 2 つのホスト間の通信とユーザ認証を 公開鍵暗号を使って暗号化します. <tt>ssh</tt> を使うと安全にリモートホストにログインしたり, ホスト間でデータを安全にコピーしたりすることができ, 割り込み攻撃(セッションのハイジャック)や DNS 詐称を防ぐことができます. <tt>ssh</tt> は接続上でデータ圧縮も行い, ホスト間での安全な X11 の通信も行います. <P> <!--O There are several ssh implementiations now. The original commercial implementation by Data Fellows can be found at The <tt>ssh</tt> home page can be found at <htmlurl url="http://www.datafellows.com" name="http://www.datafellows.com">. --> いまでは, ssh には何種類かの実装があります. Data Fellows 社によるオリジナルの商用の実装は The <tt>ssh</tt> home page <htmlurl url="http://www.datafellows.com" name="http://www.datafellows.com"> にあります. <P> <!--O The excellent Openssh implementation is based on a early version of the datafellows ssh and has been totally reworked to not include any patented or propriatary peices. It is free and under a BSD liscence. It can be found at: <htmlurl url="http://www.openssh.com" name="http://www.openssh.com">. --> The excellent Openssh の素晴らしい実装は Data Fellows の ssh の初期のバージョンを元にしつつ, 特許に関わる部分や占有物が入らなくなるように 完全に作り直されました. フリーで, BSD ライセンスの元にあります. <htmlurl url="http://www.openssh.com" name="http://www.openssh.com"> にあります. <P> <!--O There is also a open source project to re-implement ssh from the ground up called "psst...". For more information see: <htmlurl url="http://www.net.lut.ac.uk/psst/" name="http://www.net.lut.ac.uk/psst/"> --> "psst..." という名前の, ssh を一から再実装しようという オープンソースなプロジェクトもあります. 詳しくは <htmlurl url="http://www.net.lut.ac.uk/psst/" name="http://www.net.lut.ac.uk/psst/"> をご覧ください. <P> <!-- You can also use <tt>ssh</tt> from your Windows workstation to your Linux <tt>ssh</tt> server. There are several freely available Windows client implementations, including the one at <htmlurl url="http://guardian.htu.tuwien.ac.at/therapy/ssh/" name="http://guardian.htu.tuwien.ac.at/therapy/ssh/"> as well as a commercial implementation from DataFellows, at <htmlurl url="http://www.datafellows.com" name="http://www.datafellows.com">. --> <tt>ssh</tt> を Windows PC から Linux の <tt>ssh</tt> サーバに対して使うこともできます. Windows 用のクライアントの実装はいくつかあります. その 1 つは <htmlurl url="http://guardian.htu.tuwien.ac.at/therapy/ssh/" name="http://guardian.htu.tuwien.ac.at/therapy/ssh/"> ですし, DataFellows による商用の実装も <htmlurl url="http://www.datafellows.com" name="http://www.datafellows.com"> にあります. <P> <!-- SSLeay is a free implementation of Netscape's Secure Sockets Layer protocol, developed by Eric Young. It includes several applications, such as Secure telnet, a module for Apache, several databases, as well as several algorithms including DES, IDEA and Blowfish. --> SSLeay は Netscape の Secure Sockets Layer プロトコルのフリーの実装です. これには Secure telnet, Apache 用のモジュール, いくつかのデータベース等のアプリケーションがいくつか含まれており, DES, IDEA, Blowfish 等のアルゴリズムもいくつか含まれています. <P> <!-- Using this library, a secure telnet replacement has been created that does encryption over a telnet connection. Unlike SSH, stelnet uses SSL, the Secure Sockets Layer protocol developed by Netscape. You can find Secure telnet and Secure FTP by starting with the SSLeay FAQ, available at <htmlurl url="http://www.psy.uq.oz.au/~ftp/Crypto/" name="http://www.psy.uq.oz.au/~ftp/Crypto/"> --> このライブラリを使って, telnet 接続上のデータを暗号化する telnet の安全な代替プログラムが作られました. SSH と異なり, stelnet は Netscape が開発した SSL (Secure Sockets Layer) プロトコルを使います. Secure telnet と Secure FTP は SSLeay FAQ からたどって見つけることができます. この FAQ は <htmlurl url="http://www.psy.uq.oz.au/~ftp/Crypto/" name="http://www.psy.uq.oz.au/~ftp/Crypto/"> にあります. <P> 訳注: 日本語訳が <htmlurl url="http://www.infoscience.co.jp/technical/crypto/ssleay_jp.html" name="http://www.infoscience.co.jp/technical/crypto/ssleay_jp.html"> にあります. <P> <!-- SRP is another secure telnet/ftp implementation. From their web page: --> SRP は別の安全な telnet/ftp の実装です. その WWW ページを引用すると <P> <!-- <quote>"The SRP project is developing secure Internet software for free worldwide use. Starting with a fully-secure Telnet and FTP distribution, we hope to supplant weak networked authentication systems with strong replacements that do not sacrifice user-friendliness for security. Security should be the default, not an option!" </quote> --> <quote> 「SRP プロジェクトは世界中でフリーに利用できる 安全なインターネットソフトウェアを開発しています. 完全に安全な telnet と ftp の配布を始めとして, 我々は弱いネットワーク認証を, セキュリティのためにユーザインタフェースを 犠牲にしない強力なものに置き換えたいと考えています. セキュリティがオプションなんてとんでもない! セキュリティはデフォルトでなければなりません」 </quote> とのことです. <P> <!-- For more information, go to <htmlurl url="http://srp.stanford.edu/srp" name="http://srp.stanford.edu/srp">. --> 詳しい情報については <htmlurl url="http://srp.stanford.edu/srp" name="http://srp.stanford.edu/srp"> を見てください. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> PAM - Pluggable Authentication Modules --> <SECT1>PAM - 交換可能な認証モジュール <P> <!-- Newer versions of the Red Hat Linux distribution ship with a unified authentication scheme called "PAM". PAM allows you to change your authentication methods and requirements on the fly, and encapsulate all local authentication methods without recompiling any of your binaries. Configuration of PAM is beyond the scope of this document, but be sure to take a look at the PAM web site for more information. <htmlurl url="http://www.kernel.org/pub/linux/libs/pam/index.html" name="http://www.kernel.org/pub/linux/libs/pam/index.html"> --> 最近のバージョンの Red Hat Linux ディストリビューションでは, "PAM" と呼ばれる統一された認証方法が使われています. PAM を使うと, システムを動作させたままで 認証の方法や要件を変更することとローカルの認証方法をカプセル化することが 可能になります. バイナリは一切再コンパイルする必要がありません. PAM の設定は本書の範囲を越えますが, 必ず PAM のウェブサイトを見て, 詳しい情報を見ておいてください. <htmlurl url="http://www.kernel.org/pub/linux/libs/pam/index.html" name="http://www.kernel.org/pub/linux/libs/pam/index.html"> <P> <!-- Just a few of the things you can do with PAM: --> PAM で可能になることをほんの少しだけ列挙します. <P> <ITEMIZE> <ITEM> <!-- Use encryption other than DES for your passwords. (Making them harder to brute-force decode) --> パスワードに DES 以外の暗号を用いる. (力任せの解読が難しくなります) <ITEM> <!-- Set resource limits on all your users so they can't perform denial-of-service attacks (number of processes, amount of memory, etc) --> サービス妨害攻撃を実行できなくするため, 全てのユーザに対してリソース (プロセス数, メモリの大きさ等) の制限を加える. <ITEM> <!-- Enable shadow passwords (see below) on the fly --> システムを動作させたまま, シャドウパスワード(後述)を利用可能にする. <ITEM> <!-- allow specific users to login only at specific times from specific places --> 特定のユーザについて, 特定の回数のみ, 特定の場所からログインを許可する. </ITEMIZE> <P> <!-- Within a few hours of installing and configuring your system, you can prevent many attacks before they even occur. For example, use PAM to disable the system-wide usage of <tt>.rhosts</tt> files in user's home directories by adding these lines to <tt>/etc/pam.d/rlogin</tt>: --> システムのインストールと設定を行う数時間の間に, 実際に攻撃を受ける前に多くの攻撃を予防しておくことができます. 例えば PAM を使うと, ホームディレクトリの <tt>.rhosts</tt> ファイルの使用をシステム全体で無効にすることができます. 設定は <tt>/etc/pam.d/rlogin</tt> に以下のような行を追加します: <tscreen><verb> # # Disable rsh/rlogin/rexec for users # login auth required pam_rhosts_auth.so no_rhosts </verb></tscreen> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1>Cryptographic IP Encapsulation (CIPE) --> <SECT1>暗号による IP のカプセル化 (Cryptographic IP Encapsulation, CIPE) <P> <!-- The primary goal of this software is to provide a facility for secure (against eavesdropping, including traffic analysis, and faked message injection) subnetwork interconnection across an insecure packet network such as the Internet. --> このソフトウェアの基本的な目的は, インターネットのような安全でないパケットネットワークを通る安全な (トラフィック解析, 偽メッセージ混入を含む盗聴に対して) サブネットワーク間接続を提供することです. <P> <!-- CIPE encrypts the data at the network level. Packets traveling between hosts on the network are encrypted. The encryption engine is placed near the driver which sends and receives packets. --> CIPE はデータをネットワークレベルで暗号化します. つまり, ネットワーク上のホスト間を転送されるパケットが暗号化されます. 暗号化エンジンはパケットを送受信するドライバの近くに配置されます. <P> <!-- This is unlike SSH, which encrypts the data by connection, at the socket level. A logical connection between programs running on different hosts is encrypted. --> CIPE は, 接続ごとにソケットレベルでデータを暗号化する SSH とは異なります. 異なるホスト上で実行されているプログラム間の論理的な接続が暗号化されます. <P> <!-- CIPE can be used in tunnelling, in order to create a Virtual Private Network. Low-level encryption has the advantage that it can be made to work transparently between the two networks connected in the VPN, without any change to application software. --> CIPE は仮想プライベートネットワーク (Virtual Private Network) を構築するために, トンネリングで使うことができます. 低レベルの暗号化には, アプリケーションソフトウェアを変更しなくても, VPN に接続している 2 つのネットワーク間で透過的に動作させることができるという利点があります. <P> <!-- Summarized from the CIPE documentation: --> CIPE のドキュメントからの要約です: <P> <!-- <quote> The IPSEC standards define a set of protocols which can be used (among other things) to build encrypted VPNs. However, IPSEC is a rather heavyweight and complicated protocol set with a lot of options, implementations of the full protocol set are still rarely used and some issues (such as key management) are still not fully resolved. CIPE uses a simpler approach, in which many things which can be parameterized (such as the choice of the actual encryption algorithm used) are an install-time fixed choice. This limits flexibility, but allows for a simple (and therefore efficient, easy to debug...) implementation. <quote> --> <quote> IPSEC 標準は, 暗号化された VPN を構築するため (他にもありますが) に使うことができるプロトコル群を定義しています. しかし, IPSEC はオプションがたくさんある比較的重くて複雑なプロトコル群で, プロトコル群の完全な実装はまだほとんど使われておらず, 一部の問題 (鍵管理など) はまだ完全には解決されていません. CIPE は比較的簡単なアプローチを取っており, CIPE においてパラメータ化できることの多く (実際に使う暗号化アルゴリズムの選択など)は, インストール時に選択したものに固定されます. これは柔軟さを制限しますが, 実装が簡単に (したがって, 効率的でデバッグもしやすく) なります. </quote> <P> <!-- Further information can be found at <htmlurl url="http://www.inka.de/~bigred/devel/cipe.html" name="http://www.inka.de/~bigred/devel/cipe.html"> --> 詳しい情報は <htmlurl url="http://www.inka.de/~bigred/devel/cipe.html" name="http://www.inka.de/~bigred/devel/cipe.html"> にあります. <P> <!-- As with other forms of cryptography, it is not distributed with the kernel by default due to export restrictions. --> 他の暗号化と同様の輸出制限のため, CIPE はカーネルと一緒には配布されていません. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> Kerberos <P> <!-- Kerberos is an authentication system developed by the Athena Project at MIT. When a user logs in, Kerberos authenticates that user (using a password), and provides the user with a way to prove her identity to other servers and hosts scattered around the network. --> Kerberos は MIT の Athena Project で開発された認証システムです. ユーザがログインした時, Kerberos は(パスワードを用いて)ユーザを認証し, ネットワーク上に分散している他のサーバやホストに対して ユーザの身分を証明するための方法を提供します. <P> <!-- This authentication is then used by programs such as <tt>rlogin</tt> to allow the user to login to other hosts without a password (in place of the <tt>.rhosts</tt> file). This authentication method can also used by the mail system in order to guarantee that mail is delivered to the correct person, as well as to guarantee that the sender is who he claims to be. --> それから, この認証情報は <tt>rlogin</tt> のようなプログラムが使い, ユーザがパスワード無しで他のホストにログインすることを許可するために使います (<tt>.rhosts</tt> ファイルの代わり). この認証方法をメールシステムで使えば, メールが正しい宛先に配達されたことの保証や, 送信者が自分が名乗っている通りのユーザであることの保証が行えます. <P> <!-- Kerberos and the other programs that come with it, prevent users from "spoofing" the system into believing they are someone else. Unfortunately, installing Kerberos is very intrusive, requiring the modification or replacement of numerous standard programs. --> Kerberos およびこれに付属しているプログラムは, あるユーザが, 自分を他のユーザであるとシステムに思わせる「詐称」を実質的に不可能にします. Kerberos のインストールは残念ながらシステムに深く立ち入ったものになるので, 基本的なプログラムをたくさん修正したり入れ換えたりしなければなりません. <P> <!-- You can find more information about kerberos by looking at <htmlurl url="http://www.cis.ohio-state.edu/hypertext/faq/usenet/kerberos-faq/general/faq.html" name="the kerberos FAQ">, and the code can be found at <htmlurl url="http://nii.isi.edu/info/kerberos/" name="http://nii.isi.edu/info/kerberos/">. --> Kerberos に関する詳しい情報は <htmlurl url="http://www.cis.ohio-state.edu/hypertext/faq/usenet/kerberos-faq/general/faq.html" name="the kerberos FAQ"> にあり, コードは <htmlurl url="http://nii.isi.edu/info/kerberos/" name="http://nii.isi.edu/info/kerberos/"> にあります. <P> <!-- [From: Stein, Jennifer G., Clifford Neuman, and Jeffrey L. Schiller. "Kerberos: An Authentication Service for Open Network Systems." USENIX Conference Proceedings, Dallas, Texas, Winter 1998.] --> [参考: Stein, Jennifer G., Clifford Neuman, and Jeffrey L. Schiller. "Kerberos: An Authentication Service for Open Network Systems." USENIX Conference Proceedings, Dallas, Texas, Winter 1998.] <P> <!-- Kerberos should not be your first step in improving security of your host. It is quite involved, and not as widely used as, say, SSH. --> Kerberos はホストのセキュリティ向上のために取るべき 最初のステップではありません. Kerberos は非常に複雑ですし, 例えば SSH ほど使われているわけでもありません. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Shadow Passwords. --> <SECT1> シャドウパスワード <P> <!-- Shadow passwords are a means of keeping your encrypted password information secret from normal users. Recent versions of both Red Hat and Debian Linux use shadow passwords by default, but on other systems, encrypted passwords are stored in <tt>/etc/passwd</tt> file for all to read. Anyone can then run password-guesser programs on them and attempt to determine what they are. Shadow passwords, by contrast, are saved in <tt>/etc/shadow</tt>, which only privileged users can read. In order to use shadow passwords, you need to make sure all your utilities that need access to password information are recompiled to support them. PAM (above) also allows you to just plug in a shadow module; it doesn't require re-compilation of executables. You can refer to the Shadow-Password HOWTO for further information if necessary. It is available at <htmlurl url="http://metalab.unc.edu/LDP/HOWTO/Shadow-Password-HOWTO.html" name="http://metalab.unc.edu/LDP/HOWTO/Shadow-Password-HOWTO.html"> It is rather dated now, and will not be required for distributions supporting PAM. --> シャドウパスワードは, 暗号化されたパスワード情報を一般ユーザから隠す手法です. Red Hat と Debian の両方とも, 最近のバージョンでは デフォルトでシャドウパスワードを使うようになっていますが, ほかのシステムでは, 暗号化されたパスワードは普通, 誰でも読める <tt>/etc/passwd</tt> に格納されています. したがって, 誰でもパスワード推測プログラムを実行して パスワードを見つけようと試みることができます. 一方シャドウパスワードでは, この情報は特権ユーザしか読めない <tt>/etc/shadow</tt> ファイルに格納されます. シャドウパスワードを利用するためには, パスワード情報へアクセスする必要があるユーティリティを 全てシャドウパスワード対応に再コンパイルする必要があります. (先述の) PAM を使っていれば, シャドウモジュールを使用するだけでよく, 実行ファイルを再コンパイルする必要はありません. 必要ならば Shadow-Password HOWTO を参照して詳しい情報を調べてください. このドキュメントは <htmlurl url="http://linuxdoc.org/HOWTO/Shadow-Password-HOWTO.html" name="http://linuxdoc.org/HOWTO/Shadow-Password-HOWTO.html"> にあります. このドキュメントは現在は多少古くなっていますし, PAM をサポートしているディストリビューションではたぶん不要でしょう. <P> 訳注: 和訳は <htmlurl url="http://www.linux.or.jp/JF/JFdocs/Shadow-Password-HOWTO.html" name="http://www.linux.or.jp/JF/JFdocs/Shadow-Password-HOWTO.html"> にあります. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> "Crack" and "John the Ripper"<label id="crack"> --> <SECT1> "Crack" および "John the Ripper"<label id="crack"> <P> <!-- If for some reason your <tt>passwd</tt> program is not enforcing hard-to-guess passwords, you might want to run a password-cracking program and make sure your users' passwords are secure. --> 推測しにくいパスワードをつけることを <tt>passwd</tt> プログラムにおいて強制することができない場合は, パスワードをクラッキングするプログラムを実行し, ユーザのパスワードが安全かどうか確認するとよいでしょう. <P> <!-- Password cracking programs work on a simple idea: they try every word in the dictionary, and then variations on those words, encrypting each one and checking it against your encrypted password. If they get a match they know what your password is. --> パスワードクラックのプログラムは, 単純な考えに基づいて動作します. つまり, 辞書に載っている単語とこれらの単語の変化形を順に試すのです. それぞれを暗号化し, 暗号化されたパスワード文字列と比べます. これらが一致すれば, パスワードがわかります. <P> <!-- There are a number of programs out there...the two most notable of which are "Crack" and "John the Ripper" (<htmlurl url="http://www.false.com/security/john/index.html" name="http://www.false.com/security/john/index.html">) . They will take up a lot of your cpu time, but you should be able to tell if an attacker could get in using them by running them first yourself and notifying users with weak passwords. Note that an attacker would have to use some other hole first in order to read your <tt>/etc/passwd</tt> file, but such holes are more common than you might think. --> このようなプログラムはたくさんありますが, その中でも "Crack" と "John the Ripper" (<htmlurl url="http://www.false.com/security/john/index.html" name="http://www.false.com/security/john/index.html">) の 2 つが有名です. これらは CPU パワーを大量に消費しますが, 予めこれを実行しておくことで, 攻撃者がこれらのツールを使って侵入することができるかどうか知ることができ, 脆弱なパスワードを使っているユーザに注意することができます. 攻撃者はパスワードファイル (UNIX では <tt>/etc/passwd</tt>) を入手するために, まず他のセキュリティホールを突かなければなりませんが, それは読者の皆さんがが考えているよりもありふれているものであることは 知っておいてください. <P> <!-- Because security is only as strong as the most insecure host, it is worth mentioning that if you have any Windows machines on your network, you should check out L0phtCrack, a Crack implementation for Windows. It's available from <htmlurl url="http://www.l0pht.com" name="http://www.l0pht.com"> --> 最も弱いホストの強さが全体のセキュリティの強さになってしまいます. ですから, ネットワーク上に Windows マシンがある場合には L0phtCrack を調べるべきだということは言及しておく価値があるでしょう. これは Crack の Windows 用の実装です. これは <htmlurl url="http://www.l0pht.com" name="http://www.l0pht.com"> で入手できます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> CFS - Cryptographic File System and TCFS - Transparent Cryptographic File System --> <SECT1> CFS (暗号化ファイルシステム)と TCFS (透過的暗号化ファイルシステム) <P> <!-- CFS is a way of encrypting entire directory trees and allowing users to store encrypted files on them. It uses an NFS server running on the local machine. RPMS are available at <htmlurl url="http://www.zedz.net/redhat/" name="http://www.zedz.net/redhat/">, and more information on how it all works is at <htmlurl url="ftp://ftp.research.att.com/dist/mab/" name="ftp://ftp.research.att.com/dist/mab/">. --> CFS はディレクトリツリー全体を暗号化する手法で, このツリーに暗号化されたファイルを置くことができます. これはローカルマシン上で NFS サーバを動作させます. RPM は <htmlurl url="http://www.zedz.net/redhat/" name="http://www.zedz.net/redhat/"> で入手可能であり, 動作に関する情報は <htmlurl url="ftp://ftp.research.att.com/dist/mab/" name="ftp://ftp.research.att.com/dist/mab/"> で得られます. <P> <!-- TCFS improves on CFS by adding more integration with the file system, so that it's transparent to users that the file system that is encrypted. More information at: <htmlurl url="http://edu-gw.dia.unisa.it/tcfs/" name="http://edu-gw.dia.unisa.it/tcfs/" >. --> TCFS は CFS を改良したもので, ファイルシステムとの統合をより進めたものです. したがって, ユーザは透過的に暗号化ファイルシステムを利用することができます. 詳しい情報は <htmlurl url="http://edu-gw.dia.unisa.it/tcfs/" name="http://edu-gw.dia.unisa.it/tcfs/" > で得られます. <P> <!-- It also need not be used on entire filesystems. It works on directory trees as well. --> TCFS は必ずしもファイルシステム全体で使う必要はありません. これもディレクトリツリーで使用することができます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> X11, SVGA and display security --> <SECT1>X11, SVGA, ディスプレイに関するセキュリティ <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT2> X11 <p> <!-- It's important for you to secure your graphical display to prevent attackers from grabbing your passwords as you type them, reading documents or information you are reading on your screen, or even using a hole to gain root access. Running remote X applications over a network also can be fraught with peril, allowing sniffers to see all your interaction with the remote system. --> グラフィックディスプレイを安全にしておき, 攻撃者が入力したパスワードを奪ったり, 画面で見ているドキュメントや情報を読んだり, セキュリティホールを突いて root 権限を奪ったりできないようにしておくことは重要です. X アプリケーションをネットワーク越しにリモートで動作させることも, リモートのシステムとのやりとりを全部盗聴されてしまう危険を伴うことがあります. <P> <!-- X has a number of access-control mechanisms. The simplest of them is host-based: you use <tt>xhost</tt> to specify the hosts that are allowed access to your display. This is not very secure at all, because if someone has access to your machine, they can <tt>xhost + <it>their machine</it></tt> and get in easily. Also, if you have to allow access from an untrusted machine, anyone there can compromise your display. --> X にはアクセス制御機構がいくつもあります. その中で最も簡単なものはホストに基づくものです. <tt>xhost</tt> コマンドを用いれば, ディスプレイへのアクセスが許可されるホストを指定できます. しかし, この機構は非常に危険です. マシンにアクセスできる人は, <tt>xhost +</tt> を実行し, 容易に侵入することができます. もし, 信頼できないホストからのアクセスを許可しなければならない場合には, そのホストにログインしているユーザは 誰でもディスプレイに不正アクセスすることができます. <P> <!-- When using <tt>xdm</tt> (X Display Manager) to log in, you get a much better access method: MIT-MAGIC-COOKIE-1. A 128-bit "cookie" is generated and stored in your <tt>.Xauthority</tt> file. If you need to allow a remote machine access to your display, you can use the <tt>xauth</tt> command and the information in your <tt>.Xauthority</tt> file to provide access to only that connection. See the Remote-X-Apps mini-howto, available at <htmlurl url="http://metalab.unc.edu/LDP/HOWTO/mini/Remote-X-Apps.html" name="http://metalab.unc.edu/LDP/HOWTO/mini/Remote-X-Apps.html">. --> ログインのために <tt>xdm</tt> (X ディスプレイマネージャ) を使っている場合, ずっと良いアクセス方法である MIT-MAGIC-COOKIE-1 を使いましょう. この機構は 128ビット長の「クッキー」を生成して, ユーザのホームディレクトリの <tt>.Xauthority</tt> ファイルに格納します. リモートのマシンにディスプレイへのアクセスを許可するには, <tt>xauth</tt> コマンドと <tt>.Xauthority</tt> ファイル内の情報を使って, その接続だけを許可するようにします. Remote-X-Apps mini-howto をご覧ください. これは <htmlurl url="http://linuxdoc.org/HOWTO/mini/Remote-X-Apps.html" name="http://linuxdoc.org/HOWTO/mini/Remote-X-Apps.html"> で入手できます. <P> 訳注: <htmlurl url="http://www.linux.or.jp/JF/JFdocs/Remote-X-Apps.html" name="Remote-X-Apps の和訳"> があります. <P> <!-- You can also use <tt>ssh</tt> (see <ref id="ssh">, above) to allow secure X connections. This has the advantage of also being transparent to the end user, and means that no unencrypted data flows across the network. --> X の接続を安全に行うために <tt>ssh</tt> (前述の <ref id="ssh"> の項を参照のこと) を使うこともできます. <tt>ssh</tt> には, ユーザが透過的に扱うことができる, およびネットワーク上に暗号化されていないデータが流れない, という 2 つの利点があります. <P> <!-- Take a look at the <tt>Xsecurity</tt> man page for more information on X security. The safe bet is to use <tt>xdm</tt> to login to your console and then use <tt>ssh</tt> to go to remote sites on which you wish to run X programs. --> X のセキュリティについての詳しい情報については, オンラインマニュアルの <tt>Xsecurity</tt> を参照してください. 安全な策としては, コンソールにログインするときには <tt>xdm</tt> を使い, リモートのサイトで X のプログラムを実行したいときは <tt>ssh</tt> を使うことです. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT2> SVGA <P> <!-- SVGAlib programs are typically SUID-root in order to access all your Linux machine's video hardware. This makes them very dangerous. If they crash, you typically need to reboot your machine to get a usable console back. Make sure any SVGA programs you are running are authentic, and can at least be somewhat trusted. Even better, don't run them at all. --> SVGAlib を使うプログラムはビデオ関係のハードウェアを操作するため, 普通は root に setuid されます. これは非常に危険です. プログラムがクラッシュした場合, 普通はコンソールを元に戻すためマシンを再起動しなくてはならなくなってしまいます. このようなプログラムについては, 確実に信頼できること, あるいは少なくとも少しは信用できることを確かめてください. できれば, そもそも使わないのが良いでしょう. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT2> GGI (Generic Graphics Interface project) <p> <!-- The Linux GGI project is trying to solve several of the problems with video interfaces on Linux. GGI will move a small piece of the video code into the Linux kernel, and then control access to the video system. This means GGI will be able to restore your console at any time to a known good state. They will also allow a secure attention key, so you can be sure that there is no Trojan horse <tt>login</tt> program running on your console. <htmlurl url="http://synergy.caltech.edu/~ggi/" name="http://synergy.caltech.edu/~ggi/"> --> Linux GGI プロジェクトは Linux のビデオインタフェースの問題について ひとつの解を提案しようとする試みです. GGI では Linux のカーネル内に少しビデオ関係のコードを入れ, そうしてビデオへアクセスします. つまり, GGI を使えばいつでもコンソールを正常な状態に戻すことができます. また, secure attention key を使うことができ, コンソールでトロイの木馬が入った <tt>login</tt> プログラムを使われるのを防げます. <htmlurl url="http://synergy.caltech.edu/~ggi/" name="http://synergy.caltech.edu/~ggi/"> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Kernel Security<label id="kernel-security"> --> <SECT> カーネルのセキュリティ<label id="kernel-security"> <P> <!-- This is a description of the kernel configuration options that relate to security, and an explanation of what they do, and how to use them. --> ここではセキュリティに関連するカーネル設定オプションの説明と, それらの動作や使い方に関する説明を行います. <P> <!-- As the kernel controls your computer's networking, it is important that it be very secure, and not be compromised. To prevent some of the latest networking attacks, you should try to keep your kernel version current. You can find new kernels at <url url="ftp://ftp.kernel.org"> or from your distribution vendor. --> カーネルはコンピュータのネットワークを制御するので, カーネルをこの上な く安全にしておくことと, カーネルそのものが破られないようにすることは重 要です. 最近出現したネットワーク攻撃のいくつかを防ぐために, カーネルの バージョンは最新に保つようにすべきです. 新しいカーネルは <url url="ftp://ftp.kernel.org"> またはお使いのディストリビューション のベンダから入手できます. <P> <!-- There is also a international group providing a single unified crypto patch to the mainstream Linux kernel. This patch provides support for a number of cyrptographic subsystems and things that cannot be included in the mainstream kernel due to export restrictions. For more information, visit their web page at: <htmlurl url="http://www.kerneli.org" name="http://www.kerneli.org"> --> 本家の Linux カーネル用にひとつに統合された 暗号化パッチを提供している国際的なグループもあります. このパッチは, 各種暗号サブシステムや輸出制限のために本家のカーネルに 含まれていない機能を提供します. 詳しい情報については グループの WWW ページ <htmlurl url="http://www.kerneli.org" name="http://www.kerneli.org"> をご覧ください. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> 2.0 Kernel Compile Options --> <SECT1> バージョン 2.0 のカーネルのコンパイルオプション <P> <!-- For 2.0.x kernels, the following options apply. You should see these options during the kernel configuration process. Many of the comments here are from <tt>./linux/Documentation/Configure.help</tt>, which is the same document that is referenced while using the Help facility during the <tt>make config</tt> stage of compiling the kernel. --> 2.0.x カーネルでは以下のオプションが該当します. カーネルを設定する際にこれらのオプションを確認することになるでしょう. ここに挙げたコメントの多くは <tt>./linux/Documentation/Configure.help</tt> から取っています. このコメントは, カーネルのコンパイル時に<tt>make config</tt> の Help 機能で参照できるドキュメントと同じものです. <P> <ITEMIZE> <ITEM>Network Firewalls (CONFIG_FIREWALL) <P> <!-- This option should be on if you intend to run any firewalling or masquerading on your Linux machine. If it's just going to be a regular client machine, it's safe to say no. --> このオプションは Linux マシンでファイアウォールを構築する際や IP マスカレードを行う際に有効にすべきです. 単に普通のクライアントマシンにするつもりならば no と設定するのが安全でしょう. <P> <ITEM>IP: forwarding/gatewaying (CONFIG_IP_FORWARD) <P> <!-- If you enable IP forwarding, your Linux box essentially becomes a router. If your machine is on a network, you could be forwarding data from one network to another, and perhaps subverting a firewall that was put there to prevent this from happening. Normal dial-up users will want to disable this, and other users should concentrate on the security implications of doing this. Firewall machines will want this enabled, and used in conjunction with firewall software. --> IP forwarding を有効にすると, Linux マシンは本質的にルータになります. このマシンがネットワークに繋がっていると, あるネットワークから別のネットワークにデータを転送しているかもしれず, これを起さないために設置されている防火壁をたぶん壊しています. 通常のダイアルアップユーザはこれを無効にしたいと思うでしょうし, 他のユーザはこれを行うことのセキュリティ的な意味を良く考えるべきです. 防火壁のマシンはこれを有効にし, 防火壁のソフトウェアと組み合わせて使おうと考えるでしょう. <P> <!-- You can enable IP forwarding dynamically using the following command: --> IP forwarding は以下のコマンドで動的に有効にすることができます: <P><tscreen><verb> root# echo 1 > /proc/sys/net/ipv4/ip_forward </verb></tscreen> <!-- and disable it with the command: --> また次のコマンドで無効にすることができます: <tscreen><verb> root# echo 0 > /proc/sys/net/ipv4/ip_forward </verb></tscreen> <!-- Keep in mind the files in /proc are "virtual" files and the shown size of the file might not reflect the data output from it. --> /proc にあるファイルは「仮想的」なファイルであり, 表示されるファイルの大きさは, そこから出てくるデータの量を反映していないことは覚えておいてください. <P> <ITEM>IP: syn cookies (CONFIG_SYN_COOKIES) <P> <!-- a "SYN Attack" is a denial of service (DoS) attack that consumes all the resources on your machine, forcing you to reboot. We can't think of a reason you wouldn't normally enable this. In the 2.2.x kernel series this config option merely allows syn cookies, but does not enable them. To enable them, you have to do: --> 「SYN 攻撃」はサービス妨害(DoS)攻撃のひとつです. マシンのリソースを全て喰い潰してしまい, リブートするはめに追い込みます. このオプションを有効にしておかない理由は普通は考えられません. 2.2.x 系のカーネルでは, この設定オプションは単に syn cookie を許可するだけで, 有効にはしません. これを有効にするには以下のコマンドを実行する必要があります: <P> <tscreen><verb> root# echo 1 > /proc/sys/net/ipv4/tcp_syncookies <P> </verb></tscreen> <P> <ITEM>IP: Firewalling (CONFIG_IP_FIREWALL) <P> <!-- This option is necessary if you are going to configure your machine as a firewall, do masquerading, or wish to protect your dial-up workstation from someone entering via your PPP dial-up interface. --> このオプションが必要になるのは, マシンを防火壁として設定する時や, IP マスカレードを行う時に PPP のダイアルアップインタフェース経由で 何者かがダイアルアップマシンに入ってくるのを防ぎたい時です. <P> <P> <item>IP: firewall packet logging (CONFIG_IP_FIREWALL_VERBOSE) <p> <!-- This option gives you information about packets your firewall received, like sender, recipient, port, etc. --> このオプションを使うと, 送信者, 受信者, ポート等の防火壁が受け取ったパケットに関する情報が記録されます. <P> <ITEM>IP: Drop source routed frames (CONFIG_IP_NOSR) <P> <!-- This option should be enabled. Source routed frames contain the entire path to their destination inside of the packet. This means that routers through which the packet goes do not need to inspect it, and just forward it on. This could lead to data entering your system that may be a potential exploit. --> このオプションは有効にすべきです. 始点で経路設定されたフレーム (source routed frames) は, 終点までの全体のパスをパケット内に持っています. つまり, パケットが通るルータはパケットを検査する必要がなく, 単に転送すればよいということです. これは危険であるかもしれないデータをシステムに入れる可能性を持ちます. <P> <ITEM>IP: masquerading (CONFIG_IP_MASQUERADE) <!-- If one of the computers on your local network for which your Linux box acts as a firewall wants to send something to the outside, your box can "masquerade" as that host, i.e., it forwards the traffic to the intended destination, but makes it look like it came from the firewall box itself. See <htmlurl url="http://www.indyramp.com/masq" name="http://www.indyramp.com/masq"> for more information. --> <P> Linux マシンが防火壁として動作している場合, そのローカルネットワークのコンピュータのひとつが外部に接続しようとすると, Linux マシンはそのホストの「仮面を被る」ことができます. つまり, Linux マシンはローカルネットワーク内のマシンが想定している 終点アドレスへトラフィックを転送しますが, このトラフィックが防火壁のマシンから来たように見せかけます. 詳しい情報については <htmlurl url="http://www.indyramp.com/masq" name="http://www.indyramp.com/masq"> をご覧ください. <P> <ITEM>IP: ICMP masquerading (CONFIG_IP_MASQUERADE_ICMP) <!-- This option adds ICMP masquerading to the previous option of only masquerading TCP or UDP traffic. --> <P> 前のオプションは TCP トラフィックと UDP トラフィックのマスカレーディングしか行いませんが, このオプションは ICMP のマスカレーディングも行うようにします. <P> <ITEM>IP: transparent proxy support (CONFIG_IP_TRANSPARENT_PROXY) <!-- This enables your Linux firewall to transparently redirect any network traffic originating from the local network and destined for a remote host to a local server, called a "transparent proxy server". This makes the local computers think they are talking to the remote end, while in fact they are connected to the local proxy. See the IP-Masquerading HOWTO and <htmlurl url="http://www.indyramp.com/masq" name="http://www.indyramp.com/masq"> for more information. --> <P> このオプションは, Linux マシンの防火壁の透過的リダイレクト機能を有効にします. つまり, ローカルネットワークが始点であり, かつ終点がリモートホストであるような任意のネットワークトラフィックが ローカルのサーバ (いわゆる「透過的プロキシサーバ」) にリダイレクトされます. これにより, ローカルのコンピュータにリモート側と通信していると思わせながら, 実際にはローカルのプロキシと接続した状態にします. 詳しくは IP-Masquerading HOWTO と <htmlurl url="http://www.indyramp.com/masq" name="http://www.indyramp.com/masq"> をご覧ください. <P> <ITEM>IP: always defragment (CONFIG_IP_ALWAYS_DEFRAG) <P> <!-- Generally this option is disabled, but if you are building a firewall or a masquerading host, you will want to enable it. When data is sent from one host to another, it does not always get sent as a single packet of data, but rather it is fragmented into several pieces. The problem with this is that the port numbers are only stored in the first fragment. This means that someone can insert information into the remaining packets that isn't supposed to be there. It could also prevent a teardrop attack against an internal host that is not yet itself patched against it. --> 普通はこのオプションは無効になっていますが, 防火壁や IP マスカレードを行うホストを構築する場合には, このオプションを有効にしたくなるはずです. あるホストから別のホストまでデータが送られる時, データは必ずしも単独のデータパケットだけで送られるわけではなく, 複数個のパケットに分割されます. このやり方の問題点は, ポート番号は最初のパケットにしか格納されていないことです. つまり, 何者かが入っていないはずの情報を その接続の残りのパケットに入れることが可能なのです. このオプションは, teardrop 攻撃に対するパッチを当てていない内部ホストに対する teardrop 攻撃も防ぐことができるはずです. <P> <ITEM>Packet Signatures (CONFIG_NCPFS_PACKET_SIGNING) <P> <!-- This is an option that is available in the 2.2.x kernel series that will sign NCP packets for stronger security. Normally you can leave it off, but it is there if you do need it. --> このオプションは 2.2.x 系列のカーネルで利用可能なオプションで, セキュリティを強固にするために NCP パケットに署名をするようにします. 通常は無効にしておいて構いませんが, 必要ならばどうぞ. <P> <ITEM>IP: Firewall packet netlink device (CONFIG_IP_FIREWALL_NETLINK) <P> <!-- This is a really neat option that allows you to analyze the first 128 bytes of the packets in a userspace program, to determine if you would like to accept or deny the packet, based on its validity. --> これは実に便利なオプションで, ユーザ空間プログラムのパケットの先頭の 128 バイトを解析し, 正当さに基づいてそのパケットを許すか拒否するかを決めるようにできます. </ITEMIZE> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> 2.2 Kernel Compile Options --> <SECT1> バージョン 2.2 のカーネルのコンパイルオプション <P> <!-- For 2.2.x kernels, many of the options are the same, but a few new ones have been developed. Many of the comments here are from <tt>./linux/Documentation/Configure.help</tt>, which is the same document that is referenced while using the Help facility during the <tt>make config</tt> stage of compiling the kernel. Only the newly- added options are listed below. Consult the 2.0 description for a list of other necessary options. The most significant change in the 2.2 kernel series is the IP firewalling code. The <tt>ipchains</tt> program is now used to install IP firewalling, instead of the <tt>ipfwadm</tt> program used in the 2.0 kernel. --> 2.2.x カーネルでも多くのオプションは同じですが, 新しいオプションもいくつか開発されています. ここに挙げたコメントの多くは <tt>./linux/Documentation/Configure.help</tt> から取っています. このコメントは, カーネルのコンパイル時に <tt>make config</tt> の Help 機能で参照できるドキュメントと同じものです. 以下では新しく追加されたオプションだけを示します. 必要な他のオプションについては, 2.0 用の説明を参照してください. 2.2 カーネルにおける最大の変更点は, IP firewalling のコードです. 2.2 カーネルからは, IP firewalling を行うには, <tt>ipchains</tt> を使うようになりました. 2.0 カーネルで使われていた <tt>ipfwadm</tt> は使いません. <P> <ITEMIZE> <ITEM>Socket Filtering (CONFIG_FILTER) <P> <!-- For most people, it's safe to say no to this option. This option allows you to connect a userspace filter to any socket and determine if packets should be allowed or denied. Unless you have a very specific need and are capable of programming such a filter, you should say no. Also note that as of this writing, all protocols were supported except TCP. --> 大抵の人にとっては, このオプションに no を設定しておくのが安全です. このオプションを使うと, ユーザ空間のフィルタを任意のソケットに接続して, パケットを受け取るか拒否するかを決めることができます. どうしても必要, かつフィルタのようなプログラムを組めないのなら, このオプションには no を設定すべきです. 本 HOWTO の執筆時点では, TCP を除く全てのプロトコルがサポートされています. <P> <ITEM>Port Forwarding <!-- Port Forwarding is an addition to IP Masquerading which allows some forwarding of packets from outside to inside a firewall on given ports. This could be useful if, for example, you want to run a web server behind the firewall or masquerading host and that web server should be accessible from the outside world. An external client sends a request to port 80 of the firewall, the firewall forwards this request to the web server, the web server handles the request and the results are sent through the firewall to the original client. The client thinks that the firewall machine itself is running the web server. This can also be used for load balancing if you have a farm of identical web servers behind the firewall. --> ポート転送 (Port Forwarding) は IP マスカレードへの追加機能であり, 指定されたポートにおける一部のパケットについて, 防火壁の外部から内部への転送を許可します. このオプションが役立つのは, 例えば WWW サーバを防火壁の中や IP マスカレードを行うホストの後ろで実行し, これを外の世界からアクセスできるようにしたい場合です. 外部のクライアントが防火壁の 80 番ポートにリクエストを送ると, 防火壁はこのリクエストを WWW サーバに転送します. WWW サーバはリクエストを処理し, その結果を防火壁経由で元のクライアントに送ります. クライアントにとっては, 防火壁のマシンで WWW サーバが動いているように見えます. この機能は, 防火壁の後ろに全く同じ構成の WWW サーバが複数ある場合に 負荷調整 (load balancing) を行うためにも使えます. <!-- Information about this feature is available from http://www.monmouth.demon.co.uk/ipsubs/portforwarding.html (to browse the WWW, you need to have access to a machine on the Internet that has a program like lynx or netscape). For general info, please see ftp://ftp.compsoc.net/users/steve/ipportfw/linux21/ --> この機能に関する情報は http://www.monmouth.demon.co.uk/ipsubs/portforwarding.html にあります (WWW を見るには, インターネットに接続しており, かつ lynx や Netscape のようなプログラムが使えるマシンが必要です). 一般的な情報については ftp://ftp.compsoc.net/users/steve/ipportfw/linux21/ をご覧ください. <P> <ITEM>Socket Filtering (CONFIG_FILTER) <!-- Using this option, user-space programs can attach a filter to any socket and thereby tell the kernel that it should allow or disallow certain types of data to get through the socket. Linux socket filtering works on all socket types except TCP for now. See the text file <tt>./linux/Documentation/networking/filter.txt</tt> for more information. --> このオプションを使うと, ユーザ空間プログラムは任意のソケットにフィルタを付けることができ, 特定の種類のデータをソケット経由で取得する際に許可するか拒否するかを カーネルに指示することができます. Linux のソケットフィルタリングは, 現在 TCP を除く全ての種類のソケットで動作します. 詳しくはテキストファイル <tt>./linux/Documentation/networking/filter.txt</tt> をご覧ください. 訳注: カーネルのソースに含まれているテキストファイルのことです. <P> <ITEM>IP: Masquerading <!-- The 2.2 kernel masquerading has been improved. It provides additional support for masquerading special protocols, etc. Be sure to read the IP Chains HOWTO for more information. --> カーネル 2.2 の IP マスカレードは改良されています. 特殊なプロトコルのマスカレーディング等のサポートが追加されています. 詳しくは IP Chains HOWTO をご覧ください. </ITEMIZE> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Kernel Devices --> <sect1> カーネルデバイス <P> <!-- There are a few block and character devices available on Linux that will also help you with security. --> Linux には, セキュリティの向上にも使えるブロックデバイスや キャラクタデバイスがいくつかあります. <P> <!-- The two devices <tt>/dev/random</tt> and <tt>/dev/urandom</tt> are provided by the kernel to provide random data at any time. --> <tt>/dev/random</tt> と <tt>/dev/urandom</tt> という, いつでもランダムなデータを取り出せる 2 つのデバイスがカーネルに用意されています. <P> <!-- Both <tt>/dev/random</tt> and <tt>/dev/urandom</tt> should be secure enough to use in generating PGP keys, <tt>ssh</tt> challenges, and other applications where secure random numbers are required. Attackers should be unable to predict the next number given any initial sequence of numbers from these sources. There has been a lot of effort put in to ensuring that the numbers you get from these sources are random in every sense of the word. --> <tt>/dev/random</tt> と <tt>/dev/urandom</tt> はどちらも安全であり, PGP の鍵や <tt>ssh</tt> のチャレンジ文字列の生成や, ランダムな数字を必要とする他のアプリケーションで利用できるはずです. これらを入力として数の初期シーケンスを与えても, 攻撃者が次の数を予測することは不可能なはずです. これらの入力から得た数字があらゆる意味において言葉通りランダムで あることを保証するため, 大変な努力が行われてきました. <P> <!-- The only difference between the two devices, is that <tt>/dev/random</tt> runs out of random bytes and it makes you wait for more to be accumulated. Note that on some systems, it can block for a long time waiting for new user-generated entry to be entered into the system. So you have to use care before ! entropy to be entered into the system. So you have to use care before using <tt>/dev/random</tt>. (Perhaps the best thing to do is to use it when you're generating sensitive keying information, and you tell the user to pound on the keyboard repeatedly until you print out "OK, enough".) --> 2 つのデバイスの唯一の違いは, <tt>/dev/random</tt> はランダムなバイト列を全て使う点と, 計算を行うためのユーザの待ち時間がより長い点です. 一部のシステムでは, ユーザが生成したエントロピーが システムに入るのを待つ長い間, ブロックされてしまうことに注意してください. したがって, <tt>/dev/random</tt> を使う前には気を付ける必要があります. (これの利用の最良の場面はおそらく, 機密キー入力情報を生成する時で, ユーザに「はい, もう十分です」 と表示するまでキーボードを繰り返し叩いてもらう場合です) <P> <!-- <tt>/dev/random</tt> is high quality entropy, generated from measuring the inter-interrupt times etc. It blocks until enough bits of random data are available. --> <tt>/dev/random</tt> は非常に高品質のエントロピーを持ち, 割り込み間の 時間等の測定値から生成しています. このデバイスは十分なビット数のランダ ムデータが利用可能になるまでブロックします. <P> <!-- <tt>/dev/urandom</tt> is similar, but when the store of entropy is running low, it'll return a cryptographically strong hash of what there is. This isn't as secure, but it's enough for most applications. --> <tt>/dev/urandom</tt> も同様ですが, エントロピーの保持量が少なくなると, 現在保持している値の暗号学的に強いハッシュ値を返します. これは <tt>/dev/random</tt> ほど安全ではありませんが, ほとんどの目的に 対してはこれで十分です. <P> <!-- You might read from the devices using something like: --> このデバイスは以下のようにして読み出すことができます: <P><tscreen><verb> root# head -c 6 /dev/urandom | mmencode root# head -c 6 /dev/urandom | mimencode </verb></tscreen> <!-- This will print eight random characters on the console, suitable for password generation. You can find <tt>mimencode</tt> in the <tt>metamail</tt> package. --> これはコンソールに 8 つのランダムな文字を出力します. パスワード生成などによいでしょう. <tt>mimeencode</tt> は <tt>metamail</tt> パッケージに入っています. <P> <!-- See <tt>/usr/src/linux/drivers/char/random.c</tt> for a description of the algorithm. --> アルゴリズムの説明については, <tt>/usr/src/linux/drivers/char/random.c</tt> を参照してください. <P> <!-- Thanks to Theodore Y. Ts'o, Jon Lewis, and others from Linux-kernel for helping me (Dave) with this. --> これについて筆者(Dave)に教えてくださった, Theodore Y. Ts'o さん, Jon Lewis さん他の Linux-kernel ML の皆さんに感謝します. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Network Security<label id="network-security"> --> <SECT>ネットワークのセキュリティ<label id="network-security"> <P> <!-- Network security is becoming more and more important as people spend more and more time connected. Compromising network security is often much easier than compromising physical or local security, and is much more common. --> ネットワークに接続する時間が長ければ長いほど, ネットワークのセキュリティが重要になってきます. ネットワークのセキュリティを破ることは, 物理的あるいはローカルのセキュリティを破るよりも簡単なことが多く, よりありふれたことです. <P> <!-- There are a number of good tools to assist with network security, and more and more of them are shipping with Linux distributions. --> ネットワークのセキュリティ確保を支援するための良いツールはたくさんあり, これらの多くは Linux の各ディストリビューションにも付属しています. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Packet Sniffers --> <SECT1>パケット盗聴 <P> <!-- One of the most common ways intruders gain access to more systems on your network is by employing a packet sniffer on a already compromised host. This "sniffer" just listens on the Ethernet port for things like <tt>passwd</tt> and <tt>login</tt> and <tt>su</tt> in the packet stream and then logs the traffic after that. This way, attackers gain passwords for systems they are not even attempting to break into. Clear-text passwords are very vulnerable to this attack. --> 侵入者がネットワーク上でより多くのシステムのアクセス権を得るためによく 使う方法の一つが, 既に悪用しているホスト上でパケット盗聴プログラムを使 うことです. この「盗聴プログラム」は, イーサネット上のパケットストリー ムの <tt>passwd</tt>, <tt>login</tt>, <tt>su</tt> のようなものを監視し, その後のトラフィックをログに残します. このようにして, 侵入者は破ろうと さえとしていないシステムのパスワードも得てしまいます. 平文の(暗号化さ れていない)パスワードは, このような攻撃に対して非常に脆弱です. <P> <!-- Example: Host A has been compromised. Attacker installs a sniffer. Sniffer picks up admin logging into Host B from Host C. It gets the admin's personal password as they login to B. Then, the admin does a <tt>su</tt> to fix a problem. They now have the root password for Host B. Later the admin lets someone <tt>telnet</tt> from his account to Host Z on another site. Now the attacker has a password/login on Host Z. --> 例: ホスト A は既に破られています. 攻撃者はパケット盗聴プログラムをイ ンストールします. ホスト C からホスト B への管理者のログインを拾い出し ます. まず管理者が B にログインするときに, 個人のパスワードを入手しま す. それから, 管理者は何か問題を処理するために <tt>su</tt> を実行しま す. このときに, ホスト B の root のパスワードが入手できます. 後で, 管 理者が誰かを他のサイトのホスト Z に <tt>telnet</tt> させます. こうして, 攻撃者はホスト Z の password/login を入手することができます. <P> <!-- In this day and age, the attacker doesn't even need to compromise a system to do this: they could also bring a laptop or pc into a building and tap into your net. --> 今日では, 攻撃者はこの攻撃を行うためにシステムを破る必要などありません. ノートパソコン等を建物に持ち込み, ネットワークに繋いでしまえばよいので す. <P> <!-- Using <tt>ssh</tt> or other encrypted password methods thwarts this attack. Things like APOP for POP accounts also prevents this attack. (Normal POP logins are very vulnerable to this, as is anything that sends clear-text passwords over the network.) --> この攻撃を防ぐには, <tt>ssh</tt> 等のパスワード認証を暗号化します. POP の場合には APOP 等を使うことで, この攻撃を防ぐことができます. (通常の POP は, パスワードを暗号化せずにネットワーク上に流すので, この攻撃に対 して非常に脆弱です. ) <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> System services and tcp_wrappers --> <SECT1>システムサービスと tcp_wrappers <p> <!-- Before you put your Linux system on <em>ANY</em> network the first thing to look at is what services you need to offer. Services that you do not need to offer should be disabled so that you have one less thing to worry about and attackers have one less place to look for a hole. --> <em>どんな</em>ネットワークであれ, Linux システムを接続する前にまず確 認すべきことは, どのサービスを提供するかです. 提供する必要が無いサービ スは無効にするべきであり, そうすることで 心配の種を一つ減らすことがで き, 攻撃者がセキュリティホールを探す余地も一つ減ります. <P> <!-- There are a number of ways to disable services under Linux. You can look at your <tt>/etc/inetd.conf</tt> file and see what services are being offered by your <tt>inetd</tt>. Disable any that you do not need by commenting them out (<tt>#</tt> at the beginning of the line), and then sending your inetd process a SIGHUP. --> Linux でサービスを無効にするための方法は色々あります. <tt>/etc/inetd.conf</tt> ファイルを見れば, <tt>inetd</tt> 経由で提供され ているサービスを確認することができます. 必要の無いサービスは, コメントア ウトして(行の先頭に <tt>#</tt> を挿入します), inetd のプロセスに SIGHUP を送ることで無効にすることができます. <P> <!-- You can also remove (or comment out) services in your <tt>/etc/services</tt> file. This will mean that local clients will also be unable to find the service (i.e., if you remove <tt>ftp</tt>, and try and ftp to a remote site from that machine it will fail with an "unknown service" message). It's usually not worth the trouble to remove services from <tt>/etc/services</tt>, since it provides no additional security. If a local person wanted to use <tt>ftp</tt> even though you had commented it out, they would make their own client that used the common FTP port and would still work fine. --> <tt>/etc/services</tt> ファイル内のサービスを削除 (またはコメントアウト) する方法もあります. これによりローカルのクライアントもサービスを見つけられなくなります (例えば <tt>ftp</tt> の項を削除し, そのマシンからリモートサイトへ ftp すると, "unknown service" というエラーになるでしょう). しかし, サービスの削除に伴うトラブルに見合うだけの価値はないでしょう. というのも, <tt>/etc/services</tt> からサービスを削除してもセキュリティが向上するわけではないからです. <tt>/etc/services</tt> で <tt>ftp</tt> の項目をコメントアウトしていても, ローカルのユーザが <tt>ftp</tt> を使いたければ, FTP の一般的なポート番号を使うクライアントを用意すればちゃんと動作するのですから. <P> <!-- Some of the services you might want to leave enabled are:<P> --> 有効なまま残しておくとよいサービスには以下のようなものがあります:<P> <itemize><item><tt>ftp</tt> <item><tt>telnet</tt> (or <tt>ssh</tt>) <item>mail, such as <tt>pop-3</tt> or <tt>imap</tt> <item><tt>identd</tt> </itemize> <P> <!-- If you know you are not going to use some particular package, you can also delete it entirely. <tt>rpm -e <it>packagename</it></tt> under the Red Hat distribution will erase an entire package. Under debian <tt>dpkg —remove</tt> does the same thing. --> 特定のパッケージを使わないことが分かっているならば, そのパッケージを全 部削除する方法もあります. Red Hat ディストリビューションでは, <tt>rpm -e <it>パッケージ名</it></tt> というコマンドがパッケージ全体を 削除するコマンドです. Debian の場合は, <tt>dpkg --remove</tt> コマンド で同様のことが実行できます. <P> <!-- Additionally, you really want to disable the rsh/rlogin/rcp utilities, including login (used by <tt>rlogin</tt>), shell (used by <tt>rcp</tt>), and exec (used by <tt>rsh</tt>) from being started in <tt>/etc/inetd.conf</tt>. These protocols are extremely insecure and have been the cause of exploits in the past. --> 加えて, rsh/rlogin/rcp ユーティリティ(/etc/inetd.conf から login (<tt>rlogin</tt> が使用), shell(<tt>rcp</tt> が使用), exec (<tt>rsh</tt> が使用)の項目を含む)が <tt>/etc/inetd.conf</tt> から起動 されるのを無効にしたいと思うことでしょう. これらのプロトコルは非常に危 険ですし, 過去にも攻撃を受ける原因となってきました. <P> <!-- You should check <tt>/etc/rc.d/rc[0-9].d</tt> (on Red Hat; <tt>/etc/rc[0-9].d</tt> on Debian), and see if any of the servers started in those directories are not needed. The files in those directories are actually symbolic links to files in the directory <tt>/etc/rc.d/init.d</tt> (on Red Hat; <tt>/etc/init.d</tt> on Debian). Renaming the files in the <tt>init.d</tt> directory disables all the symbolic links that point to that file. If you only wish to disable a service for a particular run level, rename the appropriate symbolic link by replacing the upper-case <tt>S</tt> with a lower-case --> <tt>/etc/rc.d/rc[0-9].d</tt> (Red Hat の場合. Debian では <tt>/etc/rc[0-9].d</tt>) ディレクトリをチェックし, 不要なサーバが起動されていないかどうか確認しましょう. こういったディレクトリ中のファイルは実際には <tt>/etc/rc.d/init.d</tt> ディレクトリ (Red Hat の場合. Debian では <tt>/etc/init.d</tt>) 中のファイルへのシンボリックリンクです. <tt>init.d</tt> ディレクトリ中のファイルの名前を変更すると, そのファイルに対するシンボリックリンクを無効にすることができます. 特定のランレベルのサービスだけを無効にしたい場合は, そのサービスに対応するシンボリックリンクの大文字 'S' を小文字の 's' に名称変更してください. これは以下のように行います: <P><tscreen><verb> root# cd /etc/rc6.d root# mv S45dhcpd s45dhcpd </verb></tscreen> <P> <!-- If you have BSD-style <tt>rc</tt> files, you will want to check <tt>/etc/rc*</tt> for programs you don't need. --> BSD スタイルの <tt>rc</tt> ファイルのシステムの場合には, 不要なプログ ラムは <tt>/etc/rc*</tt> から探します. <P> <!-- Most Linux distributions ship with tcp_wrappers "wrapping" all your TCP services. A tcp_wrapper (<tt>tcpd</tt>) is invoked from <tt>inetd</tt> instead of the real server. <tt>tcpd</tt> then checks the host that is requesting the service, and either executes the real server, or denies access from that host. <tt>tcpd</tt> allows you to restrict access to your TCP services. You should make a <tt>/etc/hosts.allow</tt> and add in only those hosts that need to have access to your machine's services. --> ほとんどの Linux ディストリビューションには, 全ての TCP サービスを 「ラッピング(包む)」する tcp_wrappers が付いています. tcp_wrapper(<tt>tcpd</tt>)は, <tt>inetd</tt> が実際のサーバの代わりに 呼び出します. <tt>tcpd</tt> はサービスを要求したホストをチェックし, サー バの起動かアクセス拒否を行います. <tt>/etc/hosts.allow</tt> ファイルを 作り, そのマシンのサービスを受ける必要があるマシンだけを指定しましょう. <P> <!-- If you are a home dialup user, we suggest you deny ALL. <tt>tcpd</tt> also logs failed attempts to access services, so this can alert you if you are under attack. If you add new services, you should be sure to configure them to use tcp_wrappers if they are TCP-based. For example, a normal dial-up user can prevent outsiders from connecting to your machine, yet still have the ability to retrieve mail, and make network connections to the Internet. To do this, you might add the following to your <tt>/etc/hosts.allow</tt>: --> 家からダイアルアップ接続しているユーザは, <em>全て</em>を拒否する設定をお勧めします. <tt>tcpd</tt> はサービスへのアクセス失敗を記録することもできるので, 攻撃を受けた際には警告を受けることができます. 新しいサービスを追加する際には, それが TCP ベースのものなら, 必ず tcp_wrappers を使う設定にすべきです. 例えば通常のダイアルアップユーザは外部からの接続を禁止することができますが, その状態でもメールの取得やインターネットへのネットワーク接続はできます. これを行うには, <tt>/etc/hosts.allow</tt> に以下の設定を追加してください: <P> <!-- ALL: 127. --> ALL: 127 <P> <!-- And of course /etc/hosts.deny would contain: --> また, 当然ながら <tt>/etc/hosts.deny</tt> も関係あります. <P> ALL: ALL <P> <!-- which will prevent external connections to your machine, yet still allow you from the inside to connect to servers on the Internet. --> これにより, 外部からあなたのマシンへの接続は全て禁止されますが, 内部か らインターネット上のサーバへの接続は許されます. <P> <!-- Keep in mind that tcp_wrappers only protects services executed from <tt>inetd</tt>, and a select few others. There very well may be other services running on your machine. You can use <tt>netstat -ta</tt> to find a list of all the services your machine is offering. --> tcp_wrappers が守れるのは <tt>inetd</tt> から実行するサービスだけであり, 他を選択する余地はほとんどないことを覚えておいてください. サービスは他にもたくさん実行されているかもしれません. <tt>netstat -ta</tt> を実行すれば, お使いのマシンで行われているサービスを全て表示することができます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Verify Your DNS Information --> <SECT1> DNS 情報の確認 <P> <!-- Keeping up-to-date DNS information about all hosts on your network can help to increase security. If an unauthorized host becomes connected to your network, you can recognize it by its lack of a DNS entry. Many services can be configured to not accept connections from hosts that do not have valid DNS entries. --> 自分のネットワーク上の全てのホストに関して最新の DNS 情報を保つことは, セキュリティの向上に繋がります. 許可されていないホストがネットワークに 繋がれた際には, そのホストが DNS エントリを持たないことから識別するこ とができます. サービスの多くは正しい DNS エントリを持たないマシンから の接続を受け付けないように設定することができます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> <tt>identd</tt> <P> <!-- <tt>identd</tt> is a small program that typically runs out of your <tt>inetd</tt> server. It keeps track of what user is running what TCP service, and then reports this to whoever requests it. --> <tt>identd</tt> は一般的に <tt>inetd</tt> の代わりとなる小さなプログラ ムです. <tt>identd</tt> はどのユーザがどの TCP サービスを受けているか を常に監視し, 要求に応じてこの結果を報告します. <P> <!-- Many people misunderstand the usefulness of <tt>identd</tt>, and so disable it or block all off site requests for it. <tt>identd</tt> is not there to help out remote sites. There is no way of knowing if the data you get from the remote <tt>identd</tt> is correct or not. There is no authentication in <tt>identd</tt> requests. --> 多くの人は <tt>identd</tt> の有益さを誤解しており, <tt>identd</tt> を 無効にしたり, 外部サイトからの <tt>identd</tt> へのリクエストをブロッ クしたりしています. <tt>identd</tt> はリモートサイトを助けるためにある のではありません. リモートの <tt>identd</tt> から得たデータが正しいか どうかを知る術はありません. <tt>identd</tt> のリクエストは認証を行いま せん. <P> <!-- Why would you want to run it then? Because it helps <em>you</em> out, and is another data-point in tracking. If your <tt>identd</tt> is un compromised, then you know it's telling remote sites the user-name or uid of people using TCP services. If the admin at a remote site comes back to you and tells you user so-and-so was trying to hack into their site, you can easily take action against that user. If you are not running <tt>identd</tt>, you will have to look at lots and lots of logs, figure out who was on at the time, and in general take a lot more time to track down the user. --> それでは, どうして identd を使うのでしょうか? それは<em>読者の皆さん</em>を 助けてくれるからであり, 追跡調査の際のデータになるからです. <tt>identd</tt> が悪用されていなければ, リモートサイトに TCP サービス を受けたユーザ名やユーザID を知らせることができます. リモートサイトの 管理者が戻ってきて彼らのサイトが攻撃されていると言ってきた場合, 簡単に そのユーザに対して行動を起こすことができます. もし <tt>identd</tt> が 動いていなければ, 大量のログを調べ, その時に誰がいたのか調べなければな りませんが, そのユーザを突き止めることは一般にとても時間がかかる作業で す. <P> <!-- The <tt>identd</tt> that ships with most distributions is more configurable than many people think. You can disable it for specific users (they can make a <tt>.noident</tt> file), you can log all <tt>identd</tt> requests (We recommend it), you can even have identd return a uid instead of a user name or even NO-USER. --> ほとんどのディストリビューションに付属している <tt>identd</tt> は一般 に思われているよりも細かい設定が可能です. 特定のユーザについて <tt>identd</tt> を無効にすることができますし(<tt>.noident</tt> ファイ ルを作ります), <tt>identd</tt> リクエストのログを全て残すこともできま すし(この設定をお勧めします), ユーザ名の代わりにユーザID や NO-USER を 返すようにすることさえできます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> SATAN, ISS, and Other Network Scanners --> <SECT1>SATAN, ISS その他のネットワーク探査プログラム <P> <!-- There are a number of different software packages out there that do port and service-based scanning of machines or networks. SATAN, ISS, SAINT, and Nessus are some of the more well-known ones. This software connects to the target machine (or all the target machines on a network) on all the ports they can, and try to determine what service is running there. Based on this information, you can tell if the machine is vulnerable to a specific exploit on that server. --> マシンやネットワークのポートやサービスの探査を行う ソフトウェアのパッケージはいろいろあります. SATAN や ISS, SAINT, Nessus はこの種のパッケージの中でも特に有名なものです. このソフトウェアは調査対象のマシン (あるいはネットワーク上の全ての対象マシン) の接続可能なポート全てに接続し, そのポートで提供されているサービスについて調べようとします. この情報に基づいて, サーバに対する特定の攻撃に対してマシンが脆弱であるかどうか 調べることができます. <P> <!-- SATAN (Security Administrator's Tool for Analyzing Networks) is a port scanner with a web interface. It can be configured to do light, medium, or strong checks on a machine or a network of machines. It's a good idea to get SATAN and scan your machine or network, and fix the problems it finds. Make sure you get the copy of SATAN from <url url="http://metalab.unc.edu/pub/packages/security/Satan-for-Linux/" name="metalab"> or a reputable FTP or web site. There was a Trojan copy of SATAN that was distributed out on the net. <htmlurl url="http://www.trouble.org/~zen/satan/satan.html" name="http://www.trouble.org/~zen/satan/satan.html">. Note that SATAN has not been updated in quite a while, and some of the other tools below might do a better job. --> SATAN(Security Administrator's Tool for Analyzing Networks)はウェブの インタフェースを持つポート探査プログラムです. マシンあるいはネットワー クに対して, light, medium, strong いずれかのチェックを行う設定ができま す. SATAN を入手し, 自分のマシンやネットワークを検査し, 見つかった問題 を修正するとよいでしょう. 必ず, SATAN は <url url="http://metalab.unc.edu/pub/packages/security/Satan-for-Linux/" name="metalab"> か有名 FTP/ウェブサイトから入手しましょう. 過去に, ト ロイの木馬が仕込まれた SATAN がネットワーク上で配布されたことがあるか らです. <htmlurl url="http://www.trouble.org/~zen/satan/satan.html" name="http://www.trouble.org/~zen/satan/satan.html">. SATAN はしばらく 更新されていないため, この後で説明する他のツールの方が役に立つかもしれ ません. <P> <!-- ISS (Internet Security Scanner) is another port-based scanner. It is faster than Satan, and thus might be better for large networks. However, SATAN tends to provide more information. --> ISS (Internet Security Scanner) もポートを検査するプログラムです. ISS は SATAN よりも動作が軽いので, 大規模ネットワークに向いているでしょう. ただし, 得られる情報は SATAN の方が詳しいようです. <P> <!-- Abacus is a suite of tools to provide host-based security and intrusion detection. Look at it's home page on the web for more information. <htmlurl url="http://www.psionic.com/abacus" name="http://www.psionic.com/abacus/"> --> Abacus は, ホストベースのセキュリティと侵入者発見の機能を持つツールで す. 詳しい情報については WWW 上のホームページを見てください. <htmlurl url="http://www.psionic.com/abacus" name="http://www.psionic.com/abacus/"> <P> <!-- SAINT is a updated version of SATAN. It is web-based and has many more up-to-date tests than SATAN. You can find out more about it at: <htmlurl url="http://www.wwdsi.com/saint" name="http://www.wwdsi.com/~saint"> --> SAINT は SATAN の新しいバージョンです. SAINT はウェブベースであり, SATAN よりも新しい検査がたくさん追加されています. 詳しくは <htmlurl url="http://www.wwdsi.com/saint" name="http://www.wwdsi.com/saint"> を見てください. <P> <!-- Nessus is a free security scanner. It has a GTK graphical interface for ease of use. It is also designed with a very nice plugin setup for new port-scanning tests. For more information, take a look at: <htmlurl url="http://www.nessus.org/" name="http://www.nessus.org"> --> Nessus はフリーのセキュリティ検査プログラムです. これは GTK による使い やすいグラフィカルインタフェースを持っています. また, 新しいポート探査 を設定するための素晴らしいプラグイン機構を備えています. 詳しい情報につ いては <htmlurl url="http://www.nessus.org/" name="http://www.nessus.org"> を見てください. <P> <!-- <sect2>Detecting Port Scans --> <sect2>ポート探査を受けたことの検出 <P> <!-- There are some tools designed to alert you to probes by SATAN and ISS and other scanning software. However, if you liberally use tcp_wrappers, and look over your log files regularly, you should be able to notice such probes. Even on the lowest setting, SATAN still leaves traces in the logs on a stock Red Hat system. --> SATAN や ISS などの探査プログラムによる探査を受けたことを 警告するために設計されたツールがいくつかあります. しかし, tcp_wrappers をうまく使い, ログを定期的に見ていれば, このような探査があったことはわかります. 最低限の設定でも, SATAN は Red Hat の標準システムのログに痕跡を残します. <P> <!-- There are also "stealth" port scanners. A packet with the TCP ACK bit set (as is done with established connections) will likely get through a packet-filtering firewall. The returned RST packet from a port that <em>_had no established session_</em> can be taken as proof of life on that port. I don't think TCP wrappers will detect this. --> 「見えない」ポート探査もあります. TCP ACK ビットがセットされているパケッ ト(確立されている接続ではそうなっています)は多分, パケットフィルタリング を行う防火壁を通過するでしょう. <em>確立されているセッションを持たない</em> ポートから返される RST パケットは, そのポートが生きている証拠として受 け取ることができます. TCP wrappers はこれを検出できないと思います. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> <tt>sendmail</tt>, <tt>qmail</tt> and MTA's --> <SECT1> <tt>sendmail</tt>, <tt>qmail</tt> 等の MTA <P> <!-- One of the most important services you can provide is a mail server. Unfortunately, it is also one of the most vulnerable to attack, simply due to the number of tasks it must perform and the privileges it typically needs. --> ユーザに提供するサービスの中でも特に重要なものの 1 つは, メールサーバ です. 残念ながら, これは攻撃に特に弱いものの 1 つでもあります. 単にそ の理由は, やらなければならない仕事の数が多いことと, 一般に root ユーザ の権限を必要とするからです. <P> <!-- If you are using <tt>sendmail</tt> it is very important to keep up on current versions. <tt>sendmail</tt> has a long long history of security exploits. Always make sure you are running the most recent version from <htmlurl url="http://www.sendmail.org/" name="http://www.sendmail.org">. --> <tt>sendmail</tt> を使う場合には特に, 必ず最新バージョンを使うことが重 要です. <tt>sendmail</tt> にはセキュリティの問題の長い長い歴史がありま す. いつも必ず最新バージョンを動作させましょう. <htmlurl url="http://www.sendmail.org/" name="http://www.sendmail.org"> <P> <!-- Keep in mind that sendmail does not have to be running in order for you to send mail. If you are a home user, you can disable sendmail entirely, and simply use your mail client to send mail. You might also choose to remove the "-bd" flag from the sendmail startup file, thereby disabling incoming requests for mail. In other words, you can execute sendmail from your startup script using the following instead: --> メールを送信するだけなら sendmail を実行する必要はないことは知っておい てください. 家庭ユーザであれば, sendmail を完全に使えなくしてしまい, メールの送信には単にメールクライアントを使うということもできます. sendmail の起動ファイルから "-bd" フラグを削除しても良いでしょう. これ によりメール送信のリクエストが無効になります. 言い換えれば, 今までの起 動スクリプトではなく以下のコマンドを使って sendmail を実行すればよいと いうことです: <tscreen><verb> # /usr/lib/sendmail -q15m </verb></tscreen> <!-- This will cause sendmail to flush the mail queue every fifteen minutes for any messages that could not be successfully delivered on the first attempt. --> これにより sendmail は, 最初に送信したときにうまく配送できなかったメー ルについて, 15 分ごとに送信キューをフラッシュします. <P> <!-- Many administrators choose not to use sendmail, and instead choose one of the other mail transport agents. You might consider switching over to <tt>qmail</tt>. <tt>qmail</tt> was designed with security in mind from the ground up. It's fast, stable, and secure. Qmail can be found at <htmlurl url="http://www.qmail.org" name="http://www.qmail.org"> --> 管理者の多くは sendmail を使わないで, 別のメール配送エージェントを使う ようになっています. <tt>qmail</tt> への乗り換えを検討してもよいでしょ う. <tt>qmail</tt> は徹底的にセキュリティに注意して設計されています. <tt>qmail</tt> は高速かつ安定, 安全です. <tt>qmail</tt> は <htmlurl url="http://www.qmail.org" name="http://www.qmail.org"> で入 手することができます. <P> 訳注: <htmlurl url="http://www.jp.qmail.org" name="http://www.jp.qmail.org"> も参考になるでしょう. <P> <!-- In direct competition to qmail is "postfix", written by Wietse Venema, the author of tcp_wrappers and other security tools. Formerly called vmailer, and sponsored by IBM, this is also a mail transport agent written from the ground up with security in mind. You can find more information about postfix at <htmlurl url="http://www.postfix.org/" name="http://www.postfix.org"> --> qmail の対抗馬は "postfix" です. これは tcp_wrappers 等のセキュリティ関連ツールの作者である Wietse Venema 氏が書かれたものです. 以前は vmailer と呼ばれ, IBM の支援を受けていました. これも徹底的にセキュリティに配慮して書かれたメール配送エージェントです. postfix に関するもっと詳しい情報については <htmlurl url="http://www.postfix.org/" name="http://www.postfix.org"> をご覧ください. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Denial of Service Attacks --> <SECT1> サービス妨害攻撃 <P> <!-- A "Denial of Service" (DoS) attack is one where the attacker tries to make some resource too busy to answer legitimate requests, or to deny legitimate users access to your machine. --> 「サービス妨害攻撃(Denial of Service attack, DoS attack)」は, リソース を食い潰すことにより, 正当なリクエストに応じられないようにしたり, 正当 なユーザがマシンにアクセスできないようにする攻撃です. <P> <!-- Denial of service attacks have increased greatly in recent years. Some of the more popular and recent ones are listed below. Note that new ones show up all the time, so this is just a few examples. Read the Linux security lists and the bugtraq list and archives for more current information. --> サービス妨害攻撃は近年とても増えています. ここでは, 有名なものや最近の ものをいくつか紹介します. 新しいものが常に現れるので, ここ示す例はほん の一部に過ぎない点には注意してください. 最新の情報を知るには, Linux の セキュリティ関連メーリングリストや bugtraq メーリングリストやこれらの アーカイブを読みましょう. <P> <ITEMIZE><ITEM> <!-- <bf>SYN Flooding</bf> - SYN flooding is a network denial of service attack. It takes advantage of a "loophole" in the way TCP connections are created. The newer Linux kernels (2.0.30 and up) have several configurable options to prevent SYN flood attacks from denying people access to your machine or services. See <ref id="kernel-security" name="Kernel Security"> for proper kernel protection options. --> <bf>SYN Flooding</bf> - SYN flooding はネットワークでのサービス妨害攻 撃です. これは TCP 接続を確立する際の手順の「抜け穴」を利用するものです. 新しい Linux カーネル(2.0.30 以降)には, SYN flooding 攻撃によりユーザ がマシンやサービスにアクセスできなくなることを防ぐための設定オプション があります. カーネルの適切な防御用オプションについては, <ref id="kernel-security" name="カーネルのセキュリティ"> の章を参照してください. <P> <!-- <item><bf>Pentium "F00F" Bug</bf> - It was recently discovered that a series of assembly codes sent to a genuine Intel Pentium processor would reboot the machine. This affects every machine with a Pentium processor (not clones, not Pentium Pro or PII), no matter what operating system it's running. Linux kernels 2.0.32 and up contain a work around for this bug, preventing it from locking your machine. Kernel 2.0.33 has an improved version of the kernel fix, and is suggested over 2.0.32. If you are running on a Pentium, you should upgrade now! --> <item><bf>Pentium の "F00F" バグ</bf> -これは最近見つかったもので, 特 定のアセンブリコードを純正の Intel Pentium プロセッサに送ると, マシン がリブートしてしまうというものです. この影響は, 実行している OS に関係 なく Pentium プロセッサを積んでいる全てのマシンが受けます(互換 CPU や Pentium Pro, Pentium II では問題ありません). Linux 2.0.32 以降には, こ のバグに対する対処が入っているので, マシンが止まってしまうことはあり ません. カーネル 2.0.33 での対処はさらに改良されており, カーネル 2.0.32 よりもお勧めできます. 現在 Pentium を使っているのなら, カーネル のバージョンをすぐに上げましょう! <P> <ITEM> <!-- <bf>Ping Flooding</bf> - Ping flooding is a simple brute-force denial of service attack. The attacker sends a "flood" of ICMP packets to your machine. If they are doing this from a host with better bandwidth than yours, your machine will be unable to send anything on the network. A variation on this attack, called "smurfing", sends ICMP packets to a host with <em>your</em> machine's return IP, allowing them to flood you less detectably. You can find more information about the "smurf" attack at <htmlurl url="http://www.quadrunner.com/~chuegen/smurf.txt" name=" http://www.quadrunner.com/~chuegen/smurf.txt"> --> <bf>Ping Flooding</bf> - Ping flooding は単純な力任せのサービス妨害 攻撃です. 攻撃者は対象となるマシンに ICMP パケットの「洪水(flood)」を 送ります. 攻撃する側のマシンが攻撃を受ける側のマシンより広いバンド 幅を持っていた場合, 攻撃を受けたマシンはネットワークに何も送れなくなっ てしまいます. この攻撃の一種である "smurfing 攻撃" では, あるホストに 対して, <em>あなたの</em>マシンの IP アドレスを返答先とした ICMP パケッ トを送り, ばれないように洪水を送ります. "smurf" 攻撃に関する情報は <htmlurl url="http://www.quadrunner.com/~chuegen/smurf.txt" name="http://www.quadrunner.com/~chuegen/smurf.txt"> で詳しく調べるこ とができます. <P> <!-- If you are ever under a ping flood attack, use a tool like <tt>tcpdump</tt> to determine where the packets are coming from (or appear to be coming from), then contact your provider with this information. Ping floods can most easily be stopped at the router level or by using a firewall. --> ping flooding 攻撃を受けた場合は, <tt>tcpdump</tt> などのツールを使っ てどこからパケットが来たのか(あるいは来たように見えるのか)を調べ, 読者 の皆さんが接続しているプロバイダにこのデータに基づいて相談しましょう. ping flood 攻撃はルータのレベルや防火壁の利用で簡単に止めることができ ます. <P> <ITEM> <!-- <bf>Ping o' Death</bf> - The Ping o' Death attack sends ICMP ECHO REQUEST packets that are too large to fit in the kernel data structures intended to store them. Because sending a single, large (65,510 bytes) "ping" packet to many systems will cause them to hang or even crash, this problem was quickly dubbed the "Ping o' Death." This one has long been fixed, and is no longer anything to worry about. --> <bf>Ping o' Death</bf> - Ping o' Death 攻撃は, ICMP ECHO REQUEST パケッ トを格納するためのカーネルのデータ構造体よりも大きい ICMP ECHO REQUEST パケットを送るものです. 巨大な(65,510 バイト) "ping" パケット 1 つを送っ ただけで多くのシステムがハングしたり, クラッシュすることさえあるため, この問題はそのまま "Ping o' Death" という名前を授けられました. この問 題はずっと前に修正されているので, 現在は心配の必要は全くありません. <P> <ITEM> <!-- <bf>Teardrop / New Tear</bf> - One of the most recent exploits involves a bug present in the IP fragmentation code on Linux and Windows platforms. It is fixed in kernel version 2.0.33, and does not require selecting any kernel compile-time options to utilize the fix. Linux is apparently not vulnerable to the "newtear" exploit. --> <bf>Teardrop / New Tear</bf> - ごく最近の攻撃で, Linux と Windows プラッ トフォームの IP フラグメンテーションのバグを利用したものです. これに対 する修正はカーネルのバージョン 2.0.33 で行われており, この修正を有効に するためにコンパイル時のオプションを選択する必要はありません. 見たとこ ろ, Linux は 'newtear' 攻撃は受け付けないようです. <P> </ITEMIZE> <!-- You can find code for most exploits, and a more in-depth description of how they work, at <htmlurl url="http://www.rootshell.com" name="http://www.rootshell.com"> using their search engine. --> ほとんどの攻撃に関するコードおよびそのコードの動作原理に関する突っ込ん だ説明は, <htmlurl url="http://www.rootshell.com" name="http://www.rootshell.com"> の検索エンジンを使って調べることがで きます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> NFS (Network File System) Security. --> <SECT1> NFS (Network File System) のセキュリティ <P> <!-- NFS is a very widely-used file sharing protocol. It allows servers running <tt>nfsd</tt> and <tt>mountd</tt> to "export" entire filesystems to other machines using NFS filesystem support built in to their kernels (or some other client support if they are not Linux machines). <tt>mountd</tt> keeps track of mounted filesystems in <tt>/etc/mtab</tt>, and can display them with <tt>showmount</tt>. --> NFS は大変広く使われているファイル共有プロトコルです. <tt>nfsd</tt> と <tt>mountd</tt> が動作しているサーバマシンは, カーネルに NFS ファイル システムのサポートが組み込まれている他のマシン(NFS クライアント機能を サポートしていれば Linux でなくても構いません)にファイルシステム全体を 「エクスポート」することができます. <tt>mountd</tt> は <tt>/etc/mtab</tt> に記録されているマウントされているファイルシステム を監視しています. これらのファイルシステムは <tt>showmount</tt> コマン ドで表示することができます. <P> <!-- Many sites use NFS to serve home directories to users, so that no matter what machine in the cluster they login to, they will have all their home files. --> 多くのサイトでは, ユーザのホームディレクトリを提供するために NFS を用 いており, LAN のどのマシンにログインした場合にも同じホームディレクトリ を使うことができます. <P> <!-- There is some small amount of security allowed in exporting filesystems. You can make your <tt>nfsd</tt> map the remote root user (uid=0) to the <tt>nobody</tt> user, denying them total access to the files exported. However, since individual users have access to their own (or at least the same uid) files, the remote root user can login or <tt>su</tt> to their account and have total access to their files. This is only a small hindrance to an attacker that has access to mount your remote filesystems. --> ファイルシステムをエクスポートする時には, 少しだけセキュリティをかける ことができます. <tt>nfsd</tt> にはリモートの root ユーザ(ユーザID = 0) を nobody ユーザとして扱わせ, エクスポートしたファイル全体にはアクセス できないように設定できます. しかし, 個々のユーザは自分の(あるい は少なくとも同じユーザ ID の)ファイルにはアクセスできるので, ローカル のスーパーユーザはそのユーザとしてログインするか <tt>su</tt> を行えば, そのユーザのファイル全てにアクセスすることができます. つまり, この方法 は読者の皆さんのリモートファイルシステムをマウントできる攻撃者に対して はちょっとした妨害にしかなりません. <P> <!-- If you must use NFS, make sure you export to only those machines that you really need to. Never export your entire root directory; export only directories you need to export. --> NFS を使わなければならない場合は, 本当に必要なマシンだけにエクスポート することを徹底しましょう. ルートディレクトリ以下全部をエクスポートする ようなことは絶対に行ってはなりません. エクスポートの必要があるディレク トリだけをエクスポートしましょう. <P> <!-- See the NFS HOWTO for more information on NFS, available at <htmlurl url="http://metalab.unc.edu/mdw/HOWTO/NFS-HOWTO.html" name="http://metalab.unc.edu/mdw/HOWTO/NFS-HOWTO.html"> --> NFS に関する詳しい情報については NFS HOWTO を参照してください. これは <htmlurl url="http://metalab.unc.edu/mdw/HOWTO/NFS-HOWTO.html" name="http://metalab.unc.edu/mdw/HOWTO/NFS-HOWTO.html"> にあります. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> NIS (Network Information Service) (formerly YP). --> <SECT1> NIS (Network Information service) (かつての YP) <P> <!-- Network Information service (formerly YP) is a means of distributing information to a group of machines. The NIS master holds the information tables and converts them into NIS map files. These maps are then served over the network, allowing NIS client machines to get login, password, home directory and shell information (all the information in a standard <tt>/etc/passwd</tt> file). This allows users to change their password once and have it take effect on all the machines in the NIS domain. --> NIS (かつての YP) は, 多数のマシンに情報を配布するための仕組みです. NIS マスタは情報テーブルを保持し, これを NIS マップファイルに変換しま す. このマップはネットワーク上で得ることができるので, NIS クライアント はログイン名, パスワード, ホームディレクトリ, シェルの情報(標準的な <tt>/etc/passwd</tt> ファイルに書かれている全ての情報)を得ることができ ます. これにより, パスワードを一度変えるだけで, NIS ドメイン上の全ての マシンで新しい設定を有効にできます. <P> <!-- NIS is not at all secure. It was never meant to be. It was meant to be handy and useful. Anyone that can guess the name of your NIS domain (anywhere on the net) can get a copy of your passwd file, and use "crack" and "John the Ripper" against your users' passwords. Also, it is possible to spoof NIS and do all sorts of nasty tricks. If you must use NIS, make sure you are aware of the dangers. --> NIS は全く安全ではありません. そもそも安全にするつもりもなく, 手軽で便 利に使うことが目的でした. NIS ドメインの名前を推測できれば誰でも(ネッ トワークのどこからでも)パスワードファイルのコピーを得ることができ, "Crack" や "John the Ripper" 等を使ってパスワードを破ることができます. また, なりすまし等の汚いトリックも色々可能です. NIS を使わなければなら ない場合には, この危険性は知っておいてください. <P> <!-- There is a much more secure replacement for NIS, called NIS+. Check out the NIS HOWTO for more information: <htmlurl url="http://metalab.unc.edu/mdw/HOWTO/NIS-HOWTO.html" name="http://metalab.unc.edu/mdw/HOWTO/NIS-HOWTO.html"> --> NIS+ と呼ばれる NIS よりもずっと安全な代替策があります. 詳しくは NIS HOWTO を参照してください: (<htmlurl url="http://metalab.unc.edu/mdw/HOWTO/NIS-HOWTO.html" name="http://metalab.unc.edu/mdw/HOWTO/NIS-HOWTO.html">). <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Firewalls --> <SECT1> 防火壁(ファイアウォール) <P> <!-- Firewalls are a means of controlling what information is allowed into and out of your local network. Typically the firewall host is connected to the Internet and your local LAN, and the only access from your LAN to the Internet is through the firewall. This way the firewall can control what passes back and forth from the Internet and your LAN. --> 防火壁は, ローカルのネットワークに出入りできる情報を制御するための仕組みです. 普通, 防火壁になるホストはインターネットとローカルの LAN に接続され, あなたの LAN からインターネットへのアクセスは 防火壁を通り抜けるしかないようになっています. このように, 防火壁はインターネットと LAN の行き来を制御します. <P> <!-- There are a number of types of firewalls and methods of setting them up. Linux machines make pretty good firewalls. Firewall code can be built right into 2.0 and higher kernels. The user-space tools <tt>ipfwadm</tt> for 2.0 kernels and <tt>ipchains</tt> for 2.2 kernels, allows you to change, on the fly, the types of network traffic you allow. You can also log particular types of network traffic. --> 防火壁にはたくさんの種類があり, その設定方法もたくさんあります. Linux はかなり良い防火壁になります. 防火壁のコードは 2.0 以降のカーネルに組み込むことができます. カーネル 2.0 には ユーザ空間で動作する <tt>ipfwadm</tt>, カーネル 2.2 には <tt>ipchains</tt> というツールを使って, 許可するネットワークトラフィックの種類を システムの動作中に変更することができます. 特定のネットワークトラフィックのログを取ることもできます. <P> <!-- Firewalls are a very useful and important technique in securing your network. However, never think that because you have a firewall, you don't need to secure the machines behind it. This is a fatal mistake. Check out the very good <tt>Firewall-HOWTO</tt> at your latest metalab archive for more information on firewalls and Linux. <htmlurl url="http://metalab.unc.edu/mdw/HOWTO/Firewall-HOWTO.html" name="http://metalab.unc.edu/mdw/HOWTO/Firewall-HOWTO.html"> --> 防火壁はネットワークを守るために大変便利かつ重要な技術です. ただし, 防 火壁があるからといって, その内部のマシンのセキュリティが不必要なわけで は決してありません. これは極めて重大な誤りです. 防火壁と Linux につい ての詳しい情報については, metalab の最新のアーカイブにある <tt>Firewall-HOWTO</tt> がとても良い資料なので, これを参照してください (<htmlurl url="http://metalab.unc.edu/mdw/HOWTO/Firewall-HOWTO.html" name="http://metalab.unc.edu/mdw/HOWTO/Firewall-HOWTO.html">). <P> <!-- More information can also be found in the IP-Masquerade mini-howto: <htmlurl url="http://metalab.unc.edu/mdw/HOWTO/mini/IP-Masquerade.html" name="http://metalab.unc.edu/mdw/HOWTO/mini/IP-Masquerade.html"> --> 更に IP-Masquerade mini-howto にも情報があります (<htmlurl url="http://metalab.unc.edu/mdw/HOWTO/mini/IP-Masquerade.html" name="http://metalab.unc.edu/mdw/HOWTO/mini/IP-Masquerade.html">). <P> <!-- More information on <tt>ipfwadm</tt> (the tool that lets you change settings on your firewall, can be found at it's home page: <htmlurl url="http://www.xos.nl/linux/ipfwadm/" name="http://www.xos.nl/linux/ipfwadm/"> --> <tt>ipfwadm</tt> (防火壁の設定を変更するためのツール) に関する詳しい情報は以下のホームページにあります: <htmlurl url="http://www.xos.nl/linux/ipfwadm/" name="http://www.xos.nl/linux/ipfwadm/"> <P> <!-- If you have no experience with firewalls, and plan to set up one for more than just a simple security policy, the Firewalls book by O'Reilly and Associates or other online firewall document is mandatory reading. Check out <htmlurl url="http://www.ora.com" name="http://www.ora.com"> for more information. The National Institute of Standards and Technology have put together an excellent document on firewalls. Although dated 1995, it is still quite good. You can find it at <htmlurl url="http://csrc.nist.gov/nistpubs/800-10/main.html" name="http://csrc.nist.gov/nistpubs/800-10/main.html">. Also of interest: --> 防火壁に関する経験をお持ちでないのに, 単なるセキュリティ方針だけでなく 防火壁そのものを設定する予定であれば, O'Reilly and Associates 社の書籍 「Firewalls」またはその他のオンラインドキュメントを必ず読んでください. この書籍の詳しい情報については <htmlurl url="http://www.ora.com/" name="http://www.ora.com/"> をご覧ください. 国立標準技術研究所 (The National Institute of Standards and Technology) も防火壁に関する素晴らしいドキュメントをまとめています. 日付は 1995 年となっていますが, 現在でも非常に役立ちます. これは <htmlurl url="http://csrc.nist.gov/nistpubs/800-10/main.html" name="http://csrc.nist.gov/nistpubs/800-10/main.html"> にあります. ほかには: <P> <ITEMIZE> <!-- <ITEM> The Freefire Project — a list of freely-available firewall tools, available at <htmlurl url="http://sites.inka.de/sites/lina/freefire-l/index_en.html" name="http://sites.inka.de/sites/lina/freefire-l/index_en.html"> --> <ITEM> The Freefire Project -- フリーに利用できる防火壁用ツールのリス トです. <htmlurl url="http://sites.inka.de/sites/lina/freefire-l/index_en.html" name="http://sites.inka.de/sites/lina/freefire-l/index_en.html"> にあ ります. <!-- <ITEM> SunWorld Firewall Design — written by the authors of the O'Reilly book, this provides a rough introduction to the different firewall types. It's available at <htmlurl url="http://www.sunworld.com/swol-01-1996/swol-01-firewall.html" name="http://www.sunworld.com/swol-01-1996/swol-01-firewall.html"> --> <ITEM> SunWorld Firewall Design -- O'Reilly の書籍の著者が書いたドキュ メントであり, 各種の防火壁を簡単に紹介しています. <htmlurl url="http://www.sunworld.com/swol-01-1996/swol-01-firewall.html" name="http://www.sunworld.com/swol-01-1996/swol-01-firewall.html"> に あります. <!--O <ITEM>Mason - the automated firewall builder for Linux. This is a firewall script that learns as you do the things you need to do on your network! More info at: <htmlurl url="http://www.pobox.com/~wstearns/mason/" name="http://www.pobox.com/~wstearns/mason/"> --> <ITEM>Mason -- Linux 向けの防火壁自動構築ツールです. あなたがネットワークでやりたいことをやれば, それを学習する防火壁スクリプトです! 詳しくは: <htmlurl url="http://www.pobox.com/~wstearns/mason/" name="http://www.pobox.com/~wstearns/mason/"> をどうぞ. </ITEMIZE> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> IP Chains - Linux Kernel 2.2.x Firewalling --> <SECT1> IP Chains - Linux カーネル 2.2.x における防火壁の構築 <P> <!-- Linux IP Firewalling Chains is an update to the 2.0 Linux firewalling code for the 2.2 kernel. It has a great deal more features than code for the 2.2 kernel. It has many more features than previous implementations, including: --> Linux の IP Firewalling Chains はカーネル 2.0 の防火壁用のコードを カーネル 2.2 用に更新したものです. これは以前の実装よりもずっと多くの機能を持っています. 以下に列挙します: <itemize> <!-- <item> More flexible packet manipulations --> <item> より柔軟なパケット操作 <!-- <item> More complex accounting --> <item> より複雑なアカウンティング <!-- <item> Simple policy changes possible atomically --> <item> 非常に細かい操作ができ, 簡単なポリシー変更 <!-- <item> Fragments can be explicitly blocked, denied, etc. --> <item> フラグメントの明示的なブロックや拒否など <!-- <item> Logs suspicious packets. --> <item> 怪しいパケットの記録 <!-- <item> Can handle protocols other than ICMP/TCP/UDP. --> <item> ICMP/TCP/UDP 以外のプロトコルの処理 </itemize> <P> <!-- If you are currently using <tt>ipfwadm</tt> on your 2.0 kernel, there are scripts available to convert the <tt>ipfwadm</tt> command format to the format <tt>ipchains</tt> uses. --> 現在, カーネル 2.0 で <tt>ipfwadm</tt> をお使いであれば, <tt>ipfwadm</tt> のコマンド形式を <tt>ipchains</tt> で使える形式に変換するスクリプトがあります. <P> <!-- Be sure to read the IP Chains HOWTO for further information. It is available at <htmlurl url="http://www.rustcorp.com/linux/ipchains/HOWTO.html" name="http://www.rustcorp.com/linux/ipchains/HOWTO.html"> --> 詳しくは IP Chains HOWTO をお読みください. これは <htmlurl url="http://www.rustcorp.com/linux/ipchains/HOWTO.html" name="http://www.rustcorp.com/linux/ipchains/HOWTO.html"> にあります. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> VPNs - Virtual Private Networks --> <SECT1> 仮想プライベートネットワーク(VPN, Virtual Private Network) <P> <!-- VPN's are a way to establish a "virtual" network on top of some already-existing network. This virtual network often is encrypted and passes traffic only to and from some known entities that have joined the network. VPNs are often used to connect someone working at home over the public Internet to an internal company network. --> VPN は何らかの既存ネットワークの上に 「仮想的な」ネットワークを確立する手法です. この仮想ネットワークは, 暗号化されていたり, ネットワークに加わっている何らかの既知の存在との間のトラフィックしか 通さないようになっていたりします. VPN は, 家で作業している人と会社の内部ネットワークを インターネット経由で接続するためにもよく使われます. <P> <!-- If you are running a Linux masquerading firewall and need to pass MS PPTP (Microsoft's VPN point-to-point product) packets, there is a Linux kernel patch out to do just that. See: <htmlurl url="ftp://ftp.rubyriver.com/pub/jhardin/masquerade/ip_masq_vpn.html" name="ip-masq-vpn">. --> Linux の IP マスカレードを行う防火壁を使っており, かつ MS の PPTP (Microsoft 製の VPN 接続のための製品) パケットを通過させる必要がある場合には, これを行うためのカーネルパッチを使ってください. <htmlurl url="ftp://ftp.rubyriver.com/pub/jhardin/masquerade/ip_masq_vpn.html" name="ip-masq-vpn"> をご覧ください. <P> <!-- There are several Linux VPN solutions available: --> Linux で利用できる VPN のソリューションはいくつかあります: <ITEMIZE> <!-- <ITEM> vpnd. See the <htmlurl url="http://sunsite.auc.dk/vpnd/" name="http://sunsite.auc.dk/vpnd/">. --> <ITEM> vpnd. <htmlurl url="http://sunsite.auc.dk/vpnd/" name="http://sunsite.auc.dk/vpnd/"> をご覧ください. <!-- <ITEM> Free S/Wan, available at <htmlurl url="http://www.xs4all.nl/~freeswan/" name="http://www.xs4all.nl/~freeswan/"> --> <ITEM> Free S/Wan. <htmlurl url="http://www.xs4all.nl/~freeswan/" name="http://www.xs4all.nl/~freeswan/"> をご覧ください. <!-- <ITEM> ssh can be used to construct a VPN. See the VPN mini-howto for more information. --> <ITEM> ssh を使って VPN を構築することができます. 詳しくは VPN mini-howto をご覧ください. <!-- <ITEM> vps (virtual private server) at <htmlurl url="http://www.strongcrypto.com" name="http://www.strongcrypto.com">. --> <ITEM> vps (virtual private server). <htmlurl url="http://www.strongcrypto.com" name="http://www.strongcrypto.com"> をご覧ください. </ITEMIZE> <P> <!-- See also the section on IPSEC for pointers and more information. --> 情報ポインタや詳しい情報については, IPSEC の章もご覧ください. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Security Preparation (before you go on-line)<label id="secure-prep"> --> <SECT> セキュリティの準備 (ネットワークに接続する前に)<label id="secure-prep"> <P> <!-- Ok, so you have checked over your system, and determined it's as secure as feasible, and you're ready to put it online. There are a few things you should now do in order to prepare for an intrusion, so you can quickly disable the intruder, and get back up and running. --> さて, システムのチェックが終わり, 安全かつ使いやすいものになり, ネット ワークに接続する準備ができました. ここでは, 実際に侵入された場合に備え ての準備のためにすべきことをいくつか挙げます. これを行っておけば, 侵入 者をすぐに追い払い, システムを復旧, 稼働させることができます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> マシン全体のバックアップの作成 <!-- Make a Full Backup of Your Machine --> <p> <!-- Discussion of backup methods and storage is beyond the scope of this document, but here are a few words relating to backups and security: --> バックアップの方法や保存媒体についての議論は本ドキュメントの範囲外です が, バックアップとセキュリティについて簡単に触れておきます: <p> <!-- If you have less than 650mb of data to store on a partition, a CD-R copy of your data is a good way to go (as it's hard to tamper with later, and if stored properly can last a long time). Tapes and other re-writable media should be write-protected as soon as your backup is complete, and then verified to prevent tampering. Make sure you store your backups in a secure off-line area. A good backup will ensure that you have a known good point to restore your system from. --> 1 つのパーティションに入っているデータが 650MB 以下であれば, CD-R にデー タをコピーすると良いでしょう(改竄が困難ですし, きちんと保管すれば長期 間保存できます). テープなどの読み書き可能なメディアは, バックアップが 終わり次第書き込み禁止にし, 改竄できないようにすべきです. バックアップ はオンラインでアクセスできない場所に置きましょう. 良いバックアップを作っ ておけば, 何かあった時にシステムをその時点に復旧させることができます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> 適切なバックアップ計画の決定 <!-- Choosing a Good Backup Schedule --> <P> <!-- A six-tape cycle is easy to maintain. This includes four tapes for during the week, one tape for even Fridays, and one tape for odd Fridays. Perform an incremental backup every day, and a full backup on the appropriate Friday tape. If you make some particularly important changes or add some important data to your system, a full backup might well be in order. --> 6 本のテープを使い回すと管理が楽です. 4 本のテープを平日に使い, 残りの 2 本は 1 本ずつ金曜日に隔週で使います. 毎日インクリメンタルバックアップ を実行し, 金曜日のテープ(適切な方)にはフルバックアップを取ります. 特に重要な変更がシステムにあった場合や, 重要なデータを加えた場合には, バックアップを行うのが適切でしょう. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> RPM ファイルデータベースや Debian のファイルデータベースのバックアップ <!-- Backup Your RPM or Debian File Database --> <P> <!-- In the event of an intrusion, you can use your RPM database like you would use <tt>tripwire</tt>, but only if you can be sure it too hasn't been modified. You should copy the RPM database to a floppy, and keep this copy off-line at all times. The Debian distribution likely has something similar. --> システムに侵入された時に RPM データベースを <tt>tripwire</tt> 代わりに 使うことができますが, これはデータベースが改竄されていないことが確実な 場合だけです. ですから, RPM データベースをフロッピーディスクにコピーし ておき, コンピュータから取り出して保管しておきましょう. Debian ディス トリビューションについても同様です. <P> <!-- The files <tt>/var/lib/rpm/fileindex.rpm</tt> and <tt>/var/lib/rpm/packages.rpm</tt> most likely won't fit on a single floppy. But if compressed, each should fit on a seperate floppy. --> ファイル <tt>/var/lib/rpm/fileindex.rpm</tt> や <tt>/var/lib/rpm/packages.rpm</tt> は大抵フロッピーディスク 1 枚には収まらないでしょう. ですが圧縮すれば別々のフロッピーディスクに収めることができるはずです. <P> <!-- Now, when your system is compromised, you can use the command: --> 仮にシステムに侵入されてしまったときには, 次のコマンドを実行してシステ ムの各ファイルを検査します: <P><tscreen><verb> root# rpm -Va </verb></tscreen> <!-- to verify each file on the system. See the <tt>rpm</tt> man page, as there are a few other options that can be included to make it less verbose. Keep in mind you must also be sure your RPM binary has not been compromised. --> <tt>rpm</tt> のオンラインマニュアルを参照すれば, 出力を少なくするオプ ションに関する説明があります. RPM のバイナリ自体が改竄されていないこと も確認すべきである点は忘れないでください. <P> <!-- This means that every time a new RPM is added to the system, the RPM database will need to be rearchived. You will have to decide the advantages versus drawbacks. --> この方法を使う場合には, 新しい RPM パッケージを追加するごとに RPM デー タベースのバックアップを取らなければなりません. この方法を使うかどうか は利点と欠点を考え合わせて決めてください. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1>Keep Track of Your System Accounting Data<label id="logs"> --> <SECT1> システムログの監視<label id="logs"> <P> <!-- It is very important that the information that comes from <tt>syslog</tt> not be compromised. Making the files in <tt>/var/log</tt> readable and writable by only a limited number of users is a good start. --> <tt>syslog</tt> から得られる情報が改竄されないようにするのはとても重要です. まず, <tt>/var/log</tt> を 特定のユーザしか読み書きできないようにしておきましょう. <P> <!-- Be sure to keep an eye on what gets written there, especially under the <tt>auth</tt> facility. Multiple login failures, for example, can indicate an attempted break-in. --> ログに出力されていること, 特に <tt>auth</tt> の項目には目を通しましょ う. 例えばログイン失敗が続いていると, これは侵入の試みの痕跡かもしれま せん. <P> <!-- Where to look for your log file will depend on your distribution. In a Linux system that conforms to the "Linux Filesystem Standard", such as Red Hat, you will want to look in <tt>/var/log</tt> and check <tt>messages</tt>, <tt>mail.log</tt>, and others. --> ログがどこにあるかは ディストリビューションによって異なります. Red Hat のように "Linux Filesystem Standard" に準拠しているシステムであれば, <tt>/var/log</tt> に <tt>messages</tt> ファイルや <tt>mail.log</tt> 等 があるはずです. <P> <!-- You can find out where your distribution is logging to by looking at your <tt>/etc/syslog.conf</tt> file. This is the file that tells <tt>syslogd</tt> (the system logging daemon) where to log various messages. --> 自分が使っているディストリビューションがどこにログを出力しているのかは, <tt>/etc/syslog.conf</tt> ファイルを見ればわかります. これは <tt>syslogd</tt> (システムのログを取るためのデーモン)に, メッセージの 出力の仕方を指示するファイルです. <P> <!-- You might also want to configure your log-rotating script or daemon to keep logs around longer so you have time to examine them. Take a look at the <tt>logrotate</tt> package on recent Red Hat distributions. Other distributions likely have a similar process. --> ログが長くなり過ぎないようにし, 検査もしやすくするために, ログをローテー トさせるスクリプトやデーモンを設定することもできます. 最近の Red Hat ディ ストリビューションでは <tt>logrotate</tt> パッケージを調べてみましょう. 他のディストリビューションにも同様の仕組みがあるはずです. <P> <!-- If your log files have been tampered with, see if you can determine when the tampering started, and what sort of things appeared to be tampered with. Are there large periods of time that cannot be accounted for? Checking backup tapes (if you have any) for untampered log files is a good idea. --> ログファイルが改竄されてしまっても, いつ, どんな種類の改竄が行われたの かを調べましょう. 長期間記録されていない項目はありませんか? (もしある ならば)バックアップのテープで, 改竄されていないログをチェックすること もできます. <P> <!-- Intruders typically modify log files in order to cover their tracks, but they should still be checked for strange happenings. You may notice the intruder attempting to gain entrance, or exploit a program in order to obtain the root account. You might see log entries before the intruder has time to modify them. --> 侵入の痕跡を消すため, 侵入者は一般的にログファイルを改竄しますが, それでも思わぬところでチェックに引っかかることもあります. 入口を見つけようとしていたり, root 権限を得るためプログラムを不正使用しようとしている 侵入者に気づくかもしれません. 侵入者がログを改竄するより前に, ログを見ましょう. <p> <!-- You should also be sure to separate the <tt>auth</tt> facility from other log data, including attempts to switch users using <tt>su</tt>, login attempts, and other user accounting information. --> <tt>su</tt> によるユーザ変更やログインの試み等のユーザアカウント情報を 含む <tt>auth</tt> の項目は, 他のログから分離すべきでしょう. <P> <!-- If possible, configure <tt>syslog</tt> to send a copy of the most important data to a secure system. This will prevent an intruder from covering his tracks by deleting his login/su/ftp/etc attempts. See the <tt>syslog.conf</tt> man page, and refer to the <tt>@</tt> option. --> 可能ならば, 重要なデータのコピーを安全なシステムに送るように <tt>syslog</tt> を設定しましょう. これにより, login/su/ftp 等の記録を 消して侵入者が足跡を消してしまうことを防げます. <tt>syslog.conf</tt> のオンラインマニュアルの <tt>@</tt> オプションを参照してください. <P> <!-- There are several more advanced <tt>syslogd</tt> programs out there. Take a look at <htmlurl url="http://www.core-sdi.com/ssyslog/" name="http://www.core-sdi.com/ssyslog/"> for Secure Syslog. Secure Syslog allows you to encrypt your syslog entries and make sure no one has tampered with them. --> 高機能版の <tt>syslogd</tt> がいくつかあります. 例えば <htmlurl url="http://www.core-sdi.com/ssyslog/" name="http://www.core-sdi.com/ssyslog/"> にある Secure Syslog をご覧く ださい. Secure Syslog を使うと syslog のエントリを暗号化して誰も改竄で きないようにします. <P> <!-- Another <tt>syslogd</tt> with more features is <htmlurl url="http://www.balabit.hu/products/syslog-ng.html" name="syslog-ng">. It allows you a lot more flexibility in your logging and also can has your remote syslog streams to prevent tampering. --> 別の高機能 <tt>syslogd</tt> としては <htmlurl url="http://www.balabit.hu/products/syslog-ng.html" name="syslog-ng"> があります. これを用いるとログの記録をより柔軟に行うことができ, またリモートの syslog のストリームを改竄できないようにします. <P> <!-- Finally, log files are much less useful when no one is reading them. Take some time out every once in a while to look over your log files, and get a feeling for what they look like on a normal day. Knowing this can help make unusual things stand out. --> 最後になりますが, 誰も読んでいないようなログは役に立ちません. 適当に間 隔を取ってログを読み, いつもはどんな感じであるのかを感覚的に知っておき ましょう. そうしておけば, 異常があった場合にすぐに見つけることができます. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT1> システム更新パッケージの適用 <!-- Apply All New System Updates. --> <P> <!-- Most Linux users install from a CD-ROM. Due to the fast-paced nature of security fixes, new (fixed) programs are always being released. Before you connect your machine to the network, it's a good idea to check with your distribution's ftp site and get all the updated packages since you received your distribution CD-ROM. Many times these packages contain important security fixes, so it's a good idea to get them installed. --> ほとんどのユーザは Linux を CD-ROM からインストールします. しかし, セ キュリティのためのシステム修正は速いペースで行われているので, 新しい (修正済みの)プログラムが常にリリースされています. マシンをネットワーク に接続する前には, お使いのディストリビューションの FTP サイトをチェッ クし, インストールに使った CD-ROM より新しいパッケージを全て手に入れま しょう. これらのパッケージにはセキュリティ関連の重要な修正が入っている ことが多いので, これをインストールするのは良い考えです. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> What To Do During and After a Breakin<label id="after-breakin"> --> <SECT> システムに侵入された場合や現在侵入されている場合の対応<label id="after-breakin"> <P> <!-- So you have followed some of the advice here (or elsewhere) and have detected a break-in? The first thing to do is to remain calm. Hasty actions can cause more harm than the attacker would have. --> 本ドキュメント(あるいは他の)のアドバイスに従っていて, システムへの侵入 を発見した場合にはどうすべきでしょうか? まず最初にすべきことは, 平静 を保つことです. あわてて行動すると, 侵入者にやられるよりも悲惨なことに なるかもしれません. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Security Compromise Underway. --> <SECT1> セキュリティが破られている最中 <P> <!-- Spotting a security compromise under way can be a tense undertaking. How you react can have large consequences. --> セキュリティが破られている最中であることに気づくと, 緊張する仕事を強い られることになるでしょう. あなたがどのように対処するかは, 重大な意味を 持ちうるからです. <p> <!-- If the compromise you are seeing is a physical one, odds are you have spotted someone who has broken into your home, office or lab. You should notify your local authorities. In a lab, you might have spotted someone trying to open a case or reboot a machine. Depending on your authority and procedures, you might ask them to stop, or contact your local security people. --> それが物理的な攻撃であるのなら, あなたは家や会社, 研究室に何者か侵入し たことに気づいたということなのでしょう. まずは, このことをその場所の責 任者に知らせるべきです. 研究室ならば, 誰かがケースを開けようとしていた り, マシンをリブートしようとしているのを見つけたのかもしれません. この 場合には, あなたの権限と職務手順に基づいて, 相手を止めるか警備員に連絡 することになるでしょう. <P> <!-- If you have detected a local user trying to compromise your security, the first thing to do is confirm they are in fact who you think they are. Check the site they are logging in from. Is it the site they normally log in from? No? Then use a non-electronic means of getting in touch. For instance, call them on the phone or walk over to their office/house and talk to them. If they agree that they are on, you can ask them to explain what they were doing or tell them to cease doing it. If they are not on, and have no idea what you are talking about, odds are this incident requires further investigation. Look into such incidents , and have lots of information before making any accusations. --> ローカルのユーザがセキュリティを破ろうとしているのを見つけた場合には, まずは本当にその本人なのかどうか確認しましょう. その人がログインしてき ている元のサイトを調べましょう. そのサイトはその人が普段ログインしてく るところですか? 違うのならば, 非ネットワーク的な手段で連絡を取りましょ う. 例えば, その人のオフィスや家に電話したり直接赴いてから話をするので す. その人が自分がやったことを認めたら, 何をしようとしていたのか説明さ せたり, それをやめるように伝えます. 何もしていないとか, 全く身に覚えが 無いと言われた場合には, この事件は更に調査が必要でしょう. 告発を行う前 には, まず事件を調べて多くの情報を集めましょう. <P> <!-- If you have detected a network compromise, the first thing to do (if you are able) is to disconnect your network. If they are connected via modem, unplug the modem cable; if they are connected via Ethernet, unplug the Ethernet cable. This will prevent them from doing any further damage, and they will probably see it as a network problem rather than detection. --> ネットワークでの攻撃を見つけた場合には, まずは(可能ならば)ネットワークへの接続を切り離します. モデム接続ならばモデムケーブルを抜き, イーサネット接続ならばイーサネットケーブルを抜きましょう. これにより, より大きな被害を防ぐことができますし, 相手側にも発見に気づかせず, ネットワークの問題だと思わせることができるかもしれません. <P> <!-- If you are unable to disconnect the network (if you have a busy site, or you do not have physical control of your machines), the next best step is to use something like <tt>tcp_wrappers</tt> or <tt>ipfwadm</tt> to deny access from the intruder's site. --> ネットワーク接続を切り離せない場合(忙しいサイトや, マシンを物理的に操 作できない場合)には, 次善の策として, <tt>tcp_wrappers</tt> や <tt>ipfwadm</tt> のようなツールを使って侵入者のサイトからのアクセスを 拒否しましょう. <P> <!-- If you can't deny all people from the same site as the intruder, locking the user's account will have to do. Note that locking an account is not an easy thing. You have to keep in mind <tt>.rhosts</tt> files, FTP access, and a host of possible backdoors. --> 侵入者と同じサイトのユーザを全て拒否することができない場合は, ユーザアカウントをロックすべきです. ユーザアカウントをロックするのは容易でないことには注意してください. <tt>.rhosts</tt> ファイル, FTP でのアクセス, 裏口になり得るホストには気を付けてください. <P> <!-- After you have done one of the above (disconnected the network, denied access from their site, and/or disabled their account), you need to kill all their user processes and log them off. --> 以上の処置(ネットワークの切断, 攻撃者のサイトからのアクセス拒否, アカ ウントの停止)の後は, これらのユーザのプロセスを全て止め, ログアウトさ せます. <P> <!-- You should monitor your site well for the next few minutes, as the attacker will try to get back in. Perhaps using a different account, and/or from a different network address. --> 攻撃者は戻ってこようとするでしょうから, その後しばらくは自分のサイトを 監視すべきです. おそらく, 別のアカウントや別のネットワークアドレスを使っ てくるでしょう. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Security Compromise has already happened --> <SECT1> 既にセキュリティが破られてしまった場合 <P> <!-- So you have either detected a compromise that has already happened or you have detected it and locked (hopefully) the offending attacker out of your system. Now what? --> 既にシステムに侵入されてしまったことに気づいた場合や, 侵入に気づいて (願わくば)侵入者をシステムから追い出した場合にはどうすればいいでしょう か? <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT2> Closing the Hole --> <SECT2> セキュリティの穴を塞ぐ <P> <!-- If you are able to determine what means the attacker used to get into your system, you should try to close that hole. For instance, perhaps you see several FTP entries just before the user logged in. Disable the FTP service and check and see if there is an updated version, or if any of the lists know of a fix. --> 攻撃者がシステムに侵入した方法を調べることができたら, 今度はその穴を塞 がなければなりません. 例えば, そのユーザがログインする直前にいくつか FTP のエントリがあったとします. その場合には FTP のサービスを停止し, 新しいバージョンのサーバが出ていないか, あるいはセキュリティ関係のメー リングリストに修正方法が投稿されていないかを調べましょう. <P> <!-- Check all your log files, and make a visit to your security lists and pages and see if there are any new common exploits you can fix. You can find Caldera security fixes at <htmlurl url="http://www.caldera.com/tech-ref/security/" name="http://www.caldera.com/tech-ref/security/">. Red Hat has not yet separated their security fixes from bug fixes, but their distribution errata is available at <htmlurl url="http://www.redhat.com/errata" name="http://www.redhat.com/errata"> --> 全てのログファイルを調べ, セキュリティ関係のメーリングリストやウェブペー ジを調べ, 修正可能な新しい一般的な弱点が出ていないか調べます. Caldela のセキュリティ修正は <htmlurl url="http://www.caldera.com/tech-ref/security/" name="http://www.caldera.com/tech-ref/security/"> にあります. Red Hat はまだセキュリティ修正とバグ修正を分離していませんが, ディストリビュー ションの訂正は <htmlurl url="http://www.redhat.com/errata" name="http://www.redhat.com/errata"> にあります. <P> <!-- Debian now has a security mailing list and web page. See: <htmlurl url="http://www.debian.org/security/" name="http://www.debian.org/security/"> for more information. --> Debian にはセキュリティのためのメーリングリストと WWW ページがあります. 詳しくは <htmlurl url="http://www.debian.org/security/" name="http://www.debian.org/security/"> を見てください. <P> <!-- It is very likely that if one vendor has released a security update, that most other Linux vendors will as well. --> あるベンダがセキュリティ更新パッケージをリリースしていれば, ほぼ確実に 他の Linux ベンダもセキュリティ更新パッケージを出しているでしょう. <P> <!-- There is now a Linux security auditing project. They are methodically going through all the user-space utilities and looking for possible security exploits and overflows. From their announcement: --> 現在はセキュリティ監査を行うプロジェクトがあります. このプロジェクトは, ユーザ空間で動作するユーティリティを組織的に全て検査して, セキュリティ的な弱点やオーバーフローの可能性がある部分を探す作業を行っています. このプロジェクトによるアナウンスを以下に引用します: <P> <!-- <quote> "We are attempting a systematic audit of Linux sources with a view to being as secure as OpenBSD. We have already uncovered (and fixed) some problems, but more help is welcome. The list is unmoderated and also a useful resource for general security discussions. The list address is: security-audit@ferret.lmh.ox.ac.uk To subscribe, send a mail to: security-audit-subscribe@ferret.lmh.ox.ac.uk" </quote> --> <quote> 「我々は Linux 関連のソースコードの組織的な監査を行って OpenBSD と同じ くらい安全にしようとしています. 我々は既にいくつかの問題を明らかにして (そして修正して)いますが, まだまだ助力が必要です. このメーリングリスト は誰でも投稿できますし, セキュリティ関連の一般的な議論にも役立つリソー スです. このメーリングリストのアドレスは security-audit@ferret.lmh.ox.ac.uk です. 購読するには security-audit-subscribe@ferret.lmh.ox.ac.uk 宛に空メールを送ってくだ さい」 </quote> <P> <!-- If you don't lock the attacker out, they will likely be back. Not just back on your machine, but back somewhere on your network. If they were running a packet sniffer, odds are good they have access to other local machines. --> 攻撃者を締め出さなければ, 彼らはまた戻ってくるでしょう. あなたのマシン に戻ってくるだけでなく, 同じ LAN にある他のマシンにも来るかもしれませ ん. 彼らがパケット盗聴プログラムを実行していたら, 大抵, 他のマシンにも アクセスできるようになっていることでしょう. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT2> Assessing the Damage --> <SECT2> 被害の見積り <P> <!-- The first thing is to assess the damage. What has been compromised? If you are running an integrity checker like <tt>Tripwire</tt>, you can use it to perform an integrity check; it should help to tell you what has been compromised. If not, you will have to look around at all your important data. --> まず被害の見積りを行います. 何が壊されたのでしょうか? <tt>Tripwire</tt> のようなシステムの完全性をチェックするプログラムを 実行していれば, なにがやられたのか調べる助けとなるはずです. さもなくば, 重要なデータを全て個別に確認しなければならないでしょう. <P> <!-- Since Linux systems are getting easier and easier to install, you might consider saving your config files, wiping your disk(s), reinstalling, then restoring your user files and your config files from backups. This will ensure that you have a new, clean system. If you have to restore files from the compromised system, be especially cautious of any binaries that you restore, as they may be Trojan horses placed there by the intruder. --> 最近は Linux のシステムのインストールが簡単になったので, 設定ファイルを保存しておいてからディスクをフォーマットし直し, 再インストール, ユーザのファイルと設定ファイルを書き戻すという手順を考えてみてもよいでしょう. こうすれば, 新しくてきれいなシステムであることを保証できます. 破られたシステムからファイルのバックアップを行わなければならない場合は, バイナリを書き戻す時には特に注意しましょう. 侵入者がトロイの木馬を置いているかもしれないからです. <P> <!-- Re-installation should be considered mandatory upon an intruder obtaining root access. Additionally, you'd like to keep any evidence there is, so having a spare disk in the safe may make sense. --> 侵入者に root 権限を奪われた場合には, 再インストールも必須だと考えてく ださい. 加えて, 証拠を残しておきたいと思うでしょうから, 予備のディスク を金庫に保管しておくことも無駄ではないかもしれません. <P> <!-- Then you have to worry about how long ago the compromise happened, and whether the backups hold any damaged work. More on backups later. --> その後は, どれだけ前にやられたのか, そして壊された成果はバックアップに 入っているのかどうかを心配しなければなりません. できるだけ新しいバック アップを使いましょう. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT2> Backups, Backups, Backups! --> <SECT2> バックアップ, バックアップ, バックアップ! <P> <!-- Having regular backups is a godsend for security matters. If your system is compromised, you can restore the data you need from backups. Of course, some data is valuable to the attacker too, and they will not only destroy it, they will steal it and have their own copies; but at least you will still have the data. --> セキュリティの問題において, 定期的なバックアップは大変貴重なものです. システムが破壊された場合, 必要なデータをバックアップから書き戻すことが できます. もちろん攻撃者にとって価値のあるデータもありますから, 彼らは データを破壊するだけでなく, 盗んでしまうかもしれません. それでも最低限 こちら側にデータだけは残ります. <P> <!-- You should check several backups back into the past before restoring a file that has been tampered with. The intruder could have compromised your files long ago, and you could have made many successful backups of the compromised file! --> 改竄されたファイルをバックアップから書き戻す前には, 過去に亙って複数のバックアップを必ず調べましょう. 侵入者がずっと前からファイルを壊しているかもしれないし, 壊されたファイルの正しいバックアップを取っているかもしれません! <P> <!-- Of course, there are also a raft of security concerns with backups. Make sure you are storing them in a secure place. Know who has access to them. (If an attacker can get your backups, they can have access to all your data without you ever knowing it.) --> もちろん, バックアップにまつわるセキュリティの問題もたくさんあります. バックアップは安全な場所に保管しましょう. 誰がバックアップに触れるのか を知っておきましょう. (もし攻撃者がバックアップを手に入れてしまったら, 知らないうちにあなたの持つ全てのデータにアクセスされてしまいます. ) <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT2> Tracking Down the Intruder. --> <SECT2> 侵入者を突き止める <P> <!-- Ok, you have locked the intruder out, and recovered your system, but you're not quite done yet. While it is unlikely that most intruders will ever be caught, you should report the attack. --> さて, 侵入者を締め出して, システムを復旧させましたが, まだ全ては終わっ ていません. 侵入者が捕まることはまずありませんが, 攻撃を受けたことは報 告しておくべきです. <P> <!-- You should report the attack to the admin contact at the site from which the attacker attacked your system. You can look up this contact with <tt>whois</tt> or the Internic database. You might send them an email with all applicable log entries and dates and times. If you spotted anything else distinctive about your intruder, you might mention that too. After sending the email, you should (if you are so inclined) follow up with a phone call. If that admin in turn spots your attacker, they might be able to talk to the admin of the site where they are coming from and so on. --> あなたのシステムに攻撃を行った攻撃者のサイトの管理者の連絡先に, 攻撃を受けたことを報告しましょう. この連絡先は <tt>whois</tt> コマンドか, InterNIC のデータベースで調べることができます. 適切なログのエントリと日時を相手にメールで送りましょう. 他にもわかっている侵入者の特徴があれば, それも知らせましょう. メールを送った後に (気になるなら) 電話をすべきです. その管理者があなたのサイトへの攻撃者に気づいたら, 今度はこの管理者が, 攻撃者がやってきているサイトの管理者に話ができるかもしれません. <P> <!-- Good crackers often use many intermediate systems, some (or many) of which may not even know they have been compromised. Trying to track a cracker back to their home system can be difficult. Being polite to the admins you talk to can go a long way to getting help from them. --> 腕の立つクラッカーは, クラックしたシステムを間にいくつか挟んで攻撃して くることがよくあります. その経路には自分達がシステムを破られたことさえ 知らないサイトも(たくさん)あります. ですから, クラッカーの本拠地を追跡 して突き止めることは困難です. 話をした管理者が役に立たなくても, その辺 りの配慮をしてあげましょう. <P> <!-- You should also notify any security organizations you are a part of (<url url="http://www.cert.org/" name="CERT"> or similar), as well as your Linux system vendor. --> また, 自分が所属しているセキュリティ関連団体(<url url="http://www.cert.org/" name="CERT"> 等)や, お使いの Linux システム のベンダにも報告すべきです. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Security Sources<label id="sources"> --> <SECT> セキュリティ関係の情報源<label id="sources"> <P> <!-- There are a LOT of good sites out there for Unix security in general and Linux security specifically. It's very important to subscribe to one (or more) of the security mailing lists and keep current on security fixes. Most of these lists are very low volume, and very informative. --> UNIX 一般のセキュリティと Linux 特定のセキュリティのいずれについても, 良いサイトが<em>たくさん</em>あります. セキュリティに関するメーリング リストを 1 つ(あるいはそれ以上)購読し, セキュリティに関する修正を常に 最新の状態にしておくことが重要です. 以下に挙げるリストは量こそ少ないで すが, とても有益なものです. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <sect1> FTP Sites<label id="ftpsites"> --> <SECT1> FTP サイト<label id="ftpsites"> <P> <!-- CERT is the Computer Emergency Response Team. They often send out alerts of current attacks and fixes. See <htmlurl url="ftp://ftp.cert.org" name="ftp://ftp.cert.org"> for more information. --> CERT は Computer Emergency Response Team の略です. CERT は最新の攻撃や その対処についての警告を発行しています. 詳しくは <htmlurl url="ftp://ftp.cert.org" name="cert.org"> を見てください. <P> <!-- ZEDZ (formerly Replay) (<htmlurl url="http://www.zedz.net" name="http://www.zedz.net">) has archives of many security programs. Since they are outside the US, they don't need to obey US crypto restrictions. --> ZEDZ (元は Replay と呼ばれていました) (<htmlurl url="http://www.zedz.net" name="http://www.zedz.net">) にはセキュリティ関連プログラムの大きなアーカイブがあります. このサイトはアメリカ合衆国国内にはありませんので, アメリカの馬鹿げた暗号規制に従う必要はありません. <P> <!-- Matt Blaze is the author of CFS and a great security advocate. Matt's archive is available at <url url="ftp://ftp.research.att.com/pub/mab" name="ftp://ftp.research.att.com/pub/mab"> --> Matt Blaze 氏は CFS の作者であり, セキュリティの大家です. Matt 氏のアー カイブが <url url="ftp://ftp.research.att.com/pub/mab" name="ftp://ftp.research.att.com/pub/mab"> にあります. <P> <!-- <tt>tue.nl</tt> is a great security FTP site in the Netherlands. <htmlurl url="ftp://ftp.win.tue.nl/pub/security/" name="ftp.win.tue.nl"> --> <tt>tue.nl</tt> はオランダにある大きなセキュリティ関係 FTP サイトです. <htmlurl url="ftp://ftp.win.tue.nl/pub/security/" name="ftp.win.tue.nl"> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Web Sites<label id="websites"> --> <SECT1>ウェブサイト<label id="websites"> <P> <ITEMIZE> <ITEM> <!-- The Hacker FAQ is a FAQ about hackers: <htmlurl url="http://www.solon.com/~seebs/faqs/hacker.html" name="The Hacker FAQ"> --> The Hacker FAQ はハッカーに関する FAQ です: <htmlurl url="http://www.solon.com/~seebs/faqs/hacker.html" name="The Hacker FAQ"> <ITEM> <!-- The COAST archive has a large number of Unix security programs and information: <htmlurl url="http://www.cs.purdue.edu/coast/" name="COAST"> --> COAST アーカイブには UNIX のセキュリティ関連プログラムと情報がたくさん あります: <htmlurl url="http://www.cs.purdue.edu/coast/" name="COAST"> <!-- <ITEM> SuSe Security Page: <htmlurl url="http://www.suse.de/security/" name="http://www.suse.de/security/"> --> <ITEM> SuSe によるセキュリティのページ: <htmlurl url="http://www.suse.de/security/" name="http://www.suse.de/security/"> <ITEM> <!-- Rootshell.com is a great site for seeing what exploits are currently being used by crackers: <htmlurl url="http://www.rootshell.com/" name="http://www.rootshell.com/"> --> Rootshell.com はシステムの問題を知るのに大変役立つサイトで, 現在はクラッ カーにも使われています: <htmlurl url="http://www.rootshell.com/" name="http://www.rootshell.com/"> <ITEM> <!-- BUGTRAQ puts out advisories on security issues: <htmlurl url="http://www.netspace.org/lsv-archive/bugtraq.html" name="BUGTRAQ archives"> --> BUGTRAQ はセキュリティに関する勧告を発行しています: <htmlurl url="http://www.netspace.org/lsv-archive/bugtraq.html" name="BUGTRAQ archives"> <ITEM> <!-- CERT, the Computer Emergency Response Team, puts out advisories on common attacks on Unix platforms: <htmlurl url="http://www.cert.org/" name="CERT home"> --> CERT (the Computer Emergency Response Team) は UNIX に対する一般的な攻撃に関する勧告を発行しています: <htmlurl url="http://www.cert.org/" name="CERT のホームページ"> <P> 訳注: 日本では <htmlurl url="http://www.jpcert.or.jp/" name="JPCERT (コンピュータ緊急対応センター)"> が活動しています. <ITEM> <!-- Dan Farmer is the author of SATAN and many other security tools. His home site has some interesting security survey information, as well as security tools: <htmlurl url="http://www.trouble.org" name="http://www.trouble.org"> --> Dan Farmer 氏は SATAN 等のセキュリティ関連ツールの作者です. 氏のホームペー ジにはセキュリティに関する興味深い調査結果やセキュリティ関連ツールがあ ります: <htmlurl url="http://www.trouble.org" name="Dan Farmers trouble.org"> <ITEM> <!-- The Linux security WWW is a good site for Linux security information: <htmlurl url="http://www.aoy.com/Linux/Security/" name="Linux Security WWW"> --> The linux security WWW は Linux のセキュリティ情報を調べるのに便利なサ イトです: <htmlurl url="http://www.aoy.com/Linux/Security/" name="Linux Security WWW"> <ITEM> <!-- Infilsec has a vulnerability engine that can tell you what vulnerabilities affect a specific platform: <htmlurl url="http://www.infilsec.com/vulnerabilities/" name="http://www.infilsec.com/vulnerabilities/"> --> Infilsec には特定のプラットフォームのセキュリティ的な弱点を調べること ができる検索エンジン(vulnerability engine)があります: <htmlurl url="http://www.infilsec.com/vulnerabilities/" name="http://www.infilsec.com/vulnerabilities/"> <ITEM> <!-- CIAC sends out periodic security bulletins on common exploits: <htmlurl url="http://ciac.llnl.gov/cgi-bin/index/bulletins" name="http://ciac.llnl.gov/cgi-bin/index/bulletins"> --> CIAC は一般的な問題について定期的にセキュリティ bulitin を送ってくれま す: <htmlurl url="http://ciac.llnl.gov/cgi-bin/index/bulletins" name="http://ciac.llnl.gov/cgi-bin/index/bulletins"> <ITEM> <!-- A good starting point for Linux Pluggable Authentication modules can be found at <htmlurl url="http://www.kernel.org/pub/linux/libs/pam/" name="http://www.kernel.org/pub/linux/libs/pam/">. --> Linux Pluggable Authentication Modules(差し替え可能な認証モジュール)の 良い入門が <htmlurl url="http://www.kernel.org/pub/linux/libs/pam/" name="http://www.kernel.org/pub/linux/libs/pam/"> にあります. <ITEM> <!-- The Debian project has a web page for their security fixes and information. It is at <htmlurl url="http://www.debian.org/security/" name="http://www.debian.org/security/">. --> Debian プロジェクトにはセキュリティ関係の修正パッケージと情報を載せた WWW ページがあります (<htmlurl url="http://www.debian.org/security/" name="http://www.debian.org/security/">). <!-- <ITEM> WWW Security FAQ, written by Lincoln Stein, is a great web security reference. Find it at <htmlurl url="http://www.w3.org/Security/Faq/www-security-faq.html" name="http://www.w3.org/Security/Faq/www-security-faq.html"> --> <ITEM> WWW Security FAQ: これは Lincoln Stein 氏が書かれた文書で, WWW のセキュリティに関する素晴らしい参考文献です. <htmlurl url="http://www.w3.org/Security/Faq/www-security-faq.html" name="http://www.w3.org/Security/Faq/www-security-faq.html"> をご覧ください. </ITEMIZE> <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Mailing Lists --> <SECT1>メーリングリスト <P> <!-- Bugtraq: To subscribe to bugtraq, send mail to listserv@netspace.org containing the message body subscribe bugtraq. (see links above for archives). --> Bugtraq: Bugtraq を購読するには, listserv@netspace.org 宛に本文が <verb>subscribe bugtraq</verb> であるメールを送ります. (メーリングリストのアーカイブについては, 前述のリンクを参照してください) <P> <!-- CIAC: Send e-mail to majordomo@tholia.llnl.gov. In the BODY (not subject) of the message put (either or both): <verb>subscribe ciac-bulletin</verb> --> CIAC: majordomo@tholia.llnl.gov 宛に, 本文(サブジェクトではありません)が <verb>subscribe ciac-bulletin</verb> であるメールを送ります. <P> <!-- Red Hat has a number of mailing lists, the most important of which is the redhat-announce list. You can read about security (and other) fixes as soon as they come out. Send email to redhat-announce-list-request@redhat.com with the Subject <verb>Subscribe</verb> See <htmlurl url="http://www.redhat.com/mailing-lists/redhat-announce-list/" name="http://www.redhat.com/mailing-lists/redhat-announce-list/"> for more info and archives. --> Red Hat はたくさんのメーリングリストを運営していますが, その中でも特に重要なのが redhat-announce メーリングリストです. セキュリティ (や, その他) の修正パッケージに関する情報が出るとすぐにここに投稿されます. Subject が <verb>Subscribe</verb> であるメールを redhat-announce-list-request@redhat.com 宛に送ってください. より詳しい情報や記事のアーカイブについては <htmlurl url="http://www.redhat.com/mailing-lists/redhat-announce-list/" name="http://www.redhat.com/mailing-lists/redhat-announce-list/"> をご覧ください. <P> <!-- The Debian project has a security mailing list that covers their security fixes. See <htmlurl url="http://www.debian.org/security/" name="http://www.debian.org/security/"> for more information. --> Debian プロジェクトもセキュリティ更新パッケージを扱うメーリングリスト を運営しています. 詳しくは <htmlurl url="http://www.debian.org/security/" name="http://www.debian.org/security/"> をご覧ください. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT1> Books - Printed Reading Material --> <SECT1>書籍 <P> <!-- There are a number of good security books out there. This section lists a few of them. In addition to the security specific books, security is covered in a number of other books on system administration. --> セキュリティ関係の良書はたくさんあります. この章ではその一部を紹介しま す. セキュリティ専門の本に加え, システム管理の本の多くでもセキュリティ の話題を扱っています. <P> 訳注: これらの本の和訳があればぜひお知らせください. <P> Building Internet Firewalls By D. Brent Chapman & Elizabeth D. Zwicky <P> 1st Edition September 1995 <P> ISBN: 1-56592-124-0 <P> 訳注: 和訳は <P>歌代和正監訳「ファイアウォールの構築 〜インターネットセキュリティ〜」 <P> 株式会社オライリージャパン, 1996 <P> ISBN: 4-900900-03-6 <P> 紹介ページ: http://www.oreilly.co.jp/BOOK/firewall/ <P>です. <P> Practical UNIX & Internet Security, 2nd Edition By Simson Garfinkel & Gene Spafford <P> 2nd Edition April 1996 <P> ISBN: 1-56592-148-8 <P> 訳注: 和訳は <P>山口英監訳「UNIX & インターネットセキュリティ」 <P> 株式会社オライリージャパン, 1998 <P> ISBN: 4-900900-38-9 <P> 紹介ページ: http://www.oreilly.co.jp/BOOK/puis/ <P>です. <P> Computer Security Basics By Deborah Russell & G.T. Gangemi, Sr. <P> 1st Edition July 1991 <P> ISBN: 0-937175-71-4 <P> Linux Network Administrator's Guide By Olaf Kirch <P> 1st Edition January 1995 <P> ISBN: 1-56592-087-2 <P> PGP: Pretty Good Privacy By Simson Garfinkel <P> 1st Edition December 1994 <P> ISBN: 1-56592-098-8 <P> 訳注: 和訳は <P>山本和彦監訳「PGP 暗号メールと電子署名」 <P> 株式会社オライリージャパン, 1996 <P> ISBN: 4-900900-02-8 <P>です. <P> Computer Crime A Crimefighter's Handbook By David Icove, Karl Seger & William VonStorch (Consulting Editor Eugene H. Spafford) <P> 1st Edition August 1995 <P> ISBN: 1-56592-086-4 <P> <P> Linux Security By John S. Flowers <P> New Riders; <P> ISBN: 0735700354 <P> March 1999 <P> <P> Maximum Linux Security : A Hacker's Guide to Protecting Your Linux Server and Network <P> Anonymous <P> Paperback - 829 pages <P> Sams; <P> ISBN: 0672313413 <P> July 1999 <P> 訳注: 和訳は <P>トップスタジオ訳「Linux版 クラッカー迎撃完全ガイド」 <P> 株式会社インプレス, 2000 <P> ISBN: 4844313606 <P>です. <P> Intrusion Detection By Terry Escamilla <P> Paperback - 416 pages (September 1998) <P> John Wiley and Sons; <P> ISBN: 0471290009 <P> <P> Fighting Computer Crime <P> Donn Parker <P> Paperback - 526 pages (September 1998) <P> John Wiley and Sons; <P> ISBN: 0471163783 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <SECT> 用語解説 <!-- Glossary --> <P> <ITEMIZE> <!-- <ITEM><bf>authentication:</bf> The process of knowing that the data received is the same as the data that was sent and that the claimed sender is in fact the actual sender. --> <ITEM><bf>認証(authentication):</bf> 受け取ったデータが 送られたものと同じかどうか調べる過程や, データの送り主が本当に実際に本人であるかどうかを確認すること. <P> <!-- <ITEM><bf>bastion Host:</bf> A computer system that must be highly secured because it is vulnerable to attack, usually because it is exposed to the Internet and is a main point of contact for users of internal networks. It gets its name from the highly fortified projects on the outer walls of medieval castles. Bastions overlook critical areas of defense, usually having strongs walls, room for extra troops, and the occasional useful tub of boiling hot oil for discouraging attackers. --> <ITEM><bf>要塞ホスト(bastion host):</bf>通常はインターネットに接続した り, 内部ネットワークでユーザがアクセスする中心ホスト. 何も備えがないシ ステムは攻撃に対して脆弱であるため, 高度に安全にしなければならない. こ の名前は中世の城砦の外壁の高度な防御工事に由来する. 要塞の監督は守備の 要であり, 通常は頑丈な壁があり, 騎兵隊の詰所があり, 攻撃者を撃退するた めの油や熱湯を入れる桶がある. <P> <!-- <ITEM><bf>buffer overflow:</bf> Common coding style is to never allocate buffers "large enough" and not checking for overflows. When such buffers are overflows, the executing program (daemon or set-uid program) can be tricked in doing some other things. Generally this works by overwriting a function's return address on the stack to point to another location. --> <ITEM><bf>バッファオーバーフロー(buffer overflow):</bf> 通常のプログラ ムの書き方では, 「十分長いバッファ」を確保されず, バッファのオーバーフ ローのチェックも行われないことがある. このようなバッファがオーバーフロー すると, プログラム(デーモンや setuid されたプログラム)を動作中に他の目 的に悪用することが可能である. 一般的に, これはスタック上の関数の戻り先 を他の場所に上書きすることで行われる. <P> <!-- <ITEM><bf>denial of service:</bf> An attack that consumes the resources on your computer for things it was not intended to be doing, thus preventing normal use of your network resources for legitmate purposes. --> <ITEM><bf>サービス妨害攻撃(denial of service):</bf> サービス妨害攻撃は, 攻撃者が本来の目的とは異なる使い方でコンピュータの資源を食い潰し, 通常 のネットワーク資源の利用を妨害する攻撃である. <P> <!-- <ITEM><bf>dual-homed Host:</bf> A general-purpose computer system that has at least two network interfaces. --> <ITEM><bf>dual-homed host:</bf> 少なくとも 2 つのネットワークインタフェー スを持つ, 汎用のコンピュータシステム. <P> <!-- <ITEM><bf>firewall:</bf> A component or set of components that restricts access between a protected network and the Internet, or between other sets of networks. --> <ITEM><bf>防火壁(firewall):</bf> 保護されたネットワークとインターネッ ト間, あるいは異なるネットワーク同士の間のアクセスを制限するコンポーネ ントあるいはコンポーネントの集合. <P> <!-- <ITEM><bf>host:</bf> A computer system attached to a network. --> <ITEM><bf>ホスト(host):</bf> ネットワークに接続されたコンピュータ <P> <!-- <ITEM><bf>IP spoofing:</bf> IP Spoofing is a complex technical attack that is made up of several components. It is a security exploit that works by tricking computers in a trust relationship into thinking that you are someone that you really aren't. There is an extensive paper written by daemon9, route, and infinity in the Volume Seven, Issue Forty-Eight issue of Phrack Magazine. --> <ITEM><bf>IP 詐称(IP spoofing):</bf> IP 詐称は複数の要素からなる, 技術的に複雑な攻撃である. 信頼関係に基づく計算機の利用ををぺてんにかけ, あなたは本当にあなたなのか? という疑心暗鬼に追い込むという セキュリティ攻撃となる. daemon9, route, infinity によって書かれた詳しいペーパーが Phrack Magazine の 第 7 巻, 第 48 号にある. <P> <!-- <ITEM><bf>non-repudiation:</bf> The property of a receiver being able to prove that the sender of some data did in fact send the data even though the sender might later deny ever having sent it. --> <ITEM><bf>否認防止性(non-repudiation):</bf> 送り主がデータを送ったこと を後から否定しようとしても, その送り主が実際にデータを送ったことをデー タを受け取った側が証明できるという性質. <P> <!-- <ITEM><bf>packet:</bf> The fundamental unit of communication on the Internet. --> <ITEM><bf>パケット(packet):</bf> インターネットにおける通信の基本単位. <P> <!-- <ITEM><bf>packet filtering:</bf> The action a device takes to selectively control the flow of data to and from a network. Packet filters allow or block packets, usually while routing them from one network to another (most often from the Internet to an internal network, and vice-versa). To accomplish packet filtering, you set up rules that specify what types of packets (those to or from a particular IP address or port) are to be allowed and what types are to be blocked. --> <ITEM><bf>パケットフィルタリング(packet filtering:)</bf> ネットワーク を出入りするデータの流れを選択的に制御すること. パケットフィルタは, 通 常は外部ネットワークとの間のルーティングの時に, パケットの通行を許可あ るいは禁止する(普通はインターネットと内部ネットワークの間). パケットフィ ルタリングを行うためには, 許可または禁止するパケットの種類(特定の IP あるいはポートで指定)を指定するルールを設定する必要がある. <P> <!-- <ITEM><bf>perimeter network:</bf> A network added between a protected network and an external network, in order to provide an additional layer of security. A perimeter network is sometimes called a DMZ. --> <ITEM><bf>境界ネットワーク(perimeter network):</bf> セキュリティの層を 追加するために, 保護されたネットワークと外部ネットワークとの間に作るネッ トワーク. 境界ネットワークは非武装地帯(DMZ, demilitarized zone)と呼ば れることもある. <P> <!-- <ITEM><bf>proxy server:</bf> A program that deals with external servers on behalf of internal clients. Proxy clients talk to proxy servers, which relay approved client requests to real servers, and relay answers back to clients. --> <ITEM><bf>代理サーバ(proxy server):</bf> 内部クライアントに外部サーバ へアクセスさせるためのプログラム. クライアントは代理サーバにアクセスし, 代理サーバは, クライアントの許可したリクエストを実際のサーバに中継し, その応答をクライアントに中継する. <P> <!-- <ITEM><bf>superuser:</bf> An informal name for <tt>root</tt>. --> <ITEM><bf>ユーパーユーザ(superuser):</bf> <tt>root</tt> の通称. <P> </ITEMIZE> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Frequently Asked Questions<label id="q-and-a"> --> <SECT> よくある質問<label id="q-and-a"> <P> <enum> <!-- <ITEM> Is it more secure to compile driver support directly into the kernel, instead of making it a module? --> <ITEM> ドライバをカーネルに直接組み込むのと, モジュールとして作成する のでは, どちらが安全でしょうか? <P> <!-- Answer: Some people think it is better to disable the ability to load device drivers using modules, because an intruder could load a Trojan module or a module that could affect system security. --> 回答: モジュールを用いたデバイスドライバのロード機能は無効にしておく方 が良いという意見の人もいます. というのも, 侵入者がトロイの木馬を仕込ん だモジュールやシステムのセキュリティに影響を与えるモジュールをロードす るかもしれないからです. <P> <!-- However, in order to load modules, you must be root. The module object files are also only writable by root. This means the intruder would need root access to insert a module. If the intruder gains root access, there are more serious things to worry about than whether he will load a module. --> しかし, モジュールを読み込むためには root にならなくてはなりません. モジュールのオブジェクトファイルを書き換えることができるのも root だけ です. つまり, 侵入者がモジュールを組み込むためには, root 権限が必要で す. 逆に侵入者が root 権限を得てしまったら, モジュールをロードするかど うかということよりも, もっと深刻な事態になります. <P> <!-- Modules are for dynamically loading support for a particular device that may be infrequently used. On server machines, or firewalls for instance, this is very unlikely to happen. For this reason, it would make more sense to compile support directly into the kernel for machines acting as a server. Modules are also slower than support compiled directly in the kernel. --> モジュールはあまり頻繁に使用しない特定デバイスを動的に読み込むための仕 組みです. 例えばサーバマシンや防火壁などでは, こういうことはあまり起こ りません. 従って, サーバとして動かすマシンでは, カーネルに直接ドライバ を組み込む方が良いでしょう. また, モジュールを使うと直接カーネルに組み 込む場合よりも動作が遅くなります. <P> <!-- <ITEM> Why does logging in as root from a remote machine always fail? --> <ITEM> リモートのマシンから root でログインできません. <P> <!-- Answer: See <ref id="root-security" name="Root Security">. This is done intentionally to prevent remote users from attempting to connect via <tt>telnet</tt> to your machine as <tt>root</tt>, which is a serious security vulnerability, because then the root password would be transmitted, in cleartext, across the network. Don't forget: potential intruders have time on their side, and can run automated programs to find your password. --> 回答: <ref id="root-security" name="root のセキュリティ">の章を読みましょう. これはリモートのユーザが <tt>telnet</tt> で <tt>root</tt> としてログインしようとするのを防ぐため, わざとそうしているのです. <tt>root</tt> として <tt>telnet</tt> でログインするのは セキュリティ的に非常に危険なことです. ルートのパスワードが平文のまま (暗号化されずに) ネットワークに送出されてしまうでしょう. 侵入者になる可能性を持った人は常にあなたのそばにいて, パスワードを盗むためのプログラムを自動的に動かしていることを忘れてはなりません. <P> <!-- <ITEM> How do I enable shadow passwords on my Red Hat 4.2 or 5.x Linux --> <item> Red Hat Linux 4.2, 5.x でシャドウパスワードを使うにはどうすれば良いでしょう? <P> <!-- Answer: <P> To enable shadow passwords, run <tt>pwconv</tt> as root, and <tt>/etc/shadow</tt> should now exist, and be used by applications. If you are using RH 4.2 or above, the PAM modules will automatically adapt to the change from using normal <tt>/etc/passwd</tt> to shadow passwords without any other change. <P> Some background: shadow passwords is a mechanism for storing your password in a file other than the normal <tt>/etc/passwd</tt> file. This has several advantages. The first one is that the shadow file, <tt>/etc/shadow</tt>, is only readable by root, unlike <tt>/etc/passwd</tt>, which must remain readable by everyone. The other advantage is that as the administrator, you can enable or disable accounts without everyone knowing the status of other users' accounts. --> 回答: <P> シャドウパスワードを有効にするには, root で <tt>pwconv</tt> を実行します. <tt>/etc/shadow</tt> が存在し, アプリケーションがこれに対応していなければいけません. Red Hat 4.2 以降をご利用なら, 他に変更することなく, PAM モジュールが自動的に 普通の <tt>/etc/passwd</tt> からシャドウパスワードへの移行に追従してくれます. <P> 背景説明: シャドウパスワードは, 標準の <tt>/etc/passwd</tt> ファイル以外の ファイルにパスワードを格納する機構です. これにはいくつかの利点がありま す. 最初の利点は, シャドウファイル <tt>/etc/shadow</tt> は誰でも読めな ければならない <tt>/etc/passwd</tt> ファイルと異なり, root しか読み出 せない点です. 別の利点は, 管理者として, 他のユーザアカウントの状態を誰 にも知らせないまま, アカウントを有効または無効にできることです. <P> <!-- The <tt>/etc/passwd</tt> file is then used to store user and group names, used by programs like <tt>/bin/ls</tt> to map the user ID to the proper username in a directory listing. --> シャドウパスワードを使っていても, ユーザやグループ名の格納には <tt>/etc/passwd</tt> ファイルが使われます. このファイルは, <tt>/bin/ls</tt> 等のプログラムがディレクトリ表示の際にユーザ ID を適 切なユーザ名に変換するために使います. <P> <!-- The <tt>/etc/shadow</tt> file then only contains the username and his/her password, and perhaps accounting information, like when the account expires, etc. --> <tt>/etc/shadow</tt> ファイルには, ユーザ名とパスワードとアカウントの 有効期限などのアカウント情報だけが含まれています. <P> <!-- To enable shadow passwords, run <tt>pwconv</tt> as root, and <tt>/etc/shadow</tt> should now exist, and be used by applications. Since you are using RH 4.2 or above, the PAM modules will automatically adapt to the change from using normal <tt>/etc/passwd</tt> to shadow passwords without any other change. --> シャドウパスワードを有効にするためには, root になって <tt>pwconv</tt> コマンドをを実行します. すると <tt>/etc/shadow</tt> ファイルが作られ, アプリケーションに使われるようになります. Red Hat 4.2 以降では, 通常の <tt>/etc/passwd</tt> ファイルからシャドウパスワードへの変更への適合は PAM モジュールが自動的に行います. 他の変更は全く必要ありません. <P> <!-- Since you're interested in securing your passwords, perhaps you would also be interested in generating good passwords to begin with. For this you can use the <tt>pam_cracklib</tt> module, which is part of PAM. It runs your password against the Crack libraries to help you decide if it is too-easily guessable by password-cracking programs. --> パスワードの安全を考えていれば, たぶんパスワードも最初から良いものを 作ろうと思うでしょう. これを行うために PAM の一部である `pam_cracklib' モジュールが利用できます. これはパスワードに対して Crack ライブラリを適用し, パスワードクラッキングプログラムによって簡単 に推測されないかどうか調べることができます. <P> <!-- <ITEM> How can I enable the Apache SSL extensions? --> <item> Apache の SSL 拡張はどうやって有効にするのですか? <P> <!-- Answer: --> 回答: <P> <!-- <enum> <item>Get SSLeay 0.8.0 or later from <url url="ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL"><P> <item>Build and test and install it!<P> <item>Get Apache 1.2.5 source<P> <item>Get Apache SSLeay extensions from <url url="ftp://ftp.ox.ac.uk/pub/crypto/SSL/apache_1.2.5+ssl_1.13.tar.gz" name="here"><P> <item>Unpack it in the apache-1.2.5 source directory and patch Apache as per the README.<P> <item>Configure and build it.<P> </enum> <P> --> <enum> <item>バージョン 0.8.0 以降の SSLeay を <url url="ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL"> から入手します<P> <item>これをコンパイル, テスト, そしてインストールします<P> <item>Apache 1.2.5 のソースを入手します<P> <url url="ftp://ftp.ox.ac.uk/pub/crypto/SSL/apache_1.2.5+ssl_1.13.tar.gz" name="ここ"> から Apache SSLeay 拡張を入手します<P> <item>これを Apache 1.2.5 のソースディレクトリで展開し, README に従ってパッ チを当てます<P> <item>設定とコンパイルを行います<P> </enum> <P> <!-- You might also try <htmlurl url="http://www.replay.com" name="Replay Associates"> which has many pre-built packages, and is located outside You might also try <htmlurl url="http://www.zedz.net" name="ZEDZ net"> which has many pre-built packages, and is located outside of the United States. of the United States. --> <htmlurl url="http://www.zedz.com" name="ZEDZ net"> から各種バイナリパッケージを入手することもできます. これはアメリカ国外にあります. <P> <!-- <ITEM> How can I manipulate user accounts, and still retain security? --> <item> セキュリティを確保したままで, ユーザアカウントを処理するにはど うすれば良いでしょう? <P> <!-- Answer: The Red Hat distribution, especially RH5.0, contains a great number of tools to change the properties of user accounts. --> 回答: Red Hat ディストリビューション, 特に Red Hat 5.0 には, ユーザアカウントの状態を変更するツールがたくさん入っています. <P> <!-- <ITEMIZE> <ITEM>The <tt>pwconv</tt> and <tt>unpwconv</tt> programs can be used to convert between shadow and non-shadowed passwords. <ITEM>The <tt>pwck</tt> and <tt>grpck</tt> programs can be used to verify proper organization of the <tt>passwd</tt> and <tt>group</tt> files. <ITEM>The <tt>useradd</tt>, <tt>usermod</tt>, and <tt>userdel</tt> programs can be used to add, delete and modify user accounts. The <tt>groupadd</tt>, <tt>groupmod</tt>, and <tt>groupdel</tt> programs will do the same for groups. <ITEM>Group passwords can be created using <tt>gpasswd</tt>. </ITEMIZE> --> <ITEMIZE> <ITEM>シャドウパスワードと非シャドウパスワードを相互変換する <tt>pwconv</tt> と <tt>unpwconv</tt> <ITEM><tt>passwd</tt> ファイルと <tt>group</tt> ファイルの構成が正しい かどうか検査する <tt>pwck</tt> と <tt>grpck</tt> <ITEM>ユーザアカウントの追加, 削除, 変更を行う <tt>useradd</tt>, <tt>usermod</tt>, <tt>userdel</tt>. グループについて同様の作業を行うた めの <tt>groupadd</tt>, <tt>gropumod</tt>, <tt>groupdel</tt> <ITEM>グループにパスワードを設定する <tt>gpasswd</tt> </ITEMIZE> <!-- All these programs are "shadow-aware" — that is, if you enable shadow they will use <tt>/etc/shadow</tt> for password information, otherwise they won't. --> これらのプログラムは全て「シャドウ対応」です. つまり, シャドウパスワー ドが有効であれば, <tt>/etc/shadow</tt> のパスワード情報を参照し, 有効 でなければこのファイルは参照しません. <P> <!-- See the respective man pages for further information. --> 詳しくは, それぞれのコマンドのオンラインマニュアルを参照してください. <P> <!-- <ITEM> How can I password-protect specific HTML documents using Apache? --> <item> Apache で特定の HTML をパスワードで保護するにはどうすればよい でしょうか? <P> <!-- I bet you didn't know about <htmlurl url="http://www.apacheweek.com" name="http://www.apacheweek.org">, did you? --> <htmlurl url="http://www.apacheweek.com" name="http://www.apacheweek.org"> のことをご存じないでしょう? <P> <!-- You can find information on user Authentication at <htmlurl url="http://www.apacheweek.com/features/userauth" name="http://www.apacheweek.com/features/userauth"> as well as other web server security tips from <htmlurl url="http://www.apache.org/docs/misc/security_tips.html" name="http://www.apache.org/docs/misc/security_tips.html"> --> ユーザ認証については, <htmlurl url="http://www.apacheweek.com/features/userauth" name="http://www.apacheweek.com/features/userauth"> に情報がありますし, ウェブサーバに関するその他のヒントも <htmlurl url="http://www.apache.org/docs/misc/security_tips.html" name="http://www.apache.org/docs/misc/security_tips.html"> にあります. </enum> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Conclusion<label id="conclusion"> --> <SECT> まとめ<label id="conclusion"> <P> <!-- By subscribing to the security alert mailing lists, and keeping current, you can do a lot towards securing your machine. If you pay attention to your log files and run something like <tt>tripwire</tt> regularly, you can do even more. --> セキュリティに関する警告が流れるメーリングリストを購読することと, 最新 のソフトウェアを使うことによって, セキュリティを大幅に向上させることが できます. ログファイルに注意を払い, <tt>tripwire</tt> のようなプログラ ムを定期的に実行すればもっと良いでしょう. <P> <!-- A reasonable level of computer security is not difficult to maintain on a home machine. More effort is required on business machines, but Linux can indeed be a secure platform. Due to the nature of Linux development, security fixes often come out much faster than they do on commercial operating systems, making Linux an ideal platform when security is a requirement. --> 家庭のマシンを管理する分には, 十分なレベルのセキュリティも困難ではあり ません. 仕事に使うマシンではかなり努力が必要でしょうが, Linux はかなり 安全なプラットフォームです. Linux の開発の特徴により, セキュリティ関連 の修正が商用の OS よりもずっと早いことが多々あり, このため Linux はセ キュリティが必要な場合には理想的なプラットフォームになっています. <P> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- <SECT> Acknowledgements --> <SECT> 謝辞 <P> <!-- Information here is collected from many sources. Thanks to the following that either indirectly or directly have contributed: --> 本ドキュメントの情報はいろいろな所から集めたものです. 直接・間接的に貢 献してくださった以下の方々に感謝します: <!-- <tscreen> Rob Riggs <htmlurl url="mailto:rob@DevilsThumb.com" name="rob@DevilsThumb.com"> <P> S. Coffin <htmlurl url="mailto:scoffin@netcom.com" name="scoffin@netcom.com"> <P> Viktor Przebinda <htmlurl url="mailto:viktor@CRYSTAL.MATH.ou.edu" name="viktor@CRYSTAL.MATH.ou.edu"> <P> Roelof Osinga <htmlurl url="mailto:roelof@eboa.com" name="roelof@eboa.com"> <P> Kyle Hasselbacher <htmlurl url="mailto:kyle@carefree.quux.soltec.net" name="kyle@carefree.quux.soltc.net"> <P> David S. Jackson <htmlurl url="mailto:dsj@dsj.net" name="dsj@dsj.net"> <P> Todd G. Ruskell <htmlurl url="mailto:ruskell@boulder.nist.gov" name="ruskell@boulder.nist.gov"> <P> Rogier Wolff <htmlurl url="mailto:R.E.Wolff@BitWizard.nl" name="R.E.Wolff@BitWizard.nl"> <P> Antonomasia <htmlurl url="mailto:ant@notatla.demon.co.uk" name="ant@notatla.demon.co.uk"> <P> Nic Bellamy <htmlurl url="mailto:sky@wibble.net" name="sky@wibble.net"> <P> Eric Hanchrow <htmlurl url="mailto:offby1@blarg.net" name="offby1@blarg.net"> <P> Robert J. Berger<htmlurl url="mailto:rberger@ibd.com" name="rberger@ibd.com"> <P> Ulrich Alpers <htmlurl url="mailto:lurchi@cdrom.uni-stuttgart.de" name="lurchi@cdrom.uni-stuttgart.de"> <P> David Noha <htmlurl url="mailto:dave@c-c-s.com" name="dave@c-c-s.com"> <P> Pavel Epifanov. <htmlurl url="mailto:epv@ibm.net" name="epv@ibm.net"> <P> Joe Germuska. <htmlurl url="mailto:joe@germuska.com" name="joe@germuska.com"> <P> Franklin S. Werren <htmlurl url="mailto:fswerren@bagpipes.net" name="fswerren@bagpipes.net"> <P> Paul Rusty Russell <htmlurl url="mailto:Paul.Russell@rustcorp.com.au" name="<Paul.Russell@rustcorp.com.au>"> <P> Christine Gaunt <htmlurl url="mailto:cgaunt@umich.edu" name="<cgaunt@umich.edu>"> <P> lin <htmlurl url="mailto:bhewitt@refmntutl01.afsc.noaa.gov" name="bhewitt@refmntutl01.afsc.noaa.gov"> <P> A. Steinmetz <htmlurl url="mailto:astmail@yahoo.com" name="astmail@yahoo.com"> <P> Jun Morimoto <htmlurl url="mailto:morimoto@xantia.citroen.org" name="morimoto@xantia.citroen.org"> <P> Xiaotian Sun <htmlurl url="mailto:sunx@newton.me.berkeley.edu" name="sunx@newton.me.berkeley.edu"> <P> Eric Hanchrow <htmlurl url="mailto:offby1@blarg.net" name="offby1@blarg.net"> <P> The following have translated this HOWTO into various other languages! <P> A special thank you to all of them for help spreading the Linux word... <P> Polish: Ziemek Borowski <htmlurl url="mailto:ziembor@FAQ-bot.ZiemBor.Waw.PL" name="ziembor@FAQ-bot.ZiemBor.Waw.PL"> <P> Japanese: FUJIWARA Teruyoshi <htmlurl url="mailto:fjwr@mtj.biglobe.ne.jp" name="fjwr@mtj.biglobe.ne.jp"> <P> Indonesian: Tedi Heriyanto <htmlurl url="mailto:22941219@students.ukdw.ac.id" name="22941219@students.ukdw.ac.id"> <P> Korean: Bume Chang <htmlurl url="mailto:Boxcar0001@aol.com" name="Boxcar0001@aol.com"> <P> Spanish: Juan Carlos Fernandez <htmlurl url="mailto:piwiman@visionnetware.com" name="piwiman@visionnetware.com"> <P> Dutch: R. Ekkebus <htmlurl url="mailto:reggy@zeelandnet.nl" name="reggy@zeelandnet.nl"> <P> </tscreen> --> <tscreen> Rob Riggs さん <htmlurl url="mailto:rob@DevilsThumb.com" name="rob@DevilsThumb.com"> <P> S. Coffin さん <htmlurl url="mailto:scoffin@netcom.com" name="scoffin@netcom.com"> <P> Viktor Przebinda さん <htmlurl url="mailto:viktor@CRYSTAL.MATH.ou.edu" name="viktor@CRYSTAL.MATH.ou.edu"> <P> Roelof Osinga さん <htmlurl url="mailto:roelof@eboa.com" name="roelof@eboa.com"> <P> Kyle Hasselbacher さん <htmlurl url="mailto:kyle@carefree.quux.soltec.net" name="kyle@carefree.quux.soltc.net"> <P> David S. Jackson さん <htmlurl url="mailto:dsj@dsj.net" name="dsj@dsj.net"> <P> Todd G. Ruskell さん <htmlurl url="mailto:ruskell@boulder.nist.gov" name="ruskell@boulder.nist.gov"> <P> Rogier Wolff さん <htmlurl url="mailto:R.E.Wolff@BitWizard.nl" name="R.E.Wolff@BitWizard.nl"> <P> Antonomasia さん <htmlurl url="mailto:ant@notatla.demon.co.uk" name="ant@notatla.demon.co.uk"> <P> Nic Bellamy さん <htmlurl url="mailto:sky@wibble.net" name="sky@wibble.net"> <P> Eric Hanchrow さん <htmlurl url="mailto:offby1@blarg.net" name="offby1@blarg.net"> <P> Robert J. Berger さん<htmlurl url="mailto:rberger@ibd.com" name="rberger@ibd.com"> <P> Ulrich Alpers さん <htmlurl url="mailto:lurchi@cdrom.uni-stuttgart.de" name="lurchi@cdrom.uni-stuttgart.de"> <P> David Noha さん <htmlurl url="mailto:dave@c-c-s.com" name="dave@c-c-s.com"> <P> Pavel Epifanov さん <htmlurl url="mailto:epv@ibm.net" name="epv@ibm.net"> <P> Joe Germuska さん <htmlurl url="mailto:joe@germuska.com" name="joe@germuska.com"> <P> Franklin S. Werren さん <htmlurl url="mailto:fswerren@bagpipes.net" name="fswerren@bagpipes.net"> <P> Paul Rusty Russell さん <htmlurl url="mailto:Paul.Russell@rustcorp.com.au" name="<Paul.Russell@rustcorp.com.au>"> <P> Christine Gaunt さん <htmlurl url="mailto:cgaunt@umich.edu" name="<cgaunt@umich.edu>"> <P> lin さん <htmlurl url="mailto:bhewitt@refmntutl01.afsc.noaa.gov" name="bhewitt@refmntutl01.afsc.noaa.gov"> <P> A. Steinmetz さん <htmlurl url="mailto:astmail@yahoo.com" name="astmail@yahoo.com"> <P> 森本 淳さん <morimoto@xantia.citroen.org> <P> Xiaotian Sun さん <htmlurl url="mailto:sunx@newton.me.berkeley.edu" name="sunx@newton.me.berkeley.edu"> <P> Eric Hanchrow さん <htmlurl url="mailto:offby1@blarg.net" name="offby1@blarg.net"> <P> 以下の方々はこの HOWTO を色々な言葉に翻訳してくださいました! <P> Linux の言葉を広める手伝いをしてくださる全ての方々に深く感謝します. <P> ポーランド語: Ziemek Borowski さん <htmlurl url="mailto:ziembor@FAQ-bot.ZiemBor.Waw.PL" name="ziembor@FAQ-bot.ZiemBor.Waw.PL"> <P> 日本語: 藤原輝嘉 <htmlurl url="mailto:fjwr@mtj.biglobe.ne.jp" name="fjwr@mtj.biglobe.ne.jp"> <P> インドネシア語: Tedi Heriyanto さん <htmlurl url="mailto:22941219@students.ukdw.ac.id" name="22941219@students.ukdw.ac.id"> <P> 韓国語: Bume Chang さん <htmlurl url="mailto:Boxcar0001@aol.com" name="Boxcar0001@aol.com"> <P> スペイン語: Juan Carlos Fernandez さん <htmlurl url="mailto:piwiman@visionnetware.com" name="piwiman@visionnetware.com"> <P> オランダ語: R. Ekkebus さん <htmlurl url="mailto:reggy@zeelandnet.nl" name="reggy@zeelandnet.nl"> <P> </tscreen> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> </article>