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

keystore tool RPM and DEB packages creation #2804

Merged
merged 1 commit into from
Feb 2, 2024
Merged

Conversation

tdrauncieal
Copy link
Contributor

@tdrauncieal tdrauncieal commented Jan 31, 2024

Related issue
Closes #2791

Description

The objective is to include the installation of the wazuh-keystore tool, which will be located in the bin directory. This tool is essential for managing the keystore within the Wazuh environment.

This PR is related to #21680 which complies with the necessary changes in https://github.com/wazuh/wazuh/

Tests

Centos test

[root@44fc8ae8f64c /]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
[root@44fc8ae8f64c /]# cd /var/ossec/bin/
[root@44fc8ae8f64c bin]# ./wazuh-keystore -h

Usage: wazuh-keystore <option(s)>
Options:
        -h                      Show this help message
        -f COLUMN_FAMILY        Specifies the target column family for the insertion.
        -k KEY                  Specifies the key for the key-value pair.
        -v VALUE                Specifies the value associated with the key.

Example:
        ./wazuh-keystore -f indexer -k username -v admin

[root@44fc8ae8f64c bin]# ./wazuh-keystore -f indexer -k username -v admin
[root@44fc8ae8f64c bin]# ls -l ../queue/keystore/
total 80
-rw-r--r-- 1 root root     0 Jan 31 14:10 000004.log
-rw-r--r-- 1 root root  1307 Jan 31 14:10 000012.sst
-rw-r--r-- 1 root root    16 Jan 31 14:10 CURRENT
-rw-r--r-- 1 root root    36 Jan 31 14:10 IDENTITY
-rw-r--r-- 1 root root     0 Jan 31 14:10 LOCK
-rw-r--r-- 1 root root 44845 Jan 31 14:10 LOG
-rw-r--r-- 1 root root   258 Jan 31 14:10 MANIFEST-000005
-rw-r--r-- 1 root root  7080 Jan 31 14:10 OPTIONS-000009
-rw-r--r-- 1 root root 11466 Jan 31 14:10 OPTIONS-000011

Ubuntu Test

✔ 14:12 $ ./docker\ exec\ -it\ determined_borg\ bash 
root@72a10253b9d0:/# cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
root@72a10253b9d0:/# cd /var/ossec/bin/
root@72a10253b9d0:/var/ossec/bin# ./wazuh-keystore -h

Usage: wazuh-keystore <option(s)>
Options:
        -h                      Show this help message
        -f COLUMN_FAMILY        Specifies the target column family for the insertion.
        -k KEY                  Specifies the key for the key-value pair.
        -v VALUE                Specifies the value associated with the key.

Example:
        ./wazuh-keystore -f indexer -k username -v admin

root@72a10253b9d0:/var/ossec/bin# ./wazuh-keystore -f indexer -k username -v admin
root@72a10253b9d0:/var/ossec/bin# ll ../queue/keystore/
total 88
drwxr-x---  2 wazuh wazuh  4096 Jan 31 14:14 ./
drwxr-x--- 19 root  wazuh  4096 Jan 30 00:38 ../
-rw-r--r--  1 root  root      0 Jan 31 14:14 000004.log
-rw-r--r--  1 root  root   1307 Jan 31 14:14 000012.sst
-rw-r--r--  1 root  root     16 Jan 31 14:14 CURRENT
-rw-r--r--  1 root  root     36 Jan 31 14:14 IDENTITY
-rw-r--r--  1 root  root      0 Jan 31 14:14 LOCK
-rw-r--r--  1 root  root  44850 Jan 31 14:14 LOG
-rw-r--r--  1 root  root    258 Jan 31 14:14 MANIFEST-000005
-rw-r--r--  1 root  root   7080 Jan 31 14:14 OPTIONS-000009
-rw-r--r--  1 root  root  11466 Jan 31 14:14 OPTIONS-000011
  • Build the package in any supported platform
    • Linux
    • Windows
    • macOS
    • Solaris
    • AIX
    • HP-UX
  • Package installation
  • Package upgrade
  • Package downgrade
  • Package remove
  • Package install/remove/install
  • Change added to CHANGELOG.md
  • Tests for Linux RPM
    • Build the package for x86_64
    • Build the package for i386
    • Build the package for armhf
    • Build the package for aarch64
    • %files section is correctly updated if necessary
  • Tests for Linux deb
    • Build the package for x86_64
    • Build the package for i386
    • Build the package for armhf
    • Build the package for aarch64
    • Package install/remove/install
    • Package install/purge/install
    • Check file permissions after installing the package
  • Tests for macOS
    • Test the package from macOS Sierra to Mojave
  • Tests for Solaris
    • Test the package on Solaris 10
    • Test the package on Solaris 11
    • Check file permissions on Solaris 11 template
  • Tests for IBM AIX
    • %files section is correctly updated if necessary
    • Check the changes from IBM AIX 5 to 7

@tdrauncieal tdrauncieal added level/task Subtask issue type/enhancement Enhancement issue labels Jan 31, 2024
@tdrauncieal tdrauncieal self-assigned this Jan 31, 2024
@tdrauncieal tdrauncieal changed the base branch from master to 4.8.0 January 31, 2024 14:23
@tdrauncieal tdrauncieal marked this pull request as ready for review January 31, 2024 15:02
Copy link
Contributor

@mateocervilla mateocervilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I think the failed checks are due to the fact that the branch of wazuh-wazuh 21668-keystore-tool and wazuh-packages 2791-keystore-tool have different names and cannot be found by the tests.

Copy link

@Leoquicenoz Leoquicenoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

Solving the branch issue, it should work without any problem (we checked this with the test we did earlier).

@Dwordcito Dwordcito merged commit b3517d6 into 4.8.0 Feb 2, 2024
8 of 12 checks passed
@Dwordcito Dwordcito deleted the 2791-keystore-tool branch February 2, 2024 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Subtask issue type/enhancement Enhancement issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify specs files to deploy the 'wazuh-keystore' tool
5 participants