Skip to content
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

chown: unknown user/group root:wazuh #778

Open
AishVinod opened this issue Jul 31, 2024 · 3 comments
Open

chown: unknown user/group root:wazuh #778

AishVinod opened this issue Jul 31, 2024 · 3 comments

Comments

@AishVinod
Copy link

I am trying to integrate custom-urlhaus with wazuh deployed on kubernetes using this documentation https://wazuh.com/blog/detecting-malicious-urls-using-wazuh-and-urlhaus/

For kubernetes setup I have mounted custom-urlhaus.py into /var/ossec/integrations/custom-urlhaus.py. However in order to execute the scripts below permisisons and ownership is mandatory :

chmod 750 /var/ossec/integrations/custom-urlhaus.py
chown root:wazuh /var/ossec/integrations/custom-urlhaus.py

Once I mount the files into pod, by default I see permission as below :

-rw-r--r-- 1 root 101 5441 custom-urlhaus.py

I suppose group 101 is coming from below configuration is master-sts file :

securityContext:
fsGroup: 101

I tried adding initcontainer to execute the required script :

initContainers:
- name: volume-mount-hack
image: busybox
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 100m
memory: 256Mi
command:
- sh
- '-c'
- 'chmod 750 /var/ossec/integrations/custom-urlhaus.py && chown root:wazuh /var/ossec/integrations/custom-urlhaus.py'

However I see inticontainer is failing with below errors :

chmod: /var/ossec/integrations/custom-urlhaus.py: Read-only file system
chown: unknown user/group root:wazuh

Any help on how to update the needed permissions in cluster files would be appreciated.

@saraiva82
Copy link

I am seeing some issues with this with my integration as well. All files in the container are root:wazuh owned. if you run a ps in the container
same
image
and
there does not seem to be a user 101 either
image

closest is some dude name games lol. now the wazuh user is 999 so wouldn't it make more sense to set that
securityContext: to
fsGroup: 999 instead?
anyways Im trying it out and see if my cluster still works after

@AishVinod
Copy link
Author

@saraiva82 Any luck on the same? I am still struggling for the same

@saraiva82
Copy link

Hey @AishVinod,
so far the permissions issues seem to have resolved themselves
image

and now when i use wazuh-logtester to debug my log I do not see the permissions errors that I was getting on my integrations and rules. So I think it resolved the issue even though im troubleshooting my log but now i think is a decoder thing and not this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants