Skip to content

Commit 4a9ece2

Browse files
JoshVanLmsfussell
andauthored
[1.16] Add docs on DAPR_UNSAFE_SKIP_CONTAINER_UID_GID_CHECK env var (#4832)
* [1.16] Add docs on DAPR_UNSAFE_SKIP_CONTAINER_UID_GID_CHECK env var Fixes #4784 Signed-off-by: joshvanl <[email protected]> * Apply suggestions from code review Co-authored-by: Mark Fussell <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> * Adds DAPR_UNSAFE_SKIP_CONTAINER_UID_GID_CHECK to environment reference Signed-off-by: joshvanl <[email protected]> * Moved non-root execution section for Kubernetes Moved the section on running Dapr services as non-root in Kubernetes, including environment variable configuration. Signed-off-by: Mark Fussell <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> Signed-off-by: Mark Fussell <[email protected]> Co-authored-by: Mark Fussell <[email protected]>
1 parent 2ff6e63 commit 4a9ece2

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

daprdocs/content/en/concepts/security-concept.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ With Dapr OAuth 2.0 middleware, you can enable OAuth authorization on Dapr endpo
153153

154154
You can adopt common network security technologies, such as network security groups (NSGs), demilitarized zones (DMZs), and firewalls, to provide layers of protection over your networked resources. For example, unless configured to talk to an external binding target, Dapr sidecars don’t open connections to the internet and most binding implementations only use outbound connections. You can design your firewall rules to allow outbound connections only through designated ports.
155155

156+
## Run as non-root in Kubernetes
157+
When running in Kubernetes, Dapr services ensure each process is running as non-root. This is done by checking the UID & GID of the process is `65532`, and fatal erroring if it is not what is expected. If you must run a non-default UID & GID in Kubernetes, set the following env var to skip this check.
158+
```bash
159+
DAPR_UNSAFE_SKIP_CONTAINER_UID_GID_CHECK="true"
160+
```
161+
156162
# Security policies
157163

158164
Dapr has an extensive set of security policies you can apply to your applications. You can scope what they are able to do, either through a policy setting in the sidecar configuration, or with the component specification.

daprdocs/content/en/operations/hosting/kubernetes/kubernetes-production.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,20 @@ By default, the Dapr sidecar injector injects a sidecar without any `seccompProf
343343

344344
Refer to [the Arguments and Annotations overview]({{% ref "arguments-annotations-overview.md" %}}) to set the appropriate `seccompProfile` on the sidecar container.
345345

346-
## Best Practices
346+
## Run as non-root
347+
When running in Kubernetes, Dapr services ensure each process is running as non-root.
348+
This is done by checking the UID & GID of the process is `65532`, and fatal erroring if it is not what is expected.
349+
If you must run a non-default UID & GID in Kubernetes, set the following env var to skip this check.
350+
351+
```bash
352+
DAPR_UNSAFE_SKIP_CONTAINER_UID_GID_CHECK="true"
353+
```
354+
355+
## Best Practices
347356

348357
Watch this video for a deep dive into the best practices for running Dapr in production with Kubernetes.
349358

359+
350360
{{< youtube id=_U9wJqq-H1g >}}
351361

352362
## Related links

daprdocs/content/en/reference/environment/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ The following table lists the environment variables used by the Dapr runtime, CL
2929
| DAPR_COMPONENTS_SOCKETS_EXTENSION | .NET and Java pluggable component SDKs | A per-SDK configuration that indicates the default file extension applied to socket files created by the SDKs. Not a Dapr-enforced behavior. |
3030
| DAPR_PLACEMENT_METADATA_ENABLED | Dapr placement | Enable an endpoint for the Placement service that exposes placement table information on actor usage. Set to `true` to enable in self-hosted mode. [Learn more about the Placement API]({{% ref placement_api.md %}}) |
3131
| DAPR_HOST_IP | Dapr sidecar | The host's chosen IP address. If not specified, will loop over the network interfaces and select the first non-loopback address it finds.|
32-
| DAPR_HEALTH_TIMEOUT | SDKs | Sets the time on the "wait for sidecar" availability. Overrides the default timeout setting of 60 seconds. |
32+
| DAPR_HEALTH_TIMEOUT | SDKs | Sets the time on the "wait for sidecar" availability. Overrides the default timeout setting of 60 seconds. |
33+
| DAPR_UNSAFE_SKIP_CONTAINER_UID_GID_CHECK | Dapr control plane & sidecar | Disable the check that ensures the Dapr containers are not running as root on Kubernetes linux. This is not recommended for production environments. Set to `true` to disable the check. |

0 commit comments

Comments
 (0)