> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# テナントアクセス制御リストのルールで監視モードを有効または無効にする方法

> 監視モードを有効にすると、テナントアクセス制御リストの現在の動作を変更せずに、ルールが受信トラフィックにどのような影響を与えるかを監査できます。

ルールが監視モードの場合、Tenant ACL はその[ルールを評価](/docs/ja-jp/secure/tenant-access-control-list/rule-evaluation.md)し、[テナントログイベント](/docs/ja-jp/secure/tenant-access-control-list/tenant-log-event-reference.md)を生成しますが、ルールのアクションは実行せず、後続のルールやリストの評価も中断しません。

監視モードを有効にするには、ルールの action プロパティ `log` を `true` に設定します。

> [tab] Management API
>
> 以下の本文を指定して、Management API の[アクセス制御リストを部分的に更新するエンドポイント](/docs/docs/ja-jp/api/management/v2/network-acls/patch-network-acls-by-id)を呼び出します。
>
> ```json Management API request body highlight={4} theme={null}
> {
>   "rule": {
>     "action": {
>       "log": true
>     },
>     "scope": "authentication"
>   }
> }
> ```

> [tab] Go SDK
>
> ```go highlight={20} theme={null}
> package main
>
> import (
> 	"context"
> 	"log"
>
> 	"github.com/auth0/go-auth0"
> 	"github.com/auth0/go-auth0/management"
> )
>
> func main() {
> 	mgmt, err := management.New("{yourDomain}", management.WithClientCredentials("{yourClientId}", "{yourClientSecret}"))
> 	if err != nil {
> 		log.Fatal(err)
> 	}
>
> 	networkACL := &management.NetworkACL{
> 		Rule: &management.NetworkACLRule{
> 			Action: &management.NetworkACLRuleAction{
> 				Log: auth0.Bool(true),
> 			},
> 			Scope: auth0.String("authentication"),
> 		},
> 	}
>
> 	err = mgmt.NetworkACL.Patch(context.Background(), "{yourTenantAclRuleId}", networkACL)
> 	if err != nil {
> 		log.Fatal(err)
> 	}
> 	log.Println("Network ACL has been updated to enable monitoring mode")
> ```

> [tab] Node SDK
>
> ```javascript highlight={4} theme={null}
> const updateNetworkAclPayload: Management.UpdateNetworkAclRequestContent = {
>   rule: {
>     action: {
>       log: true,
>     },
>     scope: "authentication"
>   }
> };
>
> const updateNetworkAcl = await client.networkAcls.update("{yourTenantAclRuleId}", updateNetworkAclPayload);
> ```

> [tab] Terraform
>
> リソースブロックの [`rule.action`](https://registry.terraform.io/providers/auth0/auth0/latest/docs/resources/network_acl#nested-schema-for-ruleaction) で、`log` を `true` に設定します。
>
> ```terraform highlight={7} theme={null}
> resource "auth0_network_acl" "example_acl" {
>     description = "Example ACL"
>     active = true
>     priority = 1
>     rule {
>         action {
>             block = true
>             log = true
>         }
>         scope = "authentication"
>         match {
>           hostnames = ["example.com"]
>         }
>     }
> }
> ```

> [tab] Deploy CLI
>
> ```yaml highlight={8} theme={null}
> exampleACLs:
>   - description: Example ACL
>     active: true
>     priority: 1
>     rule:
>       action:
>         block: true
>         log: true
>       match:
>         hostnames:
>           - "example.com"
>       scope: authentication
> ```

> [tab] Auth0 CLI
>
> ```bash theme={null}
> auth0 network-acl update {yourTenantAclRuleId} --action log
> ```

同様に、`log` プロパティを `false` に設定すると、監視モードを無効にできます。
