

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

# 憑證儲存體稽核日誌
<a name="pkcs11-certificate-storage-audit-logs"></a>

 AWS CloudHSM 會寫入憑證儲存操作的稽核日誌，以將資料修改為叢集 Amazon CloudWatch CloudWatch Events 日誌串流。此日誌串流會針對叢集命名，而不是針對叢集內的特定 HSM。

 如需有關在 CloudWatch 中存取稽核日誌的資訊，請參閱 [使用 Amazon CloudWatch Logs 和 AWS CloudHSM 稽核日誌](get-hsm-audit-logs-using-cloudwatch.md)。

## 日誌項目欄位
<a name="pkcs11-certificate-storage-audit-logs-fields"></a>

`object_handle`  
憑證物件的唯一識別符。

`op_code`  
執行或嘗試的操作。可能的值如下：  
+ `CreateObject`
+ `DestroyObject`
+ `SetAttributeValues`

`response`  
`OK` 如果操作成功，或下列其中一個錯誤類型：  
+ `DuplicateAttribute`
+ `InvalidAttributeValue`
+ `ObjectNotFound`
+ `MaxObjectsReached`
+ `InternalFailure`

`attributes`  
已修改屬性，如果有的話。

`timestamp`  
操作發生的時間，以 Unix epoch 後的毫秒為單位。

## 稽核日誌範例
<a name="pkcs11-certificate-storage-audit-logs-examples"></a>

### CreateObject 範例
<a name="pkcs11-certificate-storage-audit-logs-examples-create"></a>

```
{
    "object_handle": 463180677312929947,
    "op_code": "CreateObject",
    "response": "OK",
    "attributes": null,
    "timestamp": 1725482483671
}
```

### DestroyObject 範例
<a name="pkcs11-certificate-storage-audit-logs-examples-delete"></a>

```
{
    "object_handle": 463180677312929947,
    "op_code": "DestroyObject",
    "response": "OK",
    "attributes": null,
    "timestamp": 1725482484559
}
```

### SetAttributeValues 範例
<a name="pkcs11-certificate-storage-audit-logs-examples-set"></a>

```
{
    "object_handle": 463180678453346687,
    "op_code": "SetAttributeValues",
    "response": "OK",
    "attributes": [
        "Label"
    ],
    "timestamp": 1725482488004
}
```

### 不成功的 CreateObject 範例
<a name="pkcs11-certificate-storage-audit-logs-examples-error"></a>

```
{
    "object_handle": null,
    "op_code": "CreateObject",
    "response": "MaxObjectsReached",
    "attributes": null,
    "timestamp": 1726084937125
}
```