Skip to content

Commit

Permalink
feat!: Add config to disable proxy /shutdown admin endpoint (#12705)
Browse files Browse the repository at this point in the history
The proxy may expose a /shutdown HTTP endpoint on its admin server that may be used by `linkerd-await --shutdown` to trigger proxy shutdown after a process completes. If an application has an SSRF vulnerability, however, an attacker could use this endpoint to trigger proxy shutdown, causing a denial of service. This admin endpoint is only useful with linkerd-await; and this functionality is supplanted by Kubernetes Native Sidecars.

To address this potential issue, this change disables the proxy's admin endpoint by default. A helm value is introduced to support enabling the admin endpoint cluster-wide; and the `config.linkerd.io/proxy-admin-shutdown: enabled` annotation may be set to enable it the admin endpoint on an individual workload.

Signed-off-by: Alex Leong <alex@buoyant.io>
  • Loading branch information
adleong committed Jun 14, 2024
1 parent 26eba44 commit 35fb2d6
Show file tree
Hide file tree
Showing 58 changed files with 240 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/linkerd-control-plane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ Kubernetes: `>=1.22.0-0`
| proxy.disableInboundProtocolDetectTimeout | bool | `false` | When set to true, disables the protocol detection timeout on the inbound side of the proxy by setting it to a very high value |
| proxy.disableOutboundProtocolDetectTimeout | bool | `false` | When set to true, disables the protocol detection timeout on the outbound side of the proxy by setting it to a very high value |
| proxy.enableExternalProfiles | bool | `false` | Enable service profiles for non-Kubernetes services |
| proxy.enableShutdownEndpoint | bool | `false` | Enables the proxy's /shutdown admin endpoint |
| proxy.gid | int | `-1` | Optional customisation of the group id under which the proxy runs (the group ID will be omitted if lower than 0) |
| proxy.image.name | string | `"cr.l5d.io/linkerd/proxy"` | Docker image for the proxy |
| proxy.image.pullPolicy | string | imagePullPolicy | Pull policy for the proxy container image |
Expand Down
2 changes: 2 additions & 0 deletions charts/linkerd-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ proxy:
# -- Tag for the proxy container image
# @default -- linkerdVersion
version: ""
# -- Enables the proxy's /shutdown admin endpoint
enableShutdownEndpoint: false
# -- Log level for the proxy
logLevel: warn,linkerd=info,hickory=error
# -- Log format (`plain` or `json`) for the proxy
Expand Down
2 changes: 2 additions & 0 deletions charts/partials/templates/_proxy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ env:
- name: LINKERD2_PROXY_INBOUND_PORTS_REQUIRE_TLS
value: {{.Values.proxy.requireTLSOnInboundPorts | quote}}
{{ end -}}
- name: LINKERD2_PROXY_SHUTDOWN_ENDPOINT_ENABLED
value: {{.Values.proxy.enableShutdownEndpoint | quote}}
- name: LINKERD2_PROXY_LOG
value: "{{.Values.proxy.logLevel}}{{ if not (eq .Values.proxy.logHTTPHeaders "insecure") }},linkerd_proxy_http::client[{headers}]=off{{ end }}"
- name: LINKERD2_PROXY_LOG_FORMAT
Expand Down
2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject-filepath/expected/injected_nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: LINKERD2_PROXY_SHUTDOWN_ENDPOINT_ENABLED
value: "false"
- name: LINKERD2_PROXY_LOG
value: warn,linkerd=info,hickory=error,linkerd_proxy_http::client[{headers}]=off
- name: LINKERD2_PROXY_LOG_FORMAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: LINKERD2_PROXY_SHUTDOWN_ENDPOINT_ENABLED
value: "false"
- name: LINKERD2_PROXY_LOG
value: warn,linkerd=info,hickory=error,linkerd_proxy_http::client[{headers}]=off
- name: LINKERD2_PROXY_LOG_FORMAT
Expand Down Expand Up @@ -267,6 +269,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: LINKERD2_PROXY_SHUTDOWN_ENDPOINT_ENABLED
value: "false"
- name: LINKERD2_PROXY_LOG
value: warn,linkerd=info,hickory=error,linkerd_proxy_http::client[{headers}]=off
- name: LINKERD2_PROXY_LOG_FORMAT
Expand Down
2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject-filepath/expected/injected_redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: LINKERD2_PROXY_SHUTDOWN_ENDPOINT_ENABLED
value: "false"
- name: LINKERD2_PROXY_LOG
value: warn,linkerd=info,hickory=error,linkerd_proxy_http::client[{headers}]=off
- name: LINKERD2_PROXY_LOG_FORMAT
Expand Down
2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_contour.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_already_injected.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_deployment.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_deployment_debug.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_deployment_udp.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_list.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_pod.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_pod_ingress.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_pod_proxyignores.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_emojivoto_statefulset.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/cmd/testdata/inject_gettest_deployment.good.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/cmd/testdata/inject_tap_deployment_debug.golden.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 35fb2d6

Please sign in to comment.