ARGUS - Auditing Network Activity

提供:MDWiki
移動: 案内, 検索

ARGUS はパケットモニタリング(記録、監査)ツールである。argus-sever と argus-clients に分かれていて、単にログを取るだけなら argus-server 単体でよい。

なお、構造計画研究所という会社が出している不動産分析汎用ツールの「ARGUS」とは無関係だし、ここここも関係ない。このカメラとも無関係である。

他方、ARGUS を載せたアプライアンス機器として SwiftWing Network Appliance - Argus という製品がある。こちらは以下に紹介する ARGUS だ。

目次

インストール

FreeBSD 8.2 release 上での操作を仮定する。入っていない場合は、一緒に cyrus-sasl が入る。

freebsd# cd /usr/ports/net-mgmt/argus3
freebsd# cat distinfo
SHA256 (argus-3.0.4.tar.gz) = ff8582da63ff9fca807505ba7359bc58628b20e827afb93a08f706dd5b86bb52
SIZE (argus-3.0.4.tar.gz) = 476702
freebsd#make
[...]
freebsd# make install
[...]
/bin/mkdir -p /usr/local/share/doc/argus/
install  -o root -g wheel -m 444 /usr/ports/net-mgmt/argus3/work/argus-3.0.4/doc/README /usr/local/share/doc/argus/
install  -o root -g wheel -m 444 /usr/ports/net-mgmt/argus3/work/argus-3.0.4/man/man5/argus.conf.5 /usr/local/man/man5
install  -o root -g wheel -m 444 /usr/ports/net-mgmt/argus3/work/argus-3.0.4/man/man8/argus.8 /usr/local/man/man8
===> Installing rc.d startup script(s)
===>   Compressing manual pages for argus-sasl-3.0.4
===>   Registering installation for argus-sasl-3.0.4
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/sbin/argus

      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/argus

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.qosient.com/argus/
freebsd#

argus の実行パスは、/usr/local/sbin/argus となる。

freebsd# /usr/local/sbin/argus -h
Argus Version 3.0.4
usage: argus [options] [-i interface] [filter-expression]
usage: argus [options]  -r packetfile [filter-expression]

options: -A                   Generate application byte metrics.
         -b                   dump filter compiler output.
         -B <addr[,addr]>     specify bind interface address(s).
         -c <dir>             daemon chroot directory.
         -C                   run in control plane monitoring mode.
         -d                   run Argus in daemon mode.
         -e <value>           specify Argus Identifier <value>.
         -h                   print help.
         -F <conffile>        read configuration from <conffile>.
         -J                   generate packet performance data.
         -M <secs>            set MAR Status Report Time Interval (300s).
         -m                   turn on MAC Layer Reporting.
         -O                   turn off filter optimizer.
         -p                   don't go into promiscuous mode.
         -P <portnum>         enable remote access on <portnum> (561).
         -r <file file ...>   use packet file as data source.
         -R                   generate response time data.
         -s <bytes>           set the packet snaplen size.
         -S <secs>            set FAR Status Report Time Interval (60s).
         -t                   indicate that packetfile is MOAT Tsh format.
         -u <userid>          specify user id for daemon.
         -g <groupid>         specify group id for daemon.
         -U <bytes>           specify the number of user bytes to capture.
         -w <file ["filter"]> write output to <file>, or '-', for stdout,
                              against optional filter expression.
         -X                   reset argus configuration.
         -Z                   generate packet size data.
freebsd#

そして、同じく /usr/ports/net-mgmt/argus3-clients も入れる。入れておかないとログを ASCII 表示したりできない(argus が保存するログデータはバイナリである)。以下のインストールでは、GeoIP ライブラリのサポートを有効にしておいた。

freebsd# cd /usr/ports/net-mgmt/argus3-clients
freebsd# cat distinfo
SHA256 (argus-clients-3.0.4.1.tar.gz) = c56cb81cc9a898f638cacd9973b43fd01e0dcca3b8c7fcaa8b8c5d0456b8b581
SIZE (argus-clients-3.0.4.1.tar.gz) = 2116531
freebsd# make
cd /usr/ports/net-mgmt/argus3-clients && make config;
[...]
cc -O3 -O2 -pipe -fno-strict-aliasing -o ../bin/radump radump.o print-aodv.o print-arp.o print-beep.o print-bfd.o print-bgp.o\
 print-bootp.o print-domain.o print-krb.o print-ldp.o print-l2tp.o print-lmp.o print-msdp.o print-ntp.o print-pim.o print-pptp.o\
 print-snmp.o print-syslog.o print-rip.o print-telnet.o print-tftp.o print-isoclns.o print-ether.o print-timed.o print-radius.o print-rx.o\
 print-smb.o print-stp.o print-isakmp.o print-igmp.o print-dvmrp.o smbutil.o gmpls.o ../lib/argus_parse.a ../lib/argus_common.a\
 ../lib/argus_client.a -lm -lz -L/usr/local/lib -lsasl2  -lpthread  -L/usr/local/lib -lGeoIP
freebsd# make install clean
[...]
===>   Compressing manual pages for argus-clients-sasl-3.0.4.1
===>   Registering installation for argus-clients-sasl-3.0.4.1
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/bin/rasort
/usr/local/bin/rastrip
/usr/local/bin/racount
/usr/local/bin/ratop
/usr/local/bin/ratree
/usr/local/bin/ra
/usr/local/bin/rabins
/usr/local/bin/rastream
/usr/local/bin/rauserdata
/usr/local/bin/ratimerange
/usr/local/bin/rahisto
/usr/local/bin/ralabel
/usr/local/bin/rapath
/usr/local/bin/rasplit
/usr/local/bin/raservices
/usr/local/bin/rapolicy
/usr/local/bin/ratemplate
/usr/local/bin/racluster
/usr/local/bin/ranonymize
/usr/local/bin/rafilteraddr
/usr/local/bin/radump

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.qosient.com/argus/
===>  Cleaning for bison-2.4.3,1
===>  Cleaning for cyrus-sasl-2.1.25
===>  Cleaning for GeoIP-1.4.8_1
===>  Cleaning for argus-clients-sasl-3.0.4.1
freebsd#

使い方

まず、argus サーバを起動する。最初はログの出力場所だけ設定すればよい。

freebsd# /usr/local/sbin/argus -d -w /var/log/argus.log
argus[96071]: 07 Oct 11 10:27:25.160079 started
freebsd#

暫くログを貯めてから、今度は ra を使ってログを ASCII 表示してみる。ログはすぐに貯まるので、フィルターや logrotate を設定しないうちはすぐにサーバを # kill -KILL [id] で止めておく方がよい。

freebsd# /usr/local/bin/ra -r /var/log/argus.log
   10:27:25.661577  e         tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468         2        166   CON
   10:27:25.704647  e         arp       192.168.1.80          who        192.168.1.1               1         60   INT
   10:27:26.251720  e         arp       192.168.1.73          who      192.168.1.100               3        180   INT
   10:27:27.565229  e         udp       192.168.1.51.17500     ->    255.255.255.255.17500         1        150   INT
   10:27:27.567146  e         udp       192.168.1.51.17500     ->      192.168.1.255.17500         1        150   INT
   10:27:28.756746  e         udp fe80::b89a:1a7c:e*.56939     ->          ff02::1:3.5355          2        180   INT
   10:27:28.756836  e         udp       192.168.1.89.55776     ->        224.0.0.252.5355          2        140   INT
   10:27:28.779172  e         udp       192.168.1.80.netbio    ->      192.168.1.255.netbio        3        276   INT
   10:27:29.057335  e         udp       192.168.1.89.netbio    ->      192.168.1.255.netbio        3        276   INT
   10:27:32.248241  e         arp       192.168.1.73          who      192.168.1.100               3        180   INT
   10:27:32.710682  e         udp fe80::7822:cd08:1*.dhcpv6    ->          ff02::1:2.dhcpv6        1        150   INT
   10:27:32.935069  e         tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468        44       4388   CON
   10:27:34.083578  e         arp       192.168.1.80          who      192.168.1.100               3        180   INT
   10:27:36.039883  e         arp       192.168.1.91          who      192.168.1.100               3        180   INT
   10:27:36.988026  e         udp fe80::6cb5:b002:f*.dhcpv6    ->          ff02::1:2.dhcpv6        1        153   INT
   10:27:37.078884  e         udp fe80::f584:ebb5:7*.dhcpv6    ->          ff02::1:2.dhcpv6        3        456   INT
[...]
#freebsd

フィルタを設定していない場合は通信をフックして全てのログを取っているため、ログを ASCII 表示する場合は目当ての通信ログだけフィルタリングする。例えば、ポート番号 22(ssh)のログだけを見たい場合は以下のとおり。

freebsd# /usr/local/bin/ra -r /var/log/argus.log - "port 22"
   10:27:25.661577  e         tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468         2        166   CON
   10:27:32.935069  e         tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468        44       4388   CON
   10:27:37.942999  e         tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468        27       4814   CON
   10:27:45.047192  e r       tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468        39       3720   CON
   10:27:50.263280  e r       tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468        33       3176   CON
   10:27:56.327551  e         tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468         6        560   CON
   10:28:07.303705  e         tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468        70       6960   CON
   10:28:12.487716  e         tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468        20       4034   CON
   10:28:17.574857  e         tcp      192.168.1.182.ssh      <?>       192.168.1.51.44468        46       7166   CON
[...]
freebsd#

argus オプション

SYNOPSIS
       argus [ options ] [ filter expression ]

ふつうはローカルでデーモンとして起動するので、-d は必要。また、設定ファイルは指定する方がよいので、-F "/etc/argus.conf" も使う。ネットワーク・インターフェイスも指定するので、-i "re0" を指定。パケットのパフォーマンスデータを取るときは -J を使う。tcpdump ファイルなどを読み込むときは -r <file> で指定。出力ファイルは、-w "/path/to/file" で指定。その後の "filter expression" は、tcpdump(1) と同じフォーマットを使う。最も簡単には、

freebsd# argus -d -w /var/log/argus.log

でよいが、これだとログがかなり大きくなるので、フィルタリングするほうがよいかもしれない。

ra オプション

SYNOPSIS
       ra [raoptions] [- filter-expression]

単純に読み込むだけであれば、

freebsd# /usr/local/bin/ra -r /var/log/argus.log - "port 22"

リンク

個人用ツール
名前空間
変種
操作
案内
ツールボックス