> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/storage/appsec-aws-267.md).

# Comprehend Entity Recognizer's model is not encrypted by KMS using a customer managed Key (CMK) misc

## Rule Details

|                        |                           |
| ---------------------- | ------------------------- |
| Cortex AppSec Rule ID  | APPSEC\_AWS\_267          |
| Category - Subcategory | Storage - Encryption      |
| Provider               | AWS                       |
| Severity               | HIGH                      |
| Framework              | Terraform, Terraform Plan |

## Impact

This rule is assessing whether the Amazon Comprehend Entity Recognizer's model is encrypted using a Key Management Service (KMS) with a Customer Managed Key (CMK). An unencrypted model may be exposed to certain threats such as unauthorized access or potential data breaches. By using a KMS with a CMK, users have more control and oversight over who can use or manage their keys, enabling a higher level of data protection. Therefore, failing to use CMKs in this context could lead to vulnerabilities in data security and compliance risks.

## How to Fix

*Resource:* aws\_comprehend\_entity\_recognizer

* *Arguments:* model\_kms\_key\_id

To fix this issue, you need to configure the AWS Comprehend Entity Recognizer model with a KMS key. The KMS key must be a customer managed key, not the default AWS key. Specify the key ARN in the `model_kms_key_id` field in the resource block for the Comprehend Entity Recognizer.

## The code above creates a new Customer Managed Key (CMK) and uses it to secure the Comprehend data. The `model_kms_key_id` field specifies the ARN of the KMS key that is used to encrypt the Comprehend Entity Recognizer model. This ensures that your data is encrypted with a key that you manage, providing an additional level of control over data encryption and decryption. This provides better security compared to using the default AWS-managed key. \[source,go]

resource "aws\_kms\_key" "key" { description = "Customer Managed Key for Comprehend Entity Recognizer" deletion\_window\_in\_days = 10 }

## resource "aws\_comprehend\_entity\_recognizer" "entity\_recognizer" { name = "test-entity-recognizer" data\_access\_role\_arn = aws\_iam\_role.role.arn input\_data\_config { data\_format = "ONE\_DOC\_PER\_LINE" entity\_types { type = "TEST\_ENTITY\_TYPE" } s3\_uri = aws\_s3\_bucket\_object.test.bucket } model\_kms\_key\_id = aws\_kms\_key.key.arn }


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/storage/appsec-aws-267.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
