wazuh / wazuh-qa

Wazuh - Quality Assurance
GNU General Public License v2.0
64 stars 30 forks source link

DTT1 - Iteration 3 - Allocation module - Add support to deploy PPC OSs #5085

Closed teddytpc1 closed 5 months ago

teddytpc1 commented 6 months ago

Epic #4495

Description

This issue aims to add support to deploy PPC OSs, including validating the correct functioning of these OSs along with those added previously. It is possible that PPC OSs need a new provider because they will be deployed as Docker containers.

Tasks

c-bordon commented 6 months ago

Update report

I am working on the necessary changes to be able to create the containers on the PPC machines, at the moment I am making several related to the execution of docker

c-bordon commented 6 months ago

PPC64 Debian test

Local execution

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --size large --ssh-key ~/.ssh/allocation_test --composite-name linux-debian-9-ppc64
[2024-03-26 17:10:50] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-26 17:10:54] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-26 17:10:54] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-26 17:11:02] [INFO] ALLOCATOR: Instance VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F created.
[2024-03-26 17:11:11] [INFO] ALLOCATOR: Instance VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F started.
[2024-03-26 17:11:11] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F/inventory.yml
[2024-03-26 17:11:11] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F/inventory.yml
ansible_connection: ssh
ansible_host: 140.211.169.152
ansible_port: 2222
ansible_ssh_private_key_file: /home/cbordon/.ssh/allocation_test
ansible_user: root
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F/track.yml
arch: ppc64
host_identifier: debian
host_instance_dir: None
identifier: VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F
instance_dir: /tmp/wazuh-qa/VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F
key_path: /home/cbordon/.ssh/allocation_test
platform: linux
provider: vagrant
ssh_port: 2222
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh -i /home/cbordon/.ssh/allocation_test -p 2222 root@140.211.169.152
Linux ef238fb48d8e 4.9.0-13-powerpc64le #1 SMP Debian 4.9.228-1 (2020-07-05) ppc64le

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@ef238fb48d8e:~# exit
logout
Connection to 140.211.169.152 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/VAGRANT^C
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ls -la /tmp/wazuh-qa/VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F/
total 16
drwxrwxr-x 2 cbordon cbordon 4096 mar 26 17:11 .
drwxrwxr-x 3 cbordon cbordon 4096 mar 26 17:10 ..
-rw-rw-r-- 1 cbordon cbordon  157 mar 26 17:11 inventory.yml
-rw-rw-r-- 1 cbordon cbordon  284 mar 26 17:11 track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F/track.yml
[2024-03-26 17:12:35] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F/track.yml
[2024-03-26 17:12:36] [DEBUG] ALLOCATOR: Destroying instance VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F
[2024-03-26 17:12:42] [INFO] ALLOCATOR: Instance VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F deleted.

Remote server

debian@wazuh1:~$ sudo docker ps
CONTAINER ID   IMAGE                  COMMAND               CREATED          STATUS          PORTS                                   NAMES
ef238fb48d8e   testing-debian-image   "/usr/sbin/sshd -D"   46 seconds ago   Up 43 seconds   0.0.0.0:2222->22/tcp, :::2222->22/tcp   VAGRANT-3D5DD11F-C5A5-41AF-BABA-10C2D12C9A0F
a9ffadc97f8e   testing-debian-image   "/usr/sbin/sshd -D"   16 minutes ago   Up 16 minutes   0.0.0.0:8080->22/tcp, :::8080->22/tcp   VAGRANT-5C99E9BB-FA5E-4BB3-8849-20D3FD2395BC
debian@wazuh1:~$ sudo docker ps
CONTAINER ID   IMAGE                  COMMAND               CREATED          STATUS          PORTS                                   NAMES
a9ffadc97f8e   testing-debian-image   "/usr/sbin/sshd -D"   17 minutes ago   Up 17 minutes   0.0.0.0:8080->22/tcp, :::8080->22/tcp   VAGRANT-5C99E9BB-FA5E-4BB3-8849-20D3FD2395BC
c-bordon commented 6 months ago

PPC64 Centos test

Local execution

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --size large --ssh-key ~/.ssh/allocation_test --composite-name linux-centos-7-ppc64
[2024-03-26 17:15:06] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-26 17:15:10] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-26 17:15:10] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-26 17:15:19] [INFO] ALLOCATOR: Instance VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7 created.
[2024-03-26 17:15:31] [INFO] ALLOCATOR: Instance VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7 started.
[2024-03-26 17:15:31] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7/inventory.yml
[2024-03-26 17:15:31] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7/inventory.yml
ansible_connection: ssh
ansible_host: 140.211.169.156
ansible_port: 2222
ansible_ssh_private_key_file: /home/cbordon/.ssh/allocation_test
ansible_user: root
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7/track.yml
arch: ppc64
host_identifier: centos
host_instance_dir: None
identifier: VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7
instance_dir: /tmp/wazuh-qa/VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7
key_path: /home/cbordon/.ssh/allocation_test
platform: linux
provider: vagrant
ssh_port: 2222
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh -i /home/cbordon/.ssh/allocation_test -p 2222 root@140.211.169.156
[root@597c7c6c0adc ~]# cat /etc/*release
CentOS Linux release 7.9.2009 (AltArch)
NAME="CentOS Linux"
VERSION="7 (AltArch)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (AltArch)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7:server"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.9.2009 (AltArch)
CentOS Linux release 7.9.2009 (AltArch)
[root@597c7c6c0adc ~]# exit
logout
Connection to 140.211.169.156 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7/track.yml
[2024-03-26 17:16:38] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7/track.yml
[2024-03-26 17:16:40] [DEBUG] ALLOCATOR: Destroying instance VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7
[2024-03-26 17:16:45] [INFO] ALLOCATOR: Instance VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7 deleted.

Remote server

[centos@wazuh3 ~]$ sudo docker ps
CONTAINER ID        IMAGE                  COMMAND               CREATED              STATUS              PORTS                  NAMES
597c7c6c0adc        testing-centos-image   "/usr/sbin/sshd -D"   About a minute ago   Up 57 seconds       0.0.0.0:2222->22/tcp   VAGRANT-99B8D5A3-80B9-4807-B962-2CEB0C5C28D7
5d154dfb506d        testing-centos-image   "/usr/sbin/sshd -D"   2 weeks ago          Up 2 weeks          0.0.0.0:8080->22/tcp   centos_idr_828
[centos@wazuh3 ~]$ sudo docker ps
CONTAINER ID        IMAGE                  COMMAND               CREATED             STATUS              PORTS                  NAMES
5d154dfb506d        testing-centos-image   "/usr/sbin/sshd -D"   2 weeks ago         Up 2 weeks          0.0.0.0:8080->22/tcp   centos_idr_828
c-bordon commented 6 months ago

Vagrant local test

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --size large --ssh-key ~/.ssh/allocation_test --composite-name linux-ubuntu-18.04-amd64
[2024-03-26 17:18:06] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-26 17:18:06] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-26 17:18:06] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-26 17:18:09] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-03-26 17:18:09] [INFO] ALLOCATOR: Instance VAGRANT-4488101C-5709-40AA-9B72-748047163A0A created.
[2024-03-26 17:19:41] [INFO] ALLOCATOR: Instance VAGRANT-4488101C-5709-40AA-9B72-748047163A0A started.
[2024-03-26 17:19:44] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/VAGRANT-4488101C-5709-40AA-9B72-748047163A0A/inventory.yml
[2024-03-26 17:19:47] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/VAGRANT-4488101C-5709-40AA-9B72-748047163A0A/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-4488101C-5709-40AA-9B72-748047163A0A/inventory.yml
ansible_connection: ssh
ansible_host: 192.168.57.2
ansible_port: 22
ansible_ssh_private_key_file: /home/cbordon/.ssh/allocation_test
ansible_user: vagrant
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-4488101C-5709-40AA-9B72-748047163A0A/track.yml
arch: amd64
host_identifier: None
host_instance_dir: None
identifier: VAGRANT-4488101C-5709-40AA-9B72-748047163A0A
instance_dir: /tmp/wazuh-qa/VAGRANT-4488101C-5709-40AA-9B72-748047163A0A
key_path: /home/cbordon/.ssh/allocation_test
platform: linux
provider: vagrant
ssh_port: 22
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh -i /home/cbordon/.ssh/allocation_test vagrant@192.168.57.2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:NbCMotBFL2Ckta07eQHA6r/SRlKmXLDaj9Q1jpKT08M.
Please contact your system administrator.
Add correct host key in /home/cbordon/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/cbordon/.ssh/known_hosts:1216
  remove with:
  ssh-keygen -f "/home/cbordon/.ssh/known_hosts" -R "192.168.57.2"
Host key for 192.168.57.2 has changed and you have requested strict checking.
Host key verification failed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh-keygen -f "/home/cbordon/.ssh/known_hosts" -R "192.168.57.2"
# Host 192.168.57.2 found: line 1214
# Host 192.168.57.2 found: line 1215
# Host 192.168.57.2 found: line 1216
/home/cbordon/.ssh/known_hosts updated.
Original contents retained as /home/cbordon/.ssh/known_hosts.old
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh -i /home/cbordon/.ssh/allocation_test vagrant@192.168.57.2
The authenticity of host '192.168.57.2 (192.168.57.2)' can't be established.
ED25519 key fingerprint is SHA256:NbCMotBFL2Ckta07eQHA6r/SRlKmXLDaj9Q1jpKT08M.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.57.2' (ED25519) to the list of known hosts.
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-212-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Mar 26 20:20:12 UTC 2024

  System load:  0.11              Processes:             120
  Usage of /:   3.0% of 38.70GB   Users logged in:       0
  Memory usage: 1%                IP address for enp0s3: 10.0.2.15
  Swap usage:   0%                IP address for enp0s8: 192.168.57.2

Expanded Security Maintenance for Infrastructure is not enabled.

0 updates can be applied immediately.

Enable ESM Infra to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status

New release '20.04.6 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

vagrant@ubuntu-bionic:~$ exit
logout
Connection to 192.168.57.2 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/VAGRANT-4488101C-5709-40AA-9B72-748047163A0A/track.yml
[2024-03-26 17:20:31] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/VAGRANT-4488101C-5709-40AA-9B72-748047163A0A/track.yml
[2024-03-26 17:20:31] [DEBUG] ALLOCATOR: The key /home/cbordon/.ssh/allocation_test will not be deleted. It is the user's responsibility to delete it.
[2024-03-26 17:20:31] [DEBUG] ALLOCATOR: Destroying instance VAGRANT-4488101C-5709-40AA-9B72-748047163A0A
[2024-03-26 17:20:36] [INFO] ALLOCATOR: Instance VAGRANT-4488101C-5709-40AA-9B72-748047163A0A deleted.
c-bordon commented 6 months ago

macOS ARM Vagrant

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --size large --ssh-key ~/.ssh/allocation_test --composite-name macos-sonoma-14.0-arm64
[2024-03-26 17:44:48] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-26 17:44:48] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-03-26 17:44:53] [INFO] ALLOCATOR: macStadium server has less than 2 VMs running, deploying in this host.
[2024-03-26 17:44:57] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-26 17:44:57] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-26 17:45:00] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-03-26 17:45:04] [INFO] ALLOCATOR: Instance VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE created.
[2024-03-26 17:46:04] [INFO] ALLOCATOR: Instance VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE started.
[2024-03-26 17:46:22] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE/inventory.yml
[2024-03-26 17:46:33] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE/inventory.yml
ansible_connection: ssh
ansible_host: 10.10.0.250
ansible_password: vagrant
ansible_port: 43220
ansible_user: vagrant
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE/track.yml
arch: arm64
host_identifier: macstadium
host_instance_dir: /Users/jenkins/testing/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE
identifier: VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE
instance_dir: /tmp/wazuh-qa/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE
key_path: /home/cbordon/.ssh/allocation_test
platform: macos
provider: vagrant
ssh_port: 43220
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh -p 43220 vagrant@10.10.0.250
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:9mvLUi073rS4FehhGw4QggPltOA94OIuv4G7oqkaiRI.
Please contact your system administrator.
Add correct host key in /home/cbordon/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in /home/cbordon/.ssh/known_hosts:1087
  remove with:
  ssh-keygen -f "/home/cbordon/.ssh/known_hosts" -R "[10.10.0.250]:43220"
Host key for [10.10.0.250]:43220 has changed and you have requested strict checking.
Host key verification failed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh-keygen -f "/home/cbordon/.ssh/known_hosts" -R "[10.10.0.250]:43220"
# Host [10.10.0.250]:43220 found: line 1087
/home/cbordon/.ssh/known_hosts updated.
Original contents retained as /home/cbordon/.ssh/known_hosts.old
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh -p 43220 vagrant@10.10.0.250
The authenticity of host '[10.10.0.250]:43220 ([10.10.0.250]:43220)' can't be established.
ED25519 key fingerprint is SHA256:9mvLUi073rS4FehhGw4QggPltOA94OIuv4G7oqkaiRI.
This host key is known by the following other names/addresses:
    ~/.ssh/known_hosts:857: [hashed name]
    ~/.ssh/known_hosts:996: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[10.10.0.250]:43220' (ED25519) to the list of known hosts.
(vagrant@10.10.0.250) Password:
Last login: Wed Oct 11 06:37:37 2023
vagrant@vagrants-Virtual-Machine ~ % exit
Connection to 10.10.0.250 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE/track.yml
[2024-03-26 17:48:26] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE/track.yml
[2024-03-26 17:48:27] [DEBUG] ALLOCATOR: Destroying instance VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE
[2024-03-26 17:48:40] [DEBUG] ALLOCATOR: Deleting remote directory /Users/jenkins/testing/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE
[2024-03-26 17:48:43] [DEBUG] ALLOCATOR: Killing remote process on port 43220
[2024-03-26 17:48:50] [INFO] ALLOCATOR: Instance VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE deleted.

Remote host

sh-3.2# cd testing/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE/
sh-3.2# ls -la
total 8
drwxr-xr-x  4 jenkins  staff  128 Mar 26 13:45 .
drwxr-xr-x  7 jenkins  staff  224 Mar 26 13:44 ..
drwxr-xr-x  5 root     staff  160 Mar 26 13:45 .vagrant
-rw-r--r--  1 jenkins  staff  549 Mar 26 13:45 Vagrantfile
sh-3.2# pwd
/Users/jenkins/testing/VAGRANT-D98C5EFB-C8C7-4EBC-9B06-68C1885A08BE
sh-3.2# vagrant status
Current machine states:

default                   running (parallels)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
sh-3.2# cd ..
sh-3.2# ls -la
total 0
drwxr-xr-x   6 jenkins  staff   192 Mar 26 13:48 .
drwxr-x---+ 35 jenkins  staff  1120 Mar 26 13:47 ..
drwxr-xr-x   4 root     staff   128 Jan 15 04:56 689
drwxr-xr-x   4 root     staff   128 Sep  8  2023 macos-testing
drwxr-xr-x   2 root     staff    64 Feb 21 05:17 testing_dir
drwxr-xr-x   4 root     staff   128 Aug 22  2023 wpk-testing
c-bordon commented 5 months ago

macOS AMD

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --size medium --ssh-key ~/.ssh/allocation_test --composite-name macos-catalina-10.15.1-amd64
[2024-03-27 08:18:00] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-27 08:18:00] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-03-27 08:18:14] [INFO] ALLOCATOR: Using the black mini server to deploy.
[2024-03-27 08:18:19] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-27 08:18:19] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-27 08:18:26] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-03-27 08:18:31] [INFO] ALLOCATOR: Instance VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614 created.
[2024-03-27 08:21:57] [ERROR] ALLOCATOR: Command failed: Sorry, don't know how to check guest version of Virtualbox Guest Additions on this platform. Stopping installation.

[2024-03-27 08:21:57] [INFO] ALLOCATOR: Instance VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614 started.
[2024-03-27 08:22:09] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614/inventory.yml
[2024-03-27 08:22:21] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614/inventory.yml
ansible_connection: ssh
ansible_host: 10.10.0.251
ansible_password: vagrant
ansible_port: 43220
ansible_user: vagrant
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614/track.yml
arch: amd64
host_identifier: black_mini
host_instance_dir: /Users/jenkins/testing/VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614
identifier: VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614
instance_dir: /tmp/wazuh-qa/VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614
key_path: /home/cbordon/.ssh/allocation_test
platform: macos
provider: vagrant
ssh_port: 43220
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh -p 43220 vagrant@10.10.0.251 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:dNNIOOfMK7fopfzb1m6CI47Eit8zEO6CKxx+z0t/Pu0.
Please contact your system administrator.
Add correct host key in /home/cbordon/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/cbordon/.ssh/known_hosts:1125
  remove with:
  ssh-keygen -f "/home/cbordon/.ssh/known_hosts" -R "[10.10.0.251]:43220"
Host key for [10.10.0.251]:43220 has changed and you have requested strict checking.
Host key verification failed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh-keygen -f "/home/cbordon/.ssh/known_hosts" -R "[10.10.0.251]:43220"
# Host [10.10.0.251]:43220 found: line 1124
# Host [10.10.0.251]:43220 found: line 1125
/home/cbordon/.ssh/known_hosts updated.
Original contents retained as /home/cbordon/.ssh/known_hosts.old
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh -p 43220 vagrant@10.10.0.251 
The authenticity of host '[10.10.0.251]:43220 ([10.10.0.251]:43220)' can't be established.
ED25519 key fingerprint is SHA256:dNNIOOfMK7fopfzb1m6CI47Eit8zEO6CKxx+z0t/Pu0.
This host key is known by the following other names/addresses:
    ~/.ssh/known_hosts:336: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[10.10.0.251]:43220' (ED25519) to the list of known hosts.
(vagrant@10.10.0.251) Password:
Last login: Tue Feb 25 07:44:14 2020 from 10.0.2.2
vagrant@test ~ % exit
Connection to 10.10.0.251 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614/track.yml
[2024-03-27 08:24:09] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614/track.yml
[2024-03-27 08:24:10] [DEBUG] ALLOCATOR: Destroying instance VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614
[2024-03-27 08:24:28] [DEBUG] ALLOCATOR: Deleting remote directory /Users/jenkins/testing/VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614
[2024-03-27 08:24:32] [INFO] ALLOCATOR: Instance VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614 deleted.

Remote host

sh-3.2# cd testing/
sh-3.2# ls -la
total 0
drwxr-xr-x   3 jenkins  staff    96 Mar 27 12:18 .
drwxr-xr-x@ 69 jenkins  staff  2208 Mar 27 12:23 ..
drwxr-xr-x   4 root     staff   128 Mar 27 12:18 VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614
sh-3.2# ls -la VAGRANT-B08CB71B-C873-4C25-A8E4-11CC90ACA614/
total 8
drwxr-xr-x  4 root     staff  128 Mar 27 12:18 .
drwxr-xr-x  3 jenkins  staff   96 Mar 27 12:18 ..
drwxr-xr-x  5 root     staff  160 Mar 27 12:18 .vagrant
-rw-r--r--  1 root     staff  749 Mar 27 12:18 Vagrantfile
sh-3.2# ls -la
total 0
drwxr-xr-x   2 jenkins  staff    64 Mar 27 12:24 .
drwxr-xr-x@ 69 jenkins  staff  2208 Mar 27 12:23 ..
c-bordon commented 5 months ago

AWS Deploy

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size medium --ssh-key ~/.ssh/allocation_test --composite-name linux-ubuntu-22.04-arm64 --label-termination-date 1d --label-team devops
[2024-03-27 08:27:23] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-27 08:27:23] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-27 08:27:23] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-27 08:27:24] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-740E9FEF-E9BF-42B6-9310-DFB28E1DA392
[2024-03-27 08:27:43] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-740E9FEF-E9BF-42B6-9310-DFB28E1DA392 directory to /tmp/wazuh-qa/i-053cb5df9ab19a629
[2024-03-27 08:27:43] [INFO] ALLOCATOR: Instance i-053cb5df9ab19a629 created.
[2024-03-27 08:27:45] [INFO] ALLOCATOR: Instance i-053cb5df9ab19a629 started.
[2024-03-27 08:27:45] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-053cb5df9ab19a629/inventory.yml
[2024-03-27 08:27:45] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-053cb5df9ab19a629/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/i-053cb5df9ab19a629/inventory.yml
ansible_connection: ssh
ansible_host: ec2-107-23-188-233.compute-1.amazonaws.com
ansible_port: 2200
ansible_ssh_private_key_file: /home/cbordon/.ssh/allocation_test
ansible_user: ubuntu
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ cat /tmp/wazuh-qa/i-053cb5df9ab19a629/track.yml
arch: arm64
host_identifier: None
host_instance_dir: None
identifier: i-053cb5df9ab19a629
instance_dir: /tmp/wazuh-qa/i-053cb5df9ab19a629
key_path: /home/cbordon/.ssh/allocation_test
platform: linux
provider: aws
ssh_port: 2200
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ ssh -i /home/cbordon/.ssh/allocation_test -p 2200 ubuntu@ec2-107-23-188-233.compute-1.amazonaws.com
The authenticity of host '[ec2-107-23-188-233.compute-1.amazonaws.com]:2200 ([107.23.188.233]:2200)' can't be established.
ED25519 key fingerprint is SHA256:TZH6eqTW3vNFGRjkWNmmNLJqG67RM/tOQjwjKGdHs2I.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[ec2-107-23-188-233.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 6.2.0-1012-aws aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Wed Mar 27 11:28:42 UTC 2024

  System load:  0.169921875       Processes:             160
  Usage of /:   18.9% of 7.58GB   Users logged in:       0
  Memory usage: 2%                IPv4 address for ens5: 172.31.23.30
  Swap usage:   0%

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status

The list of available updates is more than a week old.
To check for new updates run: sudo apt update

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@ip-172-31-23-30:~$ exit
logout
Connection to ec2-107-23-188-233.compute-1.amazonaws.com closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/i-053cb5df9ab19a629/track.yml
[2024-03-27 08:29:00] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/i-053cb5df9ab19a629/track.yml
[2024-03-27 08:29:48] [INFO] ALLOCATOR: Instance i-053cb5df9ab19a629 deleted.
QU3B1M commented 5 months ago

LGTM!