> 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/public-exposure/appsec2-oci-6.md).

# OCI Kubernetes Engine Cluster pod security policy not enforced misconfiguration detected in code

## Rule Details

|                        |                                    |
| ---------------------- | ---------------------------------- |
| Cortex AppSec Rule ID  | APPSEC2\_OCI\_6                    |
| Category - Subcategory | Public Exposure - Ingress Controls |
| Provider               | ORACLE                             |
| Severity               | LOW                                |
| Framework              | Terraform, Terraform Plan          |

## Impact

This rule is checking to ensure that the pod security policy is enforced for Kubernetes Engine Clusters. A pod security policy is a cluster-level resource that controls the security-sensitive aspects of the pod specification. This rule checks if this safety protocol is in place.

If this policy is not enforced, it may leave the Kubernetes Engine Clusters vulnerable to security issues. The absence of this policy may allow the creation and modification of pods that may affect the stability and integrity of the overall cluster. Therefore, not having a Kubernetes Engine Cluster pod security policy enforced is recognized as a bad practice due to its potential risks to security and stability.

## How to Fix

*Resource:* oci\_containerengine\_cluster

* *Arguments:* options.admission\_controller\_options.is\_pod\_security\_policy\_enabled

This Cortex Cloud AppSec rule indicates that the Kubernetes Engine Cluster pod security policy is not enforced.

To fix this issue, you need to enable PodSecurityPolicy in your Kubernetes Engine. A Kubernetes Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification.

## In the secure code above, "is\_pods\_security\_enabled" is set to true, meaning that the Pod Security Policy is being enforced. This will ensure that any pod that violates the policy will not be created. This enhances the security of your cluster by ensuring that only secure pods are allowed to be run. \[source,go]

resource "oci\_containerengine\_cluster" "pass" {

options { admission\_controller\_options {

* is\_pod\_security\_policy\_enabled = "True" } persistent\_volume\_config { freeform\_tags = { "ClusName" = pud\_cluster } } } vcn\_id = oci\_core\_vcn.pud\_oci\_core\_vcn.id }

***


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec2-oci-6.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
