Identity & Zero Trust for Platform Engineers›Foundations of trust · Cheat sheet & self-check

Foundations of trust · wrap-up

Cheat sheet & self-check

Every command from this section on one page.

01 · Zero trust, layer by layer

Quick checks: how much implicit trust is left?

kubectl get networkpolicy -ANamespaces with no policy are flat: every pod can reach them
kubectl get peerauthentication -AMesh mTLS mode per namespace (PERMISSIVE still accepts plaintext)
kubectl get ns -L pod-security.kubernetes.io/enforcePod Security level enforced per namespace
kubectl get clusterrolebindings -o wide | grep cluster-adminWho holds cluster-admin
kubectl auth can-i --list --as=system:serviceaccount:<ns>:defaultWhat a namespace's default ServiceAccount can do

02 · From TLS to mTLS

Inspect TLS from the command line

openssl s_client -connect host:443 -servername host -tls1_3 </dev/nullHandshake details, chain and negotiated cipher
openssl s_client -connect host:443 -showcerts </dev/nullPrint every certificate the server sends
openssl x509 -in cert.pem -noout -subject -issuer -dates -ext subjectAltNameWho, issued by whom, validity, SAN names
curl -v --cert client.crt --key client.key --cacert ca.crt https://api.internalCall an mTLS endpoint with a client certificate
openssl s_server -accept 8443 -cert srv.crt -key srv.key -CAfile ca.crt -Verify 1Test server that requires a client certificate

03 · PKI for a whole platform

Inventory and expiry

kubectl get certificates -Acert-manager certificates and their Ready state
kubectl get certificaterequests -A --sort-by=.metadata.creationTimestampRecent issuance attempts (look for failures)
kubeadm certs check-expirationControl-plane certificate expiry on a kubeadm node
openssl x509 -in cert.pem -noout -enddateExpiry of one certificate
echo | openssl s_client -connect host:443 -servername host 2>/dev/null | openssl x509 -noout -enddateExpiry as a client actually sees it

Trust bundles

cat old-root.pem new-root.pem > bundle.pemA bundle that trusts both roots during rotation
openssl verify -CAfile bundle.pem -untrusted intermediate.pem leaf.pemCheck a leaf chains to a root in the bundle