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?

【備忘録】EC2インスタンスのインバウンドルールのソースにセキュリティグループを指定した時はパブリックIPで疎通出来ない

Posted at

はじめに

踏み台サーバを作ってWebサーバへのSSHを基本閉じておくことでセキュアにしたい。

問題点

Webサーバ側のインバウンドルールのSSHに踏み台サーバのセキュリティグループを指定した場合、踏み台サーバからWebサーバプライベートIPを指定するとSSH接続が出来るが、パブリックIPを指定するとSSH接続が出来ない。

image.png
↑Webサーバのインバウンドルール

解決のための仮説

Q.EC2インスタンスからパブリックIPに対してSSHすると、インターネットを通った上でSSHすることになっているのでは?
(つまりSSH元IP踏み台サーバのパブリックIPになっているという意味)

1.Webサーバのインバウンドルールに踏み台サーバのパブリックIPからのSSHを許可する
image.png
2.パブリックIPを指定してSSHする
image.png
image.png

通ったため、恐らく仮説は正しかった。

最後に

インバウンドルールにセキュリティグループを指定すると、そのセキュリティグループを持つ EC2インスタンスのローカルIPからの通信(VPC内に閉じた通信) を許可するという意味合いになっていると思います。

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?