-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Migrate keystore to master #27066
Migrate keystore to master #27066
Conversation
965bb18
to
19679b8
Compare
4b0b74d
to
6a755db
Compare
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
6a755db
to
2157bda
Compare
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
f6e3f90
to
7a70871
Compare
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
d2e0e4b
to
3d2e058
Compare
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
3d2e058
to
31487ba
Compare
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
std::ofstream file(m_filePath); | ||
if (!file.is_open()) | ||
{ | ||
throw std::runtime_error("Error creating key-value file due to: " + std::string(strerror(errno))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it expect to fail if the folder is not created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question.
In the installer, the folder /etc/wazuh-server
should exist.
The problem is that the error message in this case isn't helpful
…d to upgrade feature
2d954e6
to
414a665
Compare
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
@pereyra-m is OOO, I made some changes in the Keystore::filecreate class, because we call the std::ofstream constructor with the filename and not with the filepath. |
Coverage reportsThe coverage report can be downloaded from here
🟢 All modules have passed the coverage check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing
Insert values
./wazuh-keystore -k stdin
stdin_value
Key store file updated successfully.
echo "echo_value" | ./wazuh-keystore -k echo
Key store file updated successfully.
./wazuh-keystore -k file -vp value.txt
Key store file updated successfully.
./wazuh-keystore -k arg -v arg_value
Key store file updated successfully.
Read values
python3 read.py
arg:arg_value
echo:echo_value
file:file_value
stdin:stdin_value
Overwrite values
./wazuh-keystore -k arg -v arg_value_new
Key store file updated successfully.
python3 read.py
arg:arg_value_new
echo:echo_value
file:file_value
stdin:stdin_value
Description
This PR migrates the
wazuh-keystore
to themaster
branch and adapts it to the project structure. The QA/UT tests and required utils were also migrated.The OpenSSL v3.1.0 was added to vcpkg because it was missing and it was the closest version to the one used at branch v4.10.0.
The
IndexerConnector
class was updated to read the keystore and the plain text credentials were removed.The SPECS and installer scripts were modified to include the new binary, but the RPM package can't be built due to previous errors.
The folders and binaries permissions were preserved but due to facebook/rocksdb#11503 the internal RocksDB files will have 644 instead of 640.
Until this PR is merged #26908, the
root:wazuh
permissions will be used instead ofwazuh:wazuh
.Tests
I've installed a package built from this branch and configured the keystore credentials.
A test event is properly indexed