Skip to content

Commit

Permalink
[Backport 4.5.1-7.10] Update test snapshots for 4.5 (#5605)
Browse files Browse the repository at this point in the history
* Update test snapshots for 4.5 (#5601)

* Add missing supported versions to the Docker environments (#5584)

feat(environments): add latest versions to Docker environments

- Add Kibana versions: 7.17.7, 7.17.8, 7.17.9 and 7.17.10
- Add OpenSearch: 2.6.0
- Add OpenSearch Dashboards: 2.6.0
- Add Wazuh 4.4.1, 4.4.2, 4.4.3 and 4.4.4

* Update test snapshost

* Update API data to 4.5

* Update branch patterns for GH Actions

---------

Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com>
(cherry picked from commit 1ae5f19)

* Fix API reference links in endpoints.json
  • Loading branch information
AlexRuiz7 authored Jun 27, 2023
1 parent f4fbeae commit e3200a6
Show file tree
Hide file tree
Showing 11 changed files with 507 additions and 495 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
name: ESLint

on:
push:
branches: [ "master", "*.*-*.*", "*.*-*.*-wzd", "[0-9].[0-9]+" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "*.*-*.*", "*.*-*.*-wzd", "[0-9].[0-9]+" ]
branches:
- 'master'
- '[345].[0-9]+' # Minor branches
- '[345].[0-9]+.[0-9]+' # Patch branches
- '[345].[0-9]+.[0-9]+-7.[0-9]+' # Minor branches - Kibana

jobs:
eslint:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ on:
pull_request:
branches:
- 'master'
- '*.*-*.*'
- '*.*-*.*-wzd'
- '[0-9].[0-9]+'
- '[345].[0-9]+' # Minor branches
- '[345].[0-9]+.[0-9]+' # Patch branches
- '[345].[0-9]+.[0-9]+-7.[0-9]+' # Minor branches - Kibana

jobs:
# Run unit tests with Jest
Expand Down
531 changes: 276 additions & 255 deletions common/api-info/endpoints.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common/services/web_documentation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ test(`Generate a web documentation URL to the base URL using to the plugin short
});

test(`Generate a web documentation URL using a specific version`, () => {
expect(webDocumentationLink('user-manual/agent-enrollment/index.html', '4.4')).toBe(`${DOCUMENTATION_WEB_BASE_URL}/4.4/user-manual/agent-enrollment/index.html`);
expect(webDocumentationLink('user-manual/agent-enrollment/index.html', '4.5')).toBe(`${DOCUMENTATION_WEB_BASE_URL}/4.5/user-manual/agent-enrollment/index.html`);
});
110 changes: 54 additions & 56 deletions docker/wazuh-4.4-wz/pre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

versions=(
"4.4.0"
"4.4.1"
"4.4.2"
"4.4.3"
"4.4.4"
"4.4.1"
"4.4.2"
"4.4.3"
"4.4.4"
"4.5.0"
"4.5.1"
)
Expand Down Expand Up @@ -34,26 +34,24 @@ usage() {
exit -1
}

if [ $# -ne 3 ]
then
echo "Incorrect number of arguments " $#
usage
if [ $# -ne 3 ]; then
echo "Incorrect number of arguments " $#
usage
fi

if [[ ! " ${versions[*]} " =~ " ${1} " ]]
then
echo "Version ${1} not found in ${versions[*]}"
exit -1
if [[ ! " ${versions[*]} " =~ " ${1} " ]]; then
echo "Version ${1} not found in ${versions[*]}"
exit -1
fi

[ -n "$2" ] && [ "$2" -eq "$2" ] 2>/dev/null
if [ $? -ne 0 ]; then
echo "$2 is not number"
exit -1
echo "$2 is not number"
exit -1
fi

patch_version=$2
cat << EOF > config/imposter/api_info.json
cat <<EOF >config/imposter/api_info.json
{
"data": {
"title": "Wazuh API REST",
Expand All @@ -74,46 +72,46 @@ export KIBANA_PASSWORD=${PASSWORD:-SecretPassword}
export COMPOSE_PROJECT_NAME=wz-pre-${WAZUH_STACK//./}

case "$3" in
up)
# recreate volumes
docker compose -f pre.yml up -Vd
up)
# recreate volumes
docker compose -f pre.yml up -Vd

# This installs Wazuh and integrates with a default Wazuh stack
# v=$( echo -n $WAZUH_STACK | sed 's/\.//g' )
echo
echo "Install the pre-release package manually with:"
echo
echo "1. Uninstall current version of the Wazuh app:"
echo "docker exec -ti ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1 /usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin remove wazuh"
echo
echo "2. Restart Wazuh Dashboard:"
echo "docker restart ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1"
echo
echo "3. Copy the pre-release package to the running Wazuh Dashboard container:"
echo docker cp wazuh-4.4.${patch_version}-1.zip ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1:/tmp
echo
echo "4. Install the package we have just uploaded:"
echo "docker exec -ti ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1 /usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin install file:///tmp/wazuh-4.4.${patch_version}-1.zip"
echo
echo "5. Restart the Wazuh Dashboard container:"
echo "docker restart ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1"
echo
echo "6. Upload the Wazuh app configuration:"
echo "docker cp ./config/wazuh_dashboard/wazuh.yml ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1:/usr/share/wazuh-dashboard/data/wazuh/config/"
echo
echo "7. Access the running instance in:"
echo "https://localhost:${KIBANA_PORT}"
echo
;;
down)
# delete volumes
docker compose -f pre.yml down -v --remove-orphans
;;
stop)
docker compose -f rel.yml -p ${COMPOSE_PROJECT_NAME} stop
;;
*)
echo "Action must be either up or down"
usage
;;
# This installs Wazuh and integrates with a default Wazuh stack
# v=$( echo -n $WAZUH_STACK | sed 's/\.//g' )
echo
echo "Install the pre-release package manually with:"
echo
echo "1. Uninstall current version of the Wazuh app:"
echo "docker exec -ti ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1 /usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin remove wazuh"
echo
echo "2. Restart Wazuh Dashboard:"
echo "docker restart ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1"
echo
echo "3. Copy the pre-release package to the running Wazuh Dashboard container:"
echo docker cp wazuh-4.4.${patch_version}-1.zip ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1:/tmp
echo
echo "4. Install the package we have just uploaded:"
echo "docker exec -ti ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1 /usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin install file:///tmp/wazuh-4.4.${patch_version}-1.zip"
echo
echo "5. Restart the Wazuh Dashboard container:"
echo "docker restart ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1"
echo
echo "6. Upload the Wazuh app configuration:"
echo "docker cp ./config/wazuh_dashboard/wazuh.yml ${COMPOSE_PROJECT_NAME}-wazuh.dashboard-1:/usr/share/wazuh-dashboard/data/wazuh/config/"
echo
echo "7. Access the running instance in:"
echo "https://localhost:${KIBANA_PORT}"
echo
;;
down)
# delete volumes
docker compose -f pre.yml down -v --remove-orphans
;;
stop)
docker compose -f rel.yml -p ${COMPOSE_PROJECT_NAME} stop
;;
*)
echo "Action must be either up or down"
usage
;;
esac
77 changes: 37 additions & 40 deletions docker/wazuh-4.4-wz/rel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

versions=(
"4.4.0"
"4.4.1"
"4.4.2"
"4.4.3"
"4.4.4"
"4.4.1"
"4.4.2"
"4.4.3"
"4.4.4"
"4.5.0"
"4.5.1"
)
Expand All @@ -20,16 +20,14 @@ usage() {
exit -1
}

if [ $# -lt 2 ]
then
echo "Incorrect number of arguments " $#
usage
if [ $# -lt 2 ]; then
echo "Incorrect number of arguments " $#
usage
fi

if [[ ! " ${versions[*]} " =~ " ${1} " ]]
then
echo "Version ${1} not found in ${versions[*]}"
exit -1
if [[ ! " ${versions[*]} " =~ " ${1} " ]]; then
echo "Version ${1} not found in ${versions[*]}"
exit -1
fi

export WAZUH_STACK=${1}
Expand All @@ -41,38 +39,37 @@ profile="standard"
export WAZUH_DASHBOARD_CONF=./config/wazuh_dashboard/wazuh_dashboard.yml
export SEC_CONFIG_FILE=./config/wazuh_indexer/config.yml

if [[ "$3" =~ "saml" ]]
then
if [[ "$3" =~ "saml" ]]; then
profile="saml"
export WAZUH_DASHBOARD_CONF=./config/wazuh_dashboard/wazuh_dashboard_saml.yml
export SEC_CONFIG_FILE=./config/wazuh_indexer/config-saml.yml
fi

case "$2" in
up)
docker compose --profile $profile -f rel.yml -p ${COMPOSE_PROJECT_NAME} up -Vd
echo
echo "1. (Optional) Enroll an agent (Ubuntu 20.04):"
echo "docker run --name ${COMPOSE_PROJECT_NAME}-agent --network ${COMPOSE_PROJECT_NAME} --label com.docker.compose.project=${COMPOSE_PROJECT_NAME} -d ubuntu:20.04 bash -c '"
echo " apt update -y"
echo " apt install -y curl lsb-release"
echo " curl -so \wazuh-agent-${WAZUH_STACK}.deb \\"
echo " https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${WAZUH_STACK}-1_amd64.deb \\"
echo " && WAZUH_MANAGER='wazuh.manager' WAZUH_AGENT_GROUP='default' dpkg -i ./wazuh-agent-${WAZUH_STACK}.deb"
echo
echo " /etc/init.d/wazuh-agent start"
echo " tail -f /var/ossec/logs/ossec.log"
echo "'"
echo
;;
down)
docker compose --profile $profile -f rel.yml -p ${COMPOSE_PROJECT_NAME} down -v --remove-orphans
;;
stop)
docker compose --profile $profile -f rel.yml -p ${COMPOSE_PROJECT_NAME} stop
;;
*)
echo "Action must be either up or down"
usage
;;
up)
docker compose --profile $profile -f rel.yml -p ${COMPOSE_PROJECT_NAME} up -Vd
echo
echo "1. (Optional) Enroll an agent (Ubuntu 20.04):"
echo "docker run --name ${COMPOSE_PROJECT_NAME}-agent --network ${COMPOSE_PROJECT_NAME} --label com.docker.compose.project=${COMPOSE_PROJECT_NAME} -d ubuntu:20.04 bash -c '"
echo " apt update -y"
echo " apt install -y curl lsb-release"
echo " curl -so \wazuh-agent-${WAZUH_STACK}.deb \\"
echo " https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${WAZUH_STACK}-1_amd64.deb \\"
echo " && WAZUH_MANAGER='wazuh.manager' WAZUH_AGENT_GROUP='default' dpkg -i ./wazuh-agent-${WAZUH_STACK}.deb"
echo
echo " /etc/init.d/wazuh-agent start"
echo " tail -f /var/ossec/logs/ossec.log"
echo "'"
echo
;;
down)
docker compose --profile $profile -f rel.yml -p ${COMPOSE_PROJECT_NAME} down -v --remove-orphans
;;
stop)
docker compose --profile $profile -f rel.yml -p ${COMPOSE_PROJECT_NAME} stop
;;
*)
echo "Action must be either up or down"
usage
;;
esac
Loading

0 comments on commit e3200a6

Please sign in to comment.