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