Vercel Sandbox でホスト型 Postgres データベースへの接続が可能に
本文の状態
日本語全文を表示中
詳細モードで約2分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Vercel Blog
Vercel は Sandbox のファイアウォールをアップデートし、Neon や Supabase などの外部ホスト型 Postgres データベースへ接続できるようにした。ユーザーは Sandbox の設定でデータベースのドメイン名を許可リストに登録することで、SNI ベースのフィルタリング下でも安全に接続できる。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るSource Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
Vercel Sandbox では、Neon、Supabase、AWS RDS、Nile、Prisma Postgres を含むホストされた Postgres データベースへの接続が可能になりました。接続を有効にするには、データベースのホスト名を Sandbox の許可ドメインリストに追加してください。
背景
Vercel Sandbox で SNI に基づくフィルタリングを使用する場合、サンドボックスファイアウォールは接続時の TLS ハンドシェーク中にドメイン名を確認することで、アウトバウンドネットワークアクセスを制限します。これは、接続の開始時にドメインが確認できる HTTPS トラフィックではシームレスに機能します。
しかし、Postgres は TLS のネゴシエーション方法が異なります。Postgres クライアントはまず平文の TCP 接続を開き、その後 TLS へアップグレードします。ドメイン名がファイアウォールが最初に必要とする時点で利用できないため、標準的なドメイン制限付き Sandbox を介した Postgres 接続は失敗します。
変更点
Sandbox ファイアウォールは now、Postgres の TLS ネゴシエーションフローに対応するようになりました。プロトコルの起動シーケンスを検出し、TLS アップグレードを待ってから、ドメインポリシーを適用し、その後データベースへの接続を転送します。コードやデータベース設定に変更を加える必要はありません。
ホストされたデータベースへの接続
以下に完全な例を示します:Sandbox を作成し、Postgres クライアントをインストールし、ネットワークをデータベースのホストのみに対してロックダウンし、クエリを実行します。
知っておくべき重要事項
TLS の使用が必須です:ドメインベースのルールは、TLS ハンドシェーク時にホスト名が表示される必要があるため、クライアントは sslmode=require 以上で接続する必要があります。データベースが TLS をサポートしていない場合は、IP レンジによる許可に切り替えることができます。ほとんどのマネージド Postgres プロバイダではデフォルトで TLS が要求されます。
GSSAPI 暗号化はサポートされていません:gssencmode=prefer を使用するクライアントは自動的に TLS にフォールバックしますが、gssencmode=require の場合は接続できません。
サイレントなダウングレードはありません:クライアントが sslmode=prefer を使用している場合でも、データベースが TLS をサポートしていないと、平文への自動的なフォールバックではなく接続エラーが発生します。
Sandbox ファイアウォールに関する詳細情報はこちら。
さらに詳しく読む
原文を表示
Vercel Sandbox can now connect to hosted Postgres databases, including Neon, Supabase, AWS RDS, Nile, and Prisma Postgres. To enable a connection, add the database host to your Sandbox's allowed domains.
Background
When SNI based filtering is used with Vercel Sandbox, the sandbox firewall restricts outbound network access by checking the domain name during a connection's TLS handshake. This works seamlessly for HTTPS traffic, where the domain is visible at the start of the connection.
Postgres, however, negotiates TLS differently. A Postgres client first opens a plain TCP connection and then upgrades to TLS. Because the domain isn't available when the firewall first needs it, Postgres connections through a standard domain-restricted Sandbox would fail.
What changed
The Sandbox firewall now adjusts for the Postgres TLS negotiation flow. It detects the protocol's startup sequence, waits for the TLS upgrade, and then applies your domain policy before forwarding the connection to the database. No changes are needed to your code or database configuration.
Connecting to hosted database
Here's a full example: create a Sandbox, install a Postgres client, lock down the network to only the database host, and run a query.
Important to know
TLS is required: Domain-based rules rely on the hostname being visible during the TLS handshake, so clients must connect with sslmode=require or higher. If your database doesn't support TLS, you can allow it by IP range instead. Most managed Postgres providers require TLS by default.
GSSAPI encryption is not supported: Clients using gssencmode=prefer will fall back to TLS automatically; gssencmode=require will not connect.
No silent downgrades: If a client uses sslmode=prefer and the database doesn't support TLS, the connection will fail rather than silently falling back to plain-text.
Learn more about the Sandbox firewall.
Read more
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み