

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Verified Access 信任資料的預設內容
<a name="trust-data-default-context"></a>

AWS Verified Access 在所有 Cedar 評估中預設包含有關目前請求的一些元素，無論您設定的信任提供者為何。您可以選擇撰寫評估資料的政策。

以下是包含在評估中的資料範例。

**Topics**
+ [HTTP 請求](#default-context-http-request)
+ [TCP 流程](#default-context-tcp-flow)

## HTTP 請求
<a name="default-context-http-request"></a>

評估政策時，Verified Access 會在`context.http_request`金鑰下的 Cedar 內容中包含目前 HTTP 請求的資料。

```
{
    "title": "HTTP Request data included by Verified Access",
    "type": "object",
    "properties": {
        "http_method": {
            "type": "string",
            "description": "The HTTP method",
            "example": "GET"
        },
        "hostname": {
            "type": "string",
            "description": "The host subcomponent of the authority component of the URI",
            "example": "example.com"
        },
        "path": {
            "type": "string",
            "description": "The path component of the URI",
            "example": "app/images"
        },
        "query": {
            "type": "string",
            "description": "The query component of the URI",
            "example": "value1=1&value2=2"
        },
        "x_forwarded_for": {
            "type": "string",
            "description": "The value of the X-Forwarded-For request header",
            "example": "17.7.7.1"
        },
        "port": { 
           "type": "integer",
           "description": "The endpoint port",
           "example": 443
        },
        "user_agent": {
            "type": "string",
            "description": "The value of the User-Agent request header",
            "example": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"
        },
        "client_ip": {
            "type": "string",
            "description": "The IP address connecting to the endpoint",
            "example": "15.248.6.6"
        }
    }
}
```

**政策範例**  
以下是使用 HTTP 請求資料的範例 Cedar 政策。

```
forbid(principal, action, resource) when {
   context.http_request.http_method == "POST"
   && !(context.identity.roles.contains("Administrator"))
 };
```

## TCP 流程
<a name="default-context-tcp-flow"></a>

評估政策時，Verified Access 會在`context.tcp_flow`金鑰下的 Cedar 內容中包含目前 TCP 流程的資料。

```
{
    "title": "TCP flow data included by Verified Access",
    "type": "object",
    "properties": {
        "destination_ip": {
            "type": "string",
            "description": "The IP address of the target",
            "example": "192.100.1.3"
        },
        "destination_port": {
            "type": "string",
            "description": "The target port",
            "example": 22
        },
        "client_ip": {
            "type": "string",
            "description": "The IP address connecting to the endpoint",
            "example": "172.154.16.9"
        }
    }
}
```