CiscoWorks Monitoring Center for Security を使用した IDS アラートの E メール通知のスクリプトによる設定

Similar documents
Microsoft Word - Win-Outlook.docx

fx-9860G Manager PLUS_J

はじめに

<4D F736F F D2096C B838B B835E838A F B E92CA926D B838B5F E315

任意の間隔での FTP 画像送信イベントの設定方法 はじめに 本ドキュメントでは AXIS ネットワークカメラ / ビデオエンコーダにおいて任意の間隔で画像を FTP サー バーへ送信するイベントの設定手順を説明します 設定手順手順 1:AXIS ネットワークカメラ / ビデオエンコーダの設定ページ

Symantec AntiVirus の設定

Contents Logging in 3-14 Downloading files from e-ijlp 15 Submitting files on e-ijlp Sending messages to instructors Setting up automatic

アラートの使用

入学検定料支払方法の案内 1. 入学検定料支払い用ページにアクセス ポータルの入学検定料支払いフォームから 入学検定料支払い用 URL の ここをクリック / Click here をクリックしてください クリックを行うと 入学検定料支払い用のページが新たに開かれます ( 検定料支払い用ページは ポ

Upload path ファイル送信先ディレクトリのパスを指定します ホームディレクトリに画像を送信する場合は空白のまま サブディレクトリに画像を送信する場合はディレクトリ名を指定します さらに下位のディレクトリを指定する場合は \ マークを利用します 例 ) ホームディレクトリ以下の camera

Upload path ファイル送信先ディレクトリのパスを指定します ホームディレクトリに画像を送信する場合は空白のまま サブディレクトリに画像を送信する場合はディレクトリ名を指定します さらに下位のディレクトリを指定する場合は \ マークを利用します 例 ) ホームディレクトリ以下の camera

AN 100: ISPを使用するためのガイドライン

Microsoft Word - DUC登録方法.doc

C. S2 X D. E.. (1) X S1 10 S2 X+S1 3 X+S S1S2 X+S1+S2 X S1 X+S S X+S2 X A. S1 2 a. b. c. d. e. 2

NAC(CCA): ACS 5.x 以降を使用した Clean Access Manager での認証の設定

Introduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for

L3 Japanese (90570) 2008

RX600 & RX200シリーズ アプリケーションノート RX用仮想EEPROM

2. Save をクリックします 3. System Options - Network - TCP/IP - Advanced を開き Primary DNS server と Secondary DNS Server に AXIS ネットワークカメラ / ビデオエンコーダが参照できる DNS サ

elemmay09.pub

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble

Microsoft Word - KUINS-Air_W10_ docx

NSR-500 Create DVD Installer Procedures

CUCM と VCS 間のセキュア SIP トランクの設定例

How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

ドライバインストールガイド

How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

syspro-0405.ppt

How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

L1 What Can You Blood Type Tell Us? Part 1 Can you guess/ my blood type? Well,/ you re very serious person/ so/ I think/ your blood type is A. Wow!/ G

注意 : ネットワークカメラの画像を回転させて表示した場合 モーション検知ウインドウは回転しないまま表示されますが 検知ウインドウは被写体に対して 指定した場所通りに動作します モーション検知ウインドウの縦横のサイズは 8 ピクセルで割り切れるサイズに自動調整されます モーション検知ウインドウを作成

LEAP を使用して Cisco ワイヤレス クライアントを認証するための Funk RADIUS の設定

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

エレクトーンのお客様向けiPhone/iPad接続マニュアル

Read the following text messages. Study the names carefully. 次のメッセージを読みましょう 名前をしっかり覚えましょう Dear Jenny, Iʼm Kim Garcia. Iʼm your new classmate. These ar

平成29年度英語力調査結果(中学3年生)の概要

Microsoft Word - D JP.docx

SolarWinds Event Log Forwarder for Windows v

はじめに このドキュメントではftServerに関する障害調査を行う際に 必要となるログ データの取得方法を説明しています ログ データの取得には 初期解析用のデータの取得方法と 詳細な調査を行うときのデータ取得方法があります 特別な理由でOS 側のログが必要となった場合には RHELログの取得につ

What s your name? Help me carry the baggage, please. politeness What s your name? Help me carry the baggage, please. iii

インターネット接続ガイド v110

Microsoft Word - KUINS-Air_W8.1_ docx

国際恋愛で避けるべき7つの失敗と解決策

iPhone/iPad接続マニュアル

TH-47LFX60 / TH-47LFX6N

2 3

電話機のファイル形式

Microsoft Word - PrivateAccess_UM.docx

スケジュールを利用した FTP 画像送信イベントの設定 ( ファームウエア v5.4x 以上 ) はじめに 本ドキュメントでは AXIS ネットワークカメラ / ビデオエンコーダのファームウエアバージョン 5.4x 以降で 指定したスケジュールで画像を FTP サーバへ送信するための設定手順を説明し

Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: Using con

LC304_manual.ai

2

2

How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

Cisco CallManager で SQL クエリーを使用したコール詳細レコードの検索

ユーザ デバイス プロファイル エクス ポートの使用方法

Complex Lab – Operating Systems - Graphical Console

Microsoft Word - 【日本語】JLP様春16_Dorm Information.doc


Microsoft Word - PCM TL-Ed.4.4(特定電気用品適合性検査申込のご案内)

NSR-500 Installation Guide

2

\615L\625\761\621\745\615\750\617\743\623\6075\614\616\615\606.PS

2. 投稿マニュアル.xlsm

ユーザ デバイス プロファイルの ファイル形式

ゲートウェイのファイル形式


1 2 3

eTA案内_ 完成TZ

AtCoder Regular Contest 073 Editorial Kohei Morita(yosupo) A: Shiritori if python3 a, b, c = input().split() if a[len(a)-1] == b[0] and b[len(

PowerPoint Presentation

BS・110度CSデジタルハイビジョンチューナー P-TU1000JS取扱説明書

H8000操作編

2


cocos2d-x #cocos2d-x

19_22_26R9000操作編ブック.indb

137. Tenancy specific information (a) Amount of deposit paid. (insert amount of deposit paid; in the case of a joint tenancy it should be the total am

ISE 2.0: ASA CLI TACACS+ 認証およびコマンド認可の設定例



外部ルート向け Cisco IOS と NXOS 間の OSPF ルーティング ループ/最適でないルーティングの設定例

ip nat outside source list コマンドを使用した設定例

Microsoft Word - j201drills27.doc

ScanFront300/300P セットアップガイド

C H H H C H H H C C CUTION:These telephones are for use in Japan only. They cannot be used in other countries because of differences in voltages, tele

C FGIH C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C

IPM Release 2.6 へのアップグ レード


取説_VE-PV11L(応用編)

SQL Server または MSDE のバージョン、およびサービス パック レベルの確認

2

Actual ESS Adapterの使用について

取説_KX-PW101CL_PW102CW

16_.....E...._.I.v2006

126 学習院大学人文科学論集 ⅩⅩⅡ(2013) 1 2


取説_KX-PW38CL_PW48CL

Transcription:

CiscoWorks Monitoring Center for Security を使用した IDS アラートの E メール通知のスクリプトによる設定 目次 概要前提条件要件使用するコンポーネント表記法電子メール通知の設定手順スクリプト 3.x センサーのスクリプト 4.x センサーのスクリプト 5.x センサーのスクリプト確認トラブルシューティング関連情報 概要 Security Monitor には Event Rule がトリガーされたときに E メール通知を送信する機能があります 各イベントの E メール通知内で使用できる組み込み変数には シグニチャ ID アラートの送信元と宛先などの情報は含まれていません このドキュメントでは Security Monitor を設定して E メール通知メッセージ内にこれらの変数などを含めるために使用できる手順について説明します 前提条件 要件 このドキュメントに関する固有の要件はありません 使用するコンポーネント このドキュメントは 特定のソフトウェアやハードウェアのバージョンに限定されるものではありません ただし ご使用の環境で稼働しているセンサーのバージョンに基づいて 適切な Perl スクリプトを使用してください 表記法

ドキュメント表記の詳細は シスコテクニカルティップスの表記法 を参照してください 電子メール通知の設定手順 電子メール通知を設定するには 次の手順を実行します 注 : 正しい電子メールアドレスに電子メールを送信するため スクリプトの電子メールアドレスを変更してください 1. VPN/Security Management Solution(VMS) サーバの $BASE\CSCOpx\MDC\etc\ids\scripts ディレクトリに 次のスクリプトのいずれかをコピーします これにより プロセスの後半でイベントルールを定義するときにそのスクリプトを選択できます emailalert.pl としてスクリプトを保存します 注 : 別の名前を使用する場合は 次の手順で定義する Event Rule でその名前を参照してください バージョン 3.x センサーの場合は 3.x センサーのスクリプトを使用します バージョン 4.x センサーの場合は 4.x センサーのスクリプトを使用します バージョン 5.x センサーの場合は 5.x センサーのスクリプトを使用します センサーのバージョンが混在している場合は すべてが同じバージョンレベルになるようにアップグレードすることを推奨します これは 一度にいずれか 1 つのスクリプトしか実行できないためです 2. スクリプトには 各部分を説明するコメントと必要な入力が含まれています 特に $EmailRcpt 変数 ( ファイルの先頭近く ) は アラートを受信する人の電子メールアドレスに変更します 3. Security Monitor 内に 新しい Perl スクリプトを呼び出す Event Rule を定義します Security Monitor のメインページで [Admin] > [Event Rules] を選択して新しいイベントを追加します 4. [Specify the Event Filter] ウィンドウで 電子メールアラートをトリガーするフィルタを追加します 次の例では [Severity] が [High] のアラートで電子メールが送信されます 5. [Choose the Action] ウィンドウで [Execute a Script] チェックボックスをオンにして ドロップダウンボックスからスクリプト名を選択します 6. 次に示すように [Arguments] フィールドに "${Query" と入力します 注 : 次の図のように 二重引用符を含めて正確に入力する必要があります 大文字と小文字も区別されます 7. イベントフィルタに定義したアラート ( この例では 高重大度のアラート ) を受信すると emailalert.pl というスクリプトが ${Query の引数で呼び出されます これにはアラートに関する詳細情報が含まれます スクリプトは個々のフィールドをすべて解析し Blat と呼ばれるプログラムを使用してエンドユーザに電子メールを送信します 8. Blat とは バッチファイルまたは Perl スクリプトから電子メールを送信するために Windows システムで使用されているフリーウェアの電子メールプログラムです これは VMS インストールの一部として $BASE\CSCOpx\bin ディレクトリに含まれています パスの設定を確認するには VMS サーバでコマンドプロンプトウィンドウを開いて blat と入力します File not found エラーが表示される場合は blat.exe ファイルを winnt\system32 ディレクトリにコピーするか ファイルを検索して ファイルが格納されたディレクトリで開きます Blat をインストールするには 次を実行します blat -install <SMTP server address> <source email address> このプログラムがインストールされたら完了です スクリプト

以下は 設定手順のステップ 1 で指定されているスクリプトです 3.x センサーのスクリプト 4.x センサーのスクリプト 5.x センサーのスクリプト 3.x センサーのスクリプト バージョン 3.x センサーにはこのスクリプトを使用します 3.x センサー!/usr/bin/perl ******************************************************* **************** FILE NAME : emailalert.pl DESCRIPTION : This file is a perl script that will be executed as an action when an IDS-MC Event Rule triggers, and will send an email to $EmailRcpt with additional alert parameters (similar to the functionality available with CSPM notifications) NOTE: this script only works with 3.x sensors, alarms from 4.0 sensors are stored differently and cannot be represented in a similar format. NOTE: check the "system" command in the script for the correct format depending on whether you're using IDSMC/SecMon v1.0 or v1.1, you may need the "-on" commandline option. NOTE : This script takes the ${Query keyword from the triggered rule, extracts the set of alarms that caused the rule to trigger. It then reads the last alarm of this set, parses the individual alarm fields, and calls the legacy script with the same set of command line arguments as CSPM. The calling sequence of this script must be of the form: emailalert.pl "${Query" Where: "${Query" - this is the query keyword dynamically output by the rule when it triggers.

It MUST be wrapped in double quotes when specifying it in the Arguments box on the Rule Actions panel. ******************************************************* **************** The following are the only two variables that need changing. $TempIDSFile can be any filename (doesn't have to exist), just make sure the directory that you specify exists. Make sure to use 2 backslashes for each directory, the first backslash is so the Perl interpretor doesn't error on the pathname. $EmailRcpt is the person that is going to receive the email notifications. Also make sure you escape the @ symbol by putting a backslash in front of it, otherwise you'll get a Perl syntax error. $TempIDSFile = "c:\\temp\\idsalert.txt"; $EmailRcpt = "nobody\@cisco.com"; pull out command line arg $whereclause = $ARGV[0]; extract all the alarms matching search expression $tmpfile = "alarms.out"; The following line will extract alarms from 1.0 IDSMC/SecMon database, if using 1.1 comment out the line below and un-comment the other system line below it. V1.0 IDSMC/SecMon version system("idsalarms -s\"$whereclause\" -f\"$tmpfile\""); V1.1 IDSMC/SecMon version. system("idsalarms -on -s\"$whereclause\" - f\"$tmpfile\""); open matching alarm output if (!open(alarm_file, $tmpfile)) { print "Could not open ", $tmpfile, "\n"; exit -1; read to last line while (<ALARM_FILE>) { $line = $_;

clean up close(alarm_file); unlink($tmpfile); split last line into fields @fields = split(/,/, $line); $eventtype = @fields[0]; $recordid = @fields[1]; $gmttimestamp = 0; need gmt time_t $localtimestamp = 0; need local time_t $localdate = @fields[4]; $localtime = @fields[5]; $appid = @fields[6]; $hostid = @fields[7]; $orgid = @fields[8]; $srcdirection = @fields[9]; $destdirection = @fields[10]; $severity = @fields[11]; $sigid = @fields[12]; $subsigid = @fields[13]; $protocol = "TCP/IP"; $srcaddr = @fields[15]; $destaddr = @fields[16]; $srcport = @fields[17]; $destport = @fields[18]; $routeraddr = @fields[19]; $contextstring = @fields[20]; Open temp file to write alert data into, open(out,">$tempidsfile") warn "Unable to open output file!\n"; Now write your email notification message. You're writing the following into the temporary file for the moment, but this will then be emailed. Use the format: print (OUT "Your text with any variable name from the list above \n"); Again, make sure you escape special characters with a backslash (note the : in between $sigid and $subsigid has a backslash in front of it) print(out "\n"); print(out "Received severity $severity alert at $localdate $localtime\n"); print(out "Signature ID $sigid\:$subsigid from $srcaddr to $destaddr\n"); print(out "$contextstring"); close(out); then call "blat" to send contents of that file in the body of an email message. Blat is a freeware email program for WinNT/95, it comes with VMS in the

$BASE\CSCOpx\bin directory, make sure you install it first by running: blat -install <SMTP server address> <source email address> For more help on blat, just type "blat" at the command prompt on your VMS system (make sure it's in your path (feel free to move the executable to c:\winnt\system32 BEFORE you run the install, that'll make sure your system can always find it). system ("blat \"$TempIDSFile\" -t \"$EmailRcpt\" -s \"Received IDS alert\""); 4.x センサーのスクリプト バージョン 4.x センサーにはこのスクリプトを使用します 4.x センサー!/usr/bin/perluse Time::Local;******************************************* **************************** FILE NAME : emailalert.pl DESCRIPTION : This file is a perl script that will be executed as an action when an IDS-MC Event Rule triggers, and will send an email to $EmailRcpt with additional alert parameters (similar to the functionality available with CSPM notifications) NOTE: this script only works with 4.x sensors. It will not work with 3.x sensors. NOTES : This script takes the ${Query keyword from the triggered rule, extracts the set of alarms that caused the rule to trigger. It then reads the last alarm of this set, parses the individual alarm fields, and calls the legacy script with the same set of command line arguments as CSPM. The calling sequence of this script must be of the form: emailalert.pl "${Query" Where: "${Query" - this is the query keyword dynamically output by the rule when it triggers. It MUST be wrapped in double quotes when specifying it in the Arguments box on the Rule Actions panel. *******************************************************

**************** The following are the only two variables that need changing. $TempIDSFile can be any filename (doesn't have to exist), just make sure the directory that you specify exists. Make sure to use 2 backslashes for each directory, the first backslash is so the Perl interpretor doesn't error on the pathname. $EmailRcpt is the person that is going to receive the email notifications. Also make sure you escape the @ symbol by putting a backslash in front of it, otherwise you'll get a Perl syntax error. $TempIDSFile = "c:\\temp\\idsalert.txt"; $EmailRcpt = "yourname\@yourcompany.com"; subroutine to add leading 0's to any date variable that's less than 10. sub add_zero { my ($var) = @_; if ($var < 10) { $var = "0".$var return $var; subroutine to find one or more IP addresses within an XML tag (we can have multiple victims and/or attackers in one alert now). sub find_addresses { my ($var) = @_; my @addresses = (); if (m/$var/) { $raw = $&; while ($raw =~ m/(\d{1,3\.){3\d{1,3/) { push @addresses,$&; $raw = $'; $var = join(', ',@addresses); return $var; pull out command line arg $whereclause = $ARGV[0]; extract all the alarms matching search expression $tmpfile = "alarms.out"; Extract the XML alert/event out of the database. system("idsalarms -s\"$whereclause\" -f\"$tmpfile\""); open matching alarm output if (!open(alarm_file, $tmpfile)) { print "Could not open $tmpfile\n";

exit -1; read to last line while (<ALARM_FILE>) { chomp $_; push @logfile,$_; clean up close(alarm_file); unlink($tmpfile); Open temp file to write alert data into, open(out,">$tempidsfile"); split XML output into fields $oneline = join('',@logfile); $oneline =~ s/\<\/events\>//g; $oneline =~ s/\<\/evalert\>/\<\/evalert\>,/g; @items = split(/,/,$oneline); If you want to see the actual database query result in the email, un-comment out the line below (useful for troubleshooting): print(out "$oneline\n"); Loop until there's no more alerts foreach (@items) { if (m/\<hostid\>(.*)\<\/hostid\>/) { $hostid = $1; if (m/severity="(.*?)"/) { $sev = $1; if (m/zone\=".*"\>(.*)\<\/time\>/) { $t = $1; if ($t =~ m/(.*)(\d{9)/) { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($1); Year is reported from 1900 onwards (eg. 2003 is 103). $year = $year + 1900; Months start at 0 (January = 0, February = 1, etc), so add 1. $mon = $mon + 1; $mon = add_zero ($mon); $mday = add_zero ($mday); $hour = add_zero ($hour); $min = add_zero ($min); $sec = add_zero ($sec);

if (m/signame="(.*?)"/) { $SigName = $1; if (m/sigid="(.*?)"/) { $SigID = $1; if (m/subsigid="(.*?)"/) { $SubSig = $1; $attackerstring = "\<attacker.*\<\/attacker"; if ($attackerstring = find_addresses ($attackerstring)) { $victimstring = "\<victim.*\<\/victim"; if ($victimstring = find_addresses ($victimstring)) { if (m/\<alertdetails\>(.*)\<\/alertdetails\>/) { $AlertDetails = $1; @actions = (); if (m/\<actions\>(.*)\<\/actions\>/) { $rawaction = $1; while ($rawaction =~ m/\<(\w*?)\>(.*?)\</) { $rawaction = $'; if ($2 eq "true") { push @actions,$1; if (@actions) { $actiontaken = join(', ',@actions); else { $actiontaken = "None"; Now write your email notification message. You're writing the following into the temporary file for the moment, but this will then be emailed. Again, make sure you escape special characters with a backslash (note the : between the SigID and the SubSig). Put your VMS servers IP address in the NSDB: line below to get a direct link to the signature details within the email. print(out "\n$hostid reported a $sev severity alert at $hour:$min:$sec on $mon/$mday/$year\n"); print(out "Signature: $SigName \($SigID\:$SubSig\)\n"); print(out "Attacker: $attackerstring ---> Victim: $victimstring\n"); print(out "Alert details: $AlertDetails \n"); print(out "Actions taken: $actiontaken \n"); print(out "NSDB: https\://<your VMS server IP address>/vms/nsdb/html/expsig_$sigid.html\n\n");

print(out "--------------------------------------------- -------\n"); close(out); Now call "blat" to send contents of the file in the body of an email message. Blat is a freeware email program for WinNT/95, it comes with VMS in the $BASE\CSCOpx\bin directory, make sure you install it first by running: blat -install <SMTP server address> <source email address> For more help on blat, just type "blat" at the command prompt on your VMS system (make sure it's in your path (feel free to move the executable to c:\winnt\system32 BEFORE you run the install, that'll make sure your system can always find it). system ("blat \"$TempIDSFile\" -t \"$EmailRcpt\" -s \"Received IDS alert\""); 5.x センサーのスクリプト バージョン 5.x センサーにはこのスクリプトを使用します 5.x センサー!/usr/bin/perl use Time::Local; ******************************************************* **************** FILE NAME : emailalertv5.pl DESCRIPTION : This file is a perl script that will be executed as an action when an IDS-MC Event Rule triggers, and will send an email to $EmailRcpt with additional alert parameters (similar to the functionality available with CSPM notifications) NOTE: this script only works with 5.x sensors. NOTES : This script takes the ${Query keyword from the triggered rule, extracts the set of alarms that caused the rule to trigger. It then reads the last alarm of this set, parses the individual alarm fields, and calls the legacy script with the same

set of command line arguments as CSPM. The calling sequence of this script must be of the form: emailalert.pl "${Query" Where: "${Query" - this is the query keyword dynamically output by the rule when it triggers. It MUST be wrapped in double quotes when specifying it in the Arguments box on the Rule Actions panel. ******************************************************* **************** The following are the only two variables that need changing. $TempIDSFile can be any filename (doesn't have to exist), just make sure the directory that you specify exists. Make sure to use 2 backslashes for each directory, the first backslash is so the Perl interpretor doesn't error on the pathname. $EmailRcpt is the person that is going to receive the email notifications. Also make sure you escape the @ symbol by putting a backslash in front of it, otherwise you'll get a Perl syntax error. $TempIDSFile = "c:\\temp\\idsalert.txt"; $EmailRcpt = "gfullage\@cisco.com"; subroutine to add leading 0's to any date variable that's less than 10. sub add_zero { my ($var) = @_; if ($var < 10) { $var = "0".$var return $var; subroutine to find one or more IP addresses within an XML tag (we can have multiple victims and/or attackers in one alert now). sub find_addresses { my ($var) = @_; my @addresses = (); if (m/$var/) { $raw = $&; while ($raw =~ m/(\d{1,3\.){3\d{1,3/) { push @addresses,$&;

$raw = $'; $var = join(', ',@addresses); return $var; pull out command line arg $whereclause = $ARGV[0]; extract all the alarms matching search expression $tmpfile = "alarms.out"; Extract the XML alert/event out of the database. system("idsalarms -os -s\"$whereclause\" - f\"$tmpfile\""); open matching alarm output if (!open(alarm_file, $tmpfile)) { print "Could not open $tmpfile\n"; exit -1; read to last line while (<ALARM_FILE>) { chomp $_; push @logfile,$_; clean up close(alarm_file); unlink($tmpfile); Open temp file to write alert data into, open(out,">$tempidsfile"); split XML output into fields $oneline = join('',@logfile); $oneline =~ s/\<\/sd\:events\>//g; $oneline =~ s/\<\/sd\:evidsalert\>/\<\/sd\:evidsalert\>,/g; @items = split(/,/,$oneline); If you want to see the actual database query result in the email, un-comment out the line below (useful for troubleshooting): print(out "$oneline\n"); Loop until there's no more alerts foreach (@items) { unless ($_ =~ /\<\/env\:body\>/) { if (m/\<sd\:hostid\>(.*)\<\/sd\:hostid\>/) { $hostid = $1;

if (m/severity="(.*?)"/) { $sev = $1; if (m/zone\=".*"\>(.*)\<\/sd\:time\>/) { $t = $1; if ($t =~ m/(.*)(\d{9)/) { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($1); Year is reported from 1900 onwards (eg. 2003 is 103). $year = $year + 1900; Months start at 0 (January = 0, February = 1, etc), so add 1. $mon = $mon + 1; $mon = add_zero ($mon); $mday = add_zero ($mday); $hour = add_zero ($hour); $min = add_zero ($min); $sec = add_zero ($sec); if (m/description="(.*?)"/) { $SigName = $1; if (m/\ id="(.*?)"/) { $SigID = $1; if (m/\<cid\:subsigid\>(.*)\<\/cid\:subsigid\>/) { $SubSig = $1; if (m/\<cid\:riskratingvalue\>(.*)\<\/cid\:riskratingvalue\ >/) { $RR = $1; if (m/\<cid\:interface\>(.*)\<\/cid\:interface\>/) { $Intf = $1; $attackerstring = "\<sd\:attacker.*\<\/sd\:attacker"; if ($attackerstring = find_addresses ($attackerstring)) { { $victimstring = "\<sd\:target.*\<\/sd\:target"; if ($victimstring = find_addresses ($victimstring)) if (m/\<cid\:alertdetails\>(.*)\<\/cid\:alertdetails\>/) { $AlertDetails = $1;

@actions = (); if (m/\<sd\:actions\>(.*)\<\/sd\:actions\>/) { $rawaction = $1; while ($rawaction =~ m/\<\w*?:(\w*?)\>(.*?)\</) { $rawaction = $'; if ($2 eq "true") { push @actions,$1; if (@actions) { $actiontaken = join(', ',@actions); else { $actiontaken = "None"; Now write your email notification message. You're writing the following into the temporary file for the moment, but this will then be emailed. Again, make sure you escape special characters with a backslash (note the : between the SigID and the SubSig). Put your VMS servers IP address in the NSDB: line below to get a direct link to the signature details within the email. print(out "\n$hostid reported a $sev severity alert at $hour:$min:$sec on $mon/$mday/$year\n"); print(out "Signature: $SigName \($SigID\:$SubSig\)\n"); print(out "Attacker: $attackerstring ---> Victim: $victimstring\n"); print(out "Alert details: $AlertDetails \n"); print(out "Risk Rating: $RR, Interface: $Intf \n"); print(out "Actions taken: $actiontaken \n"); print(out "NSDB: https\://secsrv/vms/nsdb/html/expsig_$sigid.html\n\n"); print(out "----------------------------------------- -----------\n"); close(out); Now call "blat" to send contents of the file in the body of an email message. Blat is a freeware email program for WinNT/95, it comes with VMS in the $BASE\CSCOpx\bin directory, make sure you install it first by running: blat -install <SMTP server address> <source email address> For more help on blat, just type "blat" at the command prompt on your VMS system (make

sure it's in your path (feel free to move the executable to c:\winnt\system32 BEFORE you run the install, that'll make sure your system can always find it). system ("blat \"$TempIDSFile\" -t \"$EmailRcpt\" -s \"Received IDS alert\""); 確認 現在 この設定に使用できる確認手順はありません トラブルシューティング 設定をトラブルシューティングするには 次の手順を実行します 1. Blat が適切に機能することを確認するため コマンドプロンプトから次のコマンドを実行します blat <filename> -t <customer's email> -s "Test message" <filename> は VMS システム上のテキストファイルへのフルパスです 電子メールスクリプトの宛先ユーザが電子メールの本文でこのファイルを受信した場合は Blat が機能しています 2. アラートがトリガーされた後に電子メールが届かない場合は コマンドプロンプトウィンドウから Perl スクリプトを実行してみてください これは Perl またはパスタイプに問題があることを示しています Perl スクリプトを実行するには コマンドプロンプトを開いて次のように入力してください >cd Program Files/CSCOpx/MDC/etc/ids/scripts >emailalert.pl ${Query 次の例のような Sybase のエラーを受信する場合があります これは ${Query パラメータに Security Monitor から情報が渡されるのではなくユーザから渡される場合 実際には情報が含まれていないことが原因です このエラーが発生しなければ スクリプトは正しく動作して電子メールを送信します 電子メールの本文内のアラートパラメータは空白です Perl またはパスのエラーが表示される場合 電子メールを送信するには修正が必要です 関連情報 Cisco Secure Intrusion Prevention のサポートページ テクニカルサポートとドキュメント - Cisco Systems