MATIH Platform is in active MVP development. Documentation reflects current implementation status.
3. Security & Multi-Tenancy
multi-tenancy
Namespace Isolation

Namespace Isolation

Kubernetes namespace isolation is the infrastructure-level boundary that prevents one tenant's workloads from accessing another tenant's compute, network, and storage resources. Each tenant receives a dedicated namespace with NetworkPolicies, ResourceQuotas, RBAC bindings, and Pod Security Standards.


Per-Tenant Namespaces

In production, each tenant receives a dedicated Kubernetes namespace:

PatternExample
matih-data-plane-{tenant-slug}matih-data-plane-acme-corp

Each namespace is a complete security boundary containing all Data Plane services, secrets, and configuration for that tenant.


Namespace Security Controls

ControlPurposeEnforcement
NetworkPolicyBlock cross-namespace trafficKubernetes CNI (Calico/Cilium)
ResourceQuotaLimit CPU, memory, pod countKubernetes scheduler
LimitRangeDefault and max per-pod limitsKubernetes admission controller
RBACRestrict API access to own namespaceKubernetes API server
PodSecurityStandardsEnforce non-root, read-only FSKubernetes admission controller
ServiceAccountLeast-privilege identityKubernetes RBAC bindings

NetworkPolicy

Each tenant namespace has a default-deny policy with explicit allowlist:

Allowed Ingress

SourcePurpose
Pods within the same namespaceInternal service communication
Control Plane namespaceManagement and health checks
Tenant's ingress controllerExternal traffic via tenant domain

Allowed Egress

DestinationPurpose
Pods within the same namespaceInternal service communication
Shared infrastructure namespacePostgreSQL, Redis, Kafka
Kubernetes DNS (port 53/UDP)Name resolution

Blocked

Traffic PatternStatus
Tenant A to Tenant B namespaceBlocked
Tenant to Control Plane (except allowed paths)Blocked
Direct internet egressBlocked

ResourceQuota by Tier

ResourceFreeProfessionalEnterprise
requests.cpu28Custom
requests.memory4Gi16GiCustom
limits.cpu416Custom
limits.memory8Gi32GiCustom
pods2050Custom
services1020Custom
persistentvolumeclaims510Custom

RBAC Bindings

Each tenant namespace has a dedicated ServiceAccount:

PermissionScope
get, list podsOwn namespace only
get, list servicesOwn namespace only
get secretsOwn namespace only
get, list configmapsOwn namespace only

The ServiceAccount cannot access resources in other namespaces.


Pod Security

StandardEnforcement
Run as non-rootRequired
Read-only root filesystemEnabled where supported
Privilege escalationDisabled
Host network accessDisabled
Host PID namespaceDisabled
CapabilitiesDrop ALL, add only NET_BIND_SERVICE if needed

Namespace Provisioning

During tenant provisioning (Phase 2), the following resources are created:

ResourceCreated By
NamespaceTenant Service via Infrastructure Service
NetworkPolicyInfrastructure Service
ResourceQuotaInfrastructure Service (tier-based)
LimitRangeInfrastructure Service
ServiceAccountInfrastructure Service
RoleBindingInfrastructure Service

Monitoring

SignalDetection Method
NetworkPolicy violationsCNI plugin flow logs
ResourceQuota exhaustionPrometheus kube_resourcequota metrics
Pod security violationsKubernetes audit logs
Cross-namespace attemptsKubernetes API server audit

Related Pages