

# Device-side metrics
<a name="detect-device-side-metrics"></a>

보안 프로파일을 만들 때 IoT 디바이스에서 생성된 지표에 대한 동작 및 임계값을 구성하여 IoT 디바이스의 예상 동작을 지정할 수 있습니다. 다음은 디바이스에 설치한 에이전트의 지표인 디바이스 측 지표입니다.

## 전송된 바이트(`aws:all-bytes-out`)
<a name="detect-all-bytes-out"></a>

지정된 기간 동안 디바이스에서 아웃바운드된 바이트 수입니다.

지정된 기간에 디바이스에서 전송해야 하는 아웃바운드 트래픽의 최대 또는 최소 양(바이트 단위로 측정)을 지정하려면 이 지표를 사용합니다.

호환 가능: Rules Detect \$1 ML Detect

연산자: less-than \$1 less-than-equals \$1 greater-than \$1 greater-than-equals 

값: 음수가 아닌 정수 

단위: 바이트 

기간: 음수가 아닌 정수 유효한 값은 300, 600, 900, 1800 또는 3600초입니다.

**Example**  

```
{
  "name": "TCP outbound traffic",
  "metric": "aws:all-bytes-out",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 4096
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example `statisticalThreshold`를 사용하는 예제**  

```
{
  "name": "TCP outbound traffic",
  "metric": "aws:all-bytes-out",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p50"
    },
    "durationSeconds": 900,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example ML Detect를 사용하는 예**  

```
{
  "name": "Outbound traffic ML behavior",
  "metric": "aws:all-bytes-out",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 수신된 바이트(`aws:all-bytes-in`)
<a name="detect-all-bytes-in"></a>

지정된 기간 동안 디바이스로 인바운드된 바이트 수입니다.

지정된 기간에 디바이스에서 수신해야 하는 인바운드 트래픽의 최대 또는 최소 양(바이트 단위로 측정)을 지정하려면 이 지표를 사용합니다.

호환 가능: Rules Detect \$1 ML Detect

연산자: less-than \$1 less-than-equals \$1 greater-than \$1 greater-than-equals 

값: 음수가 아닌 정수 

단위: 바이트 

기간: 음수가 아닌 정수 유효한 값은 300, 600, 900, 1800 또는 3600초입니다.

**Example**  

```
{
  "name": "TCP inbound traffic",
  "metric": "aws:all-bytes-in",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 4096
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example `statisticalThreshold`를 사용하는 예제**  

```
{
  "name": "TCP inbound traffic",
  "metric": "aws:all-bytes-in",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p90"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example ML Detect를 사용하는 예**  

```
{
  "name": "Inbound traffic ML behavior",
  "metric": "aws:all-bytes-in",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 수신 TCP 포트 개수(`aws:num-listening-tcp-ports`)
<a name="detect-num-listening-tcp-ports"></a>

디바이스가 수신하는 TCP 포트의 수입니다.

이 지표를 사용하여 각 디바이스에서 모니터링해야 하는 TCP 포트의 최대 수를 지정합니다.

호환 가능: Rules Detect \$1 ML Detect

단위: 실패 

연산자: less-than \$1 less-than-equals \$1 greater-than \$1 greater-than-equals 

값: 음수가 아닌 정수 

단위: 실패 

기간: 음수가 아닌 정수 유효한 값은 300, 600, 900, 1800 또는 3600초입니다.

**Example**  

```
{
  "name": "Max TCP Ports",
  "metric": "aws:num-listening-tcp-ports",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 5
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example `statisticalThreshold`를 사용하는 예제**  

```
{
  "name": "Max TCP Ports",
  "metric": "aws:num-listening-tcp-ports",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p50"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example ML Detect를 사용하는 예**  

```
{
  "name": "Max TCP Port ML behavior",
  "metric": "aws:num-listening-tcp-ports",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 수신 UDP 포트 수`aws:num-listening-udp-ports`)
<a name="detect-num-listening-udp-ports"></a>

디바이스가 수신하는 UPD 포트 수입니다.

이 지표를 사용하여 각 디바이스에서 모니터링해야 하는 UDP 포트의 최대 수를 지정합니다.

호환 가능: Rules Detect \$1 ML Detect

단위: 실패 

연산자: less-than \$1 less-than-equals \$1 greater-than \$1 greater-than-equals 

값: 음수가 아닌 정수 

단위: 실패 

기간: 음수가 아닌 정수 유효한 값은 300, 600, 900, 1800 또는 3600초입니다.

**Example**  

```
{
  "name": "Max UDP Ports",
  "metric": "aws:num-listening-udp-ports",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 5
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example `statisticalThreshold`를 사용하는 예제**  

```
{
  "name": "Max UDP Ports",
  "metric": "aws:num-listening-udp-ports",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p50"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example ML Detect를 사용하는 예**  

```
{
  "name": "Max UPD Port ML behavior",
  "metric": "aws:num-listening-tcp-ports",
  "criteria": {
	 "consecutiveDatapointsToAlarm": 1,
	 "consecutiveDatapointsToClear": 1,
	 "mlDetectionConfig": {
	   "confidenceLevel": "HIGH"
   }
	},
  "suppressAlerts": true
}
```

## 전송된 패킷(`aws:all-packets-out`)
<a name="detect-all-packets-out"></a>

지정된 기간 동안 디바이스에서 아웃바운드된 패킷 수입니다.

지정된 기간에 디바이스에서 전송해야 하는 전체 아웃바운드 트래픽의 최소 및 최대 양을 지정하려면 이 지표를 사용합니다.

호환 가능: Rules Detect \$1 ML Detect

연산자: less-than \$1 less-than-equals \$1 greater-than \$1 greater-than-equals 

값: 음수가 아닌 정수 

단위: 패킷 

기간: 음수가 아닌 정수 유효한 값은 300, 600, 900, 1800 또는 3600초입니다.

**Example**  

```
{
  "name": "TCP outbound traffic",
  "metric": "aws:all-packets-out",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 100
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example `statisticalThreshold`를 사용하는 예제**  

```
{
  "name": "TCP outbound traffic",
  "metric": "aws:all-packets-out",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p90"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example ML Detect를 사용하는 예**  

```
{
  "name": "Outbound sent ML behavior",
  "metric": "aws:all-packets-out",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 수신된 패킷(`aws:all-packets-in`)
<a name="detect-all-packets-in"></a>

지정된 기간 동안 디바이스로 인바운드된 패킷 수입니다.

지정된 기간에 디바이스에서 수신해야 하는 전체 인바운드 트래픽의 최소 및 최대 양을 지정하려면 이 지표를 사용합니다.

호환 가능: Rule Detect \$1 ML Detect

연산자: less-than \$1 less-than-equals \$1 greater-than \$1 greater-than-equals 

값: 음수가 아닌 정수 

단위: 패킷 

기간: 음수가 아닌 정수 유효한 값은 300, 600, 900, 1800 또는 3600초입니다.

**Example**  

```
{
  "name": "TCP inbound traffic",
  "metric": "aws:all-packets-in",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 100
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example**  
`statisticalThreshold`를 사용하는 예제  

```
{
  "name": "TCP inbound traffic",
  "metric": "aws:all-packets-in",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p90"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example ML Detect를 사용하는 예**  

```
{
  "name": "Inbound sent ML behavior",
  "metric": "aws:all-packets-in",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 대상 IP(`aws:destination-ip-addresses`)
<a name="detect-destination-ip-addresses"></a>

IP 대상 집합입니다.

각 디바이스에서 AWS IoT에 연결해야 하거나 연결하지 않아야 하는 허용된 CIDR 집합(이전 명칭은 화이트리스트) 또는 거부된 Classless Inter-Domain Routings(CIDR) 집합(이전 명칭은 블랙리스트)을 지정하려면 이 지표를 사용합니다.

호환 가능: Rules Detect

연산자: in-cidr-set \$1 not-in-cidr-set 

값: CIDR 목록

단위: 해당 사항 없음

**Example**  

```
{
  "name": "Denied source IPs",
  "metric": "aws:destination-ip-address",
  "criteria": {
    "comparisonOperator": "not-in-cidr-set",
    "value": {
      "cidrs": [ "12.8.0.0/16", "15.102.16.0/24" ]
    }
  },
  "suppressAlerts": true
}
```

## 수신 TCP 포트(`aws:listening-tcp-ports`)
<a name="detect-listening-tcp-ports"></a>

디바이스가 수신하는 TCP 포트입니다.

각 디바이스에서 수신하거나 수신하지 않아야 하는 허용된 TCP 포트 집합(이전 명칭은 화이트리스트) 또는 거부된 TCP 포트 집합(이전 명칭은 블랙리스트)을 지정하려면 이 지표를 사용합니다.

호환 가능: Rules Detect

연산자: in-port-set \$1 not-in-port-set 

값: 포트 목록 

단위: 해당 사항 없음

**Example**  

```
{
  "name": "Listening TCP Ports",
  "metric": "aws:listening-tcp-ports",
  "criteria": {
    "comparisonOperator": "in-port-set",
    "value": {
      "ports": [ 443, 80 ]
    }
  },
  "suppressAlerts": true
}
```

## 수신 UDP 포트(`aws:listening-udp-ports`)
<a name="detect-listening-udp-ports"></a>

디바이스가 수신하는 UDP 포트입니다.

각 디바이스에서 수신하거나 수신하지 않아야 하는 허용된 UDP 포트 집합(이전 명칭은 화이트리스트) 또는 거부된 UDP 포트 집합(이전 명칭은 블랙리스트)을 지정하려면 이 지표를 사용합니다.

호환 가능: Rules Detect

연산자: in-port-set \$1 not-in-port-set 

값: 포트 목록 

단위: 해당 사항 없음

**Example**  

```
{
  "name": "Listening UDP Ports",
  "metric": "aws:listening-udp-ports",
  "criteria": {
    "comparisonOperator": "in-port-set",
    "value": {
      "ports": [ 1025, 2000 ]
    }
  }
}
```

## 설정된 TCP 연결 수(`aws:num-established-tcp-connections`)
<a name="detect-num-established-tcp-connections"></a>

디바이스에 대한 TCP 연결 수입니다.

각 디바이스에 있어야 하는 활성 TCP 연결(모든 TCP 상태)의 최대 또는 최소 수를 지정하려면 이 지표를 사용합니다.

호환 가능: Rules Detect \$1 ML Detect

연산자: less-than \$1 less-than-equals \$1 greater-than \$1 greater-than-equals

값: 음수가 아닌 정수 

단위: 연결

**Example**  

```
{
  "name": "TCP Connection Count",
  "metric": "aws:num-established-tcp-connections",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 3
    },
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example `statisticalThreshold`를 사용하는 예제**  

```
{
  "name": "TCP Connection Count",
  "metric": "aws:num-established-tcp-connections",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p90"
    },
    "durationSeconds": 900,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

**Example ML Detect를 사용하는 예**  

```
{
  "name": "Connection count ML behavior",
  "metric": "aws:num-established-tcp-connections",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 디바이스 지표 문서 사양
<a name="DetectMetricsMessagesSpec"></a>


**전체 구조**  

|  긴 이름  |  짧은 이름  |  필수  |  유형  |  Constraints  |  Notes  | 
| --- | --- | --- | --- | --- | --- | 
|  header  |  hed  |  Y  |  객체  |    |  올바른 형식의 보고서에 필요한 전체 블록입니다.  | 
|  지표  |  met  |  Y  |  객체  |    |  보고서에는 둘 다 또는 하나 이상의 `metrics` 또는 `custom_metrics` 블록이 있어야 합니다.  | 
|  custom\$1metrics  |  cmet  |  Y  |  객체  |    |  보고서에는 둘 다 또는 하나 이상의 `metrics` 또는 `custom_metrics` 블록이 있어야 합니다.  | 


**헤더 블록**  

|  긴 이름  |  짧은 이름  |  필수  |  유형  |  Constraints  |  Notes  | 
| --- | --- | --- | --- | --- | --- | 
|  report\$1id  |  rid  |  Y  |  Integer  |    |  단순 증가 값. Epoch 타임스탬프 권장.  | 
|  version  |  v  |  Y  |  String  |  Major.Minor  |  필드 추가와 함께 작게 증분. 지표가 제거된 경우 크게 증분.  | 

**지표 블록:**


**TCP 연결**  

|  긴 이름  |  짧은 이름  |  상위 요소  |  필수  |  유형  |  Constraints  |  Notes  | 
| --- | --- | --- | --- | --- | --- | --- | 
|  tcp\$1connections  |  tc  |  지표  |  N  |  객체  |    |    | 
|  established\$1connections  |  ec  |  tcp\$1connections  |  N  |  객체  |    |  설정된 TCP 상태  | 
|  연결  |  cs  |  established\$1connections  |  N  |  목록<객체>  |    |    | 
|  remote\$1addr  |  rad  |  연결  |  Y  |  번호  |  ip:포트  |  IP는 IPv6 또는 IPv4일 수 있음  | 
|  local\$1port  |  lp  |  연결  |  N  |  번호  |  >= 0  |    | 
|  local\$1interface  |  li  |  연결  |  N  |  String  |    |  인터페이스 이름  | 
|  total  |  t  |  established\$1connections  |  N  |  번호  |  >= 0  |  설정된 연결 수  | 


**수신 TCP 포트**  

|  긴 이름  |  짧은 이름  |  상위 요소  |  필수  |  유형  |  Constraints  |  Notes  | 
| --- | --- | --- | --- | --- | --- | --- | 
|  listening\$1tcp\$1ports  |  tp  |  지표  |  N  |  객체  |    |    | 
|  ports  |  pts  |  listening\$1tcp\$1ports  |  N  |  목록<객체>  |  > 0  |    | 
|  포트  |  pt  |  ports  |  N  |  번호  |  > 0  |  포트는 0보다 큰 숫자여야 함  | 
|  인터페이스  |  다음과 같은 경우  |  ports  |  N  |  String  |    |  인터페이스 이름  | 
|  total  |  t  |  listening\$1tcp\$1ports  |  N  |  번호  |  >= 0  |    | 


**수신 UDP 포트**  

|  긴 이름  |  짧은 이름  |  상위 요소  |  필수  |  유형  |  Constraints  |  Notes  | 
| --- | --- | --- | --- | --- | --- | --- | 
|  listening\$1udp\$1ports  |  up  |  지표  |  N  |  객체  |    |    | 
|  ports  |  pts  |  listening\$1udp\$1ports  |  N  |  목록<포트>  |  > 0  |    | 
|  포트  |  pt  |  ports  |  N  |  번호  |  > 0  |  포트는 0보다 큰 숫자여야 함  | 
|  인터페이스  |  다음과 같은 경우  |  ports  |  N  |  String  |    |  인터페이스 이름  | 
|  total  |  t  |  listening\$1udp\$1ports  |  N  |  번호  |  >= 0  |    | 


**네트워크 통계**  

|  긴 이름  |  짧은 이름  |  상위 요소  |  필수  |  유형  |  Constraints  |  Notes  | 
| --- | --- | --- | --- | --- | --- | --- | 
|  network\$1stats  |  ns  |  지표  |  N  |  객체  |    |    | 
|  bytes\$1in  |  bi  |  network\$1stats  |  N  |  번호  |  델타 지표, >= 0  |    | 
|  bytes\$1out  |  bo  |  network\$1stats  |  N  |  번호  |  델타 지표, >= 0  |    | 
|  packets\$1in  |  pi  |  network\$1stats  |  N  |  번호  |  델타 지표, >= 0  |    | 
|  packets\$1out  |  po  |  network\$1stats  |  N  |  번호  |  델타 지표, >= 0  |    | 

**Example**  
다음 JSON 구조는 긴 이름을 사용합니다.  

```
{
  "header": {
    "report_id": 1530304554,
    "version": "1.0"
  },
  "metrics": {
    "listening_tcp_ports": {
      "ports": [
        {
          "interface": "eth0",
          "port": 24800
        },
        {
          "interface": "eth0",
          "port": 22
        },
        {
          "interface": "eth0",
          "port": 53
        }
      ],
      "total": 3
    },
    "listening_udp_ports": {
      "ports": [
        {
          "interface": "eth0",
          "port": 5353
        },
        {
          "interface": "eth0",
          "port": 67
        }
      ],
      "total": 2
    },
    "network_stats": {
      "bytes_in": 29358693495,
      "bytes_out": 26485035,
      "packets_in": 10013573555,
      "packets_out": 11382615
    },
    "tcp_connections": {
      "established_connections": {
        "connections": [
          {
            "local_interface": "eth0",
            "local_port": 80,
            "remote_addr": "192.168.0.1:8000"
          },
          {
            "local_interface": "eth0",
            "local_port": 80,
            "remote_addr": "192.168.0.1:8000"
          }
        ],
        "total": 2
      }
    }
  },
  "custom_metrics": {
    "MyMetricOfType_Number": [
      {
        "number": 1
      }
    ],
    "MyMetricOfType_NumberList": [
      {
        "number_list": [
          1,
          2,
          3
        ]
      }
    ],
    "MyMetricOfType_StringList": [
      {
        "string_list": [
          "value_1",
          "value_2"
        ]
      }
    ],
    "MyMetricOfType_IpList": [
      {
        "ip_list": [
          "172.0.0.0",
          "172.0.0.10"
        ]
      }
    ]
  }
}
```

**Example 짧은 이름을 사용하는 예제 JSON 구조**  

```
{
  "hed": {
    "rid": 1530305228,
    "v": "1.0"
  },
  "met": {
    "tp": {
      "pts": [
        {
          "if": "eth0",
          "pt": 24800
        },
        {
          "if": "eth0",
          "pt": 22
        },
        {
          "if": "eth0",
          "pt": 53
        }
      ],
      "t": 3
    },
    "up": {
      "pts": [
        {
          "if": "eth0",
          "pt": 5353
        },
        {
          "if": "eth0",
          "pt": 67
        }
      ],
      "t": 2
    },
    "ns": {
      "bi": 29359307173,
      "bo": 26490711,
      "pi": 10014614051,
      "po": 11387620
    },
    "tc": {
      "ec": {
        "cs": [
          {
            "li": "eth0",
            "lp": 80,
            "rad": "192.168.0.1:8000"
          },
          {
            "li": "eth0",
            "lp": 80,
            "rad": "192.168.0.1:8000"
          }
        ],
        "t": 2
      }
    }
  },
  "cmet": {
    "MyMetricOfType_Number": [
      {
        "number": 1
      }
    ],
    "MyMetricOfType_NumberList": [
      {
        "number_list": [
          1,
          2,
          3
        ]
      }
    ],
    "MyMetricOfType_StringList": [
      {
        "string_list": [
          "value_1",
          "value_2"
        ]
      }
    ],
    "MyMetricOfType_IpList": [
      {
        "ip_list": [
          "172.0.0.0",
          "172.0.0.10"
        ]
      }
    ]
  }
}
```

## 디바이스에서 지표 전송
<a name="DetectMetricsMessages"></a>

AWS IoT Device Defender Detect는 AWS IoT 디바이스에서 생성된 지표 데이터를 수집, 집계 및 모니터링하여 비정상적인 동작을 나타내는 디바이스를 식별합니다. 이 섹션에서는 디바이스에서 AWS IoT Device Defender로 지표를 전송하는 방법을 보여줍니다.

디바이스 측 지표를 수집하려면 AWS IoT 커넥티드 디바이스 또는 디바이스 게이트웨이에 AWS IoT SDK 버전 2를 안전하게 배포해야 합니다. [여기에서](https://docs.aws.amazon.com/iot/latest/developerguide/iot-sdks.html) SDK의 전체 목록을 확인하세요.

AWS IoT Device Client는 AWS IoT Device Defender 및 AWS IoT Device Management에 있는 기능을 모두 다루는 단일 에이전트를 제공하므로 지표를 게시하는 데 사용할 수 있습니다. 이러한 기능에는 작업, 보안 터널링, AWS IoT Device Defender 지표 게시 등의 작업이 포함됩니다.

AWS IoT Device Defender가 수집 및 평가할 수 있도록 AWS IoT의 [예약된 주제(reserved topic)](https://docs.aws.amazon.com//iot/latest/developerguide/reserved-topics.html#reserved-topics-device-defender)에 디바이스 측 지표를 게시합니다.

### 지표 게시를 위해 AWS IoT 디바이스 클라이언트 사용
<a name="UsingAWSIoTDeviceClient"></a>

AWS IoT 디바이스 클라이언트를 설치하려면 [GitHub](https://github.com/awslabs/aws-iot-device-client)에서 다운로드할 수 있습니다. 디바이스 측 데이터를 수집할 디바이스에 AWS IoT 디바이스 클라이언트를 설치한 후 디바이스 측 지표를 AWS IoT Device Defender에 전송하도록 구성해야 합니다. AWS IoT 디바이스 클라이언트 [구성 파일](https://github.com/awslabs/aws-iot-device-client/blob/main/config-template.json)의 `device-defender` 섹션에 다음 매개변수가 설정되어 있는지 확인합니다.

```
  
  "device-defender":    {
        "enabled":    true,
        "interval-in-seconds": 300
    }
```

**주의**  
시간 간격을 최소 300초로 설정해야 합니다. 시간 간격을 300초 미만으로 설정하면 지표 데이터가 제한될 수 있습니다.

 구성을 업데이트한 후 AWS IoT Device Defender 콘솔에서 보안 프로파일 및 동작을 생성하여 디바이스가 클라우드에 게시하는 지표를 모니터링할 수 있습니다. 방어(Defend), 감지(Detect), 지표(Metrics)를 차례로 선택하여 AWS IoT Core 콘솔에서 게시된 지표를 찾을 수 있습니다.