ProficientNowTechRFCs

8. Kubernetes Governance

RFC-PAM-0001                                                    Section 8
Category: Standards Track                         Kubernetes Governance

8. Kubernetes Governance

← Previous: Database Access | Index | Next: Session Management →


8.1 exec/attach Access Control

8.1.1 Overview

Kubernetes exec and attach commands provide shell access to running containers. This access requires governance similar to SSH access:

  • Authentication: User identity must be verified
  • Authorization: Access must be explicitly permitted
  • Recording: Sessions must be captured for audit
  • Accountability: Commands must be attributable to individuals

8.1.2 Governed Operations

Operationkubectl CommandRisk Level
execkubectl exec -it pod -- /bin/bashHigh - arbitrary command execution
attachkubectl attach -it podHigh - access to running process
port-forwardkubectl port-forward pod 8080:80Medium - network access bypass
logskubectl logs podLow - read-only
cpkubectl cp file pod:/pathMedium - file transfer

8.1.3 Access Flow

8.2 Port-Forward Governance

8.2.1 Port-Forward Risks

Port-forwarding creates direct network paths that may bypass security controls:

RiskDescription
Service exposureInternal services accessible from developer machine
Security bypassCircumvent ingress controls and WAF
Data exfiltrationDirect access to databases or APIs
Audit gapTraffic not logged through normal channels

8.2.2 Governance Controls

ControlImplementation
Allowlist portsOnly specific ports can be forwarded
Namespace restrictionsPort-forward only in permitted namespaces
Duration limitsMaximum port-forward session time
LoggingAll port-forward requests logged

8.2.3 Port-Forward RBAC

Roles can specify port-forward permissions:

RoleNamespacesAllowed PortsMax Duration
developerdev-*, staging-*8080, 3000, 50004h
sre-oncallAllAll8h
data-analystanalytics-*5432, 33062h

8.3 Namespace-Based Policies

8.3.1 Namespace as Security Boundary

Kubernetes namespaces provide a natural access boundary:

8.3.2 Namespace Access Matrix

RoleNamespace Patternexec/attachport-forwardlogs
developerdev-*YesYesYes
developerstaging-*YesYesYes
developerprod-*NoNoYes
sre-oncall*YesYesYes
data-analystanalytics-*NoYes (DB ports)Yes

8.3.3 Label-Based Refinement

Beyond namespaces, pod labels provide fine-grained control:

LabelPurposeExample
appApplication nameapp=frontend
tierApplication tiertier=database
sensitivityData sensitivitysensitivity=pii

A role might allow exec to app=frontend but deny exec to tier=database within the same namespace.

8.4 Integration with Kubernetes RBAC

8.4.1 Dual Authorization

Teleport and Kubernetes RBAC work together:

Both must permit the action:

  1. Teleport RBAC: Can this user exec in this namespace/pod?
  2. Kubernetes RBAC: Does the agent's ServiceAccount have exec permissions?

8.4.2 Teleport Agent Permissions

The Teleport Kubernetes Agent requires RBAC permissions:

ResourceVerbsPurpose
podsget, listEnumerate pods for access
pods/execcreateExecute commands in pods
pods/attachcreateAttach to pod processes
pods/portforwardcreatePort-forward to pods

8.4.3 User Identity Propagation

Teleport propagates user identity to Kubernetes:

Kubernetes ContextValueSource
Userteleport:jane.doeTeleport user identity
Groupsteleport:developersTeleport roles
Extra: teleport-loginjane.doe@example.comKeycloak email claim

This enables Kubernetes audit logs to attribute actions to actual users.

8.5 eBPF Session Capture

8.5.1 Overview

Teleport uses eBPF (extended Berkeley Packet Filter) for low-latency session capture within containers:

MethodLatencyCapture ScopeContainer Support
eBPFMinimalAll process activityFull
Script wrappingHigherShell commands onlyPartial
Audit loggingNoneSystem callsKernel-level

8.5.2 eBPF Capabilities

eBPF capture includes:

EventDescription
Command executionAll commands run in session
File accessFiles opened/read/written
Network connectionsOutbound connections from session
Process creationChild processes spawned

8.5.3 Recording Content

Kubernetes exec sessions record:

ContentCaptured
Terminal inputAll keystrokes
Terminal outputAll screen output
Process eventsCommands, file access (via eBPF)
Session metadataUser, pod, namespace, start/end

8.5.4 eBPF Requirements

eBPF capture requires:

RequirementDescription
Kernel versionLinux 5.8+ recommended
CapabilitiesCAP_SYS_ADMIN or CAP_BPF
Agent deploymentDaemonSet on cluster nodes
Node accessAgent must run on same node as pods

8.6 Multi-Cluster Support

8.6.1 Cluster Registration

Multiple Kubernetes clusters can be registered with Teleport:

8.6.2 Cluster Labels

Clusters are labeled for RBAC:

LabelValuesPurpose
envdev, staging, prodEnvironment
regionus-east, eu-westGeographic location
tiertier1, tier2Criticality

8.6.3 Cross-Cluster RBAC

Roles can span clusters:

RoleCluster PatternNamespaces
developerenv=dev OR env=stagingAll
sre-oncallAllAll
prod-viewerenv=prodAll (logs only)

Document Navigation


End of Section 8