Product SiteDocumentation Site

10.5. 天才的な、またはパラノイアのアイデア — 何ができるか

This is probably the most unstable and funny section, since I hope that some of the "duh, that sounds crazy" ideas might be realized. The following are just some ideas for increasing security - maybe genius, paranoid, crazy or inspired depending on your point of view.
  • PAM で遊ぶ。 phrack 56 号の PAM についての記事で述べられているように、PAM のよいところは 「何を思いつけるかだけにしか制限されない」ことです。これは本当です。root の ログインが指紋確認または眼底検査または暗号カードでしかできないとしたら どうでしょうか。(なぜここで「かつ」ではなく「または」という接続詞を 使ったのでしょうか?)
  • ファシストのログ。 上でログについて述べたことはすべて「ソフト的な記録」だといえます。本物の記録を 行いたいならば、fanfold paper つきのプリンタを入手し、印刷することによって 何もかもハード的に記録しましょう。ばかげているように聞こえるでしょうが、 これは信頼できますし、削除することができません。
  • CD distribution. This idea is very easy to realize and offers pretty good security. Create a hardened Debian distribution, with proper firewall rules. Turn it into a boot-able ISO image, and burn it on a CDROM. Now you have a read-only distribution, with about 600 MB space for services. Just make sure all data that should get written is done over the network. It is impossible for intruders to get read/write access on this system, and any changes an intruder does make can be disabled with a reboot of the system.
  • モジュール能力を停止する。 カーネルのコンパイル時にカーネルモジュールの使用を停止すると、カーネルベースの 裏口の多くは導入することができなくなります。なぜならその多くは変更された カーネルモジュールをインストールすることにもとづいているからです。
  • シリアルケーブルを通じてのログ (Gaby Schilders さんによって 提供されました)。 サーバにシリアルポートがあるならば、serial-port multiplexer (cyclades または 同様のもの) をそなえた、ネットから切断された専用のログマシンを中央に 置くことを考えましょう。そしてすべてのサーバがシリアルポートへログを出力する ようにしましょう。書きこむだけです。ログマシンはシリアルポートでプレイン テキストだけを入力として受けつけ、それをログファイルに書きこむだけです。 cd または dvd ライタを接続しましょう。ログファイルが 600 MB 近くになったら、 それを cd-rom に書きこみます。ここで cd ライタにオートチェンジャを取りつけ さえすれば... プリンタほどのハードコピーではありませんが、より大容量を 扱えますし、 cd は保管場所をそれほど取りません。
  • Change file attributes using chattr (taken from the Tips-HOWTO, written by Jim Dennis). After a clean install and initial configuration, use the chattr program with the +i attribute to make files unmodifiable (the file cannot be deleted, renamed, linked or written to). Consider setting this attribute on all the files in /bin, /sbin/, /usr/bin, /usr/sbin, /usr/lib and the kernel files in root. You can also make a copy of all files in /etc/, using tar or the like, and mark the archive as immutable.
    これらすべてを行う理由は root としてログインしたときにありえる被害を制限する ためです。迷子のリダイレクト演算子でファイルを上書きすることもありませんし、 rm -fr コマンドにまちがった空白を入れてシステムを使用不能に することもありません (データに多大な被害をもたらすことはできます — しかしライブラリとバイナリはより安全でしょう)。
    これはまたさまざまなセキュリティをもたらし、サービス拒否攻撃を不可能にするか よりむずかしくします (なぜならその多くは 任意のシェルコマンドを提供して いるわけではない SUID されたプログラムの行動によってファイルを上書き することに依存するからです)。
    これによってただひとつ不便になるのはシステムのさまざまなバイナリを構築して make install するときです。一方でこれは make install がファイルを上書きすることも防ぎます。Makefile を 読むのを忘れて上書きされるべきファイル (およびファイルを追加したい ディレクトリ) に chattr -i しないでいると — make は失敗します。 chattr コマンドを使って再度実行しなければなりません。この機会に古いバイナリや ライブラリその他を .old/ ディレクトリに移動させるなり名前を変えるなり tar するなりすることもできます。
    これはシステムのパッケージをアップグレードすることもさまたげることに注意して ください。そのパッケージが提供するファイルを上書きすることはできないので、 apt-get update する直前にすべてのバイナリから immutable flag を はずすしくみがほしくなるかもしれません。
  • Play with UTP cabling in a way that you cut 2 or 4 wires and make the cable one-way traffic only. Then use UDP packets to send information to the destination machine which can act as a secure log server or a credit card storage system.

10.5.1. honeypot を構築する

A honeypot is a system designed to teach system administrators how crackers probe for and exploit a system. It is a system setup with the expectation and goal that the system will be probed, attacked and potentially exploited. By learning the tools and methods employed by the cracker, a system administrator can learn to better protect their own systems and network.
Debian GNU/Linux systems can easily be used to setup a honeynet, if you dedicate the time to implement and monitor it. You can easily setup the fake honeypot server as well as the firewall[66] that controls the honeynet and some sort of network intrusion detector, put it on the Internet, and wait. Do take care that if the system is exploited, you are alerted in time (see 第 4.13 節「ログや警告の重要性」) so that you can take appropriate measures and terminate the compromise when you've seen enough. Here are some of the packages and issues to consider when setting up your honeypot:
  • 必要なファイアウォール技術 (Linux カーネルで提供されます)。
  • syslog-ng, useful for sending logs from the honeypot to a remote syslog server.
  • 外部から honeypot へのネットワークトラフィックをすべてとらえて 攻撃を検知するために snort
  • osh, a SETUID root, security enhanced, restricted shell with logging (see Lance Spitzner's article below).
  • Of course, all the daemons you will be using for your fake server honeypot. Depending on what type of attacker you want to analyse you will or will not harden the honeypot and keep it up to date with security patches.
  • 攻撃後の監査のために完全性チェッカ (第 4.17.3 節「ファイルシステムの完全性を確かめる」を ごらんください) および The Coroner's Toolkit (tct)。
  • honeyd and farpd to setup a honeypot that will listen to connections to unused IP addresses and forward them to scripts simulating live services. Also check out iisemulator.
  • tinyhoneypot to setup a simple honeypot server with fake services.
If you cannot use spare systems to build up the honeypots and the network systems to protect and control it you can use the virtualisation technology available in xen or uml (User-Mode-Linux). If you take this route you will need to patch your kernel with either kernel-patch-xen or kernel-patch-uml.
You can read more about building honeypots in Lanze Spitzner's excellent article http://www.net-security.org/text/articles/spitzner/honeypot.shtml (from the Know your Enemy series). Also, the http://project.honeynet.org/ provides valuable information about building honeypots and auditing the attacks made on them.


[66] You will typically use a bridge firewall so that the firewall itself is not detectable, see 第 B.4 節「Setting up a bridge firewall 」.