You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit restructures and rewrites the Security recommendations
page, reducing it to the critical information and ensuring it adheres
to contemporary Hugo conventions and style guide standards.
---------
Signed-off-by: Alan Dooley <[email protected]>
Signed-off-by: Alan Dooley <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Shaun <[email protected]>
Copy file name to clipboardExpand all lines: docs/content/configuration/security.md
+46-58Lines changed: 46 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -2,68 +2,54 @@
2
2
docs: DOCS-597
3
3
doctypes:
4
4
- ''
5
-
title: Security Recommendations
5
+
title: Security recommendations
6
6
toc: true
7
7
weight: 1500
8
8
---
9
9
10
-
The security of NGINX Ingress Controller is paramount to the success of our Users, however, NGINX Ingress Controller is deployed by a User in their environment, and as such, the User takes responsibility
11
-
for securing a deployment of NGINX Ingress Controller.
12
-
We strongly recommend every User read and understand the following security concerns.
10
+
NGINX Ingress Controller follows Kubernetes best practices: this page outlines configuration specific to NGINX Ingress Controller you may require, including links to examples in the [GitHub repository](https://github.com/nginxinc/kubernetes-ingress/tree/release-3.5).
13
11
14
-
## Kubernetes
12
+
For general guidance, we recommend the official Kubernetes documentation for [Securing a Cluster](https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster/).
15
13
16
-
We recommend the Kubernetes [guide to securing a cluster](https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster/).
17
-
In addition, the following relating more specifically to Ingress Controller.
14
+
## Kubernetes recommendations
18
15
19
-
### RBAC and Service Account
16
+
### RBAC and Service Accounts
20
17
21
-
The Ingress Controller is deployed within a Kubernetes environment, this environment must be secured.
22
-
Kubernetes uses [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/) to control the resources and operations available to different types of users.
23
-
The Ingress Controller requires a service account which is configured using RBAC.
24
-
We strongly recommend using the [RBAC configuration](https://github.com/nginxinc/kubernetes-ingress/blob/v3.5.0/deployments/rbac/rbac.yaml) provided in our standard deployment configuration. It is configured with the least amount of privilege required for the Ingress Controller to work.
18
+
Kubernetes uses [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/) to control the resources and operations available to different types of users.
25
19
26
-
We strongly recommend inspecting the RBAC configuration for [Manifests](https://github.com/nginxinc/kubernetes-ingress/blob/v3.5.0/deployments/rbac/rbac.yaml)
27
-
or for [Helm](https://github.com/nginxinc/kubernetes-ingress/blob/v3.5.0/charts/nginx-ingress/templates/clusterrole.yaml) to understand what access the Ingress Controller service account has and to which resources. For example, by default the service account has access to all Secret resources in the cluster.
20
+
NGINX Ingress Controller requires RBAC to configure a [ServiceUser](https://kubernetes.io/docs/concepts/security/service-accounts/#default-service-accounts), and provides least privilege access in its standard deployment configurations:
Secrets are required by the Ingress Controller for some configurations.
32
-
[Secrets](https://kubernetes.io/docs/concepts/configuration/secret/) are stored by Kubernetes unencrypted by default.
33
-
We strongly recommend configuring Kubernetes to store these Secrets encrypted at rest.
34
-
Kubernetes has [documentation](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/) on how to configure this.
25
+
By default, the ServiceAccount has access to all Secret resources in the cluster.
35
26
36
-
##Ingress Controller
27
+
### Secrets
37
28
38
-
### Recommended Secure Defaults
29
+
[Secrets](https://kubernetes.io/docs/concepts/configuration/secret/) are required by NGINX Ingress Controller for certificates and privacy keys, which Kubernetes stores unencrypted by default. We recommend following the [Kubernetes documentation](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/) to store these Secrets using at-rest encryption.
39
30
40
-
We recommend the following for the most secure configuration:
41
31
42
-
- If Prometheus metrics are [enabled](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments/#cmdoption-enable-prometheus-metrics),
43
-
we recommend [configuring HTTPS](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments/#cmdoption-prometheus-tls-secret) for Prometheus.
32
+
## NGINX Ingress Controller recommendations
44
33
45
-
### Snippets
34
+
### Configure root filesystem as read-only
46
35
47
-
Snippets allow you to insert raw NGINX config into different contexts of NGINX configuration and are supported for [Ingress](/nginx-ingress-controller/configuration/ingress-resources/advanced-configuration-with-snippets/), [VirtualServer/VirtualServerRoute](/nginx-ingress-controller/configuration/virtualserver-and-virtualserverroute-resources/#using-snippets), and [TransportServer](/nginx-ingress-controller/configuration/transportserver-resource/#using-snippets) resources. Additionally, the [ConfigMap](/nginx-ingress-controller/configuration/global-configuration/configmap-resource#snippets-and-custom-templates) resource configures snippets globally.
36
+
{{< caution >}}
37
+
This feature is not compatible with [NGINX App Protect WAF](https://docs.nginx.com/nginx-app-protect-waf/) or [NGINX App Protect DoS](https://docs.nginx.com/nginx-app-protect-dos/).
38
+
{{< /caution >}}
48
39
49
-
Snippets are disabled by default. To use snippets, set the [`enable-snippets`](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments#cmdoption-enable-snippets) command-line argument. Note that for the ConfigMap resource, snippets are always enabled.
40
+
NGINX Ingress Controller is designed to be resilient against attacks in various ways, such as running the service as non-root to avoid changes to files. We recommend setting filesystems to read-only so that the attack surface is further reduced by limiting changes to binaries and libraries.
50
41
51
-
### Configure root filesystem as read-only
52
-
>
53
-
> **Note**: This feature is available for both the NGINX and NGINX Plus editions. NGINX AppProtect WAF and NGINX AppProtect DoS are not yet supported by this feature.
42
+
This is not enabled by default, but can be enabled with **Helm** using the [**controller.readOnlyRootFilesystem**]({{< relref "installation/installing-nic/installation-with-helm.md#configuration" >}}) argument.
54
43
55
-
The F5 Nginx Ingress Controller (NIC) has various protections against attacks, such as running the service as non-root to avoid changes to files. An additional industry best practice is having root filesystems set as read-only so that the attack surface is further reduced by limiting changes to binaries and libraries.
44
+
For **Manifests**, uncomment the following sections of the deployment:
56
45
57
-
Currently, we do not set read-only root filesystem as default. Instead, this is an opt-in feature available on the [helm-chart](/nginx-ingress-controller/installation/installation-with-helm/#configuration) via `controller.readOnlyRootFilesystem`.
58
-
When using manifests instead of Helm, uncomment the following sections of the deployment:
46
+
-`readOnlyRootFilesystem: true`
47
+
- The entire **volumeMounts** section
48
+
- The entire **initContainers** section
59
49
60
-
-`readOnlyRootFilesystem: true`,
61
-
- The entire `volumeMounts` section,
62
-
- The entire `initContainers` section,
63
-
- For `initContainers:image:`, use exact same image used for regular NIC installation.
64
-
Refer to the below code-block for guidance:
50
+
The block below shows the code you will look for:
65
51
66
-
```
52
+
```yaml
67
53
# volumes:
68
54
# - name: nginx-etc
69
55
# emptyDir: {}
@@ -89,23 +75,25 @@ Refer to the below code-block for guidance:
If Prometheus metrics are [enabled]({{< relref "/logging-and-monitoring/prometheus.md" >}}), we recommend [using HTTPS]({{< relref "configuration/global-configuration/command-line-arguments.md#cmdoption-prometheus-tls-secret" >}}).
83
+
84
+
### Snippets
85
+
86
+
Snippets allow raw NGINX configuration to be inserted into resources. They are intended for advanced NGINX users and could create vulnerabilities in a cluster if misused.
87
+
88
+
Snippets are disabled by default. To use snippets, set the [**enable-snippets**]({{< relref"configuration/global-configuration/command-line-arguments.md#cmdoption-enable-snippets" >}}) command-line argument.
89
+
90
+
{{< caution >}}
91
+
Snippets are **always** enabled for ConfigMap.
92
+
{{< /caution >}}
93
+
94
+
For more information, read the following:
95
+
96
+
-[Advanced Configuration using Snippets]({{< relref "/configuration/ingress-resources/advanced-configuration-with-snippets.md" >}})
97
+
-[Using Snippets with VirtualServer/VirtualServerRoute]({{< relref "configuration/virtualserver-and-virtualserverroute-resources.md#using-snippets" >}})
98
+
-[Using Snippets with TransportServer]({{< relref "/configuration/transportserver-resource.md#using-snippets" >}})
99
+
-[ConfigMap Snippets and Custom Templates]({{< relref "configuration/global-configuration/configmap-resource.md#snippets-and-custom-templates" >}})
0 commit comments