Overview
How access, network, secrets and images fit together on OpenShift, and the checks that show the controls are actually in place.
OpenShift will run whatever you deploy, as a service account that can do whatever its role says, on a network that by default lets any pod dial any other pod. Security is the set of decisions that make those three sentences smaller: who may call the API, which pods may talk, where a password lives, and which images may start. This page is the map. The product-specific steps live in the labs it points at.
Nothing here makes a deployment "compliant" with a named scheme. Compliance is an assessment against a control list, with evidence. These controls are the evidence you can produce. The OpenShift AI hardening labs, including disconnected installs and the Compliance Operator, are Security and compliance.
Identity and RBAC
A person logs in through the identity provider. A workload uses a service account. Both are bound to roles in a namespace. cluster-admin is for the few people who install operators, not for a pipeline and not for a developer "so the deploy works".
oc auth can-i delete pods -n payments
oc auth can-i create subscriptions.operators.coreos.com --all-namespaces
oc get rolebinding -n payments
The first command is what your user can do. The second should be no for almost everyone. The third shows who was granted what. A binding you cannot explain is a binding you remove. Review them when someone leaves the team. A role binding does not expire on its own.
Applications get a service account per workload. The default service account in a namespace is what you get when you specify none, and it is shared. Create orders and bind it to a role that can read one Secret and nothing else. oc exec into a pod runs as that account's power plus whoever can exec. Restrict pods/exec. It is a root shell on the data the pod can see.
The network
Put a NetworkPolicy on every namespace that holds data. The default, with no policy, is allow all. A policy that selects the pods and lists the peers is allow-list from then on.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: orders-ingress
namespace: payments
spec:
podSelector:
matchLabels:
app: orders
policyTypes: [Ingress]
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: ingress
ports:
- protocol: TCP
port: 8080
Redis and Data Grid need the same treatment, or the policy above is undone by any pod in the cluster dialling 6379 or 11222. The rules are in Redis security and Data Grid security. After you apply a policy, run the smoke test from Application testing. A policy that the author never called through is how production loses its database connection at 16:00.
Routes are HTTPS. The cluster's default certificate or a certificate you bring, not a Route that is edge-terminated to a backend you also left on plain HTTP across an untrusted network without knowing it. Inside the cluster, the Service is enough. A public Route to a database or a model server is a defect. Publish the application. Publish nothing else.
A service mesh gives you mTLS between pods and a clearer picture of who calls whom. It does not replace the NetworkPolicy. Service mesh is that layer.
Secrets
A Secret is the object for a password, a token, a tls key. A ConfigMap is the object for a setting you could print. The moment a password is in a ConfigMap, it is in a place more roles can read, and it will end up in a git diff.
oc create secret generic orders-db -n payments \
--from-literal=password="$(openssl rand -base64 24)"
Mount it as an environment variable or a file. Do not pass it as a command-line argument: arguments are visible in the pod spec to anyone who can get pods, which is a larger group than get secrets. That distinction is the content of a real Data Grid operator issue on cross-site TLS, noted in the Data Grid security lab.
Git holds the Secret's name. Git does not hold the value. Sealed Secrets or an external-secrets controller is how the value arrives. A private repository is not encryption. People clone it.
Rotate a secret by writing the new value, restarting the workload, and confirming the old value is rejected. A rotation that nobody tested will lock the service out, so the test is part of the change.
Images and privileges
Run as a non-root user, with a read-only root filesystem where the process allows it, and with no extra SCC. anyuid and privileged are exceptions with a ticket, not a Helm value someone copied. The Redis labs need a specific uid because of the image. That is written down there. It is not a pattern for every Deployment.
Pin the image by a digest or by a tag you control in your registry. :latest is a different image next week, and it may not be the one you scanned. In a disconnected cluster the image has to be in the mirror before the rollout. A deploy that pulls from the internet is a deploy that fails on the day the internet path is closed, and it is a supply path you do not control.
Scan the image in the pipeline, and fail the build on the severities you have agreed. A scan that only prints a report will be ignored by the third week. The supply-chain practices — SBOMs, signing, admission — sit with the DevOps series.
Who can do the dangerous thing
oc auth can-i answers for one user. The question you actually have is who, in this namespace, can delete pods, read secrets, or exec.
oc adm policy who-can delete pods -n payments
oc adm policy who-can get secrets -n payments
oc get rolebinding,clusterrolebinding -n payments -o name
Anything bound to cluster-admin, admin, or a custom role that grants * gets a name next to it and a reason. A service account in that list should be the one the pipeline uses, with its token scoped to this namespace. A personal user in that list who left the team last quarter is the finding. Remove the binding and record the date. The next platform drill is more honest once you know who else can delete the pod you are about to delete.
A pass you can repeat
Once a quarter, for each production namespace: who has admin, which pods are reachable from outside the namespace, which Secrets are older than the rotation period, which pods run as root. Write the exceptions down with an owner and a date. An exception without a date becomes the architecture.
The model endpoint is an API and follows the same list. Who may call it, whether the prompt leaves the cluster, and what a tool is allowed to do are in Risks and responsible use.
What's next
Tracing and the rest of the observability series show you what the locked-down services are doing. Platform testing checks that you can still recover when the controls are in place. A NetworkPolicy that blocks the restore pod is a finding from that drill, not a surprise for the incident.