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

[Backport 4.5.1-7.16] Update test snapshots for 4.5 #5606

Merged
merged 2 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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