LoginSignup
7
5

More than 1 year has passed since last update.

GCP(Google Cloud Platform)から謎の高額請求!お問い合わせして請求を取り消してもらったお話!

Last updated at Posted at 2021-08-05

Google Cloud Platformからとんでもない請求が、、、

名称未設定.001.png

え?なんで???

犯人はGoogle MapのGeolocation API

早速全てのプロジェクトを確認してみることに!
すると、あるプロジェクトで異常な回数のGeolocation APIが呼び出されていました。。。

スクリーンショット 2021-08-04 22.44.21.jpg

スクリーンショット 2021-08-04 22.51.45.jpg

10万回以上も呼ばれています!

一応公開されているwebサイトで使ってるAPIでしたが、アクセス数からしてそんなにGeolocation APIが呼ばれる訳がないので「誰かが不正に私のAPIキーを利用しているのでは?」と疑いました:thinking:

GCPのサポートへ連絡!!

スクリーンショット 2021-08-05 13.03.26.jpg

日本語では対応していない時間帯だった?(もしくは元々日本語でのサポートはない?)ので、英語でチャットしました。

チャットの末、「Maps tech teamに繋げる!そこで詳細を詰めよう!」と言われた。

This issue would need to go to our technical support team and we can only transfer inquiries that originated from other teams through email - you can expect a response within 24 hours. Alternatively if you'd like to start a direct chat with our tech team please visit the Cloud Console Support page https://console.developers.google.com/google/maps-apis/support and choose issue type "technical".

スクリーンショット 2021-08-05 12.44.21.jpg
そこからMaps tech teamの人と再び英語でチャットして、より詳細なことを話していく。

スクリーンショット 2021-08-05 12.04.37.jpg

結論としてまだ未解決で、3万円の請求が取り消されるのかも判りません。

今回のチャットで「まずはAPIキーに制限をつける」ことが大事だと言われました:head_bandage:

このチャットでは以下のような形で終了し

I'm following up through email to continue investigating your usage.
I have consulted with the specialists on verifying whether the usage is coming from your IP address or not.
Once the specialists replied, I'll get back to you as soon as I can.

Geolocation APIが私のIP?(私が公開してるサイトのIP?なんのIPのことを言ってるのか、今一分かってない。。。)から呼び出されていたか、専門家が調査してくれるようです。

高額請求を回避するためにやること

もし請求が来るまで気づかず、数十万円という途方もない金額に膨れ上がらないためにできることをご紹介。
GCP(もしくはFirebase)でプロジェクトを作成したら、必ず設定するようにしましょう!:sunglasses:

※ちなみに、GCPでは自動課金のストップ機能はなさそうです。。。つまり「指定金額に達したら勝手に停止」みたいな設定ができない。

まずは予算を設定

APIキーに何かしらの制限をつける

スクリーンショット 2021-08-05 12.43.52.jpg

緑のチェックマークがつくように、APIキーに制限をつけましょう。
Webアプリケーションに対してなら、HTTPリファラーは必ず付けておきましょう!

APIに対して割り当てと使用量上限

スクリーンショット 2021-08-05 14.48.20.jpg

👆これは極端な例ですが、こんな感じで目安となる上限を決めておいてもいいかもです!

追記(請求がキャンセルされました!)

Google Maps Technical Supportとチャットでやり取りをした後、メールで色々と経過報告が来ました。

Our specialists got back and the results say that the IP address you've provided did not match any of the IP address that made the requests. With that said, we can help you adjust the unauthorized charges on your account as we could not identify the source of the requests further.
I'll now transfer you to the billing team to handle the request. Please expect a response within 1-2 days. Thanks!

そして数時間後

I understand that you would like a refund regarding your unwanted usage. I'm happy to help you with this.
I have already sent a request regarding your refund. Rest assured that I will get back to you once I received an update.

請求の取り消しを既に送ったとのこと!やったー!

さらに数時間後

名称未設定.001.png

ほんとに請求が取り消された!!!

謎の高額請求が不正な理由によって引き起こされている場合、とにかく諦めずにGoogleへ問い合わせてみましょう!(こう言う時は自分に多少の英語力があってよかったと心底思う・・・)

本当にAPIキーの不正利用とかが原因であると判明すれば、しっかりと請求は取り消してくれるようです!!:relieved:

👆ここにも返金されたお話があるように、Googleさんは寛大である可能性が高いです:bow_tone1:

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