-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work with baseline pod security standard #170
Comments
Maybe the operator could remove the privileged security context if the user space implementation is being used? |
Did you got any success running it atop of Talos? I've added |
I use Talos, and it works but it does need that label. A lot of projects need it unfortunately. |
I ended up using this magic incantation to fix wireguard on Talos: apiVersion: v1
kind: Namespace
metadata:
name: wireguard
labels:
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/audit-version: latest
pod-security.kubernetes.io/enforce: privileged
pod-security.kubernetes.io/enforce-version: latest
pod-security.kubernetes.io/warn: privileged
pod-security.kubernetes.io/warn-version: latest |
@Twi The only label which should be necessary is |
Can this change be added to the project? I've never used tailos so I cannot test it :(. I'd really appreciate if you can add it! |
I'm wondering if there is a way to detect that we are running on tailsos and we cannot run the kernal mode wireguard? |
It would be a nice feature to have, though it is important to note this is not specific to Talos but any Kubernetes cluster which enforces the baseline pod security standard. There is already some fallback mechanism in place when creating the tunnel itself, but I believe the operator will need to also make changes to the pods too. |
If we won’t get success with user space implementation - at least we can add notice about PodSecurity into README :) Else it could take time for other guys to discover reason of issue |
I wonder what the right way to do this is? I guess the first step is to add some configuration option to force user space (and remove NET_ADMIN from the security capabilities). A feature could then be built on top of that which automatically detects the current pod security standard? Not sure what the right default is. User space is likely to be less efficient, but more compatible. |
I like the multiple phases approach ^^
So there is currently a parameter in the wiregurad resource called
this paremeter gets populated in the agent, which is the bootstraping software that actually runs wireguard. What is currently missing is that we need to stop populating the security capabilities if useWgUserspaceImplementation is true. so around here: https://github.com/jodevsa/wireguard-operator/blob/main/pkg/controllers/wireguard_controller.go#L741 we need soemthing like
|
Any ideas on how we can detect that? is their a kubernetes configmap that can be read to know the allowed capabilities? I think that might be more straightforward than trying to run a pod with that capabilitiy and waiting to see if that fails |
so, going back to what @uhthomas suggested, we have 2 phases to get this complete: Phase 1: Do not use NET_ADMIN capability if wireguard.spec. useWgUserspaceImplementation is equal to true |
example of using the flag:
|
Describe the bug
To Reproduce
Run a Kubernetes cluster with the baseline pod security standard (e.g Talos).
https://kubernetes.io/docs/concepts/security/pod-security-admission/
Expected behavior
Optionally use the userspace wireguard implementation.
Screenshots
N/A
Additional context
The text was updated successfully, but these errors were encountered: