How to Configure OpenShift Audit Log
You set up an openshift audit log by defining cluster audit rules on the API server. These rules record every API call and user action across your cluster. Platform teams often start with broad roles to get apps running fast. When roles are too broad, engineers can run commands in many pods. Then the team relies on logs to see what happened after the fact. How the native openshift audit log works OpenShift runs on Kubernetes and uses the same core API model. Every action in the cluster goes t
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 an openshift audit log by defining cluster audit rules on the API server. These rules record every API call and user action across your cluster. Platform teams often start with broad roles to get apps running fast. When roles are too broad, engineers can run commands in many pods. Then the team relies on logs to see what happened after the fact.
How the native openshift audit log works
OpenShift runs on Kubernetes and uses the same core API model. Every action in the cluster goes through the central API server. When a user or app makes a request, the server checks their role. In this system, a role holds a set of rules for one namespace. A cluster role holds rules for the whole cluster and all nodes.
Permissions in these roles only add access and never deny it. Role bindings link a user or group to those rules in one namespace. Cluster role bindings grant those rules across the entire cluster at once. After the API server checks these bindings, it writes an event to the log.
The openshift audit log captures the user, the target resource, and the time. It also records subresources like pod logs or pod command sessions. You can choose how much detail the server writes for each event. Some rules log only the metadata of a request to save disk space. Other rules log the full request body and the full server response. Platform teams forward these log files to a central store for review.
What native audit rules solve and what they miss
Native audit rules give you a clear record of API calls. You can see who deleted a pod or who changed a role binding. You can also see when an engineer starts a shell inside a container. This helps security teams track changes made through the cluster API.
Still, the API server only sees the start of an interactive pod session. Once the shell opens, the traffic flows over a live stream. The native audit log shows that a user opened a pod session. It does not always show every command typed inside that shell. It also cannot stop a bad command while the session is live.
Audit Log Integrity + OpenShift RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Another gap appears when pods talk to databases or internal apps. An engineer with pod shell access can read local files or run database queries. The cluster log only shows the initial connection to the pod itself. It does not record the SQL statements or the data returned to the screen. If a query returns emails, phone numbers, or card numbers, the cluster log misses it. Native roles decide who can enter a pod, not what happens inside.
Managing cluster roles and audit volume
To get better logs, teams often turn up the audit detail level. Recording full request and response bodies creates huge log files very fast. High log volume increases storage costs and slows down search tools. Automated controllers and health checks also flood the log with routine noise.
Teams must balance log size against the need for clear security records. Tightening role bindings helps reduce the number of people with broad access. Give users roles limited to one namespace instead of cluster-wide bindings. Limit who can use the pod command subresource in production namespaces. Even with tight roles, on-call engineers still need live access during outages. When they enter a pod or run a database check, you need clear visibility.
Check Kubernetes API requests and responses on the wire
Kubernetes RBAC decides who may call the API server. RBAC does not check response payloads or split listing Secret names from reading Secret values when a role grants get access. With hoop.dev, you run an open-source proxy, a sidecar for your Kubernetes API, inline on the API connection. On every kubectl or API call an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
On each call, hoop.dev guardrails read the method, normalized path, and headers to refuse bad deletes or full Secret reads with a 403 error, or hold risky calls for approval. On the way back, hoop.dev data masking walks JSON responses by key and masks matched values in Secrets, ConfigMaps, and pod logs in memory. View the project on GitHub.
Frequently asked questions
What does the OpenShift API audit log capture during a pod session?
The log records who started the session, the target pod, and the time. It captures the initial API request to the pod command subresource. It does not track every interactive command or database query run inside the shell.
Can native cluster roles block specific commands inside a container?
No, native roles are additive and only control access to the API subresource. Once a role binding allows a pod session, the user can run any command allowed by the container user.
How do subresources work in cluster role rules?
The API represents actions like reading pod logs or running commands as subresources. You grant access to these subresources in a role rule to let users debug pods without giving full cluster admin rights.
Related guides
In this post