1
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Google Apps Script発のHTTPリクエストはどのIPアドレスから発信されるのか?

Last updated at Posted at 2021-10-31

動機

  • Google Apps Script (GAS) のスクリプトから、UrlFetchApp を使って外部サイトにリクエストを送ることができる。
  • このリクエストが、どの IP アドレスから発信されているか確認した。
    • より詳しくは、利用しているのが所属機関が契約している Google Workspace for Education なので、契約先に固有の IP アドレスから発信されているのかを知りたかった。

結果

  • GASのスクリプトから発信されるリクエストは {IPアドレス}.gae.googleusercontent.com のようなIPアドレスから来ていた。

    • {IPアドレス} の部分には、IPアドレスが入るスクリプトを実行した Google Apps Engine の 107.178.192.0/18 のサーバIPアドレスが入る模様。例:107.178.192.1.gae.googleusercontent.com
  • というわけで、GASのリクエストの発信元の IPアドレスから、所属機関の Google Workspace 上のスクリプトであることを見分けるのは諦め気味。14ビットのサブネットブロックの限定された範囲内に納まっていてくれれば…などとも思うが、日を措いて再試行してみるしかないかなぁ。

参考

  • Whois に当たったところ、このIPアドレスは ARIN に登録されており、netname は GOOGLE-CLOUD、コメントには "The IP addresses under this netblock are in use by Google Cloud customers" の記載がありました。

  • 自分で書いたスクリプトを固定IPから発信したい場合はこちらの記事 などを参考されたし。

1
5
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
1
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?