[{"data":1,"prerenderedAt":453},["ShallowReactive",2],{"content-/ct-log-bot-and-ai-search":3,"all-pages-for-dir":431,"related-/ct-log-bot-and-ai-search":432,"og-image-/ct-log-bot-and-ai-search":452},{"id":4,"title":5,"body":6,"category":413,"concepts":413,"description":414,"extension":415,"meta":416,"navigation":417,"ogImage":413,"path":418,"project_name":413,"published":419,"publishedAt":420,"seo":421,"source":413,"stem":422,"tags":423,"todo":429,"unpublished":419,"updatedAt":413,"__hash__":430},"pages/2026-05/2026-05-06/ct-log-bot-and-ai-search.md","CT Logとbot対策：AI検索で参照されたいならBot Fight Modeを入れてはいけない",{"type":7,"value":8,"toc":405},"minimark",[9,13,17,27,55,59,62,65,71,74,157,160,163,166,169,176,186,189,197,203,210,315,325,331,342,345,398,401],[10,11,12],"h2",{"id":12},"きっかけ",[14,15,16],"p",{},"「どこにも公開していないのにアクセスが来る」というポストが流れてきた。コメントで「CT Logを監視されているのでは」と書いたら、「まとめがあるといいな」という反応をもらったので、簡単に整理してみた。",[14,18,19,26],{},[20,21,25],"a",{"href":22,"rel":23},"https://note.com/keikomatsu/n/n6b7c2de2d70c",[24],"nofollow","HTTPSを公開すると攻撃botが来る、という話についての記事","を読んでもらえれば経緯はわかるが、要するにこういうことだ。",[28,29,30,34,37,52],"ul",{},[31,32,33],"li",{},"HTTPSサイトを公開すると、発行した証明書がCT Logに記録される",[31,35,36],{},"CT Logは誰でも検索できるため、botはここを監視して新規公開ドメインを拾う",[31,38,39,40,44,45,44,48,51],{},"公開直後に",[41,42,43],"code",{},"/.env","、",[41,46,47],{},"/.git",[41,49,50],{},"/wp-admin","あたりを決め打ちでスキャンしてくる",[31,53,54],{},"公開直後はセキュリティ設定が甘いことが多いため、そこを狙う",[10,56,58],{"id":57},"bot-fight-modeを入れてはいけないケースがある","Bot Fight Modeを入れてはいけないケースがある",[14,60,61],{},"記事ではCloudflare WAFやBot Fight Modeでの対策を推奨している。実際、自分のサイト（このサイト）もCloudflare Pagesで運用しているので、設定を見直してみた。",[14,63,64],{},"ただ、調べていて一つ気になった点がある。",[14,66,67],{},[68,69,70],"strong",{},"Bot Fight ModeはAI検索クローラーも弾く可能性がある。",[14,72,73],{},"Cloudflareが「Verified Bot」として認識しているのは、主に学習目的のバックグラウンドクローラーだ。",[75,76,77,93],"table",{},[78,79,80],"thead",{},[81,82,83,87,90],"tr",{},[84,85,86],"th",{},"bot",[84,88,89],{},"分類",[84,91,92],{},"Bot Fight Mode",[94,95,96,108,117,126,137,146],"tbody",{},[81,97,98,102,105],{},[99,100,101],"td",{},"Googlebot",[99,103,104],{},"Verified Bot",[99,106,107],{},"通過",[81,109,110,113,115],{},[99,111,112],{},"GPTBot（OpenAI学習クローラー）",[99,114,104],{},[99,116,107],{},[81,118,119,122,124],{},[99,120,121],{},"ClaudeBot（Anthropic学習クローラー）",[99,123,104],{},[99,125,107],{},[81,127,128,131,134],{},[99,129,130],{},"Perplexityのリアルタイムフェッチ",[99,132,133],{},"グレーゾーン",[99,135,136],{},"弾かれる可能性あり",[81,138,139,142,144],{},[99,140,141],{},"ChatGPT Browseのフェッチ",[99,143,133],{},[99,145,136],{},[81,147,148,151,154],{},[99,149,150],{},"スキャンbot",[99,152,153],{},"Unverified Bot",[99,155,156],{},"ブロック",[14,158,159],{},"問題になるのは「ユーザーがAIに検索させたとき」のリアルタイムフェッチだ。PerplexityやChatGPT Browseがページ内容を取りに来るとき、そのリクエストはAIサービスのサーバーから出る。通常のブラウザとはフィンガープリントが異なるため、Bot Fight Modeに引っかかる可能性がある。",[14,161,162],{},"税理士事務所のサイトで「秋葉原 税理士事務所」とユーザーがAI検索したとき、自分のサイトが参照されなければ意味がない。それをブロックするBot Fight Modeは、この用途では逆効果になる。",[10,164,165],{"id":165},"ではどうするか",[14,167,168],{},"Bot Fight ModeなしでWAF Custom Rulesを使い、悪意あるスキャンパスだけを個別にブロックする方が安全だ。",[14,170,171,172,175],{},"Cloudflare Dashboard → ",[68,173,174],{},"Security → WAF → Custom Rules"," に以下を追加する。",[177,178,183],"pre",{"className":179,"code":181,"language":182},[180],"language-text","URI Path contains /.env       → Block\nURI Path contains /.git       → Block\nURI Path contains /wp-admin   → Block\nURI Path contains /phpinfo    → Block\nURI Path contains /.php       → Block\n","text",[41,184,181],{"__ignoreMap":185},"",[14,187,188],{},"これなら学習クローラーもリアルタイムフェッチも通過できる。スキャンbotが狙う「うっかり置いてある機密ファイル」のパスだけを塞ぐ形になる。",[10,190,192,193,196],{"id":191},"ssgでもenvの中身が漏れる経路はある","SSGでも",[41,194,195],{},".env","の中身が漏れる経路はある",[14,198,199,200,202],{},"このサイトはNuxt 3 + Cloudflare Pages静的出力（SSG）で動いている。「SSGだから",[41,201,195],{},"が本番に含まれるリスクはない」と思いがちだが、一つ落とし穴がある。",[14,204,205,206,209],{},"Nuxtの",[41,207,208],{},"runtimeConfig.public","に入れた値は、ビルド後のJavaScriptバンドルに埋め込まれる。",[177,211,215],{"className":212,"code":213,"language":214,"meta":185,"style":185},"language-ts shiki shiki-themes vitesse-light vitesse-light","// nuxt.config.ts\nruntimeConfig: {\n  resendApiKey: process.env.RESEND_API_KEY,  // サーバーサイドのみ → 静的ファイルに含まれない\n  public: {\n    apiBase: process.env.NUXT_PUBLIC_API_BASE,  // クライアントにも公開 → JSに埋め込まれる\n  }\n}\n","ts",[41,216,217,226,240,269,279,303,309],{"__ignoreMap":185},[218,219,222],"span",{"class":220,"line":221},"line",1,[218,223,225],{"class":224},"sxvE3","// nuxt.config.ts\n",[218,227,229,233,237],{"class":220,"line":228},2,[218,230,232],{"class":231},"senZ8","runtimeConfig",[218,234,236],{"class":235},"shFtX",":",[218,238,239],{"class":235}," {\n",[218,241,243,246,248,252,255,258,260,263,266],{"class":220,"line":242},3,[218,244,245],{"class":231},"  resendApiKey",[218,247,236],{"class":235},[218,249,251],{"class":250},"s4oTP"," process",[218,253,254],{"class":235},".",[218,256,257],{"class":250},"env",[218,259,254],{"class":235},[218,261,262],{"class":250},"RESEND_API_KEY",[218,264,265],{"class":235},",",[218,267,268],{"class":224},"  // サーバーサイドのみ → 静的ファイルに含まれない\n",[218,270,272,275,277],{"class":220,"line":271},4,[218,273,274],{"class":231},"  public",[218,276,236],{"class":235},[218,278,239],{"class":235},[218,280,282,285,287,289,291,293,295,298,300],{"class":220,"line":281},5,[218,283,284],{"class":231},"    apiBase",[218,286,236],{"class":235},[218,288,251],{"class":250},[218,290,254],{"class":235},[218,292,257],{"class":250},[218,294,254],{"class":235},[218,296,297],{"class":250},"NUXT_PUBLIC_API_BASE",[218,299,265],{"class":235},[218,301,302],{"class":224},"  // クライアントにも公開 → JSに埋め込まれる\n",[218,304,306],{"class":220,"line":305},6,[218,307,308],{"class":235},"  }\n",[218,310,312],{"class":220,"line":311},7,[218,313,314],{"class":235},"}\n",[14,316,317,320,321,324],{},[41,318,319],{},"resendApiKey","のようにサーバーサイドのみに置いた値はSSGビルド後の静的ファイルには含まれない。一方、",[41,322,323],{},"public","配下に入れた値はクライアント側のJSに埋め込まれ、ブラウザのDevToolsから誰でも確認できる。",[14,326,327,328,330],{},"やってしまいがちなのは、開発中に「とりあえずpublicに入れておこう」とAPIキーやトークンを置いてしまうケースだ。",[41,329,195],{},"ファイル自体は本番に存在しなくても、その中身がJSバンドル経由で全公開になる。",[14,332,333,334,337,338,341],{},"対策はシンプルで、",[68,335,336],{},"ブラウザに渡す必要がない値は絶対にpublicに入れない","、これだけだ。このサイトは",[41,339,340],{},"ogSecret","等の機密値はサーバーサイドのみに置いており、publicには非機密の設定値しか入っていない。",[10,343,344],{"id":344},"まとめ",[75,346,347,357],{},[78,348,349],{},[81,350,351,354],{},[84,352,353],{},"観点",[84,355,356],{},"結論",[94,358,359,366,374,385],{},[81,360,361,363],{},[99,362,92],{},[99,364,365],{},"AI検索で参照されたいサイトには不向き",[81,367,368,371],{},[99,369,370],{},"WAF Custom Rules",[99,372,373],{},"悪意あるパスのみ個別ブロックで十分",[81,375,376,379],{},[99,377,378],{},"robots.txt",[99,380,381,384],{},[41,382,383],{},"allow: ['/']","のまま維持（AI検索には明示的に許可を）",[81,386,387,392],{},[99,388,389,390],{},"SSG + ",[41,391,195],{},[99,393,394,395,397],{},"ファイル自体は含まれないが",[41,396,208],{},"に機密値を入れると漏れる",[14,399,400],{},"「httpsで公開したら攻撃botが来る」は事実だが、対策の選択肢によっては本来見せたい相手（AI検索）も弾いてしまう。セキュリティ設定はサイトの目的と照らし合わせて選ぶ必要がある。",[402,403,404],"style",{},"html pre.shiki code .sxvE3, html code.shiki .sxvE3{--shiki-default:#A0ADA0;--shiki-dark:#A0ADA0}html pre.shiki code .senZ8, html code.shiki .senZ8{--shiki-default:#59873A;--shiki-dark:#59873A}html pre.shiki code .shFtX, html code.shiki .shFtX{--shiki-default:#999999;--shiki-dark:#999999}html pre.shiki code .s4oTP, html code.shiki .s4oTP{--shiki-default:#B07D48;--shiki-dark:#B07D48}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":185,"searchDepth":228,"depth":228,"links":406},[407,408,409,410,412],{"id":12,"depth":228,"text":12},{"id":57,"depth":228,"text":58},{"id":165,"depth":228,"text":165},{"id":191,"depth":228,"text":411},"SSGでも.envの中身が漏れる経路はある",{"id":344,"depth":228,"text":344},null,"CT Log経由のbotスキャン対策を調べていたら、Bot Fight ModeがAI検索クローラーも弾く可能性があるとわかった。税理士事務所など「AI検索で見つかりたい」サイトに向いている代替策を整理した。","md",{},true,"/ct-log-bot-and-ai-search",false,"2026-05-06T00:00:00.000Z",{"title":5,"description":414},"2026-05/2026-05-06/ct-log-bot-and-ai-search",[424,425,426,427,428],"security","cloudflare","nuxt","ssg","ai-search","memo","63ia73ctL0iUCd5Gj5zBD0jHBogcrkB9LXqxbXyYWvg",[],[433,437,441,445,449],{"title":434,"path":435,"publishedAt":436},"Cloudflare Pages はもう Workers の中に住んでいる ― Static Assets 統合後の地図","/cloudflare-pages-to-workers-static-assets","2026-06-29T00:00:00.000Z",{"title":438,"path":439,"publishedAt":440},"非公開記事一覧をGoogleにインデックスさせない仕組みを点検した話","/unpublished-noindex","2026-06-01T00:00:00.000Z",{"title":442,"path":443,"publishedAt":444},"ページ遷移が遅い問題：SSR vs SSG の選択ミス","/ssr-vs-ssg-page-transition-slow","2025-12-05T00:00:00.000Z",{"title":446,"path":447,"publishedAt":448},"Cloudflare PagesとWorkers Static Assetsの違い、エッジキャッシュが効く仕組み","/cloudflare-pages-workers-static-assets","2026-07-22T00:00:00.000Z",{"title":450,"path":451,"publishedAt":448},"Webサービスの技術構成 2026年版 — Vue.js/Nuxt/Astroの使い分けとその理由","/web-tech-stack-2026","https://log.eurekapu.com/og/blog/ct-log-bot-and-ai-search.png?v=2026-05-06T00%3A00%3A00.000Z&title=CT%20Log%E3%81%A8bot%E5%AF%BE%E7%AD%96%EF%BC%9AAI%E6%A4%9C%E7%B4%A2%E3%81%A7%E5%8F%82%E7%85%A7%E3%81%95%E3%82%8C%E3%81%9F%E3%81%84%E3%81%AA%E3%82%89Bot%20Fight%20Mode%E3%82%92%E5%85%A5%E3%82%8C%E3%81%A6%E3%81%AF%E3%81%84%E3%81%91%E3%81%AA%E3%81%84&author=Kei%20Komatsu&sig=58e9db85e57db801",1785654963012]