機能の提供状況
| クライアントモード | Zero Trust プラン ↗ |
|---|---|
|
すべてのプラン |
| システム | 提供状況 | 必要な WARP の最小バージョン |
|---|---|---|
| Windows | ✅ | 2025.6.1400.0 |
| macOS | ❌ | |
| Linux | ❌ | |
| iOS | ❌ | |
| Android | ❌ | |
| ChromeOS | ❌ |
Cloudflare Zero Trust では、オンプレミスの Active Directory(または同等のサーバー)で、リモートユーザーの Windows ログイン資格情報を検証できます。ユーザーが初めて Windows ログイン情報を入力する前に、Cloudflare One Client(旧 WARP)はサービストークンを使って接続を確立します。この最初の接続はユーザー ID には紐づきません。ユーザーが Windows ログインを完了すると、Cloudflare One Client は ID ベースのセッションに切り替わり、以降のすべてのログインにそのユーザー登録を適用します。
- Active Directory のリソースが Cloudflare に接続 されていること。
-
Cloudflare ダッシュボード ↗ で Zero Trust > Access controls > Service credentials > Service Tokens を開きます。
-
Create Service Token を選択します。
-
サービストークンに名前を付けます。名前があると、ログ内の関連イベントを識別しやすく、トークンを個別に取り消せます。
-
Service Token Duration を選びます。トークンの有効期限が決まります。
-
Generate token を選択します。サービストークンの Client ID と Client Secret、およびそれぞれのリクエストヘッダーが表示されます。
-
Client Secret をコピーします。
-
Access Service Tokens エンドポイントに
POSTリクエストを送ります。
At least one of the following token permissions is required:Required API token permissions
Access: Service Tokens Write
Create a service tokenbash curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/service_tokens" \ --request POST \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --json '{ "name": "CI/CD token", "duration": "8760h" }' -
レスポンスの
client_idとclient_secretの値をコピーします。レスポンスjson "result": { "client_id": "88bf3b6d86161464f6509f7219099e57.access", "client_secret": "bdd31cbc4dec990953e39163fbbb194c93313ca9f0a6e420346af9d326b1d2a5", "created_at": "2025-09-25T22:26:26Z", "expires_at": "2026-09-25T22:26:26Z", "id": "3537a672-e4d8-4d89-aab9-26cb622918a1", "name": "CI/CD token", "updated_at": "2025-09-25T22:26:26Z", "duration": "8760h", "client_secret_version": 1 }
-
cloudflare_api_token↗ に次の権限を追加します。Access: Service Tokens Write
-
cloudflare_zero_trust_access_service_token↗ リソースを設定します。resource "cloudflare_zero_trust_access_service_token" "example_service_token" { account_id = var.cloudflare_account_id name = "Example service token" duration = "8760h" lifecycle { create_before_destroy = true } } -
サービストークンの Client ID と Client Secret を取得します。
例: CLI に出力する
- Client ID と Client Secret を Terraform の state ファイルに出力します。
output "example_service_token_client_id" { value = cloudflare_zero_trust_access_service_token.example_service_token.client_id } output "example_service_token_client_secret" { value = cloudflare_zero_trust_access_service_token.example_service_token.client_secret sensitive = true } - 構成を適用します。
terraform apply - Client ID と Client Secret を読み取ります。
terraform output -raw example_service_token_client_idterraform output -raw example_service_token_client_secret
例: HashiCorp Vault に保存する
resource "vault_generic_secret" "example_service_token" { path = "kv/cloudflare/example_service_token" data_json = jsonencode({ "CLIENT_ID" = cloudflare_access_service_token.example_service_token.client_id "CLIENT_SECRET" = cloudflare_access_service_token.example_service_token.client_secret }) } - Client ID と Client Secret を Terraform の state ファイルに出力します。
デバイス登録の権限 で、次のポリシーを作成します。
| Rule Action | Rule type | Selector | Value |
|---|---|---|---|
| Service Auth | Include | Service Token | <TOKEN-NAME> |
サービストークンで登録されたデバイスは、メールアドレス non_identity@<team-name>.cloudflareaccess.com で識別されます。このメールアドレスを使い、プレログイン状態では特定の デバイスプロファイル設定 と Gateway ネットワークポリシー を適用できます。たとえば、Windows ログインやデバイス管理に必要なリソースだけにアクセスを限定できます。
デバイスプロファイルルールの例
| Selector | Operator | Value | Logic |
|---|---|---|---|
| User email | in | non_identity@<team-name>.cloudflareaccess.com |
And |
| Operating system | is | Windows |
Gateway ネットワークポリシーの例
| Selector | Operator | Value | Logic |
|---|---|---|---|
| Destination IP | in list | Active Directory servers |
And |
| User email | in | non_identity@<team-name>.cloudflareaccess.com |
And |
| Passed Device Posture Checks | in | Windows 10 or higher (OS version) |
| Action |
|---|
| Allow |
Windows のプレログイン機能を有効にするには、次の形式の MDM ファイルをデバイスへ デプロイ する必要があります。次の例では、pre_login キーがサービストークンでの接続を許可し、configs にデフォルトの Zero Trust 設定を入れます。
<dict>
<key>pre_login</key>
<dict>
<key>organization</key>
<string>mycompany</string>
<key>auth_client_id</key>
<string>TOKEN-ID</string>
<key>auth_client_secret</key>
<string>TOKEN-SECRET</string>
</dict>
<key>configs</key>
<array>
<dict>
<key>organization</key>
<string>mycompany</string>
<key>display_name</key>
<string>Default</string>
</dict>
</array>
</dict>ほかの Cloudflare One Client 登録がなく、ユーザーがまだ Windows にログインしていない場合、Cloudflare One Client はプレログイン設定を適用します。プレログイン設定が有効なあいだ、デバイスは Team & Resources > Devices にメール non_identity@<team-name>.cloudflareaccess.com で表示されます。
ユーザーが Windows にログインすると、Cloudflare One Client は自動的にデフォルトの MDM 設定へ切り替わり、IdP での認証を求めます。認証が完了すると、Cloudflare One Client はユーザー ID で登録して接続します。Team & Resources > Devices ページには、ユーザーのメールに紐づく新しいデバイスが表示されます。
マルチユーザーモード がオフの場合、このユーザー登録は、次回の Windows ユーザーログイン前を含む、以降のすべての接続に使われます。ユーザー登録を削除すると、ユーザーが Windows からログアウトした時点で、Cloudflare One Client はプレログイン設定に戻ります。
プレログイン設定が マルチユーザーモード とどう連携するかは、Cloudflare One Client の登録フローチャート を参照してください。