

# 클라우드 측 지표
<a name="detect-cloud-side-metrics"></a>

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

## 메시지 크기(aws:message-byte-size)
<a name="detect-message-size"></a>

메시지의 바이트 수입니다. 디바이스에서 AWS IoT로 전송된 각 메시지의 최대 또는 최소 크기(바이트)를 지정하려면 이 지표를 사용합니다.

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

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

값: 음수가 아닌 정수 

단위: 바이트 

**Example**  

```
{
  "name": "Max Message Size",
  "metric": "aws:message-byte-size",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 1024
    },
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{

  "name": "Large Message Size",
  "metric": "aws:message-byte-size",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p90"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{
  "name": "Message size ML behavior",
  "metric": "aws:message-byte-size",
  "criteria": {
	 "consecutiveDatapointsToAlarm": 1,
	 "consecutiveDatapointsToClear": 1,
	 "mlDetectionConfig": {
	   "confidenceLevel": "HIGH"
   }
	},
  "suppressAlerts": true
}
```

3회 연속 5분간 누적 크기가 이 보안 프로파일 동작에 대해 보고하는 다른 모든 디바이스의 90%에 대해 측정된 것보다 큰 메시지를 전송하면 디바이스에 대해 경보가 발생합니다.

## 전송된 메시지(aws:num-messages-sent)
<a name="detect-messages-sent"></a>

지정된 기간 동안 디바이스에서 전송한 메시지의 수입니다.

지정된 기간에 AWS IoT와 각 디바이스 간 전송될 수 있는 메시지의 최대 또는 최소 수를 지정하려면 이 지표를 사용합니다.

호환 가능: 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": "Out bound message count",
  "metric": "aws:num-messages-sent",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 50
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
    },
  "suppressAlerts": true
}
```

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

```
{

  "name": "Out bound message rate",
  "metric": "aws:num-messages-sent",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p99"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{
  "name": "Messages sent ML behavior",
  "metric": "aws:num-messages-sent",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 수신된 메시지(aws:num-messages-received)
<a name="detect-messages-received"></a>

지정된 기간 동안 디바이스에서 수신한 메시지의 수입니다.

지정된 기간에 AWS IoT와 각 디바이스 간 수신될 수 있는 메시지의 최대 또는 최소 수를 지정하려면 이 지표를 사용합니다.

호환 가능: 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": "In bound message count",
  "metric": "aws:num-messages-received",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 50
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
    },
  "suppressAlerts": true
}
```

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

```
{
  "name": "In bound message rate",
  "metric": "aws:num-messages-received",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p99"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{
  "name": "Messages received ML behavior",
  "metric": "aws:num-messages-received",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 권한 부여 실패(aws:num-authorization-failures)
<a name="detect-auth-failures"></a>

지정된 기간에 각 디바이스에 허용된 권한 부여 실패의 최대 수를 지정하려면 이 지표를 사용합니다. 디바이스에서 충분한 권한이 없는 주제에 게시하려고 시도하는 경우와 같이 디바이스에서 AWS IoT로의 요청이 거부되는 경우 권한 부여 실패가 발생합니다.

호환 가능: 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": "Authorization Failures",
  "metric": "aws:num-authorization-failures",
  "criteria": {
    "comparisonOperator": "less-than",
    "value": {
      "count": 5
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{
  "name": "Authorization Failures",
  "metric": "aws:num-authorization-failures",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p50"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{
  "name": "Authorization failures ML behavior",
  "metric": "aws:num-authorization-failures",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 소스 IP(aws:source-ip-address)
<a name="detect-ip-address"></a>

디바이스가 AWS IoT에 연결된 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:source-ip-address",
  "criteria": {
    "comparisonOperator": "not-in-cidr-set",
    "value": {
      "cidrs": [ "12.8.0.0/16", "15.102.16.0/24" ]
    }
  },
  "suppressAlerts": true
}
```

## 연결 시도(aws:num-connection-attempts)
<a name="detect-num-connection-attempts"></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": "Connection Attempts",
  "metric": "aws:num-connection-attempts",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 5
    },
    "durationSeconds": 600,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{
  "name": "Connection Attempts",
  "metric": "aws:num-connection-attempts",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p10"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{
  "name": "Connection attempts ML behavior",
  "metric": "aws:num-connection-attempts",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": false
}
```

## 연결 해제(aws:num-disconnects)
<a name="detect-num-disconnects"></a>

지정된 기간 동안 디바이스가 AWS IoT에서 연결 해제되는 횟수입니다.

지정된 기간 동안 디바이스가 AWS IoT에서 연결 해제되는 최대 또는 최소 횟수를 지정하려면 이 지표를 사용합니다.

호환 가능: 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": "Disconnections",
  "metric": "aws:num-disconnects",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "value": {
      "count": 5
    },
    "durationSeconds": 600,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{
  "name": "Disconnections",
  "metric": "aws:num-disconnects",
  "criteria": {
    "comparisonOperator": "less-than-equals",
    "statisticalThreshold": {
      "statistic": "p10"
    },
    "durationSeconds": 300,
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1
  },
  "suppressAlerts": true
}
```

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

```
{
  "name": "Disconnects ML behavior",
  "metric": "aws:num-disconnects",
  "criteria": {
    "consecutiveDatapointsToAlarm": 1,
    "consecutiveDatapointsToClear": 1,
    "mlDetectionConfig": {
      "confidenceLevel": "HIGH"
    }
  },
  "suppressAlerts": true
}
```

## 연결 해제 기간(aws:disconnect-duration)
<a name="detect-disconnect-duration"></a>

디바이스가 AWS IoT에서 연결이 끊긴 상태로 유지되는 시간입니다.

이 지표를 사용하여 디바이스 AWS IoT에서 연결이 끊긴 상태로 유지되는 최대 기간을 지정합니다.

호환 가능: Rules Detect

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

값: 음수가 아닌 정수(분)

**Example**  

```
{
"name": "DisconnectDuration",
  "metric": "aws:disconnect-duration",
  "criteria": {
"comparisonOperator": "less-than-equals",
    "value": {
"count": 5
    }
  },
  "suppressAlerts": true
}
```