-
Notifications
You must be signed in to change notification settings - Fork 257
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
SPLUNK_USER is root in universalforwarder #43
Comments
I exec in the wrong container. All worked as expected - I see splunk as a user for UF and Enterprise image. |
@kdthanvi Just verified UF and Enterprise images 7.2.0, the actual UID of the processes are 999, and I see Splunk as a user running processes |
(Sorry for off-topic, but @outcoldman could I ask what that dashboard view is in the screenshot you posted? Is that from within Splunk? How did you get that data?) |
Also just run and got 999 as uid
@kdthanvi could you verify again with |
@aegershman this dashboard is part of our (https://www.outcoldsolutions.com) application Monitoring Docker: Metrics and Log Forwarding |
@outcoldman Thank you for the great help. |
When I use the latest image (with my production setup which is using kubernetes), it's NOT working. I checked the uid in my local container with @outcoldman any way I can resolve/debug this ? Please let me know. |
I don't think #36 is relevant here, this seems to be an implementation detail with Kubernetes specifically. I found kubernetes/kubernetes#59819 which seems to point out that in order for the securityContext/runAsNonRoot to work, the Dockerfile itself has to be built with @kdthanvi can you confirm with Kubernetes version you're running in production? Additionally, you should be able to build your own image using the Makefile in this repository (ex. |
Hi @nwang92 Thanks for the comment.
Any idea on this ? I am using kubernetes version Also, about Please let me know. Thanks! |
Please check this commit. This is how I changed/added to make the |
I checked the other parts of the uf & the |
@kdthanvi gotcha, yeah I'm guessing changing I don't have a k8s cluster readily available for that particular version, but I'm going to try building the image from your commit and seeing if I can get the basic |
Hi @nwang92 just fyi, I did check the entrypoint and it's loaded with Btw, with the commit I shared, the image builds successfully and even PS : Thanks for your support! |
Hey kdthanvi, out of curiosity, what are you using the UF for? Sidecar for pods running in k8s? or to actually monitor k8s? |
@matthewmodestino I am running splunk-uf as a sidecar container in my k8s pod for getting the application logs (from the app container, running inside the same pod). |
@kdthanvi I built the image from your fork (https://hub.docker.com/r/nwang92/uf-k8s-test/) and tried it out but I'm not able to reproduce the issue you're seeing, but it's possible that I don't have the securityContext defined correctly. For reference, here's my pod yaml:
My pod seems to be running ok:
And the user/group ID's match what you've defined in that commit:
I am using k8s 1.8.4, so it's possible this may be a feature in a new version of the engine. But wondering if you have different securityContext definitions that I might have missing? |
Hi @nwang92 What we're doing is not in yaml, but in podsecuritypolicy. |
Do you happen to know what your PodSecurityPolicy is set to? I tried creating a PodSecurityPolicy with runAsUser defined as below:
Using this security policy, I followed the examples from the docs and setup a user/role/role-binding:
But still unable to reproduce your exact issue, using the same pod yaml from above (nwang92/uf-k8s-test image).
|
Is this issue good to close out? |
Any idea when this update will be released? |
I believe the new 7.2.2 container published yesterday includes a fix for this. |
Thanks @mikedickey! |
##Details :
I want to run splunk-universalforwarder with non-root user. I checked the detailed docker file and from this I thought it should be user
splunk
.But when I run the docker image and check using
docker exec
I see the user to beroot
(though everything inside is withsplunk:splunk
permission).I am using
splunk/universalforwarder:7.1.0
image.To reproduce :
OR
You can see :
root@<container id>$
Even in the documentation here it is written that user is
splunk
, but when I run it just runs with root.Could you please help me here ? Thanks.
PS : I tried with
splunk/universalforwarder:latest
also and the results are same!The text was updated successfully, but these errors were encountered: