Datadog Azure AKS

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a datadog azure aks integration by running collectors on cluster nodes. These collectors read node metrics, pod logs, and cluster state data for your team. Most teams start this setup by granting wide cluster roles to speed up deployment. Those wide roles also let engineers run shell commands and read secret keys. When roles are too broad, one compromised account can expose every namespace at once. How a datadog azure aks setup uses cluster roles A datadog azure aks setup relies on

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up a datadog azure aks integration by running collectors on cluster nodes. These collectors read node metrics, pod logs, and cluster state data for your team. Most teams start this setup by granting wide cluster roles to speed up deployment. Those wide roles also let engineers run shell commands and read secret keys. When roles are too broad, one compromised account can expose every namespace at once.

How a datadog azure aks setup uses cluster roles

A datadog azure aks setup relies on native Kubernetes RBAC to read cluster data. In Kubernetes, a Role or ClusterRole holds rules that define a set of permissions. These permissions are purely additive, which means the system has no deny rules. A standard Role always sets permissions inside one single namespace. A ClusterRole is not namespaced and covers resources across the whole cluster. It can also cover cluster-scoped resources like nodes and non-resource endpoints.

To grant these rules, you create a RoleBinding or a ClusterRoleBinding. A RoleBinding grants permissions inside one namespace and can reference a Role or ClusterRole. A ClusterRoleBinding grants access across the entire cluster at once. Monitoring agents need a ClusterRoleBinding to read node metrics and pod states everywhere. Engineers also use these bindings when they check broken pods or read logs.

Kubernetes RBAC refers to resources by the exact name in the API URL. Some API calls use a subresource, such as reading a pod's logs or exec sessions. In RBAC rules, you write the subresource with a slash, like pods and log. When engineers fix a failing monitoring agent, they often ask for pod exec rights. Once you add that rule to a role, the user can open a shell.

Where native Kubernetes roles fall short in daily work

Native Kubernetes RBAC solves the problem of who can reach the cluster API. It checks the user identity and matches it to a Role or ClusterRole. If a rule matches the request, the API server allows the action to start. This setup works well for static service accounts that only read cluster state.

Still, native RBAC leaves a major gap during live human sessions. RBAC decides who can start a pod exec session, not what happens inside it. Once an engineer opens a shell inside a pod, RBAC stops checking their actions. The engineer can run any binary, change files, or read local memory.

Azure RBAC + AKS Managed Identity: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

The same gap applies when engineers read pod logs or query app databases. Pod logs and database tables often hold emails, phone numbers, and card numbers. Native cluster roles cannot rewrite those fields inside the data stream. If a role allows log reading, it shows the full text to the user. Teams also struggle with shared static keys stored inside Kubernetes secrets. Anyone with read rights on secrets in that namespace can copy those keys. To stay safe, teams need controls that inspect commands and mask data in flight.

Scoping agent and engineer permissions

You can reduce risk by splitting agent roles from human engineer roles. Give the monitoring agent a dedicated service account with read-only ClusterRole rules. Never let human users share the service account used by your monitoring tools. For engineers, use a RoleBinding in a single namespace instead of a ClusterRoleBinding. Avoid granting pod exec or secret read rules in default engineer roles. When someone needs to run a command, check the exact command before it runs. Also, add data masking to rewrite sensitive fields like national IDs in query results.

Add request guardrails and response masking beside Kubernetes

Cluster roles and service accounts govern who reaches the Kubernetes API. Still, a broad role or agent can delete workloads or print sensitive values from ConfigMaps and logs. In practice, hoop.dev sits inline beside the API server as a sidecar for your Kubernetes API. For every production API call an agent or human sends, hoop.dev decides whether to pass, mask, block, or escalate it for review alongside RBAC.

With hoop.dev Kubernetes controls, guardrails allow listing Secret names while refusing reads of Secret data before execution, and data masking redacts matched keys in returned JSON responses and log streams in memory. Furthermore, hoop.dev holds SOC 2 Type II and is MIT licensed on GitHub.

Frequently asked questions

Why does a datadog azure aks agent need a ClusterRole?

The agent collects data from nodes and pods across every namespace in the cluster. A ClusterRole and ClusterRoleBinding let the agent read cluster-scoped node data and pod states.

Can Kubernetes RBAC block specific shell commands inside a pod exec session?

No, Kubernetes RBAC only checks if a user can open the exec subresource. It does not inspect or block individual shell commands after the session starts.

Can native RBAC deny access to one secret in a namespace?

No, Kubernetes RBAC permissions are purely additive and do not support deny rules. If a role grants secret read access in a namespace, it applies to all secrets unless you list allowed resource names.

The query runs. The emails stay hidden.