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

Compatibility with opensearch 2.17.1 #383

Merged
merged 39 commits into from
Nov 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
13caebb
Compatibility with OpenSearch 2.11.1 (#131)
yenienserrano Dec 22, 2023
2777683
Add script test packages (#133)
yenienserrano Jan 2, 2024
d00c20f
140 update the repo with the latest changes of wazuh dashboard (#141)
yenienserrano Feb 20, 2024
f84d2f1
Modify action to allow uploading artifact to S3 (#151)
Tostti Mar 20, 2024
fddb224
Modify package generation actions (#157)
Tostti Apr 4, 2024
328de49
Remove unrequired bundle
Tostti Apr 5, 2024
b3e557b
Fix service
Tostti Apr 5, 2024
85a1ea4
Fix repository tests (#163)
Tostti Apr 12, 2024
01bff25
Fix reference in building workflow
Tostti Apr 16, 2024
a5400ff
Fix tar error in build workflow (#168)
Tostti Apr 17, 2024
7088f9e
Fix errors in package build workflow (#169)
Tostti Apr 19, 2024
d6a0bd9
Add secret for aws region (#171)
Tostti Apr 24, 2024
7ac788d
Change default theme (#174)
Tostti May 10, 2024
9030f75
Add ID input to workflows (#179)
rauldpm May 17, 2024
a38c8c4
Fix css selector to login button (#181)
lucianogorza May 22, 2024
5904e49
Fix error generating packages in branches that contain `/` (#183)
Tostti May 23, 2024
602d123
Add information to build workflow title (#188)
Tostti May 28, 2024
42bbbbb
Build packages with docker (#185)
yenienserrano May 31, 2024
72bda15
Added S3 URI output to package generation upload (#190)
rauldpm Jun 5, 2024
38cd753
Added missing name statement in package generation workflows (#191)
rauldpm Jun 6, 2024
3371776
Added missing name statement in package generation workflows
Tostti Jun 19, 2024
ede1313
Sync 4.9.0 to 4.10.0 (#269)
yenienserrano Aug 19, 2024
2e75e8f
Change the path to the name of the application to the logo redirectio…
yenienserrano Aug 30, 2024
d223035
Remove setting new home (#282)
yenienserrano Sep 3, 2024
6b35cfb
Merge 4.9.1 into 4.10.0 (#306)
yenienserrano Sep 10, 2024
ad42837
Support Wazuh 5.0.0
yenienserrano Sep 10, 2024
0800bee
Integrates the reporting plugin into the construction process (#340)
yenienserrano Oct 9, 2024
4e0777c
Merge 4.10.2 into master (#367)
Tostti Oct 17, 2024
4549838
Fix home:useNewHomePage undefined
yenienserrano Oct 28, 2024
9b080f7
Fix snapshots
yenienserrano Oct 29, 2024
e7b2b16
Make upload to s3 optional (#384)
yenienserrano Oct 29, 2024
0598183
Add dockerfile and entrypoint
yenienserrano Oct 29, 2024
8ecae44
Create image with plugins
yenienserrano Oct 29, 2024
8d68801
Add install-plugins and entrypoint to wzd.dockerfile
yenienserrano Oct 30, 2024
4368516
change usage comment
yenienserrano Oct 30, 2024
bb643d1
Change entrypoint
yenienserrano Oct 31, 2024
8c387a6
Add commit sha of all repositories in package name (#390)
Tostti Nov 4, 2024
1a2f78e
Merge 4.10.2 into master (#398)
Tostti Nov 6, 2024
2210738
Change branch to use build
yenienserrano Nov 6, 2024
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
Prev Previous commit
Next Next commit
Integrates the reporting plugin into the construction process (#340)
Signed-off-by: Antonio <[email protected]>
Co-authored-by: Antonio <[email protected]>
  • Loading branch information
yenienserrano and Desvelao committed Oct 28, 2024
commit 0800beefbf01787c2471c5f6a550a8ca3b43d0d4
33 changes: 29 additions & 4 deletions .github/workflows/build_wazuh_dashboard_with_plugins.yml
Original file line number Diff line number Diff line change
@@ -35,6 +35,11 @@ on:
description: 'Branch/tag/commit of the wazuh-dashboard-plugins repository to build the main plugins'
required: true
default: 'master'
reference_report_plugins:
type: string
description: 'Branch/tag/commit of the wazuh-dashboard-reporting repository to build the report plugin'
required: true
default: 'master'
is_stage:
type: boolean
description: 'Set production nomenclature'
@@ -72,6 +77,10 @@ on:
type: string
required: true
default: 'master'
reference_report_plugins:
type: string
required: true
default: 'master'
is_stage:
type: boolean
required: true
@@ -103,26 +112,33 @@ jobs:
build-base:
needs: [validate-inputs]
name: Build dashboard
uses: wazuh/wazuh-dashboard/.github/workflows/build_base.yml@4.10.0
uses: wazuh/wazuh-dashboard/.github/workflows/build_base.yml@master
with:
CHECKOUT_TO: ${{ github.head_ref || github.ref_name }}

build-main-plugins:
needs: [validate-inputs]
name: Build plugins
uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@4.10.0
uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@master
with:
reference: ${{ inputs.reference_wazuh_plugins }}

build-security-plugin:
needs: [validate-inputs]
name: Build security plugin
uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/manual-build.yml@4.10.0
uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/manual-build.yml@master
with:
reference: ${{ inputs.reference_security_plugins }}

build-report-plugin:
needs: [validate-inputs]
name: Build reporting plugin
uses: wazuh/wazuh-dashboards-reporting/.github/workflows/manual-build.yml@master
with:
reference: ${{ inputs.reference_report_plugins }}

build-and-test-package:
needs: [build-main-plugins, build-base, build-security-plugin]
needs: [build-main-plugins, build-base, build-security-plugin, build-report-plugin]
runs-on: ubuntu-latest
name: Generate packages
steps:
@@ -150,6 +166,7 @@ jobs:
echo "WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${{ env.VERSION }}-${{ env.REVISION }}_x64.tar.gz" >> $GITHUB_ENV
echo "WAZUH_SECURITY_PLUGIN=wazuh-security-dashboards-plugin_${{ env.VERSION }}-${{ env.REVISION }}_${{ inputs.reference_security_plugins }}.zip" >> $GITHUB_ENV
echo "WAZUH_PLUGINS=wazuh-dashboard-plugins_${{ env.VERSION }}-${{ env.REVISION }}_${{ inputs.reference_wazuh_plugins }}.zip" >> $GITHUB_ENV
echo "WAZUH_REPORT_PLUGIN=reports-dashboards_${{ env.VERSION }}-${{ env.REVISION }}_${{ inputs.reference_report_plugins }}.zip" >> $GITHUB_ENV
if [ "${{ inputs.system }}" = "deb" ]; then
if [ "${{ inputs.is_stage }}" = "true" ]; then
echo "PACKAGE_NAME=wazuh-dashboard_${{ env.VERSION }}-${{ inputs.revision }}_${{ inputs.architecture }}.deb" >> $GITHUB_ENV
@@ -182,11 +199,18 @@ jobs:
name: ${{ env.WAZUH_PLUGINS }}
path: ${{ env.CURRENT_DIR }}/artifacts/plugins

- name: Download report plugin artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.WAZUH_REPORT_PLUGIN }}
path: ${{ env.CURRENT_DIR }}/artifacts/report-plugin

- name: Zip plugins
run: |
zip -r -j ${{ env.CURRENT_DIR }}/artifacts/wazuh-package.zip ${{ env.CURRENT_DIR }}/artifacts/plugins
zip -r -j ${{ env.CURRENT_DIR }}/artifacts/security-package.zip ${{ env.CURRENT_DIR }}/artifacts/security-plugin
zip -r -j ${{ env.CURRENT_DIR }}/artifacts/dashboard-package.zip ${{ env.CURRENT_DIR }}/artifacts/dashboard/${{ env.WAZUH_DASHBOARD_SLIM }}
zip -r -j ${{ env.CURRENT_DIR }}/artifacts/report-package.zip ${{ env.CURRENT_DIR }}/artifacts/report-plugin

- name: Build package
run: |
@@ -197,6 +221,7 @@ jobs:
-a file://${{env.CURRENT_DIR}}/artifacts/wazuh-package.zip \
-s file://${{env.CURRENT_DIR}}/artifacts/security-package.zip \
-b file://${{env.CURRENT_DIR}}/artifacts/dashboard-package.zip \
-rp file://${{env.CURRENT_DIR}}/artifacts/report-package.zip \
--${{ inputs.system }} ${{ env.PRODUCTION }}

- name: Test package
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,10 @@ All notable changes to the Wazuh app project will be documented in this file.

## Wazuh dashboard v5.0.0 - OpenSearch Dashboards 2.16.0 - Revision 00

### Changed

- Changed the reportingDashboards platform plugin to a customized one and adapt the build tools [#340](https://github.com/wazuh/wazuh-dashboard/pull/340)

## Wazuh dashboard v4.10.0 - OpenSearch Dashboards 2.16.0 - Revision 00

### Removed
33 changes: 28 additions & 5 deletions dev-tools/build-packages/base/generate_base.sh
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ base=""
revision="1"
security=""
version=""
reportPlugin=""

# Paths
current_path="$( cd $(dirname $0) ; pwd -P )"
@@ -116,6 +117,24 @@ build() {
clean 1
fi

echo
echo "Downloading report plugin.."
echo

if [[ $reportPlugin =~ $valid_url ]]; then
if ! curl --output applications/reporting.zip --silent --fail "${reportPlugin}"; then
echo "The given URL or Path to the Wazuh Reporting Plugin is not working: ${reportPlugin}"
clean 1
else
echo "Extracting Reporting application"
unzip -q applications/reporting.zip -d applications
rm applications/reporting.zip
fi
else
echo "The given URL or Path to the Wazuh Reporting Plugin is not valid: ${reportPlugin}"
clean 1
fi

tar -zxf wazuh-dashboard.tar.gz
directory_name=$(ls -td */ | head -1)
working_dir="wazuh-dashboard-$version-$revision-linux-x64"
@@ -126,7 +145,7 @@ build() {
echo Building the package...
echo

# Install Wazuh apps and Security app
# Install Wazuh apps, Reporting app and Security app

plugins=$(ls $tmp_dir/applications)' '$(cat $current_path/plugins)
for plugin in $plugins; do
@@ -150,9 +169,6 @@ build() {
category_explore='{id:"explore",label:"Explore",order:100,euiIconType:"search"}'
category_dashboard_management='{id:"management",label:"Index management",order:5e3,euiIconType:"managementApp"}'

# Replace app category to Reporting app
sed -i -e "s|category:{id:\"opensearch\",label:_i18n.i18n.translate(\"opensearch.reports.categoryName\",{defaultMessage:\"OpenSearch Plugins\"}),order:2e3}|category:${category_explore}|" ./plugins/reportsDashboards/target/public/reportsDashboards.plugin.js

# Replace app category to Alerting app
sed -i -e "s|category:{id:\"opensearch\",label:\"OpenSearch Plugins\",order:2e3}|category:${category_explore}|" ./plugins/alertingDashboards/target/public/alertingDashboards.plugin.js

@@ -167,7 +183,6 @@ build() {

# Generate compressed files
files_to_recreate=(
./plugins/reportsDashboards/target/public/reportsDashboards.plugin.js
./plugins/alertingDashboards/target/public/alertingDashboards.plugin.js
./plugins/customImportMapDashboards/target/public/customImportMapDashboards.plugin.js
./plugins/notificationsDashboards/target/public/notificationsDashboards.plugin.js
@@ -253,6 +268,14 @@ main() {
help 0
fi
;;
"-rp" | "--reportPlugin")
if [ -n "${2}" ]; then
reportPlugin="${2}"
shift 2
else
help 0
fi
;;
"-v" | "--version")
if [ -n "${2}" ]; then
version="${2}"
1 change: 0 additions & 1 deletion dev-tools/build-packages/base/plugins
Original file line number Diff line number Diff line change
@@ -3,4 +3,3 @@ customImportMapDashboards
ganttChartDashboards
indexManagementDashboards
notificationsDashboards
reportsDashboards
11 changes: 10 additions & 1 deletion dev-tools/build-packages/build-packages.sh
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ base=""
revision="1"
security=""
version=""
reportPlugin=""
all_platforms="no"
deb="no"
rpm="no"
@@ -16,7 +17,7 @@ current_path="$( cd $(dirname $0) ; pwd -P )"
build_tar() {
echo "Building tar package..."
cd ./base
bash ./generate_base.sh -a $app -b $base -s $security -v $version -r $revision
bash ./generate_base.sh -a $app -b $base -s $security -rp $reportPlugin -v $version -r $revision

name_package_tar=$(ls ./output)

@@ -130,6 +131,14 @@ main() {
help 0
fi
;;
"-rp" | "--reportPlugin")
if [ -n "${2}" ]; then
reportPlugin="${2}"
shift 2
else
help 0
fi
;;
"-v" | "--version")
if [ -n "${2}" ]; then
version="${2}"
58 changes: 58 additions & 0 deletions dev-tools/build-packages/config-dockerfile/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
set -e

# Clone wazuh-dashboard
git clone --depth 1 --branch ${WAZUH_DASHBOARDS_BRANCH} https://github.com/wazuh/wazuh-dashboard.git /home/node/wzd
chown node.node /home/node/wzd

## Install dependencies and build wazuh-dashboard

cd /home/node/wzd
yarn osd bootstrap --production
yarn build --linux --skip-os-packages --release

# Clone plugins
cd /home/node/wzd/plugins
git clone --depth 1 --branch ${WAZUH_SECURITY_DASHBOARDS_PLUGIN_BRANCH} https://github.com/wazuh/wazuh-security-dashboards-plugin.git
git clone --depth 1 --branch ${WAZUH_DASHBOARDS_PLUGINS} https://github.com/wazuh/wazuh-dashboard-plugins.git
git clone --depth 1 --branch ${WAZUH_DASHBOARDS_REPORTING_BRANCH} https://github.com/wazuh/wazuh-dashboards-reporting.git

# Build wazuh-security-dashboards-plugin
cd /home/node/wzd/plugins/wazuh-security-dashboards-plugin
yarn
yarn build

# Build wazuh-dashboards-reporting
cd /home/node/wzd/plugins/wazuh-dashboards-reporting
yarn
yarn build

# Move plugins
cd /home/node/wzd/plugins
mv ./wazuh-dashboard-plugins/plugins/main ./wazuh
mv ./wazuh-dashboard-plugins/plugins/wazuh-core ./wazuh-core
mv ./wazuh-dashboard-plugins/plugins/wazuh-check-updates ./wazuh-check-updates

# Build plugins
cd /home/node/wzd/plugins/wazuh
yarn
yarn build

cd /home/node/wzd/plugins/wazuh-core
yarn
yarn build

cd /home/node/wzd/plugins/wazuh-check-updates
yarn
yarn build

# Zip packages
cd /home/node/
mkdir packages
cd /home/node/packages
zip -r -j ./dashboard-package.zip ../wzd/target/opensearch-dashboards-${OPENSEARCH_DASHBOARDS_VERSION}-linux-x64.tar.gz
zip -r -j ./security-package.zip ../wzd/plugins/wazuh-security-dashboards-plugin/build/security-dashboards-${OPENSEARCH_DASHBOARDS_VERSION}.0.zip
zip -r -j ./wazuh-package.zip ../wzd/plugins/wazuh-check-updates/build/wazuhCheckUpdates-${OPENSEARCH_DASHBOARDS_VERSION}.zip ../wzd/plugins/wazuh/build/wazuh-${OPENSEARCH_DASHBOARDS_VERSION}.zip ../wzd/plugins/wazuh-core/build/wazuhCore-${OPENSEARCH_DASHBOARDS_VERSION}.zip
zip -r -j ./reporting-package.zip ../wzd/plugins/wazuh-dashboards-reporting/build/reportsDashboards-${OPENSEARCH_DASHBOARDS_VERSION}.zip

exec "$@"
38 changes: 6 additions & 32 deletions dev-tools/build-packages/wazuh-dashboard.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,24 @@
# Usage: docker build --build-arg NODE_VERSION=18.19.0 --build-arg WAZUH_DASHBOARDS_BRANCH=4.10.0 --build-arg WAZUH_DASHBOARDS_PLUGINS=4.10.0 --build-arg WAZUH_SECURITY_DASHBOARDS_PLUGIN_BRANCH=4.10.0 --build-arg OPENSEARCH_DASHBOARDS_VERSION=2.13.0 -t wzd:4.10.0 -f wazuh-dashboard.Dockerfile .
# Usage: docker build --build-arg NODE_VERSION=18.19.0 --build-arg WAZUH_DASHBOARDS_BRANCH=4.10.0 --build-arg WAZUH_DASHBOARDS_REPORTING_BRANCH=4.10.0 --build-arg WAZUH_DASHBOARDS_PLUGINS=4.10.0 --build-arg WAZUH_SECURITY_DASHBOARDS_PLUGIN_BRANCH=4.10.0 --build-arg OPENSEARCH_DASHBOARDS_VERSION=2.13.0 -t wzd:4.10.0 -f wazuh-dashboard.Dockerfile .

ARG NODE_VERSION
FROM node:${NODE_VERSION} AS base
ARG OPENSEARCH_DASHBOARDS_VERSION
ARG WAZUH_DASHBOARDS_BRANCH
ARG WAZUH_DASHBOARDS_PLUGINS
ARG WAZUH_SECURITY_DASHBOARDS_PLUGIN_BRANCH
ARG WAZUH_DASHBOARDS_REPORTING_BRANCH
ENV OPENSEARCH_DASHBOARDS_VERSION=${OPENSEARCH_DASHBOARDS_VERSION}
USER root
RUN apt-get update && apt-get install -y git zip unzip curl brotli jq
USER node
RUN git clone --depth 1 --branch ${WAZUH_DASHBOARDS_BRANCH} https://github.com/wazuh/wazuh-dashboard.git /home/node/wzd
RUN chown node.node /home/node/wzd

WORKDIR /home/node/wzd
RUN yarn osd bootstrap --production
RUN yarn build --linux --skip-os-packages --release
COPY ./config-dockerfile/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

RUN bash /entrypoint.sh

WORKDIR /home/node/wzd/plugins
RUN git clone --depth 1 --branch ${WAZUH_SECURITY_DASHBOARDS_PLUGIN_BRANCH} https://github.com/wazuh/wazuh-security-dashboards-plugin.git
RUN git clone --depth 1 --branch ${WAZUH_DASHBOARDS_PLUGINS} https://github.com/wazuh/wazuh-dashboard-plugins.git
WORKDIR /home/node/wzd/plugins/wazuh-security-dashboards-plugin
RUN yarn
RUN yarn build
WORKDIR /home/node/wzd/plugins
RUN mv ./wazuh-dashboard-plugins/plugins/main ./wazuh
RUN mv ./wazuh-dashboard-plugins/plugins/wazuh-core ./wazuh-core
RUN mv ./wazuh-dashboard-plugins/plugins/wazuh-check-updates ./wazuh-check-updates
WORKDIR /home/node/wzd/plugins/wazuh
RUN yarn
RUN yarn build
WORKDIR /home/node/wzd/plugins/wazuh-core
RUN yarn
RUN yarn build
WORKDIR /home/node/wzd/plugins/wazuh-check-updates
RUN yarn
RUN yarn build
WORKDIR /home/node/
RUN mkdir packages
WORKDIR /home/node/packages
RUN zip -r -j ./dashboard-package.zip ../wzd/target/opensearch-dashboards-${OPENSEARCH_DASHBOARDS_VERSION}-linux-x64.tar.gz
RUN zip -r -j ./security-package.zip ../wzd/plugins/wazuh-security-dashboards-plugin/build/security-dashboards-${OPENSEARCH_DASHBOARDS_VERSION}.0.zip
RUN zip -r -j ./wazuh-package.zip ../wzd/plugins/wazuh-check-updates/build/wazuhCheckUpdates-${OPENSEARCH_DASHBOARDS_VERSION}.zip ../wzd/plugins/wazuh/build/wazuh-${OPENSEARCH_DASHBOARDS_VERSION}.zip ../wzd/plugins/wazuh-core/build/wazuhCore-${OPENSEARCH_DASHBOARDS_VERSION}.zip
WORKDIR /home/node/wzd/dev-tools/build-packages/base
RUN ./generate_base.sh -v 4.10.0 -r 1 -a file:///home/node/packages/wazuh-package.zip -s file:///home/node/packages/security-package.zip -b file:///home/node/packages/dashboard-package.zip
RUN ./generate_base.sh -v 4.10.0 -r 1 -a file:///home/node/packages/wazuh-package.zip -s file:///home/node/packages/security-package.zip -b file:///home/node/packages/dashboard-package.zip -rp file:///home/node/packages/reporting-package.zip
WORKDIR /home/node/wzd/dev-tools/build-packages/base/output
RUN cp ./* /home/node/packages/