ナビゲーション
FrontPage
FreeBSD
Linux
Citrix XenServer
VMware ESXi
Unixコマンド
MySQL
PostgreSQL
Windows
CMS/CRM
クラウド
用語
PHPスクリプト
Bashシェルスクリプト
Rubyスクリプト
開発日記
検索
ツールボックス
新しいページの作成
バックアップの表示
外部のリンク元
最近更新したページ
全ページ
ヘルプ
凍結
アップロード
ページ名の変更
最新の40件
2016-08-17
Linux/NagiosQL
Linux/CentOSチューニング
2016-02-23
Linux/ソフトウェアRAID復旧手順
2016-02-18
FreeBSD/DHCP
FreeBSD/squid
2016-02-15
Unixコマンド/file
2016-02-05
FreeBSD/DynaBook
FreeBSD/Linux compatibility
2016-01-21
PHPスクリプト/PEAR DBインストールできない
PHPスクリプト/PEAR DB
2016-01-20
PHP/フレームワーク/Zend Framework
PHP/フレームワーク
FreeBSD/Postfix+amavisd+clamav
2016-01-15
FreeBSD/sl
2015-12-04
Unixコマンド/dig
Unixコマンド/nslookup
Unixコマンド/traceroute
Linux/rsync
FreeBSD/rsync
Unixコマンド/vipw
2015-11-25
Linux/Postfix+MySQL+Postfix AdminによるバーチャルSMTPサーバの構築
Linux/Postfix + postgrey
2015-11-24
Linux/Postfix + amavisd + clamav
2015-05-25
Unixコマンド/ifconfig
2015-05-23
Unixコマンド/netstat
Unixコマンド/route
Unixコマンド/lsof
Unixコマンド/disown
Unixコマンド/time
Unixコマンド/crontab
2015-05-22
Unixコマンド/nohup
Unixコマンド/fgとbg
Unixコマンド/nice
Unixコマンド/kill
Unixコマンド/jobs
Unixコマンド/restor
Unixコマンド/dump
Unixコマンド/uncompress
Unixコマンド/compress
Unixコマンド/zcat
total:
1909
today:
1
yesterday:
0
now:
2
本文
ノート
?
編集
差分
一覧
FreeBSD/swatch の編集
*swatch [#jcadc0b0] ログの自動監視ツール #contents **インストール [#tb989a57] # cd /usr/ports/security/swatch # make install clean **/etc/rc.conf[#x1ae37db] # swatch swatch_enable="YES" swatch_rules="1" swatch_1_flags="--config-file=/usr/local/etc/swatch1.conf --awk-field-syntax --tail-file=/var/log/messages --daemon --pid-file=/var/run/swatch_1.pid" swatch_1_pidfile="/var/run/swatch_1.pid" **swatchオプション [#o2fa4606] --awk-field-syntax $0や$1の変数が使えるようになります。 **/usr/local/etc/swatch.conf [#r3c00e07] |Action|解説|h |echo [modes]|ウインドウにメッセージを表示| |bell [N]|ビープ音をN回鳴らす| |exec command|”command”を実行する| |mail [address=xxx@xxx.jp:xxx@xx...]|指定したアドレスにメールを送信する| |pipe command [,keep_open]|パイプで”command”に結果を返す| |write [user:user:...]|writeコマンドを使って指定したユーザに通知を行う| |throtte hours:minites:seconds, [use=message or regex]|同じメッセージが検出された場合、指定した時間まで通知を行わない| |continue|指定したパターンを見つけても処理を終了せず、続けて処理を行う| |quit|Swatchを終了させる| **設定ファイルの書式 [#i647acc6] watchfor /パターン/ アクション1 アクション2 …… パターンの後ろにiを付けると、パターンの大文字・小文字を区別しなくなります。(例:/ssh/i) ***最近多いDosアタックを検知するとIPFでアクセス拒否にする例 [#e716df90] watchfor /skin\/skin\/skin/ exec "echo '@1 block in quick from $1 to any' | /sbin/ipf -f -" exec "echo $1 Access Stop." **/usr/local/etc/rc.d/swatch.shの編集 [#i01671f6] 初期のシェルでstopをかけると下記のエラーでpidfileを認識してくれません。 # /usr/local/etc/rc.d/swatch.sh stop swatch not running? (check /var/run/swatch_1.pid). ■procnameの個所をコメントアウトすると正常にsotpしてくれます。 # chmod 755 /usr/local/etc/rc.d/swatch.sh # vi /usr/local/etc/rc.d/swatch.sh command=/usr/local/bin/swatch procname=/usr/local/bin/perl ↓ command=/usr/local/bin/swatch #procname=/usr/local/bin/perl
タイムスタンプを変更しない
*swatch [#jcadc0b0] ログの自動監視ツール #contents **インストール [#tb989a57] # cd /usr/ports/security/swatch # make install clean **/etc/rc.conf[#x1ae37db] # swatch swatch_enable="YES" swatch_rules="1" swatch_1_flags="--config-file=/usr/local/etc/swatch1.conf --awk-field-syntax --tail-file=/var/log/messages --daemon --pid-file=/var/run/swatch_1.pid" swatch_1_pidfile="/var/run/swatch_1.pid" **swatchオプション [#o2fa4606] --awk-field-syntax $0や$1の変数が使えるようになります。 **/usr/local/etc/swatch.conf [#r3c00e07] |Action|解説|h |echo [modes]|ウインドウにメッセージを表示| |bell [N]|ビープ音をN回鳴らす| |exec command|”command”を実行する| |mail [address=xxx@xxx.jp:xxx@xx...]|指定したアドレスにメールを送信する| |pipe command [,keep_open]|パイプで”command”に結果を返す| |write [user:user:...]|writeコマンドを使って指定したユーザに通知を行う| |throtte hours:minites:seconds, [use=message or regex]|同じメッセージが検出された場合、指定した時間まで通知を行わない| |continue|指定したパターンを見つけても処理を終了せず、続けて処理を行う| |quit|Swatchを終了させる| **設定ファイルの書式 [#i647acc6] watchfor /パターン/ アクション1 アクション2 …… パターンの後ろにiを付けると、パターンの大文字・小文字を区別しなくなります。(例:/ssh/i) ***最近多いDosアタックを検知するとIPFでアクセス拒否にする例 [#e716df90] watchfor /skin\/skin\/skin/ exec "echo '@1 block in quick from $1 to any' | /sbin/ipf -f -" exec "echo $1 Access Stop." **/usr/local/etc/rc.d/swatch.shの編集 [#i01671f6] 初期のシェルでstopをかけると下記のエラーでpidfileを認識してくれません。 # /usr/local/etc/rc.d/swatch.sh stop swatch not running? (check /var/run/swatch_1.pid). ■procnameの個所をコメントアウトすると正常にsotpしてくれます。 # chmod 755 /usr/local/etc/rc.d/swatch.sh # vi /usr/local/etc/rc.d/swatch.sh command=/usr/local/bin/swatch procname=/usr/local/bin/perl ↓ command=/usr/local/bin/swatch #procname=/usr/local/bin/perl
テキスト整形のルールを表示する
ログインまたはアカウント作成