ホワイトリストプロキシを運用している企業で Amazon Q Developer を使うために必要な許可ドメインを Squid で検証してみた

ホワイトリストプロキシを運用している企業で Amazon Q Developer を使うために必要な許可ドメインを Squid で検証してみた

Clock Icon2025.07.11

いわさです。

先日、プロキシ環境下で Amazon Q Developer を使えるかを検証しました。

https://dev.classmethod.jp/articles/q-dev-cli-squid-client/

https://dev.classmethod.jp/articles/q-dev-ide-squid-client/

この時はプロキシサーバーに Squid を使い、squid.confはローカルからの接続であれば接続先の制限は特に行っていませんでした。
しかし、実際にプロキシサーバーを運用すると接続先を都度許可していく形式のホワイトリストプロキシの運用をしていくこともあると思います。

そこで本日は、Squid を使ってホワイトリストプロキシで Amazon Q Developer を使ってみましたのでその様子を紹介します。

ホワイトリストを設定する

環境は、前回(冒頭のブログ)と同じ環境を使用します。
まずはsquid.confを編集してホワイトリストの設定を追加しましょう。

岩城さんのこちらの記事を参考にさせてもらいました。

https://dev.classmethod.jp/articles/squid-whitelist-ubuntu/

[root@ip-10-0-10-165 squid]# cat squid.conf
#
# Recommended minimum configuration:
#

:

http_access deny !localnet

acl whitelist dstdomain "/etc/squid/whitelist"
http_access allow whitelist

http_access deny all

:

squid.confは上から順に評価され、どこでも Allow 判定されなければhttp_access deny allで拒否される感じになってます。
前回は localnet を Allow していたので、localnet 以外を Deny にしつつ、その下にホワイトリストによる Allow を設定します。

試しにホワイトリストにテストサイトを設定してみましょう。設定後に squid の再起動が必要です。

[root@ip-10-0-10-165 squid]# cat whitelist 
classmethod.jp

再起動後にクライアントから確認してみると、ホワイトリストで許可された URL にはアクセスが出来て、許可されていない URL にはアクセスが出来ないことが確認出来ました。

[ec2-user@ip-10-0-128-240 bin]$ curl https://classmethod.jp/ -I
HTTP/1.1 200 Connection established

HTTP/2 200
content-type: text/html; charset=UTF-8
date: Thu, 10 Jul 2025 21:10:41 GMT
x-cache-status: MISS
strict-transport-security: max-age=2592000; preload
server: nginx
link: <https://classmethod.jp/wp-json/>; rel="https://api.w.org/"
link: <https://classmethod.jp/wp-json/wp/v2/pages/279>; rel="alternate"; type="application/json"
link: <https://classmethod.jp/>; rel=shortlink
vary: Accept-Encoding
x-cache: Hit from cloudfront
via: 1.1 6149f46c7356f1b6aa240cc7ba3d1060.cloudfront.net (CloudFront)
x-amz-cf-pop: NRT20-P1
alt-svc: h3=":443"; ma=86400
x-amz-cf-id: 2GqGKk5rvGPjaRLwEEyiXt2qHCSE-3Zu4v1iFWHBduwkFIfBAQDHRQ==
age: 39

[ec2-user@ip-10-0-128-240 bin]$ curl https://dev.classmethod.jp/ -I
HTTP/1.1 403 Forbidden
Server: squid/6.13
Mime-Version: 1.0
Date: Thu, 10 Jul 2025 21:11:49 GMTContent-Type: text/html;charset=utf-8
Content-Length: 3567X-Squid-Error: ERR_ACCESS_DENIED 0
Vary: Accept-Language
Content-Language: en
Cache-Status: ip-10-0-10-165.ap-northeast-1.compute.internal
Via: 1.1 ip-10-0-10-165.ap-northeast-1.compute.internal (squid/6.13)
Connection: keep-alive

curl: (56) CONNECT tunnel failed, response 403

そしてこの時点での Amazon Q Developer CLI の動きを観察してみましょう。
プロキシが原因かは定かではないですがリクエスト送信に失敗しているという Rust のエラーメッセージが表示されています。

[ec2-user@ip-10-0-128-240 bin]$ q chat

    ⢠⣶⣶⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣶⣦⡀⠀
 ⠀⠀⠀⣾⡿⢻⣿⡆⠀⠀⠀⢀⣄⡄⢀⣠⣤⣤⡀⢀⣠⣤⣤⡀⠀⠀⢀⣠⣤⣤⣤⣄⠀⠀⢀⣤⣤⣤⣤⣤⣤⡀⠀⠀⣀⣤⣤⣤⣀⠀⠀⠀⢠⣤⡀⣀⣤⣤⣄⡀⠀⠀⠀⠀⠀⠀⢠⣿⣿⠋⠀⠀⠀⠙⣿⣿⡆
 ⠀⠀⣼⣿⠇⠀⣿⣿⡄⠀⠀⢸⣿⣿⠛⠉⠻⣿⣿⠛⠉⠛⣿⣿⠀⠀⠘⠛⠉⠉⠻⣿⣧⠀⠈⠛⠛⠛⣻⣿⡿⠀⢀⣾⣿⠛⠉⠻⣿⣷⡀⠀⢸⣿⡟⠛⠉⢻⣿⣷⠀⠀⠀⠀⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀⢸⣿⣿
 ⠀⢰⣿⣿⣤⣤⣼⣿⣷⠀⠀⢸⣿⣿⠀⠀⠀⣿⣿⠀⠀⠀⣿⣿⠀⠀⢀⣴⣶⣶⣶⣿⣿⠀⠀⠀⣠⣾⡿⠋⠀⠀⢸⣿⣿⠀⠀⠀⣿⣿⡇⠀⢸⣿⡇⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⢹⣿⣇⠀⠀⠀⠀⠀⢸⣿⡿
 ⢀⣿⣿⠋⠉⠉⠉⢻⣿⣇⠀⢸⣿⣿⠀⠀⠀⣿⣿⠀⠀⠀⣿⣿⠀⠀⣿⣿⡀⠀⣠⣿⣿⠀⢀⣴⣿⣋⣀⣀⣀⡀⠘⣿⣿⣄⣀⣠⣿⣿⠃⠀⢸⣿⡇⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⠈⢿⣿⣦⣀⣀⣀⣴⣿⡿⠃
 ⠚⠛⠋⠀⠀⠀⠀⠘⠛⠛⠀⠘⠛⠛⠀⠀⠀⠛⠛⠀⠀⠀⠛⠛⠀⠀⠙⠻⠿⠟⠋⠛⠛⠀⠘⠛⠛⠛⠛⠛⠛⠃⠀⠈⠛⠿⠿⠿⠛⠁⠀⠀⠘⠛⠃⠀⠀⠘⠛⠛⠀⠀⠀⠀⠀⠀⠀⠀⠙⠛⠿⢿⣿⣿⣋⠀⠀
 ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⢿⡧

╭─────────────────────────────── Did you know? ────────────────────────────────╮
│                                                                              │
│   Q can use tools without asking for confirmation every time. Give /tools    │
│                                 trust a try                                  │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

/help all commands  •  ctrl + j new lines  •  ctrl + s fuzzy search
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🤖 You are chatting with claude-4-sonnet

> こんにちは

Amazon Q is having trouble responding right now:
   0: dispatch failure (io error): an i/o error occurred: error sending request
   1: dispatch failure
   2: io error
   3: an i/o error occurred: error sending request

Location:
   crates/chat-cli/src/cli/chat/mod.rs:819

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
>

ホワイトリストの構成は出来たみたいです。
この時点では Amazon Q Developer の使用は制限されていますね。

Amazon Q Developer の設定をホワイトリストに追加する

Amazon Q Developer のドキュメントにてホワイトリストに追加すべき URL が公開されているのでこの情報を参考に構成をしてみます。
ちなみにここに記載されている URL をそのまま貼り付けたところ使えなかったので、Squid 用に少し変えています。

https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/firewall.html#vsc-corp-proxy

作成したホワイトリスト用のファイルがこちらです。

[root@ip-10-0-10-165 squid]# cat whitelist 
classmethod.jp
d-90663bcb80.awsapps.com
oidc.us-east-1.amazonaws.com
*.sso.us-east-1.amazonaws.com
*.sso-portal.us-east-1.amazonaws.com
*.aws.dev
*.awsstatic.com
*.console.aws.a2z.com
*.sso.amazonaws.com
codewhisperer.us-east-1.amazonaws.com
q.us-east-1.amazonaws.com
idetoolkits-hostedfiles.amazonaws.com
idetoolkits.amazonwebservices.com
q-developer-integration.us-east-1.api.aws
aws-toolkit-language-servers.amazonaws.com
aws-language-servers.us-east-1.amazonaws.com
client-telemetry.us-east-1.amazonaws.com
cognito-identity.us-east-1.amazonaws.com

Squid の再起動後、クライアントから Amazon Q Developer を使ってみましょう。

[ec2-user@ip-10-0-128-240 bin]$ q chat

    ⢠⣶⣶⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣶⣦⡀⠀
 ⠀⠀⠀⣾⡿⢻⣿⡆⠀⠀⠀⢀⣄⡄⢀⣠⣤⣤⡀⢀⣠⣤⣤⡀⠀⠀⢀⣠⣤⣤⣤⣄⠀⠀⢀⣤⣤⣤⣤⣤⣤⡀⠀⠀⣀⣤⣤⣤⣀⠀⠀⠀⢠⣤⡀⣀⣤⣤⣄⡀⠀⠀⠀⠀⠀⠀⢠⣿⣿⠋⠀⠀⠀⠙⣿⣿⡆
 ⠀⠀⣼⣿⠇⠀⣿⣿⡄⠀⠀⢸⣿⣿⠛⠉⠻⣿⣿⠛⠉⠛⣿⣿⠀⠀⠘⠛⠉⠉⠻⣿⣧⠀⠈⠛⠛⠛⣻⣿⡿⠀⢀⣾⣿⠛⠉⠻⣿⣷⡀⠀⢸⣿⡟⠛⠉⢻⣿⣷⠀⠀⠀⠀⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀⢸⣿⣿
 ⠀⢰⣿⣿⣤⣤⣼⣿⣷⠀⠀⢸⣿⣿⠀⠀⠀⣿⣿⠀⠀⠀⣿⣿⠀⠀⢀⣴⣶⣶⣶⣿⣿⠀⠀⠀⣠⣾⡿⠋⠀⠀⢸⣿⣿⠀⠀⠀⣿⣿⡇⠀⢸⣿⡇⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⢹⣿⣇⠀⠀⠀⠀⠀⢸⣿⡿
 ⢀⣿⣿⠋⠉⠉⠉⢻⣿⣇⠀⢸⣿⣿⠀⠀⠀⣿⣿⠀⠀⠀⣿⣿⠀⠀⣿⣿⡀⠀⣠⣿⣿⠀⢀⣴⣿⣋⣀⣀⣀⡀⠘⣿⣿⣄⣀⣠⣿⣿⠃⠀⢸⣿⡇⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⠈⢿⣿⣦⣀⣀⣀⣴⣿⡿⠃
 ⠚⠛⠋⠀⠀⠀⠀⠘⠛⠛⠀⠘⠛⠛⠀⠀⠀⠛⠛⠀⠀⠀⠛⠛⠀⠀⠙⠻⠿⠟⠋⠛⠛⠀⠘⠛⠛⠛⠛⠛⠛⠃⠀⠈⠛⠿⠿⠿⠛⠁⠀⠀⠘⠛⠃⠀⠀⠘⠛⠛⠀⠀⠀⠀⠀⠀⠀⠀⠙⠛⠿⢿⣿⣿⣋⠀⠀
 ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⢿⡧

╭─────────────────────────────── Did you know? ────────────────────────────────╮
│                                                                              │
│      You can execute bash commands by typing ! followed by the command       │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

/help all commands  •  ctrl + j new lines  •  ctrl + s fuzzy search
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🤖 You are chatting with claude-4-sonnet

> こんにちは

> こんにちは!Hello! How can I help you today? I'm Amazon Q, and I'm here to assist you with AWS services, development tasks, system administration, or any other technical questions you
might have.

>

おお、今度はいけましたね!
Amazon Q Developer IDE だとどうでしょうか。

F5F1853E-7D08-4A86-8114-BE89DC2BF84D.png

こちらも問題なく利用できるようになりました。

今回使っていませんが、公式ドキュメントによると/review/devなどの機能を使う場合は Amazon Q Developer が S3 バケットにアクセスするらしいので許可ドメインの追加が必要となります。

さいごに

本日は、ホワイトリストプロキシを運用している企業で Amazon Q Developer を使うために必要な許可ドメインを Squid で検証してみました。

ここまでの検証を通して、企業プロキシ環境下でも Amazon Q Developer は問題なく使用することが出来そうですね。IAM Identity Center 統合によるユーザーライセンス管理や使用状況ダッシュボードなどの管理者向けの機能とあわせて、企業導入しやすいですね。

Share this article

facebook logohatena logotwitter logo

© Classmethod, Inc. All rights reserved.