2018-05-03 10:41:12 +00:00
|
|
|
# Custom DH parameters for perfect forward secrecy
|
2017-03-08 13:41:55 +00:00
|
|
|
|
2023-05-05 16:31:13 +00:00
|
|
|
This example aims to demonstrate the deployment of an Ingress-Nginx Controller and
|
2022-01-17 00:57:28 +00:00
|
|
|
use a ConfigMap to configure a custom Diffie-Hellman parameters file to help with
|
2017-03-08 13:41:55 +00:00
|
|
|
"Perfect Forward Secrecy".
|
|
|
|
|
|
|
|
## Custom configuration
|
|
|
|
|
|
|
|
```console
|
2017-10-16 12:55:46 +00:00
|
|
|
$ cat configmap.yaml
|
2017-03-08 13:41:55 +00:00
|
|
|
apiVersion: v1
|
|
|
|
data:
|
2017-10-16 12:55:46 +00:00
|
|
|
ssl-dh-param: "ingress-nginx/lb-dhparam"
|
2017-03-08 13:41:55 +00:00
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
2020-05-17 18:27:56 +00:00
|
|
|
name: ingress-nginx-controller
|
2017-10-16 12:55:46 +00:00
|
|
|
namespace: ingress-nginx
|
|
|
|
labels:
|
2018-09-04 03:25:30 +00:00
|
|
|
app.kubernetes.io/name: ingress-nginx
|
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
2017-03-08 13:41:55 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```console
|
2017-10-16 12:55:46 +00:00
|
|
|
$ kubectl create -f configmap.yaml
|
2017-03-08 13:41:55 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Custom DH parameters secret
|
|
|
|
|
|
|
|
```console
|
2022-01-17 00:57:28 +00:00
|
|
|
$ openssl dhparam 4096 2> /dev/null | base64
|
2017-03-08 13:41:55 +00:00
|
|
|
LS0tLS1CRUdJTiBESCBQQVJBTUVURVJ...
|
|
|
|
```
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ cat ssl-dh-param.yaml
|
|
|
|
apiVersion: v1
|
|
|
|
data:
|
|
|
|
dhparam.pem: "LS0tLS1CRUdJTiBESCBQQVJBTUVURVJ..."
|
2020-01-17 19:17:39 +00:00
|
|
|
kind: Secret
|
2017-03-08 13:41:55 +00:00
|
|
|
metadata:
|
2020-03-18 17:06:24 +00:00
|
|
|
name: lb-dhparam
|
2017-10-16 12:55:46 +00:00
|
|
|
namespace: ingress-nginx
|
|
|
|
labels:
|
2018-09-04 03:25:30 +00:00
|
|
|
app.kubernetes.io/name: ingress-nginx
|
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
2017-03-08 13:41:55 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ kubectl create -f ssl-dh-param.yaml
|
|
|
|
```
|
|
|
|
|
|
|
|
## Test
|
|
|
|
|
|
|
|
Check the contents of the configmap is present in the nginx.conf file using:
|
2022-01-17 00:57:28 +00:00
|
|
|
```console
|
|
|
|
$ kubectl exec ingress-nginx-controller-873061567-4n3k2 -n kube-system -- cat /etc/nginx/nginx.conf
|
|
|
|
```
|