> ## Documentation Index
> Fetch the complete documentation index at: https://sariva.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Permissions model

> Every permission Sariva needs on the CFK path — Kubernetes RBAC, the Kafka principal, and pod-health access — for same-EKS, different-EKS, and cross-account topologies.

Sariva's access is **read-only by design**: it observes clusters and opens pull requests; it never applies manifests, never writes to Kafka, and never holds your secrets. This page lists every permission surface on the **AWS EKS + Confluent Platform (CFK)** path, per topology.

| Surface | Where it lives | Who creates it |
| - | - | - |
| 1. Platform pod's own namespace | Sariva's release namespace | Helm chart |
| 2. CFK custom-resource read access | Your Confluent Platform namespace | You (customer-applied manifest) |
| 3. Kafka data plane (mTLS) | Sariva's release namespace | cert-manager, in Sariva's namespace |
| 4. Pod health, CPU/memory, and events | The observed cluster + AWS IAM | You (customer-authored role + RBAC) |

ⓘINFO

**Sariva ships no IAM or RBAC into your accounts.** Reader roles and Kubernetes RBAC in your clusters are customer-authored — the snippets on this page are examples you apply, so a security review sees exactly what was granted and by whom.

## 1. The platform pod's own namespace

The Helm chart creates one Role for the pod's ServiceAccount, in the release namespace only:

* **`get` on `secrets`** — used solely to resolve per-cluster credential references of the form `k8s://<namespace>/<name>` when the Secret lives in the release namespace. No `list`, no `watch`, no wildcards.
* **`rbac.appNamespaces` is empty by default and should stay empty.** It forward-provisions a per-namespace `pods` + `events` reader for a future in-cluster feature; populating it early grants permissions nothing consumes.

Pod-health monitoring does **not** use this ServiceAccount — see section 4.

## 2. CFK custom-resource read access

Sariva's observability (cluster health, component status, auto-registration) reads the CFK custom resources. It needs **`get`, `list`, `watch` on all six CFK kinds** — a Role covering only `kafkas` fails with 403 the moment component health reads Schema Registry or ksqlDB:

```yaml theme={null}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: sariva-cfk-cr-reader
  namespace: confluent          # your Confluent Platform namespace
rules:
  - apiGroups: ["platform.confluent.io"]
    resources:
      - kafkas
      - kraftcontrollers
      - schemaregistries
      - connects
      - ksqldbs
      - kafkarestproxies
    verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: sariva-cfk-cr-reader-binding
  namespace: confluent
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: sariva-cfk-cr-reader
subjects:
  - kind: ServiceAccount
    name: sariva-platform       # Sariva's ServiceAccount …
    namespace: sariva-platform  # … in Sariva's release namespace
```

No write verbs, no `secrets`, no core resources. When Sariva and Confluent Platform share the EKS cluster, this Role plus the pod's in-cluster ServiceAccount token is the **entire** Kubernetes surface Sariva needs to observe CFK.

## 3. Kafka data plane — mTLS, ACL-enforced, read-only

* Sariva's Kafka client certificate is issued by cert-manager **into Sariva's own namespace** (for example `sariva-platform/tls-sariva-client`). Sariva needs **no Secret access in your Confluent Platform namespace** — not even read. The certificate's CN is Sariva's Kafka identity (principal `User:sariva-platform`).
* Broker JMX metrics (throughput, JVM heap) are scraped from the CFK Prometheus exporter on each broker pod (port 7778) over the cluster network — this is network reachability, not an RBAC grant.

### The authorization model (on by default)

Clusters emitted by the wizard run Kafka **simple ACL authorization** with strict default-deny (`allow.everyone.if.no.acl.found=false`). Every identity is one of exactly three things:

| Identity | Standing | Why |
| - | - | - |
| Confluent Platform components (`kafka`, `kraftcontroller`, `schemaregistry`, …) | **Super-users** | Confluent's own operator pattern — components must create their internal topics |
| **Sariva** (`User:sariva-platform`) | **NOT a super-user** — describe-only ACLs | Sariva observes; it never writes |
| Application principals | Per-app ACLs, delivered via pull requests | Least privilege, SRE-approved |

### Sariva's exact grant

An emitted one-shot bootstrap Job (`sariva-read-acls`, running as the broker super-principal) grants Sariva precisely this — nothing more:

| Resource | Operations |
| - | - |
| Cluster | Describe, DescribeConfigs |
| Topic (`*`) | Describe, DescribeConfigs |
| Group (`*`) | Describe |

That set is sufficient for everything Sariva answers from Kafka — broker/controller metadata, partition health, consumer lag — and insufficient for any write. Both halves are proven live on both packages: a full health check succeeds under enforcement, and a topic-create attempt as Sariva's principal is rejected with `TopicAuthorizationException`.

### Verify it yourself

```bash theme={null}
# List exactly what Sariva's principal holds — expect the three describe-class rows, nothing else
kubectl exec -n confluent kafka-0 -- kafka-acls --list \
  --principal User:sariva-platform \
  --bootstrap-server kafka.confluent.svc.cluster.local:9071 \
  --command-config <super-principal client properties>
```

A write attempt using Sariva's certificate (topic create, ACL change, produce) fails with an authorization error — that failure is the design working.

## 4. Pod health, CPU/memory usage, and events

"Is this pod healthy, how much headroom does it have, and why is it stuck?" uses a different path — **AWS IAM, not the pod's ServiceAccount**, so the same model works whether the observed cluster is Sariva's own EKS, a second EKS in the same account, or another AWS account entirely.

The chain: Sariva's pod identity assumes a **customer-authored reader IAM role** → calls `eks:DescribeCluster` → obtains a short-lived EKS token → reads the Kubernetes API as a mapped group.

**The IAM reader role (in the account that owns the observed cluster):**

* Permissions: `eks:DescribeCluster` (plus CloudWatch Logs read actions if you also use log observability)
* Trust policy: allows Sariva's pod role to assume it — and must grant **both `sts:AssumeRole` and `sts:TagSession`** (EKS Pod Identity stamps transitive session tags; without `sts:TagSession` the assume fails with AccessDenied)
* An **EKS access entry** on the observed cluster maps the role to a Kubernetes group, for example `sariva-pod-readers`

**The Kubernetes RBAC (in the observed cluster, scoped to the observed namespace):**

```yaml theme={null}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: sariva-pod-reader
  namespace: <observed-namespace>
rules:
  - apiGroups: [""]
    resources: ["pods", "pods/log", "events"]
    verbs: ["get", "list", "watch"]
  # OPTIONAL — live CPU/memory usage for headroom answers.
  # Requires the metrics-server add-on (not installed on EKS by default).
  - apiGroups: ["metrics.k8s.io"]
    resources: ["pods"]
    verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: sariva-pod-reader
  namespace: <observed-namespace>
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: sariva-pod-reader
subjects:
  - kind: Group
    name: sariva-pod-readers
    apiGroup: rbac.authorization.k8s.io
```

What each grant powers: `pods` → status, restarts, readiness; `events` → the *why* behind Pending/CrashLoop (for example "Insufficient cpu"); `pods/log` → log reads; `metrics.k8s.io` → live CPU/memory for headroom percentages. Requests and limits come from the pod spec (`pods` read); **live usage** needs metrics-server — without it, Sariva degrades gracefully and tells you which grant or add-on is missing rather than failing.

This is a **namespaced Role, never a ClusterRole** — access is confined to the namespaces you bind, and node metrics are never read.

## Topologies: same EKS, different EKS, different account

The wizard's cluster-connection step asks where each cluster runs relative to the Sariva pod:

| Topology | CFK CR reads (§2) | Pod health (§4) |
| - | - | - |
| **A — same EKS cluster** | In-cluster ServiceAccount token + the `sariva-cfk-cr-reader` Role | Reader IAM role + access entry on the same cluster (the IAM path is used even locally, so the model never changes) |
| **B — different EKS, same AWS account** | Reader IAM role + access entry + the CR-reader Role applied on that cluster | Same reader role + access entry + `sariva-pod-reader` in the observed namespace |
| **C — different AWS account** | As B, plus the cross-account trust policy on the reader role (`sts:AssumeRole` **and** `sts:TagSession`) | As B, plus the cross-account trust |

## Verify in one minute

```bash theme={null}
# CFK CR reads — should print yes for all six kinds
kubectl auth can-i get kafkas.platform.confluent.io -n confluent \
  --as=system:serviceaccount:sariva-platform:sariva-platform

# Pod-health RBAC — namespace-scoped, no cluster-wide leak
kubectl auth can-i list pods --as-group=sariva-pod-readers -n <observed-namespace>   # yes
kubectl auth can-i list pods --as-group=sariva-pod-readers -n default                # no

# Read-only guarantee — every write verb should be no
kubectl auth can-i create kafkatopics.platform.confluent.io -n confluent \
  --as=system:serviceaccount:sariva-platform:sariva-platform                        # no
```

## Continue the deployment path

> [card] [Cross-account reader role setup](https://sariva.mintlify.site/install-setup/cross-account-reader.md)
>
> The full IAM trust policy, access entry, and RBAC walkthrough for topologies B and C.

> [card] [Back: AWS EKS + Confluent Platform (CFK)](https://sariva.mintlify.site/deploy/aws-eks-cfk.md)
>
> Return to the CFK path map.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.