|
| 1 | +--- |
| 2 | +title: Permissions |
| 3 | +description: NGINX Gateway Fabric permissions required by components. |
| 4 | +weight: 300 |
| 5 | +toc: true |
| 6 | +type: reference |
| 7 | +product: NGF |
| 8 | +--- |
| 9 | + |
| 10 | +## Overview |
| 11 | + |
| 12 | +NGINX Gateway Fabric uses a split-plane architecture with three components that require different permissions: |
| 13 | + |
| 14 | +- **Control Plane**: Manages Kubernetes APIs and data plane deployments. Needs broad API access but handles no user traffic. |
| 15 | +- **Data Plane**: Processes user traffic. Requires minimal permissions since configuration comes from control plane via secure gRPC. |
| 16 | +- **Certificate Generator**: One-time job that creates TLS certificates for inter-plane communication. |
| 17 | + |
| 18 | +## Security Context |
| 19 | + |
| 20 | +All components share these security settings: |
| 21 | + |
| 22 | +- **User ID**: 101 (non-root) |
| 23 | +- **Group ID**: 1001 |
| 24 | +- **Capabilities**: All dropped (`drop: ALL`) |
| 25 | +- **Root Filesystem**: Read-only except for specific writable volumes |
| 26 | +- **Seccomp**: Runtime default profile |
| 27 | + |
| 28 | +## Control Plane |
| 29 | + |
| 30 | +Runs as a single container in the `nginx-gateway` deployment. |
| 31 | + |
| 32 | +**Additional Security Settings:** |
| 33 | +- **Privilege Escalation**: Disabled |
| 34 | + |
| 35 | +**Volumes:** |
| 36 | +- Secret mounts for TLS certificates |
| 37 | + |
| 38 | +**RBAC Permissions:** |
| 39 | +- **Secrets, ConfigMaps, Services**: Create, update, delete, list, get, watch |
| 40 | +- **Deployments, DaemonSets**: Create, update, delete, list, get, watch |
| 41 | +- **ServiceAccounts**: Create, update, delete, list, get, watch |
| 42 | +- **Namespaces, Pods**: Get, list, watch |
| 43 | +- **Events**: Create, patch |
| 44 | +- **EndpointSlices**: List, watch |
| 45 | +- **Gateway API resources**: List, watch (read-only) + update status subresources only |
| 46 | +- **NGF Custom resources**: Get, list, watch (read-only) + update status subresources only |
| 47 | +- **Leases**: Create, get, update (for leader election) |
| 48 | +- **CustomResourceDefinitions**: List, watch |
| 49 | +- **TokenReviews**: Create (for authentication) |
| 50 | + |
| 51 | +## Data Plane |
| 52 | + |
| 53 | +NGINX containers managed by the control plane. No RBAC permissions needed since configuration comes via secure gRPC. |
| 54 | + |
| 55 | +**Additional Security Settings:** |
| 56 | +- **Privilege Escalation**: Disabled |
| 57 | +- **Sysctl**: `net.ipv4.ip_unprivileged_port_start=0` (enables binding to ports < 1024) |
| 58 | + |
| 59 | +**Volumes:** |
| 60 | +- EmptyDir volumes for NGINX configuration, runtime files, logs, and cache |
| 61 | +- Secret mounts for TLS certificates and the NGINX Plus JWT token |
| 62 | +- Projected token mounts for service account authentication |
| 63 | + |
| 64 | +**Volume Permissions:** |
| 65 | +- **EmptyDir**: Read-write (required for NGINX operation) |
| 66 | +- **Secret/ConfigMap/Projected**: Read-only |
| 67 | + |
| 68 | +## Certificate Generator |
| 69 | + |
| 70 | +Kubernetes Job that creates initial TLS certificates. |
| 71 | + |
| 72 | +**RBAC Permissions:** |
| 73 | +- **Secrets**: Create, update, get (control plane namespace only) |
| 74 | + |
| 75 | +## Platform-Specific Considerations |
| 76 | + |
| 77 | +### OpenShift Compatibility |
| 78 | + |
| 79 | +NGINX Gateway Fabric includes Security Context Constraints (SCCs) for OpenShift: |
| 80 | + |
| 81 | +**Control Plane SCC:** |
| 82 | +- **Privilege Escalation**: Disabled |
| 83 | +- **Host Access**: Disabled (network, IPC, PID, ports) |
| 84 | +- **User ID Range**: 101-101 (fixed) |
| 85 | +- **Group ID Range**: 1001-1001 (fixed) |
| 86 | +- **Volumes**: Secret only |
| 87 | + |
| 88 | +**Data Plane SCC:** |
| 89 | +Same restrictions as control plane, plus additional volume types: |
| 90 | +- **Additional Volumes**: EmptyDir, ConfigMap, Projected |
| 91 | + |
| 92 | +### Linux Capabilities |
| 93 | + |
| 94 | +NGINX Gateway Fabric drops ALL Linux capabilities and adds none, following security best practices. |
| 95 | + |
| 96 | +**How It Works Without Capabilities:** |
| 97 | +- **Process Management**: Standard Unix signals (no elevated privileges needed) |
| 98 | +- **Port Binding**: Uses sysctl `net.ipv4.ip_unprivileged_port_start=0` for ports < 1024 |
| 99 | +- **File Operations**: Volume mounts provide necessary write access |
| 100 | + |
| 101 | + |
| 102 | +## Security Features |
| 103 | + |
| 104 | +- **Separation of concerns**: Control plane (API access, no traffic) vs data plane (traffic, no API access) |
| 105 | +- **Non-root execution**: All components run as unprivileged user (UID 101) |
| 106 | +- **Zero capabilities**: All Linux capabilities dropped |
| 107 | +- **Read-only root filesystem**: Prevents runtime modifications |
| 108 | +- **Ephemeral storage**: Temporary volumes only, no persistent storage |
| 109 | +- **Least privilege RBAC**: Minimal required permissions per component |
| 110 | +- **Secure communication**: mTLS-encrypted gRPC (TLS 1.3+) between planes |
0 commit comments