-
Notifications
You must be signed in to change notification settings - Fork 1k
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
manage_agent bulk load fails #454
Comments
Taking a quick look at it, I see a call to nowChroot() in main.c. So manage_agents chroots to /var/ossec. Trying to load the file relative to this chroot ( So it appears there is a call to srandom_init() that happens after the chroot. |
It appears to work with a dev/random and dev/urandom available. |
Srandom_init must happe. Before chroot |
@jrossi unfortunately there are 3 srandom_init() calls, and 2 aren't as easy as moving them up a few lines (validate.c being one example). That's definitely the issue, but I don't know how to fix it off hand. |
Yeah a lot of the utils and management cli apps suffer from copy and paste code hell. The real only way to fix to start refactoring out things into shared or another common location. This will take some work. |
This is a big breaking fix if bulk loads don't work in 2.9. Probably should fix this before it's released. |
There is a similar (same?) issue on the client side. manage_agents(1128): ERROR: Could not create temporary file |
Any work around?? |
Circle :) |
:))) |
Prevent manage_agents from chrooting in bulk mode Currently using -f will fail because of attempts to access random, which isn't possible in the chroot (without extra work). Prevent the chroot in this mode. Fixes issue #454 Not sure this is ready yet, I'm hoping for comments. This may be the wrong way to solve it (it feels like a hack instead of a proper fix).
Prevent manage_agents from chrooting in bulk mode Currently using -f will fail because of attempts to access random, which isn't possible in the chroot (without extra work). Prevent the chroot in this mode. Fixes issue #454 Not sure this is ready yet, I'm hoping for comments. This may be the wrong way to solve it (it feels like a hack instead of a proper fix).
manage_agents -f /tmp/agents fails with "file not found". I have since worked out that it does a chroot to /var/ossec and that is why it cannot find the files. So this is a query and a suggestion. The query is, is there any need for this program to do a chroot? The suggestion is to add some text to the help message that manage_agents -? produces to say that the file must be stored in the /var/ossec file structure somewhere.
Best wishes...
Colin
The text was updated successfully, but these errors were encountered: