CloudArmorのIP制限とGCEのファイアウォールルールで、GCPのロードバランサーのヘルスチェックが失敗する
2019/12/3 追記
別件で同じ構成をしたら、cloudarmorの許可IPになくても成功したので、cloudarmorの箇所は取り消し線しました。
はまったこと
マークダウンで書けるWiki「Growi」をGCP上に構築している最中に、GCPのロードバランサーのヘルスチェックではまったことのメモ。
はまったポイントは2つ。
- GCEのファイアウォールにロードバランサーのIPの許可が必要だったこと
- アクセスを社内限定にしようと、CloudArmorでIP制限をしたら、ロードバランサーの許可が必要になったこと
GCPのCloud Load BalancingのヘルスチェックのIP
GCPのロードバランサーは、下記のIPを使う
- 130.211.0.0/22
- 35.191.0.0/16
参考:https://qiita.com/munaita_/items/26469999c0d4f2ac1df8
公式:https://cloud.google.com/load-balancing/docs/https/
公式からの抜粋
Firewall rules
You must create a firewall rule that allows traffic from 130.211.0.0/22 and 35.191.0.0/16 to reach your instances. These are IP address ranges that the load balancer uses to connect to backend instances. This rule allows traffic from both the load balancer and the health checker. The rule must allow traffic on the port your global forwarding rule has been configured to use, and your health checker should be configured to use the same port. If your health checker uses a different port, then you must create another firewall rule for that port.
GCEのファイアウォールルール
上記のとおり、許可IPに130.211.0.0/22と35.191.0.0/16を加える。
ちなみに、ファイアウォールルールにロードバランサーの名前を入れても許可はされない。
AWSと同じようにロードバランサーの名前で許可できると思うと間違う。
CloudArmorのIP許可
2019/12/3 別件で同じ構成をしたら、cloudarmorの許可IPになくても成功したので、下記内容は取り消し線しました。
CloudArmorで社内のグローバルIP以外をdenyにしたら、ロードバランサーのヘルスチェックが失敗した。
CloudArmor→Cloud Load Balancing→GCEという構造でIPを拒否しているのかと思ったら違う模様。
参考:https://apps-gcp.com/cloudarmor-ip-restriction/
参考:https://qiita.com/ikutaN/items/e29c07413b78ca8c2fb9
公式:https://cloud.google.com/armor/docs/security-policy-concepts
CloudArmorの許可IPに130.211.0.0/22と35.191.0.0/16を加えたらうまくいった。
ただ、ググッても公式でも、
CloudArmorでIP制限しているときに、ロードバランサーのIPを許可に追加するという情報が見つからない。
自分は何か勘違いしているのだろうか。
Author And Source
この問題について(CloudArmorのIP制限とGCEのファイアウォールルールで、GCPのロードバランサーのヘルスチェックが失敗する), 我々は、より多くの情報をここで見つけました https://qiita.com/henatyokotraveler/items/19af048affaa44d94227著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .