> 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/iam/appsec2-k8s-2.md).

# Granting create permissions to nodes/proxy or pods/exec sub resources allows potential privilege esc

## Rule Details

|                        |                             |
| ---------------------- | --------------------------- |
| Cortex AppSec Rule ID  | APPSEC2\_K8S\_2             |
| Category - Subcategory | Kubernetes - Access Control |
| Provider               | OTHER                       |
| Severity               | HIGH                        |
| Framework              | Helm, Kubernetes, Kustomize |

## Impact

In Kubernetes, granting the create permission to the nodes/proxy or pods/exec sub resources can potentially allow privilege escalation. This is because these sub resources enable users to access and control the Kubernetes nodes and pods in the cluster. If a user has the create permission for the nodes/proxy sub resource, they would be able to create a proxy to any node in the cluster. This would allow them to access the node as if they were directly logged in to it, potentially giving them access to sensitive information or allowing them to perform actions that they are not supposed to be able to perform. Similarly, if a user has the create permission for the pods/exec sub resource, they would be able to execute commands on any pod in the cluster. This could allow them to gain access to the containers running on the pod, potentially giving them access to sensitive information or allowing them to perform unauthorized actions. Therefore, it is important to carefully consider whether to grant the create permission for the nodes/proxy and pods/exec sub resources, as doing so could potentially allow privilege escalation. It may be safer to only grant these permissions to trusted users who have a legitimate need for them, and to monitor their usage to ensure that they are not being used for unauthorized purposes.

## How to Fix

## \[source,go]

{ "apiVersion: v1 kind: ClusterRole metadata: name: restricted-access rules:

* apiGroups: \[""] resources: \["nodes/proxy", "pods/exec"] verbs: \["create"]", }

***


---

# 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/iam/appsec2-k8s-2.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.
