-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow downgrades using RPM and DEB packages #2885
Merged
TomasTurina
merged 6 commits into
21152-improve-wpks
from
22522-dev-allow-rpm-and-deb-downgrades
Mar 27, 2024
Merged
Allow downgrades using RPM and DEB packages #2885
TomasTurina
merged 6 commits into
21152-improve-wpks
from
22522-dev-allow-rpm-and-deb-downgrades
Mar 27, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jr0me
changed the title
22522 dev allow rpm and deb downgrades
Allow downgrades using RPM and DEB packages
Mar 19, 2024
In order to succesfuly downgrade to earlier versions of Wazuh, we need to restore ownership of files to the ossec group and user. RPM may also backup the client.keys file, making it impossible for the agent to reconnect, for this reason we try to restore this backup of the client.keys if none is found.
The removal of a previous installed pacakge can result in the ossec group and user being deleted, leaving files orphaned. Some of these files are needed to be owned by Wazuh to guarantee the agent connection.
In soeme cases the service lingers and doesn't respond to more graceful attempts. We then try kill the process if previous attempts didn't work.
jr0me
force-pushed
the
22522-dev-allow-rpm-and-deb-downgrades
branch
from
March 22, 2024 13:00
11176d1
to
3b31814
Compare
2 tasks
jr0me
force-pushed
the
22522-dev-allow-rpm-and-deb-downgrades
branch
from
March 25, 2024 15:58
3b31814
to
27f61ec
Compare
TomasTurina
reviewed
Mar 27, 2024
jr0me
force-pushed
the
22522-dev-allow-rpm-and-deb-downgrades
branch
from
March 27, 2024 21:05
ed90d71
to
c52cb29
Compare
This works fine with newer versions of Wazuh that follow the same paths structure. Older versions (ones with ossec group and user) require that we restore that expected paths and ownership.
… need to reflect this on wazuh packages as well to find the correct script.
jr0me
force-pushed
the
22522-dev-allow-rpm-and-deb-downgrades
branch
from
March 27, 2024 21:55
c52cb29
to
8e72c3a
Compare
TomasTurina
approved these changes
Mar 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR modifies RPM and DEB scripts for Wazuh agent's packages.
The modifications make it possible to downgrade Wazuh to earlier versions, allowing to rollback upgrades or to undo transactions via package managers across more versions.
Tests