0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【AWS】EC2経由でパトライトとの連携について①

Posted at

当社の監視システムでは、各システムに対して障害を検知しましたら、メールにて関係者に通知していますが、夜中で夜間バッチにて障害検知時、メール通知が行われたとしても即時発覚ができない問題点はあります。
従ってメール通知のみならず、パトライトと連携して点灯や警告音等で監視部隊に通知することを決めました。
監視通知メールはどのようにパトライトと連携するかという点についてAWS上で構築したEC2を経由し、パトライトにRSHコマンドを実行し指示を出す方法がありますので、以下の通りまとめて記載しておきます。

■全体構成図

構成図.PNG
ポイントとしては
 ①SES受信機能を利用してメール受信したらイベントをSNSに送り、SNSよりLambda関数を実行させる。
 ②Lambda関数はSystemManagerのRunCommand機能を利用して、EC2内部のシェルを実行する。
 ③EC2はSite-to-Site VPNでパトライトと接続しているので、EC2から実施するRSHコマンドは受け取れ、動作できる
となります。

■Site-to-Site VPN構築

VGW、CGWの作成、
VPCルート追加(192.168.100.0/24へのトラフィックは、VGW経由)、
EC2のセキュリティグループ変更(192.168.100.0/24から許可)
の設定は割愛とさせていただきます。

vpn.png

以下はYAMAHAルーター(RTX810)のConfigです。

qiita.rb
# RTX810 Rev.11.01.19 (Mon Jul 29 15:27:26 2013)
# MAC Address : 00:a0:de:ab:4a:a0, 00:a0:de:ab:4a:a1
# Memory 128Mbytes, 2LAN
# main:  RTX810 ver=00 serial=S3K084888 MAC-Address=00:a0:de:ab:4a:a0 MAC-Address=00:a0:de:ab:4a:a1
# Reporting Date: May 21 15:56:27 2024
ip route default gateway pp 1 filter 500000 gateway pp 1
ip route 10.1.8.0/24 gateway tunnel 1 hide gateway tunnel 2 hide
ip lan1 address 192.168.100.1/24
provider type isdn-terminal
provider filter routing connection
provider lan1 name LAN:
provider lan2 name PPPoE/0/1/5/0/0/0:
pp select 1
 pp name PRV/1/1/5/0/0/0:
 pp keepalive interval 30 retry-interval=30 count=12
 pp always-on on
 pppoe use lan2
 pppoe auto disconnect off
 pp auth accept pap chap
 pp auth myname ********** *
 ppp lcp mru on 1454
 ppp ipcp ipaddress on
 ppp ipcp msext on
 ppp ccp type none
 ip pp address 202.213.149.180/32
 ip pp secure filter in 200003 200020 200021 200022 200023 200024 200025 200030 200032 200080 200081
 ip pp secure filter out 200013 200020 200021 200022 200023 200024 200025 200026 200027 200099 dynamic 200080 200081 200082 200083 200084 200085 200098 200099
 ip pp nat descriptor 1000
 pp enable 1
provider set 1
 provider dns server pp 1 1
 provider select 1
tunnel select 1
 ipsec tunnel 201
  ipsec sa policy 201 1 esp aes-cbc sha-hmac
  ipsec ike duration ipsec-sa 1 3600
  ipsec ike encryption 1 aes-cbc
  ipsec ike group 1 modp1024
  ipsec ike hash 1 sha
  ipsec ike keepalive log 1 off
  ipsec ike keepalive use 1 on heartbeat 10 3
  ipsec ike local address 1 192.168.100.1
  ipsec ike local id 1 192.168.100.0/24
  ipsec ike pfs 1 on
  ipsec ike pre-shared-key 1 *
  ipsec ike remote address 1 3.113.138.62
  ipsec ike remote id 1 10.1.8.0/24
 ipsec tunnel outer df-bit clear
 ip tunnel address 169.254.247.102/30
 ip tunnel remote address 169.254.247.101
 ip tunnel tcp mss limit auto
 tunnel enable 1
tunnel select 2
 ipsec tunnel 202
  ipsec sa policy 202 2 esp aes-cbc sha-hmac
  ipsec ike duration ipsec-sa 2 3600
  ipsec ike encryption 2 aes-cbc
  ipsec ike group 2 modp1024
  ipsec ike hash 2 sha
  ipsec ike keepalive use 2 on dpd 10 3
  ipsec ike local address 2 192.168.100.1
  ipsec ike local id 2 192.168.100.0/24
  ipsec ike pfs 2 on
  ipsec ike pre-shared-key 2 *
  ipsec ike remote address 2 3.114.147.40
  ipsec ike remote id 2 10.1.8.0/24
 ipsec tunnel outer df-bit clear
 ip tunnel address 169.254.215.42/30
 ip tunnel remote address 169.254.215.41
 ip tunnel tcp mss limit 1379
 tunnel enable 2
ip filter 200000 reject 10.0.0.0/8 * * * *
ip filter 200001 reject 172.16.0.0/12 * * * *
ip filter 200002 reject 192.168.0.0/16 * * * *
ip filter 200003 reject 192.168.100.0/24 * * * *
ip filter 200010 reject * 10.0.0.0/8 * * *
ip filter 200011 reject * 172.16.0.0/12 * * *
ip filter 200012 reject * 192.168.0.0/16 * * *
ip filter 200013 reject * 192.168.100.0/24 * * *
ip filter 200020 reject * * udp,tcp 135 *
ip filter 200021 reject * * udp,tcp * 135
ip filter 200022 reject * * udp,tcp netbios_ns-netbios_ssn *
ip filter 200023 reject * * udp,tcp * netbios_ns-netbios_ssn
ip filter 200024 reject * * udp,tcp 445 *
ip filter 200025 reject * * udp,tcp * 445
ip filter 200026 restrict * * tcpfin * www,21,nntp
ip filter 200027 restrict * * tcprst * www,21,nntp
ip filter 200030 pass * 192.168.100.0/24 icmp * *
ip filter 200031 pass * 192.168.100.0/24 established * *
ip filter 200032 pass * 192.168.100.0/24 tcp * ident
ip filter 200033 pass * 192.168.100.0/24 tcp ftpdata *
ip filter 200034 pass * 192.168.100.0/24 tcp,udp * domain
ip filter 200035 pass * 192.168.100.0/24 udp domain *
ip filter 200036 pass * 192.168.100.0/24 udp * ntp
ip filter 200037 pass * 192.168.100.0/24 udp ntp *
ip filter 200080 pass * 192.168.100.1 udp * 500
ip filter 200081 pass * 192.168.100.1 esp * *
ip filter 200098 reject-nolog * * established
ip filter 200099 pass * * * * *
ip filter 500000 restrict * * * * *
ip filter dynamic 200080 * * ftp
ip filter dynamic 200081 * * domain
ip filter dynamic 200082 * * www
ip filter dynamic 200083 * * smtp
ip filter dynamic 200084 * * pop3
ip filter dynamic 200085 * * submission
ip filter dynamic 200098 * * tcp
ip filter dynamic 200099 * * udp
nat descriptor type 1000 masquerade
nat descriptor masquerade static 1000 1 192.168.100.1 udp 500
nat descriptor masquerade static 1000 2 192.168.100.1 esp
ipsec auto refresh on
dhcp service server
dhcp server rfc2131 compliant except remain-silent
dhcp scope 1 192.168.100.2-192.168.100.191/24
dns server pp 1
dns server select 500001 pp 1 any . restrict pp 1
dns private address spoof on
■SES受信設定

事前にドメイン認証済み(お名前.comでCNAME設定しています)

無dd題.png

■SNS設定

Lambda関数をサブスクリプションしている必要

ss.png

パトライトの設定、Lambda関数の作成については次回説明いたします。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?