diff --git a/.github/ISSUE_TEMPLATE/compatibility_request.md b/.github/ISSUE_TEMPLATE/compatibility_request.md
new file mode 100644
index 000000000000..b294b6fc8704
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/compatibility_request.md
@@ -0,0 +1,23 @@
+---
+name: Compatibility request
+about: Suggest supporting a new version of OpenSearch
+title: 'Compatibility with OpenSearch (version)'
+labels: compatibility, level/task, type/research
+assignees: ''
+
+---
+
+## Description
+We need to ensure the UI compatibility with the next version of OpenSearch vX.X.
+This update is still being discussed, but we need to be aware of potential issues.
+
+For that, we need to:
+
+- [ ] Review opensearch and opensearch-dashboard latest stable changelog.
+- [ ] Identify improvements and potential impact on the UI.
+- [ ] Create new tracking and development branches.
+- [ ] Develop a testing environment to verify our components would work under this new build.
+
+
+## Issues
+- _List here the detected issues_
diff --git a/.github/ISSUE_TEMPLATE/new_release.md b/.github/ISSUE_TEMPLATE/new_release.md
new file mode 100644
index 000000000000..2a8fb24f0e4d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/new_release.md
@@ -0,0 +1,33 @@
+---
+name: New release
+about: "[wazuh-team] Track the effort of the team to release a new version of Wazuh"
+title: Support for Wazuh 4.x.x
+labels: level/task, type/enhancement
+assignees: ''
+
+---
+
+## Description
+
+Example:
+> Wazuh 4.3.8 will be released shortly. Our Wazuh Dashboard app need to support this new version. From our side, no changes will be included, so we only need to bump the version.
+
+
+## Tasks
+
+### Pre-release
+- [ ] Add support for Wazuh 4.x.x (bump).
+- [ ] Generate the required tags.
+- [ ] Generate the packages.
+- [ ] Test the packages, to verify they install, and the app works as expected.
+- [ ] [Optional] Run Regression Testing (#issue)
+- [ ] Generate draft releases.
+- [ ] Notify the @wazuh/cicd and @wazuh/content teams that the release is good to go, from our side.
+
+### Post-release
+- [ ] Make draft releases final and public.
+- [ ] Sync branches.
+
+### Supported versions
+
+Same as on [previous releases](https://github.com/wazuh/wazuh-dashboard/wiki/Compatibility)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000000..8baaf0415e3c
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,92 @@
+# This is a basic workflow that is manually triggered
+
+name: Build
+
+on:
+ workflow_call:
+ inputs:
+ CHECKOUT_TO: # This is the branch to checkout to. Defaults to 'master'
+ description: 'The branch/tag/commit to checkout to'
+ required: true
+ default: ''
+ type: string
+ workflow_dispatch:
+ inputs:
+ CHECKOUT_TO: # This is the branch to checkout to. Defaults to 'master'
+ description: 'The branch/tag/commit to checkout to'
+ required: true
+ default: ''
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ name: Build
+ defaults:
+ run:
+ working-directory: ./artifacts
+ strategy:
+ matrix:
+ DISTRIBUTION: [ tar.gz ]
+ ARCHITECTURE: [ x64 ]
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ repository: wazuh/wazuh-dashboard
+ path: ./artifacts
+ ref: ${{ inputs.CHECKOUT_TO }}
+
+ - name: Setup Node
+ uses: actions/setup-node@v3
+ with:
+ node-version-file: './artifacts/.nvmrc'
+ registry-url: 'https://registry.npmjs.org'
+
+ - name: Setup Yarn
+ run: |
+ npm uninstall -g yarn
+ npm i -g yarn@1.22.10
+ yarn config set network-timeout 1000000 -g
+
+ - name: Configure Yarn Cache
+ run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
+
+ - name: Initialize Yarn Cache
+ uses: actions/cache@v3
+ with:
+ path: ${{ env.YARN_CACHE_LOCATION }}
+ key: yarn-${{ hashFiles('**/yarn.lock') }}
+ restore-keys: |
+ yarn-
+
+ - name: Get package version
+ run: |
+ echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
+ echo "WZD_VERSION=$(yarn --silent wzd-version)" >> $GITHUB_ENV
+ echo "WZD_REVISION=$(yarn --silent wzd-revision)" >> $GITHUB_ENV
+
+ - name: Get artifact build name
+ run: |
+ echo "ARTIFACT_BUILD_NAME=wazuh-dashboard_${{ env.WZD_VERSION }}-${{ env.WZD_REVISION }}_${{ matrix.ARCHITECTURE }}_${{ inputs.CHECKOUT_TO }}.${{ matrix.DISTRIBUTION }}" >> $GITHUB_ENV
+
+ - name: Run bootstrap
+ run: yarn osd bootstrap
+
+ - name: Build linux-x64
+ if: matrix.ARCHITECTURE == 'x64'
+ run: yarn build-platform --linux --skip-os-packages --release
+
+ - name: Build linux-arm64
+ if: matrix.ARCHITECTURE == 'arm64'
+ run: yarn build-platform --linux-arm --skip-os-packages --release
+
+ - name: Rename artifact
+ run: mv /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/opensearch-dashboards-${{ env.VERSION }}-linux-${{ matrix.ARCHITECTURE }}.${{ matrix.DISTRIBUTION }} /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
+
+ - uses: actions/upload-artifact@v3
+ if: success()
+ with:
+ name: ${{ env.ARTIFACT_BUILD_NAME }}
+ path: ./artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
+ retention-days: 30
diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml
new file mode 100644
index 000000000000..8ab9a563409e
--- /dev/null
+++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml
@@ -0,0 +1,212 @@
+name: Build final packages
+
+on:
+ workflow_dispatch:
+ inputs:
+ REFERENCE_SECURITY_PLUGIN:
+ description: 'Reference Wazuh security packages (branch/tag/commit)'
+ required: true
+ default: ''
+ REFERENCE_WAZUH_PLUGINS:
+ description: 'Reference Wazuh plugins (branch/tag/commit)'
+ required: true
+ default: ''
+ REFERENCE_WAZUH_DASHBOARD:
+ description: 'Reference Wazuh dashboard (branch/tag/commit)'
+ required: true
+ default: ''
+ DISTRIBUTION:
+ description: 'Distribution to build (deb | rpm | tar | all-platforms)'
+ required: true
+ default: ''
+
+jobs:
+ build-plugins:
+ name: Build plugins
+ uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@master
+ with:
+ reference: ${{ inputs.REFERENCE_WAZUH_PLUGINS }}
+
+ build-dashboard:
+ name: Build dashboard
+ uses: wazuh/wazuh-dashboard/.github/workflows/build.yml@4.9.0
+ with:
+ CHECKOUT_TO: ${{ inputs.REFERENCE_WAZUH_DASHBOARD }}
+
+ build-security-plugin:
+ name: Build security plugin
+ uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/manual-build.yml@4.9.0
+ with:
+ reference: ${{ inputs.REFERENCE_SECURITY_PLUGIN }}
+
+
+ Build-base-package:
+ needs: [build-plugins, build-dashboard, build-security-plugin]
+ runs-on: ubuntu-latest
+ name: Generate final packages
+ strategy:
+ fail-fast: false
+ matrix:
+ # TODO: Add arm64 support
+ ARCHITECTURE: [ x64 ]
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup Node
+ uses: actions/setup-node@v3
+ with:
+ node-version-file: '.nvmrc'
+ registry-url: 'https://registry.npmjs.org'
+
+ - name: Setup variables
+ run: |
+ echo "CURRENT_DIR=$(pwd -P)" >> $GITHUB_ENV
+ echo "VERSION=$(yarn --silent wzd-version)" >> $GITHUB_ENV
+ echo "REVISION=$(yarn --silent wzd-revision)" >> $GITHUB_ENV
+
+ - name: Setup packages names
+ run: |
+ echo "WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${{ env.VERSION }}-${{ env.REVISION }}_${{ matrix.ARCHITECTURE }}_${{ inputs.REFERENCE_WAZUH_DASHBOARD }}.tar.gz" >> $GITHUB_ENV
+ echo "WAZUH_SECURITY_PLUGIN=wazuh-security-dashboards-plugin_${{ env.VERSION }}-${{ env.REVISION }}_${{ inputs.REFERENCE_SECURITY_PLUGIN }}.zip" >> $GITHUB_ENV
+ echo "WAZUH_PLUGINS=wazuh-dashboard-plugins_${{ env.VERSION }}-${{ env.REVISION }}_${{ inputs.REFERENCE_WAZUH_PLUGINS }}.zip" >> $GITHUB_ENV
+
+ - name: Download dashboard artifact
+ uses: actions/download-artifact@v3
+ with:
+ name: ${{ env.WAZUH_DASHBOARD_SLIM }}
+ path: ${{ env.CURRENT_DIR }}/artifacts/dashboard
+
+ - name: Download security plugin artifact
+ uses: actions/download-artifact@v3
+ with:
+ name: ${{ env.WAZUH_SECURITY_PLUGIN }}
+ path: ${{ env.CURRENT_DIR }}/artifacts/security-plugin
+
+ - name: Download plugins artifacts
+ uses: actions/download-artifact@v3
+ with:
+ name: ${{ env.WAZUH_PLUGINS }}
+ path: ${{ env.CURRENT_DIR }}/artifacts/plugins
+
+ - 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 }}
+
+
+ - name: Build packages
+ run: |
+ cd ${{ env.CURRENT_DIR }}/dev-tools/build-packages
+ bash ./build-packages.sh \
+ -v ${{ env.VERSION }} \
+ -r ${{ env.REVISION }} \
+ -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 \
+ --tar
+
+
+ - name: Upload tar packages
+ uses: actions/upload-artifact@v3
+ with:
+ name: wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
+ path: ${{ env.CURRENT_DIR }}/dev-tools/build-packages/output/wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
+ retention-days: 30
+
+ build-deb-package:
+ needs: [Build-base-package]
+ if: ( contains(inputs.DISTRIBUTION, 'deb') || contains(inputs.DISTRIBUTION, 'all-platforms') )
+ runs-on: ubuntu-latest
+ name: Build deb package
+ strategy:
+ fail-fast: false
+ matrix:
+ # TODO: Add arm64 support
+ ARCHITECTURE: [ x64 ]
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup Node
+ uses: actions/setup-node@v3
+ with:
+ node-version-file: '.nvmrc'
+ registry-url: 'https://registry.npmjs.org'
+
+ - name: Setup variables
+ run: |
+ echo "CURRENT_DIR=$(pwd -P)" >> $GITHUB_ENV
+ echo "VERSION=$(yarn --silent wzd-version)" >> $GITHUB_ENV
+ echo "REVISION=$(yarn --silent wzd-revision)" >> $GITHUB_ENV
+
+ - name: Download dashboard artifact
+ uses: actions/download-artifact@v3
+ with:
+ name: wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
+ path: ${{ env.CURRENT_DIR }}/artifacts/dashboard-tar
+
+ - name: Build packages
+ run: |
+ cd ${{ env.CURRENT_DIR }}/dev-tools/build-packages/deb/
+ bash ./launcher.sh \
+ -v ${{ env.VERSION }} \
+ -r ${{ env.REVISION }} \
+ -p file://${{env.CURRENT_DIR}}/artifacts/dashboard-tar/wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
+
+ - name: Upload deb packages
+ uses: actions/upload-artifact@v3
+ if: success()
+ with:
+ name: wazuh-dashboard_${{ env.VERSION }}-${{ env.REVISION }}_amd64.deb
+ path: ${{ env.CURRENT_DIR }}/dev-tools/build-packages/deb/output/wazuh-dashboard_${{ env.VERSION }}-${{ env.REVISION }}_amd64.deb
+ retention-days: 30
+
+
+ build-rpm-package:
+ needs: [Build-base-package]
+ if: ( contains(inputs.DISTRIBUTION, 'rpm') || contains(inputs.DISTRIBUTION, 'all-platforms') )
+ runs-on: ubuntu-latest
+ name: Build rpm package
+ strategy:
+ fail-fast: false
+ matrix:
+ ARCHITECTURE: [ x64 ]
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup Node
+ uses: actions/setup-node@v3
+ with:
+ node-version-file: '.nvmrc'
+ registry-url: 'https://registry.npmjs.org'
+
+ - name: Setup variables
+ run: |
+ echo "CURRENT_DIR=$(pwd -P)" >> $GITHUB_ENV
+ echo "VERSION=$(yarn --silent wzd-version)" >> $GITHUB_ENV
+ echo "REVISION=$(yarn --silent wzd-revision)" >> $GITHUB_ENV
+
+ - name: Download dashboard artifact
+ uses: actions/download-artifact@v3
+ with:
+ name: wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
+ path: ${{ env.CURRENT_DIR }}/artifacts/dashboard-tar
+
+ - name: Build packages
+ run: |
+ cd ${{ env.CURRENT_DIR }}/dev-tools/build-packages/rpm/
+ bash ./launcher.sh \
+ -v ${{ env.VERSION }} \
+ -r ${{ env.REVISION }} \
+ -p file://${{env.CURRENT_DIR}}/artifacts/dashboard-tar/wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
+
+ - name: Upload rpm packages
+ uses: actions/upload-artifact@v3
+ if: success()
+ with:
+ name: wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}.x86_64.rpm
+ path: ${{ env.CURRENT_DIR }}/dev-tools/build-packages/rpm/output/wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}.x86_64.rpm
+ retention-days: 30
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 000000000000..092c298a32e4
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,77 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ "main", "[0-9].[0-9]", "[0-9].x" ]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [ "main" ]
+ schedule:
+ - cron: '00 8 * * 5'
+ workflow_dispatch:
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'javascript' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
+ # Use only 'java' to analyze code written in Java, Kotlin or both
+ # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ # queries: security-extended,security-and-quality
+
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v2
+
+ # âšī¸ Command-line programs to run using the OS shell.
+ # đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
+
+ # - run: |
+ # echo "Run, Build Application using script"
+ # ./location_of_script_within_repo/buildscript.sh
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
+ with:
+ category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/cypress_workflow.yml b/.github/workflows/cypress_workflow.yml
index b404f9c46240..0d7a7101c609 100644
--- a/.github/workflows/cypress_workflow.yml
+++ b/.github/workflows/cypress_workflow.yml
@@ -42,6 +42,7 @@ env:
COMMENT_TAG: '[MANUAL CYPRESS TEST RUN RESULTS]'
COMMENT_SUCCESS_MSG: ':white_check_mark: Cypress test run succeeded!'
COMMENT_FAILURE_MSG: ':x: Cypress test run failed!'
+ OPENSEARCH_VERSION: ${{ vars.OPENSEARCH_VERSION }}
jobs:
cypress-tests:
@@ -108,7 +109,7 @@ jobs:
with:
path: ${{ env.FTR_PATH }}
repository: ${{ env.TEST_REPO }}
- ref: '${{ env.TEST_BRANCH }}'
+ ref: '${{ env.OPENSEARCH_VERSION }}'
- name: Setup spec files by input
if: ${{ inputs.specs != '' }}
@@ -149,7 +150,7 @@ jobs:
working-directory: ${{ env.FTR_PATH }}
start: ${{ env.OPENSEARCH_SNAPSHOT_CMD }}, ${{ env.START_CMD }}
wait-on: 'http://localhost:9200, http://localhost:5601'
- command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.SPEC }}
+ command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --config ignoreTestFiles="dashboard_sanity_test_spec.js" --spec ${{ env.SPEC }}
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v3
@@ -158,7 +159,7 @@ jobs:
name: ftr-cypress-screenshots
path: ${{ env.FTR_PATH }}/cypress/screenshots
retention-days: 1
-
+
- uses: actions/upload-artifact@v3
if: always()
with:
@@ -172,7 +173,6 @@ jobs:
name: ftr-cypress-results
path: ${{ env.FTR_PATH }}/cypress/results
retention-days: 1
-
add-comment:
needs: [cypress-tests]
if: ${{ always() && github.event_name == 'workflow_dispatch' && inputs.pr_number != '' }}
@@ -207,6 +207,6 @@ jobs:
'${{ env.SPEC }}'
```
- #### Link to results:
+ #### Link to results:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
edit-mode: replace
diff --git a/.gitignore b/.gitignore
index f62e798ad6a5..295516907c5d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
.aws-config.json
.signing-config.json
.ackrc
+/dev-tools/build-packages/*/output
/.opensearch
/.chromium
/package.json.bak
diff --git a/README.md b/README.md
index 0bd86bec6560..c4c1bf3909c2 100644
--- a/README.md
+++ b/README.md
@@ -1,44 +1,41 @@
-
+
+
+
- [Welcome!](#welcome)
- [Project Resources](#project-resources)
-- [Code of Conduct](#code-of-conduct)
+- [Wazuh UI](#wazuh-ui)
- [License](#license)
- [Copyright](#copyright)
## Welcome
-OpenSearch Dashboards is an open-source data visualization tool designed to work with OpenSearch. OpenSearch Dashboards gives you data visualization tools to improve and automate business intelligence and support data-driven decision-making and strategic planning.
+Wazuh dashboard is a fork of the [OpenSearch Dashboards][opensearch-dashboards] which
+incorporate changes to make it easier to use for Wazuh users. Our aim is to contribute
+back any work not tied specifically to Wazuh.
-We aim to be an exceptional community-driven platform and to foster open participation and collective contribution with all contributors. Stay up to date on what's happening with the OpenSearch Project by tracking GitHub [issues](https://github.com/opensearch-project/OpenSearch-Dashboards/issues) and [pull requests](https://github.com/opensearch-project/OpenSearch-Dashboards/pulls).
+Wazuh is a security detection, visibility, and compliance open-source project. Wazuh
+helps you to gain deeper security visibility into your infrastructure by monitoring
+hosts at an operating system and application level.
-You can [contribute to this project](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/CONTRIBUTING.md) by [opening issues](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/new/choose) to give feedback, share ideas, identify bugs, and contribute code.
-
-Set up your [OpenSearch Dashboards development environment](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md#getting-started-guide) today! The project team looks forward to your contributions.
-
-## Code Summary
-
-[![Build and Test][build-and-test-badge]][build-and-test-link]
-[![Unit Test Code Coverage][codecov-badge]][codecov-link]
-[![Link Checker][link-checker-badge]][link-checker-link]
+You can learn more about it at [wazuh.com][wazuh-web].
## Project Resources
-- [Project Website](https://opensearch.org/)
-- [Downloads](https://opensearch.org/downloads.html)
-- [Documentation](https://opensearch.org/docs/)
-- Need help? See the [communication guide](COMMUNICATIONS.md) for various options
-- [Project Principles](https://opensearch.org/#principles)
+- [Project Website][wazuh-web]
+- [Documentation][wazuh-docs]
+- Need help? Joins us on [Slack][slack-invite]!
- [Developer Guide](DEVELOPER_GUIDE.md)
-- [Contributing to OpenSearch](CONTRIBUTING.md)
+- [Contributing](CONTRIBUTING.md)
- [Maintainer Responsibilities](MAINTAINERS.md)
- [Release Management](RELEASING.md)
- [Testing](TESTING.md)
- [Security](SECURITY.md)
-## Code of Conduct
+## Wazuh UI
-This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [opensource-codeofconduct@amazon.com](mailto:opensource-codeofconduct@amazon.com) with any additional questions or comments.
+This repository is not a new Wazuh UI, but the platform on which Wazuh UI will run.
+The UI can be found on its own [repository][wazuh-plugin].
## License
@@ -46,11 +43,13 @@ This project is licensed under the [Apache v2.0 License](LICENSE.txt).
## Copyright
-Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details.
+- Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details.
+- Copyright Wazuh, Inc.
+
+
-[build-and-test-badge]: https://github.com/opensearch-project/OpenSearch-Dashboards/actions/workflows/build_and_test_workflow.yml/badge.svg
-[build-and-test-link]: https://github.com/opensearch-project/OpenSearch-Dashboards/actions/workflows/build_and_test_workflow.yml
-[codecov-badge]: https://codecov.io/gh/opensearch-project/OpenSearch-Dashboards/branch/main/graphs/badge.svg
-[codecov-link]: https://app.codecov.io/gh/opensearch-project/OpenSearch-Dashboards
-[link-checker-badge]: https://github.com/opensearch-project/OpenSearch-Dashboards/actions/workflows/links_checker.yml/badge.svg
-[link-checker-link]: https://github.com/opensearch-project/OpenSearch-Dashboards/actions/workflows/links_checker.yml
+[opensearch-dashboards]: https://github.com/opensearch-project/OpenSearch-Dashboards
+[wazuh-plugin]: https://github.com/wazuh/wazuh-kibana-app
+[wazuh-web]: https://wazuh.com
+[wazuh-docs]: https://documentation.wazuh.com
+[slack-invite]: https://join.slack.com/t/wazuh/shared_invite/zt-1lgu531ur-7M_k_ZQbpdo4QCn_pHee3w
diff --git a/config/node.options.prod b/config/node.options.prod
new file mode 100644
index 000000000000..ed533b559152
--- /dev/null
+++ b/config/node.options.prod
@@ -0,0 +1,9 @@
+## Node command line options
+## See `node --help` and `node --v8-options` for available options
+## Please note you should specify one option per line
+
+## max size of old space in megabytes
+#--max-old-space-size=4096
+
+## Wazuh - do not terminate process on unhandled promise rejection
+--unhandled-rejections=warn
diff --git a/config/opensearch_dashboards.prod.yml b/config/opensearch_dashboards.prod.yml
new file mode 100644
index 000000000000..89b23a8be11e
--- /dev/null
+++ b/config/opensearch_dashboards.prod.yml
@@ -0,0 +1,15 @@
+server.host: 0.0.0.0
+server.port: 443
+opensearch.hosts: https://localhost:9200
+opensearch.ssl.verificationMode: certificate
+opensearch.requestHeadersAllowlist: ["securitytenant","Authorization"]
+opensearch_security.multitenancy.enabled: false
+opensearch_security.readonly_mode.roles: ["kibana_read_only"]
+server.ssl.enabled: true
+server.ssl.key: "/etc/wazuh-dashboard/certs/dashboard-key.pem"
+server.ssl.certificate: "/etc/wazuh-dashboard/certs/dashboard.pem"
+opensearch.ssl.certificateAuthorities: ["/etc/wazuh-dashboard/certs/root-ca.pem"]
+uiSettings.overrides.defaultRoute: /app/wz-home
+
+opensearchDashboards.branding:
+ useExpandedHeader: false
diff --git a/dev-tools/build-packages/README.md b/dev-tools/build-packages/README.md
new file mode 100644
index 000000000000..16f085dde78f
--- /dev/null
+++ b/dev-tools/build-packages/README.md
@@ -0,0 +1,70 @@
+# Package building
+This folder contains tools used to create `rpm` and `deb` packages.
+
+## Requirements
+ - A system with Docker.
+ - Internet connection (to download the docker images the first time).
+
+## Builders
+
+### Tarball
+
+To system packages (deb and rpm), a tarball of Wazuh dashboard `.tar.gz` is required.
+This tarball contains the [Wazuh plugin][wazuh-plugin], the [Wazuh Security plugin][wazuh-security-plugin],
+a set of OpenSearch plugins and the default configuration for the app.
+
+The `generate_base.sh` script generates a `.tar.gz` file using the following inputs:
+- `-a` | `--app`: URL to the zipped Wazuh plugin.*
+- `-b` | `--base`: URL to the Wazuh dashboard `.tar.gz`, as generated with `yarn build --skip-os-packages --release`.*
+- `-s` | `--security`: URL to the zipped Wazuh Security plugin, as generated with `yarn build`.*
+- `-v` | `--version`: the Wazuh version of the package.
+- `-r` | `--revision`: [Optional] Set the revision of the build. By default, it is set to 1.
+- `-o` | `--output` [Optional] Set the destination path of package. By default, an output folder will be created in the same directory as the script.
+
+*Note:* use `file://` to indicate a local file. Otherwise, the script will try to download the file from the given URL.
+
+Example:
+```bash
+bash generate_base.sh \
+ --app https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-4.6.0-1.zip \
+ --base file:///home/user/wazuh-dashboard/target/opensearch-dashboards-2.4.1-linux-x64.tar.gz \
+ --security file:///home/user/wazuh-security-dashboards-plugin/build/security-dashboards-2.4.1.0.zip \
+ --version 4.6.0
+```
+
+### DEB
+
+The `launcher.sh` script generates a `.deb` package based on the previously generated `.tar.gz`.
+A Docker container is used to generate the package. It takes the following inputs:
+- `-v` | `--version`: the Wazuh version of the package.
+- `-p` | `--package`: the location of the `.tar.gz` file. It can be a URL or a PATH, with the format `file://`
+- `-r` | `--revision`: [Optional] Set the revision of the build. By default, it is set to 1.
+- `-o` | `--output` [Optional] Set the destination path of package. By default, an output folder will be created in the same directory as the script.
+- `--dont-build-docker`: [Optional] Locally built Docker image will be used instead of generating a new one.
+
+Example:
+```bash
+bash launcher.sh \
+ --version 4.6.0 \
+ --package file:///home/user/wazuh-dashboard/dev_tools/build_packages/base/output/wazuh-dashboard-4.6.0-1-linux-x64.tar.gz
+```
+
+### RPM
+
+The `launcher.sh` script generates a `.rpm` package based on the previously generated `.tar.gz`.
+A Docker container is used to generate the package. It takes the following inputs:
+- `-v` | `--version`: the Wazuh version of the package.
+- `-p` | `--package`: the location of the `.tar.gz` file. It can be a URL or a PATH, with the format `file://`
+- `-r` | `--revision`: [Optional] Set the revision of the build. By default, it is set to 1.
+- `-o` | `--output` [Optional] Set the destination path of package. By default, an output folder will be created in the same directory as the script.
+- `--dont-build-docker`: [Optional] Locally built Docker image will be used instead of generating a new one.
+
+Example:
+```bash
+bash launcher.sh \
+ --version 4.6.0 \
+ --package file:///home/user/wazuh-dashboard/dev_tools/build_packages/base/output/wazuh-dashboard-4.6.0-1-linux-x64.tar.gz
+```
+
+[wazuh-plugin]: https://github.com/wazuh/wazuh-kibana-app
+[wazuh-security-plugin]: https://github.com/wazuh/wazuh-security-dashboards-plugin
\ No newline at end of file
diff --git a/dev-tools/build-packages/base/generate_base.sh b/dev-tools/build-packages/base/generate_base.sh
new file mode 100755
index 000000000000..ad80a08c6c4b
--- /dev/null
+++ b/dev-tools/build-packages/base/generate_base.sh
@@ -0,0 +1,256 @@
+#!/bin/bash
+
+# Wazuh package generator
+# Copyright (C) 2022, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+set -e
+
+# Inputs
+app=""
+base=""
+revision="1"
+security=""
+version=""
+
+# Paths
+current_path="$( cd $(dirname $0) ; pwd -P )"
+config_path=$(realpath $current_path/../../../config)
+
+# Folders
+out_dir="${current_path}/output"
+tmp_dir="${current_path}/tmp"
+
+trap ctrl_c INT
+
+clean() {
+ exit_code=$1
+ echo
+ echo "Cleaning temporary files..."
+ echo
+ # Clean the files
+ rm -r $tmp_dir
+
+ if [ $exit_code != 0 ]; then
+ rm $out_dir/*.tar.gz
+ rmdir $out_dir
+ fi
+
+ exit ${exit_code}
+}
+
+ctrl_c() {
+ clean 1
+}
+
+# -----------------------------------------------------------------------------
+
+build() {
+ # Validate and download files to build the package
+ valid_url='(https?|ftp|file)://[-[:alnum:]\+&@#/%?=~_|!:,.;]*[-[:alnum:]\+&@#/%=~_|]'
+ echo
+ echo "Downloading plugins..."
+ echo
+ mkdir -p $tmp_dir
+ cd $tmp_dir
+ mkdir -p applications
+ mkdir -p dashboards
+ if [[ $app =~ $valid_url ]]; then
+ if ! curl --output applications/app.zip --silent --fail "${app}"; then
+ echo "The given URL or Path to the Wazuh Apps is not working: ${app}"
+ clean 1
+ else
+ echo "Extracting applications from app.zip"
+ unzip -q applications/app.zip -d applications
+ rm applications/app.zip
+ fi
+ else
+ echo "The given URL or Path to the Wazuh App is not valid: ${app}"
+ clean 1
+ fi
+
+ echo
+ echo "Downloading dashboards..."
+ echo
+
+ if [[ $base =~ $valid_url ]]; then
+ if [[ $base =~ .*\.zip ]]; then
+ if ! curl --output wazuh-dashboard.zip --silent --fail "${base}"; then
+ echo "The given URL or Path to the Wazuh Dashboard base is not working: ${base}"
+ clean 1
+ else
+ echo "Extracting Wazuh Dashboard base"
+ unzip -q wazuh-dashboard.zip -d ./dashboards/
+ rm wazuh-dashboard.zip
+ mv ./dashboards/$(ls ./dashboards) wazuh-dashboard.tar.gz
+ fi
+ else
+ if ! curl --output wazuh-dashboard.tar.gz --silent --fail "${base}"; then
+ echo "The given URL or Path to the Wazuh Dashboard base is not working: ${base}"
+ clean 1
+ fi
+ fi
+ else
+ echo "The given URL or Path to the Wazuh Dashboard base is not valid: ${base}"
+ clean 1
+ fi
+
+ echo
+ echo "Downloading security plugin..."
+ echo
+
+ if [[ $security =~ $valid_url ]]; then
+ if ! curl --output applications/security.zip --silent --fail "${security}"; then
+ echo "The given URL or Path to the Wazuh Security Plugin is not working: ${security}"
+ clean 1
+ else
+ echo "Extracting Security application"
+ unzip -q applications/security.zip -d applications
+ rm applications/security.zip
+ fi
+ else
+ echo "The given URL or Path to the Wazuh Security Plugin is not valid: ${security}"
+ clean 1
+ fi
+
+ tar -zxf wazuh-dashboard.tar.gz
+ directory_name=$(tar tf wazuh-dashboard.tar.gz | head -1 | sed 's#/.*##' | sort -u)
+ working_dir="wazuh-dashboard-$version-$revision-linux-x64"
+ mv $directory_name $working_dir
+ cd $working_dir
+
+ echo
+ echo Building the package...
+ echo
+
+ # Install plugins
+ bin/opensearch-dashboards-plugin install alertingDashboards
+ bin/opensearch-dashboards-plugin install customImportMapDashboards
+ bin/opensearch-dashboards-plugin install ganttChartDashboards
+ bin/opensearch-dashboards-plugin install indexManagementDashboards
+ bin/opensearch-dashboards-plugin install notificationsDashboards
+ bin/opensearch-dashboards-plugin install reportsDashboards
+ # Install Wazuh apps and Security app
+ plugins=$(ls $tmp_dir/applications)
+ echo $plugins
+ for plugin in $plugins; do
+ echo $plugin
+ if [[ $plugin =~ .*\.zip ]]; then
+ bin/opensearch-dashboards-plugin install file:../applications/$plugin
+ fi
+ done
+
+ # Enable the default configuration (renaming)
+ cp $config_path/opensearch_dashboards.prod.yml config/opensearch_dashboards.yml
+ cp $config_path/node.options.prod config/node.options
+
+ # TODO: investigate to remove this if possible
+ # Fix ambiguous shebangs (necessary for RPM building)
+ grep -rnwl './node_modules/' -e '#!/usr/bin/env python$' | xargs -I {} sed -i 's/#!\/usr\/bin\/env python/#!\/usr\/bin\/env python3/g' {}
+ grep -rnwl './node_modules/' -e '#!/usr/bin/python$' | xargs -I {} sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/python3/g' {}
+
+ # Compress
+ echo
+ echo Compressing the package...
+ echo
+ cd ..
+ if [ ! -d "$out_dir" ]; then
+ mkdir -p $out_dir
+ fi
+ tar -czf $out_dir/$working_dir.tar.gz $working_dir
+
+ echo
+ echo DONE!
+ echo
+ clean 0
+}
+
+# -----------------------------------------------------------------------------
+
+help() {
+ echo
+ echo "Usage: $0 [OPTIONS]"
+ echo " -a, --app Set the location of the .zip file containing the Wazuh plugin."
+ echo " -b, --base Set the location of the .tar.gz file containing the base wazuh-dashboard build."
+ echo " -s, --security Set the location of the .zip file containing the wazuh-security-dashboards-plugin."
+ echo " -v, --version Set the version of this build."
+ echo " -r, --revision [Optional] Set the revision of this build. By default, it is set to 1."
+ echo " -o, --output [Optional] Set the destination path of package. By default, an output folder will be created."
+ echo " -h, --help Show this help."
+ echo
+ exit $1
+}
+
+# -----------------------------------------------------------------------------
+
+main() {
+ while [ -n "${1}" ]; do
+ case "${1}" in
+ "-h" | "--help")
+ help 0
+ ;;
+ "-a" | "--app")
+ if [ -n "$2" ]; then
+ app="$2"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ "-s" | "--security")
+ if [ -n "${2}" ]; then
+ security="${2}"
+ shift 2
+ else
+ help 0
+ fi
+ ;;
+ "-b" | "--base")
+ if [ -n "${2}" ]; then
+ base="${2}"
+ shift 2
+ else
+ help 0
+ fi
+ ;;
+ "-v" | "--version")
+ if [ -n "${2}" ]; then
+ version="${2}"
+ shift 2
+ else
+ help 0
+ fi
+ ;;
+ "-r" | "--revision")
+ if [ -n "${2}" ]; then
+ revision="${2}"
+ shift 2
+ fi
+ ;;
+ "-o" | "--output")
+ if [ -n "${2}" ]; then
+ output="${2}"
+ shift 2
+ fi
+ ;;
+ *)
+
+ help 1
+ ;;
+ esac
+ done
+
+ if [ -z "$app" ] | [ -z "$base" ] | [ -z "$security" ] | [ -z "$version" ]; then
+ help 1
+ fi
+
+ build || exit 1
+
+ exit 0
+}
+
+main "$@"
diff --git a/dev-tools/build-packages/build-packages.sh b/dev-tools/build-packages/build-packages.sh
new file mode 100644
index 000000000000..9a9b4053ab53
--- /dev/null
+++ b/dev-tools/build-packages/build-packages.sh
@@ -0,0 +1,191 @@
+#!/bin/bash
+
+app=""
+base=""
+revision="1"
+security=""
+version=""
+all_platforms="no"
+deb="no"
+rpm="no"
+tar="no"
+output="$( cd $(dirname $0) ; pwd -P )/output"
+
+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
+
+ name_package_tar=$(ls ./output)
+
+ echo "Moving tar package to $output"
+ mv $current_path/base/output/$name_package_tar $output/$name_package_tar
+ cd ../
+}
+
+build_deb() {
+ echo "Building deb package..."
+ name_package_tar=$(find $output -name "*.tar.gz")
+ cd ./deb
+ bash ./launcher.sh -v $version -r $revision -p file://$name_package_tar
+ name_package_tar=$(ls ./output)
+ echo "Moving deb package to $output/deb"
+ mv $current_path/deb/output $output/deb
+ cd ../
+}
+
+build_rpm() {
+ echo "Building rpm package..."
+ name_package_tar=$(find $output -name "*.tar.gz")
+ cd ./rpm
+ bash ./launcher.sh -v $version -r $revision -p file://$name_package_tar
+ echo "Moving rpm package to $output/rpm"
+ mv $current_path/rpm/output $output/rpm
+ cd ../
+}
+
+
+build() {
+ name_package_tar="wazuh-dashboard-$version-$revision-linux-x64.tar.gz"
+
+ if [ ! -d "$output" ]; then
+ mkdir $output
+ fi
+
+ if [ "$all_platforms" == "yes" ]; then
+ deb="yes"
+ rpm="yes"
+ tar="yes"
+ fi
+
+ build_tar
+ cd $current_path
+
+ if [ $deb == "yes" ]; then
+ echo "Building deb package..."
+ build_deb
+ fi
+
+ if [ $rpm == "yes" ]; then
+ echo "Building rpm package..."
+ build_rpm
+ fi
+
+ if [ "$tar" == "no" ]; then
+ echo "Removing tar package..."
+ rm -r $(find $output -name "*.tar.gz")
+ fi
+}
+
+help() {
+ echo
+ echo "Usage: $0 [OPTIONS]"
+ echo " -a, --app Set the location of the .zip file containing the Wazuh plugin."
+ echo " -b, --base Set the location of the .tar.gz file containing the base wazuh-dashboard build."
+ echo " -s, --security Set the location of the .zip file containing the wazuh-security-dashboards-plugin."
+ echo " -v, --version Set the version of this build."
+ echo " --all-platforms Build for all platforms."
+ echo " --deb Build for deb."
+ echo " --rpm Build for rpm."
+ echo " --tar Build for tar."
+ echo " -r, --revision [Optional] Set the revision of this build. By default, it is set to 1."
+ echo " -o, --output [Optional] Set the destination path of package. By default, an output folder will be created."
+ echo " -h, --help Show this help."
+ echo
+ exit $1
+}
+
+# -----------------------------------------------------------------------------
+
+main() {
+ while [ -n "${1}" ]; do
+ case "${1}" in
+ "-h" | "--help")
+ help 0
+ ;;
+ "-a" | "--app")
+ if [ -n "$2" ]; then
+ app="$2"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ "-s" | "--security")
+ if [ -n "${2}" ]; then
+ security="${2}"
+ shift 2
+ else
+ help 0
+ fi
+ ;;
+ "-b" | "--base")
+ if [ -n "${2}" ]; then
+ base="${2}"
+ shift 2
+ else
+ help 0
+ fi
+ ;;
+ "-v" | "--version")
+ if [ -n "${2}" ]; then
+ version="${2}"
+ shift 2
+ else
+ help 0
+ fi
+ ;;
+ "-r" | "--revision")
+ if [ -n "${2}" ]; then
+ revision="${2}"
+ shift 2
+ fi
+ ;;
+ "--all-platforms")
+ all_platforms="yes"
+ shift 1
+ ;;
+ "--deb")
+ deb="yes"
+ shift 1
+ ;;
+ "--rpm")
+ rpm="yes"
+ shift 1
+ ;;
+ "--tar")
+ tar="yes"
+ shift 1
+ ;;
+ "-o" | "--output")
+ if [ -n "${2}" ]; then
+ output="${2}"
+ shift 2
+ fi
+ ;;
+ *)
+ echo "help"
+
+ help 1
+ ;;
+ esac
+ done
+
+ if [ -z "$app" ] | [ -z "$base" ] | [ -z "$security" ] | [ -z "$version" ]; then
+ echo "You must specify the app, base, security and version."
+ help 1
+ fi
+
+ if [ "$all_platforms" == "no" ] && [ "$deb" == "no" ] && [ "$rpm" == "no" ] && [ "$tar" == "no" ]; then
+ echo "You must specify at least one package to build."
+ help 1
+ fi
+
+ build || exit 1
+
+ exit 0
+}
+
+main "$@"
diff --git a/dev-tools/build-packages/config/default b/dev-tools/build-packages/config/default
new file mode 100644
index 000000000000..c4f94fd36814
--- /dev/null
+++ b/dev-tools/build-packages/config/default
@@ -0,0 +1,7 @@
+user="wazuh-dashboard"
+group="wazuh-dashboard"
+chroot="/"
+chdir="/"
+nice=""
+KILL_ON_STOP_TIMEOUT=0
+
diff --git a/dev-tools/build-packages/config/wazuh-dashboard b/dev-tools/build-packages/config/wazuh-dashboard
new file mode 100644
index 000000000000..ae87055c3a9d
--- /dev/null
+++ b/dev-tools/build-packages/config/wazuh-dashboard
@@ -0,0 +1,170 @@
+#!/bin/sh
+# chkconfig: 2345 95 20
+# description: Wazuh dashboard
+#
+# Source function libraries if present.
+# (It improves integration with systemd)
+#
+# Red Hat
+if [ -f /etc/rc.d/init.d/functions ]; then
+ . /etc/rc.d/init.d/functions
+
+# Debian
+elif [ -f /lib/lsb/init-functions ]; then
+ . /lib/lsb/init-functions
+
+# SUSE
+elif [ -f /etc/rc.status ]; then
+ . /etc/rc.status
+ rc_reset
+fi
+
+name=wazuh-dashboard
+program=/usr/share/wazuh-dashboard/bin/opensearch-dashboards
+args=-c\\\ /etc/wazuh-dashboard/opensearch_dashboards.yml
+PID_DIR="/run/wazuh-dashboard"
+pidfile="$PID_DIR/$name.pid"
+
+[ -r /etc/default/$name ] && . /etc/default/$name
+[ -r /etc/sysconfig/$name ] && . /etc/sysconfig/$name
+
+export NODE_OPTIONS
+
+[ -z "$nice" ] && nice=0
+
+trace() {
+ logger -t "/etc/init.d/wazuh-dashboard" "$@"
+}
+
+emit() {
+ trace "$@"
+ echo "$@"
+}
+
+start() {
+
+
+ # Setup any environmental stuff beforehand
+
+ # Ensure that the PID_DIR exists (it is cleaned at OS startup time)
+ if [ -n "$PID_DIR" ] && [ ! -e "$PID_DIR" ]; then
+ mkdir -p "$PID_DIR" && chown "$user":"$group" "$PID_DIR"
+ fi
+ if [ -n "$pidfile" ] && [ ! -e "$pidfile" ]; then
+ touch "$pidfile" && chown "$user":"$group" "$pidfile"
+ fi
+
+
+ # Run the program!
+
+ chroot --userspec "$user":"$group" "$chroot" sh -c "cd \"$chdir\";exec \"$program\" $args" &
+
+
+
+ # Generate the pidfile from here. If we instead made the forked process
+ # generate it there will be a race condition between the pidfile writing
+ # and a process possibly asking for status.
+ echo $! > $pidfile
+
+ emit "$name started"
+ return 0
+}
+
+stop() {
+ # Try a few times to kill TERM the program
+ if status ; then
+ pid=$(cat "$pidfile")
+ trace "Killing $name (pid $pid) with SIGTERM"
+ kill -TERM $pid
+ # Wait for it to exit.
+ for i in 1 2 3 4 5 ; do
+ trace "Waiting $name (pid $pid) to die..."
+ status || break
+ sleep 1
+ done
+ if status ; then
+ if [ "$KILL_ON_STOP_TIMEOUT" -eq 1 ] ; then
+ trace "Timeout reached. Killing $name (pid $pid) with SIGKILL. This may result in data loss."
+ kill -KILL $pid
+ emit "$name killed with SIGKILL."
+ else
+ emit "$name stop failed; still running."
+ fi
+ else
+ emit "$name stopped."
+ fi
+ fi
+}
+
+status() {
+ if [ -f "$pidfile" ] ; then
+ pid=$(cat "$pidfile")
+ if ps -p $pid > /dev/null 2> /dev/null ; then
+ # process by this pid is running.
+ # It may not be our pid, but that's what you get with just pidfiles.
+ # TODO(sissel): Check if this process seems to be the same as the one we
+ # expect. It'd be nice to use flock here, but flock uses fork, not exec,
+ # so it makes it quite awkward to use in this case.
+ return 0
+ else
+ return 2 # program is dead but pid file exists
+ fi
+ else
+ return 3 # program is not running
+ fi
+}
+
+force_stop() {
+ if status ; then
+ stop
+ status && kill -KILL $(cat "$pidfile")
+ fi
+}
+
+
+case "$1" in
+ force-start|start|stop|force-stop|restart)
+ trace "Attempting '$1' on wazuh-dashboard"
+ ;;
+esac
+
+case "$1" in
+ force-start)
+ PRESTART=no
+ exec "$0" start
+ ;;
+ start)
+ status
+ code=$?
+ if [ $code -eq 0 ]; then
+ emit "$name is already running"
+ exit $code
+ else
+ start
+ exit $?
+ fi
+ ;;
+ stop) stop ;;
+ force-stop) force_stop ;;
+ status)
+ status
+ code=$?
+ if [ $code -eq 0 ] ; then
+ emit "$name is running"
+ else
+ emit "$name is not running"
+ fi
+ exit $code
+ ;;
+ restart)
+
+ stop && start
+ ;;
+ *)
+ echo "Usage: $SCRIPTNAME {start|force-start|stop|force-start|force-stop|status|restart}" >&2
+ exit 3
+ ;;
+esac
+
+exit $?
+
diff --git a/dev-tools/build-packages/config/wazuh-dashboard.service b/dev-tools/build-packages/config/wazuh-dashboard.service
new file mode 100644
index 000000000000..3fd27c5a1ab9
--- /dev/null
+++ b/dev-tools/build-packages/config/wazuh-dashboard.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=wazuh-dashboard
+
+[Service]
+Type=simple
+User=wazuh-dashboard
+Group=wazuh-dashboard
+EnvironmentFile=-/etc/default/wazuh-dashboard
+EnvironmentFile=-/etc/sysconfig/wazuh-dashboard
+ExecStart=/usr/share/wazuh-dashboard/bin/opensearch-dashboards "-c /etc/wazuh-dashboard/opensearch_dashboards.yml"
+WorkingDirectory=/usr/share/wazuh-dashboard
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/dev-tools/build-packages/deb/builder.sh b/dev-tools/build-packages/deb/builder.sh
new file mode 100755
index 000000000000..681623489fa9
--- /dev/null
+++ b/dev-tools/build-packages/deb/builder.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# Wazuh package builder
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+set -e
+
+# Script parameters to build the package
+target="wazuh-dashboard"
+architecture=$1
+revision=$2
+version=$3
+directory_base="/usr/share/wazuh-dashboard"
+
+# Build directories
+build_dir=/build
+pkg_name="${target}-${version}"
+pkg_path="${build_dir}/${target}"
+source_dir="${pkg_path}/${pkg_name}"
+deb_file="${target}_${version}-${revision}_${architecture}.deb"
+
+mkdir -p ${source_dir}/debian
+
+# Including spec file
+cp -r /root/build-packages/deb/debian/* ${source_dir}/debian/
+
+# Generating directory structure to build the .deb package
+cd ${build_dir}/${target} && tar -czf ${pkg_name}.orig.tar.gz "${pkg_name}"
+
+# Configure the package with the different parameters
+sed -i "s:VERSION:${version}:g" ${source_dir}/debian/changelog
+sed -i "s:RELEASE:${revision}:g" ${source_dir}/debian/changelog
+sed -i "s:export INSTALLATION_DIR=.*:export INSTALLATION_DIR=${directory_base}:g" ${source_dir}/debian/rules
+
+# Installing build dependencies
+cd ${source_dir}
+mk-build-deps -ir -t "apt-get -o Debug::pkgProblemResolver=yes -y"
+
+# Build package
+debuild --no-lintian -b -uc -us \
+ -eINSTALLATION_DIR="${directory_base}" \
+ -eVERSION="${version}" \
+ -eREVISION="${revision}"
+
+cd ${pkg_path} && sha512sum ${deb_file} >/tmp/${deb_file}.sha512
+mv ${pkg_path}/${deb_file} /tmp/
diff --git a/dev-tools/build-packages/deb/debian/changelog b/dev-tools/build-packages/deb/debian/changelog
new file mode 100644
index 000000000000..3a5ac0f89eb2
--- /dev/null
+++ b/dev-tools/build-packages/deb/debian/changelog
@@ -0,0 +1,95 @@
+wazuh-dashboard (VERSION-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Fri, 05 May 2023 12:31:50 +0000
+
+wazuh-dashboard (4.4.2-RELEASE) stable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Mon, 24 Apr 2023 12:31:50 +0000
+
+wazuh-dashboard (4.4.1-RELEASE) stable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Mon, 17 Apr 2023 12:31:50 +0000
+
+wazuh-dashboard (4.4.0-RELEASE) stable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Wed, 18 Jan 2023 12:31:50 +0000
+
+wazuh-dashboard (4.3.10-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Thu, 10 Nov 2022 15:00:00 +0000
+
+wazuh-dashboard (4.3.9-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Mon, 03 Oct 2022 15:00:00 +0000
+
+wazuh-dashboard (4.3.8-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Mon, 19 Sep 2022 15:00:00 +0000
+
+wazuh-dashboard (4.3.7-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Mon, 08 Aug 2022 15:00:00 +0000
+
+wazuh-dashboard (4.3.6-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Thu, 07 Jul 2022 15:00:00 +0000
+
+wazuh-dashboard (4.3.5-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Wed, 29 Jun 2022 15:00:00 +0000
+
+wazuh-dashboard (4.3.4-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Tue, 07 Jun 2022 15:41:39 +0000
+
+wazuh-dashboard (4.3.3-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Tue, 31 May 2022 15:41:39 +0000
+
+wazuh-dashboard (4.3.2-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Mon, 30 May 2022 15:41:39 +0000
+
+wazuh-dashboard (4.3.1-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Wed, 18 May 2022 12:14:41 +0000
+
+wazuh-dashboard (4.3.0-RELEASE) unstable; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Thu, 05 May 2022 12:15:57 +0000
+
+wazuh-dashboard (4.2.5-1) UNRELEASED; urgency=low
+
+ * More info: https://documentation.wazuh.com/current/release-notes/
+
+ -- Wazuh, Inc Mon, 15 Nov 2021 16:47:07 +0000
diff --git a/dev-tools/build-packages/deb/debian/control b/dev-tools/build-packages/deb/debian/control
new file mode 100644
index 000000000000..5f35b4f6e601
--- /dev/null
+++ b/dev-tools/build-packages/deb/debian/control
@@ -0,0 +1,12 @@
+Source: wazuh-dashboard
+Section: admin
+Priority: extra
+Maintainer: Wazuh, Inc
+Build-Depends: debhelper-compat (= 12)
+Standards-Version: 4.5.0
+Homepage: https://www.wazuh.com
+
+Package: wazuh-dashboard
+Architecture: any
+Depends: debconf, adduser, curl, tar, libcap2-bin
+Description: Wazuh dashboard is a user interface and visualization tool for security-related data. This Wazuh central component enables exploring, visualizing, and analyzing the stored security alerts generated by the Wazuh server. Wazuh dashboard enables inspecting the status and managing the configurations of the Wazuh cluster and agents as well as creating and managing users and roles. In addition, it allows testing the ruleset and making calls to the Wazuh API. Documentation can be found at https://documentation.wazuh.com/current/getting-started/components/wazuh-dashboard.html
diff --git a/dev-tools/build-packages/deb/debian/copyright b/dev-tools/build-packages/deb/debian/copyright
new file mode 100644
index 000000000000..d2003bbbead7
--- /dev/null
+++ b/dev-tools/build-packages/deb/debian/copyright
@@ -0,0 +1,22 @@
+This work was packaged for Debian by:
+
+ Wazuh, Inc on Sat, 04 Dec 2021 14:04:26 +0000
+
+It was downloaded from:
+
+ https://www.wazuh.com
+
+Copyright:
+
+ GNU General Public License version 2.
+
+License:
+
+ GNU General Public License version 2.
+
+The Debian packaging is:
+
+ Copyright (C) 2021 Wazuh, Inc
+
+and is licensed under the GPL version 2,
+see "/usr/share/common-licenses/GPL-2".
\ No newline at end of file
diff --git a/dev-tools/build-packages/deb/debian/postinst b/dev-tools/build-packages/deb/debian/postinst
new file mode 100644
index 000000000000..232c1d0316ce
--- /dev/null
+++ b/dev-tools/build-packages/deb/debian/postinst
@@ -0,0 +1,53 @@
+#!/bin/sh
+# postinst script for wazuh-dashboard
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+set -e
+
+export NAME=wazuh-dashboard
+export CONFIG_DIR=/etc/"${NAME}"
+export INSTALLATION_DIR=/usr/share/"${NAME}"
+export PID_DIR=/run/"${NAME}"
+
+# Setting Owner and group of own folders
+mkdir -p "${PID_DIR}"
+chown -R "${NAME}":"${NAME}" "${PID_DIR}"
+
+case "$1" in
+configure)
+ chmod 750 "${TARGET_DIR}""${CONFIG_DIR}"
+ chown -R "${NAME}":"${NAME}" "${TARGET_DIR}""${CONFIG_DIR}"
+ chmod 750 "${TARGET_DIR}""${INSTALLATION_DIR}"
+ chown -R "${NAME}":"${NAME}" "${TARGET_DIR}""${INSTALLATION_DIR}"
+ setcap 'cap_net_bind_service=+ep' "${INSTALLATION_DIR}"/node/bin/node
+ if [ -f "${INSTALLATION_DIR}"/"${NAME}".restart ]; then
+ rm -f "${INSTALLATION_DIR}"/"${NAME}".restart
+ if command -v systemctl >/dev/null 2>&1 && systemctl >/dev/null 2>&1; then
+ systemctl daemon-reload >/dev/null 2>&1
+ systemctl restart wazuh-dashboard.service >/dev/null 2>&1
+ elif command -v service >/dev/null 2>&1 && service wazuh-dashboard status 2>/dev/null | grep "running" >/dev/null 2>&1; then
+ service wazuh-dashboard restart >/dev/null 2>&1
+ fi
+ fi
+ if [ ! -f "${INSTALLATION_DIR}"/config/opensearch_dashboards.keystore ]; then
+ runuser "${NAME}" --shell="/bin/bash" --command="${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore create" >/dev/null 2>&1
+ runuser "${NAME}" --shell="/bin/bash" --command="echo kibanaserver | ${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore add opensearch.username --stdin" >/dev/null 2>&1
+ runuser "${NAME}" --shell="/bin/bash" --command="echo kibanaserver | ${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore add opensearch.password --stdin" >/dev/null 2>&1
+ fi
+ ;;
+
+abort-upgrade | abort-remove | abort-deconfigure) ;;
+
+*)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+
+esac
+
+exit 0
diff --git a/dev-tools/build-packages/deb/debian/postrm b/dev-tools/build-packages/deb/debian/postrm
new file mode 100644
index 000000000000..a5b88616434f
--- /dev/null
+++ b/dev-tools/build-packages/deb/debian/postrm
@@ -0,0 +1,82 @@
+#!/bin/sh
+# postinst script for wazuh-dashboard
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+set -e
+
+export NAME=wazuh-dashboard
+export CONFIG_DIR=/etc/"${NAME}"
+export INSTALLATION_DIR=/usr/share/"${NAME}"
+export PID_DIR=/run/${NAME}
+
+#
+# This script is executed in the post-removal phase
+#
+# On Debian,
+# $1=remove : indicates a removal
+# $1=purge : indicates an upgrade
+
+# source the default env file
+if [ -f "/etc/default/${NAME}" ]; then
+ . "/etc/default/${NAME}"
+fi
+
+REMOVE_DIRS=false
+REMOVE_CONFIG_DIRECTORY=false
+REMOVE_USER_AND_GROUP=false
+
+case "$1" in
+remove)
+ REMOVE_DIRS=true
+ ;;
+
+purge)
+ REMOVE_DIRS=true
+ REMOVE_CONFIG_DIRECTORY=true
+ REMOVE_USER_AND_GROUP=true
+ ;;
+failed-upgrade | abort-install | upgrade | abort-upgrade | disappear) ;;
+
+*)
+
+ echo "post remove script called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+if [ "$REMOVE_DIRS" = "true" ]; then
+
+ if [ -d ${PID_DIR} ]; then
+ echo -n "Deleting PID directory..."
+ rm -rf ${PID_DIR} >/dev/null 2>&1
+ echo " OK"
+ fi
+
+ if [ -d "${INSTALLATION_DIR}" ]; then
+ echo -n "Deleting installation directory..."
+ rm -rf "${INSTALLATION_DIR}"
+ echo " OK"
+ fi
+
+ # Delete the config directory if we are purging
+ if [ "$REMOVE_CONFIG_DIRECTORY" = "true" ]; then
+ rm -rf "${CONFIG_DIR}"
+ echo " OK"
+ fi
+
+fi
+
+if [ "$REMOVE_USER_AND_GROUP" = "true" ]; then
+ if id "${NAME}" >/dev/null 2>&1; then
+ userdel "${NAME}"
+ fi
+
+ if getent group "${NAME}" >/dev/null 2>&1; then
+ groupdel "${NAME}"
+ fi
+fi
diff --git a/dev-tools/build-packages/deb/debian/preinst b/dev-tools/build-packages/deb/debian/preinst
new file mode 100644
index 000000000000..1d955fd8dc1c
--- /dev/null
+++ b/dev-tools/build-packages/deb/debian/preinst
@@ -0,0 +1,73 @@
+#!/bin/sh
+# postinst script for wazuh-dashboard
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+set -e
+
+#
+# This script is executed in the pre-installation phase
+#
+# On Debian,
+# $1=install : indicates an new install
+# $1=upgrade : indicates an upgrade
+
+# configuration variables
+export NAME=wazuh-dashboard
+export CONFIG_DIR=/etc/"${NAME}"
+export INSTALLATION_DIR=/usr/share/"${NAME}"
+
+case "$1" in
+# Debian ####################################################
+install)
+ # environment configuration
+ mkdir -p "${CONFIG_DIR}"
+ mkdir -p "${INSTALLATION_DIR}"
+
+ # Create wazuh-dashboard group if not existing
+ if ! getent group "${NAME}" >/dev/null 2>&1; then
+ echo -n "Creating ${NAME} group..."
+ addgroup --quiet --system "${NAME}"
+ echo " OK"
+ fi
+ # Create wazuh-dashboard user if not existing
+ if ! id "${NAME}" >/dev/null 2>&1; then
+ echo -n "Creating ${NAME} user..."
+ adduser --quiet \
+ --system \
+ --no-create-home \
+ --home /nonexistent \
+ --ingroup "${NAME}" \
+ --disabled-password \
+ --shell /bin/false \
+ "${NAME}"
+ echo " OK"
+ fi
+
+ ;;
+upgrade)
+ # Stop the services to upgrade the package
+ if command -v systemctl >/dev/null 2>&1 && systemctl >/dev/null 2>&1 && systemctl is-active --quiet "${NAME}" >/dev/null 2>&1; then
+ systemctl stop "${NAME}".service >/dev/null 2>&1
+ touch "${INSTALLATION_DIR}"/"${NAME}".restart
+ # Check for SysV
+ elif command -v service >/dev/null 2>&1 && service "${NAME}" status 2>/dev/null | grep "running" >/dev/null 2>&1; then
+ service "${NAME}" stop >/dev/null 2>&1
+ touch "${INSTALLATION_DIR}"/"${NAME}".restart
+ fi
+ ;;
+abort-deconfigure | abort-upgrade | abort-remove) ;;
+
+*)
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 1
+
+ ;;
+
+esac
+
+exit 0
diff --git a/dev-tools/build-packages/deb/debian/prerm b/dev-tools/build-packages/deb/debian/prerm
new file mode 100644
index 000000000000..eef54075a11b
--- /dev/null
+++ b/dev-tools/build-packages/deb/debian/prerm
@@ -0,0 +1,82 @@
+#!/bin/sh
+# postinst script for wazuh-dashboard
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+set -e
+
+export NAME=wazuh-dashboard
+export CONFIG_DIR=/etc/"${NAME}"
+export INSTALLATION_DIR=/usr/share/"${NAME}"
+
+#
+# This script is executed in the pre-remove phase
+#
+# On Debian,
+# $1=remove : indicates a removal
+# $1=upgrade : indicates an upgrade
+
+# source the default env file
+if [ -f "/etc/default/${NAME}" ]; then
+ . "/etc/default/${NAME}"
+fi
+
+STOP_REQUIRED=false
+REMOVE_SERVICE=false
+
+case "$1" in
+
+# Debian ####################################################
+remove)
+ STOP_REQUIRED=true
+ REMOVE_SERVICE=true
+ ;;
+upgrade | deconfigure | failed-upgrade) ;;
+
+*)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+
+esac
+
+# Stops the service
+if [ "$STOP_REQUIRED" = "true" ]; then
+ echo -n "Stopping wazuh-dashboard service..."
+ if command -v systemctl >/dev/null; then
+ systemctl --no-reload stop "${NAME}".service
+
+ elif [ -x /etc/init.d/"${NAME}" ]; then
+ if command -v invoke-rc.d >/dev/null; then
+ invoke-rc.d "${NAME}" stop
+ else
+ /etc/init.d/"${NAME}" stop
+ fi
+
+ # older suse linux distributions do not ship with systemd
+ # but do not have an /etc/init.d/ directory
+ # this tries to start the wazuh-dashboard service on these
+ # as well without failing this script
+ elif [ -x /etc/rc.d/init.d/"${NAME}" ]; then
+ /etc/rc.d/init.d/"${NAME}" stop
+ fi
+ echo " OK"
+fi
+
+if [ "$REMOVE_SERVICE" = "true" ]; then
+ if command -v systemctl >/dev/null; then
+ systemctl disable "${NAME}".service >/dev/null 2>&1 || true
+ fi
+
+ if command -v chkconfig >/dev/null; then
+ chkconfig --del "${NAME}" 2>/dev/null || true
+ fi
+
+ if command -v update-rc.d >/dev/null; then
+ update-rc.d "${NAME}" remove >/dev/null || true
+ fi
+fi
diff --git a/dev-tools/build-packages/deb/debian/rules b/dev-tools/build-packages/deb/debian/rules
new file mode 100644
index 000000000000..98638dab5602
--- /dev/null
+++ b/dev-tools/build-packages/deb/debian/rules
@@ -0,0 +1,112 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+#
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets by Bill Allombert 2001
+#
+# Modified by Wazuh
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+export TARGET_DIR=${CURDIR}/debian/wazuh-dashboard
+export NAME=wazuh-dashboard
+export CONFIG_DIR=/etc/$(NAME)
+export INSTALLATION_DIR=$(INSTALLATION_DIR)
+export USER=$(NAME)
+export GROUP=$(NAME)
+export DASHBOARD_FILE=wazuh-dashboard.tar.gz
+
+# -----------------------------------------------------------------------------
+
+%:
+ dh $@
+
+# -----------------------------------------------------------------------------
+
+override_dh_shlibdeps:
+
+# -----------------------------------------------------------------------------
+
+override_dh_auto_configure:
+
+# -----------------------------------------------------------------------------
+
+override_dh_auto_install:
+
+# -----------------------------------------------------------------------------
+
+override_dh_install:
+ cp /opt/$(DASHBOARD_FILE) ./
+
+ groupadd $(GROUP)
+ useradd -g $(GROUP) $(USER)
+
+ tar -xf $(DASHBOARD_FILE)
+
+ mkdir -p $(TARGET_DIR)$(CONFIG_DIR)
+ mkdir -p $(TARGET_DIR)$(INSTALLATION_DIR)
+ mkdir -p $(TARGET_DIR)/etc/systemd/system
+ mkdir -p $(TARGET_DIR)/etc/default
+
+ cp wazuh-dashboard-base/config/node.options $(TARGET_DIR)$(CONFIG_DIR)
+ cp wazuh-dashboard-base/config/opensearch_dashboards.yml $(TARGET_DIR)$(CONFIG_DIR)
+ mv wazuh-dashboard-base/* $(TARGET_DIR)$(INSTALLATION_DIR)
+
+ mkdir -p $(TARGET_DIR)$(INSTALLATION_DIR)/config
+
+ cp $(TARGET_DIR)$(INSTALLATION_DIR)/wazuh-dashboard.service $(TARGET_DIR)/etc/systemd/system/wazuh-dashboard.service
+ cp $(TARGET_DIR)$(INSTALLATION_DIR)/wazuh-dashboard $(TARGET_DIR)/etc/systemd/system/$(NAME)
+ cp $(TARGET_DIR)$(INSTALLATION_DIR)/default $(TARGET_DIR)/etc/default/$(NAME)
+
+ rm -rf $(TARGET_DIR)$(INSTALLATION_DIR)/etc
+
+ chown -R $(USER):$(GROUP) $(TARGET_DIR)$(INSTALLATION_DIR)
+ chown -R $(USER):$(GROUP) $(TARGET_DIR)$(CONFIG_DIR)
+
+ find $(TARGET_DIR)$(INSTALLATION_DIR)/plugins/wazuh/ -exec chown $(USER):$(GROUP) {} \;
+
+# -----------------------------------------------------------------------------
+
+override_dh_fixperms:
+ chmod 750 $(TARGET_DIR)$(CONFIG_DIR)
+ chown -R $(USER):$(GROUP) $(TARGET_DIR)$(CONFIG_DIR)
+ chmod 750 $(TARGET_DIR)$(INSTALLATION_DIR)
+ chown -R $(USER):$(GROUP) $(TARGET_DIR)$(INSTALLATION_DIR)
+ chown root:root $(TARGET_DIR)/etc/systemd/system/wazuh-dashboard.service
+ chown root:root $(TARGET_DIR)/etc/systemd/system/"$(NAME)"
+ chown $(USER):$(GROUP) $(TARGET_DIR)/etc/default/"$(NAME)"
+ chown $(USER):$(GROUP) $(TARGET_DIR)$(INSTALLATION_DIR)/VERSION
+ chmod 440 $(TARGET_DIR)$(INSTALLATION_DIR)/VERSION
+ chmod 750 $(TARGET_DIR)/etc/systemd/system/wazuh-dashboard
+ chmod 750 $(TARGET_DIR)/etc/default/wazuh-dashboard
+ chmod 640 "$(TARGET_DIR)$(CONFIG_DIR)"/node.options
+ chmod 640 $(TARGET_DIR)/etc/systemd/system/wazuh-dashboard.service
+ find "$(TARGET_DIR)$(INSTALLATION_DIR)" -type d -exec chmod 750 {} \;
+ find "$(TARGET_DIR)$(INSTALLATION_DIR)" -type f -perm 644 -exec chmod 640 {} \;
+ find "$(TARGET_DIR)$(INSTALLATION_DIR)" -type f -perm 755 -exec chmod 750 {} \;
+ find "$(TARGET_DIR)$(INSTALLATION_DIR)" -type f -perm 744 -exec chmod 740 {} \;
+
+# -----------------------------------------------------------------------------
+
+override_dh_strip:
+ dh_strip --no-automatic-dbgsym -XlibGLESv2.so -XlibEGL.so
+
+# -----------------------------------------------------------------------------
+
+.PHONY: override_dh_strip override_dh_auto_clean override_dh_auto_build override_dh_auto_configure
diff --git a/dev-tools/build-packages/deb/docker/amd64/Dockerfile b/dev-tools/build-packages/deb/docker/amd64/Dockerfile
new file mode 100644
index 000000000000..f3ca3b981113
--- /dev/null
+++ b/dev-tools/build-packages/deb/docker/amd64/Dockerfile
@@ -0,0 +1,16 @@
+FROM debian:10
+
+ENV DEBIAN_FRONTEND noninteractive
+
+# Installing necessary packages
+RUN apt-get update && apt-get install -y --allow-change-held-packages apt-utils && \
+ apt-get install -y --allow-change-held-packages \
+ curl sudo wget expect gnupg build-essential \
+ devscripts equivs selinux-basics procps gawk
+
+# Add the script to build the Debian package
+ADD builder.sh /usr/local/bin/builder
+RUN chmod +x /usr/local/bin/builder
+
+# Set the entrypoint
+ENTRYPOINT ["/usr/local/bin/builder"]
\ No newline at end of file
diff --git a/dev-tools/build-packages/deb/launcher.sh b/dev-tools/build-packages/deb/launcher.sh
new file mode 100755
index 000000000000..090bcb96a71b
--- /dev/null
+++ b/dev-tools/build-packages/deb/launcher.sh
@@ -0,0 +1,195 @@
+#!/bin/bash
+
+# Wazuh package generator
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+# Inputs
+package=""
+version=""
+revision="1"
+architecture="amd64"
+build_base="yes"
+build_docker="yes"
+
+# Constants
+deb_amd64_builder="deb_dashboard_builder_amd64"
+deb_builder_dockerfile="${current_path}/docker"
+
+# Paths
+current_path="$( cd $(dirname $0) ; pwd -P )"
+config_path=$(realpath $current_path/../config)
+
+# Folders
+out_dir="${current_path}/output"
+tmp_dir="${current_path}/tmp"
+
+trap ctrl_c INT
+
+clean() {
+ exit_code=$1
+ echo
+ echo "Cleaning temporary files..."
+ echo
+ # Clean the files
+ rm -r $tmp_dir
+ rm $current_path/docker/amd64/*.sh
+ if [ $exit_code != 0 ]; then
+ rm $out_dir/*
+ rmdir $out_dir
+ fi
+
+ exit ${exit_code}
+}
+
+ctrl_c() {
+ clean 1
+}
+
+build_deb() {
+ container_name="$1"
+ dockerfile_path="$2"
+
+ # Validate and download files to build the package
+ valid_url='(https?|ftp|file)://[-[:alnum:]\+&@#/%?=~_|!:,.;]*[-[:alnum:]\+&@#/%=~_|]'
+
+ echo
+ echo "Downloading files..."
+ echo
+
+ mkdir -p $tmp_dir
+ cd $tmp_dir
+
+ if [[ $package =~ $valid_url ]]; then
+ if ! curl --output wazuh-dashboard.tar.gz --silent --fail "${package}"; then
+ echo "The given URL or Path to the Wazuh Dashboard package is not working: ${package}"
+ clean 1
+ fi
+ else
+ echo "The given URL or Path to the Wazuh Dashboard package is not valid: ${package}"
+ clean 1
+ fi
+
+ echo
+ echo Building the package...
+ echo
+
+ # Prepare the package
+ directory_name=$(tar tf wazuh-dashboard.tar.gz | head -1 | sed 's#/.*##' | sort -u)
+ tar -zxf wazuh-dashboard.tar.gz
+ rm wazuh-dashboard.tar.gz
+ mv $directory_name wazuh-dashboard-base
+ cp $config_path/* wazuh-dashboard-base
+ echo ${version} >wazuh-dashboard-base/VERSION
+ tar -czf ./wazuh-dashboard.tar.gz wazuh-dashboard-base
+
+ # Copy the necessary files
+ cp ${current_path}/builder.sh ${dockerfile_path}
+
+ # Build the Docker image
+ if [[ ${build_docker} == "yes" ]]; then
+ docker build -t ${container_name} ${dockerfile_path} || return 1
+ fi
+
+ # Build the Debian package with a Docker container
+ if [ ! -d "$out_dir" ]; then
+ mkdir -p $out_dir
+ fi
+ volumes="-v ${out_dir}/:/tmp:Z -v ${tmp_dir}/wazuh-dashboard.tar.gz:/opt/wazuh-dashboard.tar.gz"
+ docker run -t --rm ${volumes} \
+ -v ${current_path}/../..:/root:Z \
+ ${container_name} ${architecture} \
+ ${revision} ${version} || return 1
+
+ echo "Package $(ls -Art ${out_dir} | tail -n 1) added to ${out_dir}."
+
+ echo
+ echo DONE!
+ echo
+
+ return 0
+}
+
+build() {
+ build_name="${deb_amd64_builder}"
+ file_path="../${deb_builder_dockerfile}/${architecture}"
+ build_deb ${build_name} ${file_path} || return 1
+ return 0
+}
+
+help() {
+ echo
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo " -v, --version Wazuh version"
+ echo " -p, --package Set the location of the .tar.gz file containing the Wazuh Dashboard package."
+ echo " -r, --revision [Optional] Package revision. By default: 1."
+ echo " -o, --output [Optional] Set the destination path of package. By default, an output folder will be created."
+ echo " --dont-build-docker [Optional] Locally built Docker image will be used instead of generating a new one."
+ echo " -h, --help Show this help."
+ echo
+ exit $1
+}
+
+main() {
+ while [ -n "${1}" ]; do
+ case "${1}" in
+ "-h" | "--help")
+ help 0
+ ;;
+ "-p" | "--package")
+ if [ -n "${2}" ]; then
+ package="${2}"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ "-v" | "--version")
+ if [ -n "${2}" ]; then
+ version="${2}"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ "-r" | "--revision")
+ if [ -n "${2}" ]; then
+ revision="${2}"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ "--dont-build-docker")
+ build_docker="no"
+ shift 1
+ ;;
+ "-o" | "--output")
+ if [ -n "${2}" ]; then
+ out_dir="${2}"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ *)
+ help 1
+ ;;
+ esac
+ done
+
+ if [ -z "$package" ] | [ -z "$version" ]; then
+ help 1
+ fi
+
+ build || clean 1
+
+ clean 0
+}
+
+main "$@"
diff --git a/dev-tools/build-packages/rpm/builder.sh b/dev-tools/build-packages/rpm/builder.sh
new file mode 100755
index 000000000000..f71f9476d038
--- /dev/null
+++ b/dev-tools/build-packages/rpm/builder.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# Wazuh package builder
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+set -e
+
+# Script parameters to build the package
+target="wazuh-dashboard"
+architecture=$1
+revision=$2
+version=$3
+directory_base="/usr/share/wazuh-dashboard"
+
+# Build directories
+build_dir=/build
+rpm_build_dir=${build_dir}/rpmbuild
+pkg_name=${target}-${version}
+pkg_path="${rpm_build_dir}/RPMS/${architecture}"
+file_name="${target}-${version}-${revision}"
+rpm_file="${file_name}.${architecture}.rpm"
+
+mkdir -p ${rpm_build_dir}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
+
+# Prepare the sources directory to build the source tar.gz
+mkdir ${build_dir}/${pkg_name}
+
+# Including spec file
+cp /root/build-packages/rpm/${target}.spec ${rpm_build_dir}/SPECS/${pkg_name}.spec
+
+# Generating source tar.gz
+cd ${build_dir} && tar czf "${rpm_build_dir}/SOURCES/${pkg_name}.tar.gz" "${pkg_name}"
+
+# Building RPM
+/usr/bin/rpmbuild -v \
+ --define "_topdir ${rpm_build_dir}" \
+ --define "_version ${version}" \
+ --define "_release ${revision}" \
+ --define "_localstatedir ${directory_base}" \
+ --target ${architecture} \
+ -ba ${rpm_build_dir}/SPECS/${pkg_name}.spec
+
+cd ${pkg_path} && sha512sum ${rpm_file} >/tmp/${rpm_file}.sha512
+
+find ${pkg_path}/ -maxdepth 3 -type f -name "${file_name}*" -exec mv {} /tmp/ \;
diff --git a/dev-tools/build-packages/rpm/docker/x86_64/Dockerfile b/dev-tools/build-packages/rpm/docker/x86_64/Dockerfile
new file mode 100644
index 000000000000..eb6493d15878
--- /dev/null
+++ b/dev-tools/build-packages/rpm/docker/x86_64/Dockerfile
@@ -0,0 +1,21 @@
+FROM rockylinux:8.5
+
+# Install all the necessary tools to build the packages
+RUN yum clean all && yum update -y
+RUN yum install -y openssh-clients sudo gnupg \
+ yum-utils epel-release redhat-rpm-config rpm-devel \
+ zlib zlib-devel rpm-build autoconf automake \
+ glibc-devel libtool perl
+
+#RUN yum install -y --nobest https://repo.ius.io/ius-release-el7.rpm
+
+RUN yum update -y && yum install -y python3
+
+RUN ln -fs /usr/bin/python3.6 /usr/bin/python
+
+# Add the scripts to build the RPM package
+ADD builder.sh /usr/local/bin/builder
+RUN chmod +x /usr/local/bin/builder
+
+# Set the entrypoint
+ENTRYPOINT ["/usr/local/bin/builder"]
diff --git a/dev-tools/build-packages/rpm/launcher.sh b/dev-tools/build-packages/rpm/launcher.sh
new file mode 100755
index 000000000000..ca9a67d4c1c4
--- /dev/null
+++ b/dev-tools/build-packages/rpm/launcher.sh
@@ -0,0 +1,198 @@
+#!/bin/bash
+
+# Wazuh package generator
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+
+# Inputs
+package=""
+version=""
+revision="1"
+architecture="x86_64"
+build_base="yes"
+build_docker="yes"
+
+# Constants
+rpm_x86_builder="rpm_dashboard_builder_x86"
+rpm_builder_dockerfile="${current_path}/docker"
+
+# Paths
+current_path="$( cd $(dirname $0) ; pwd -P )"
+config_path=$(realpath $current_path/../config)
+
+# Folders
+out_dir="${current_path}/output"
+tmp_dir="${current_path}/tmp"
+
+trap ctrl_c INT
+
+clean() {
+ exit_code=$1
+ echo
+ echo "Cleaning temporary files..."
+ echo
+ # Clean the files
+ rm -r $tmp_dir
+ rm $current_path/docker/x86_64/*.sh
+
+ if [ $exit_code != 0 ]; then
+ rm $out_dir/*
+ rmdir $out_dir
+ fi
+
+ exit ${exit_code}
+}
+
+ctrl_c() {
+ clean 1
+}
+
+build_rpm() {
+ container_name="$1"
+ dockerfile_path="$2"
+
+ # Validate and download files to build the package
+ valid_url='(https?|ftp|file)://[-[:alnum:]\+&@#/%?=~_|!:,.;]*[-[:alnum:]\+&@#/%=~_|]'
+
+ echo
+ echo "Downloading files..."
+ echo
+
+ mkdir -p $tmp_dir
+ cd $tmp_dir
+
+ if [[ $package =~ $valid_url ]]; then
+ if ! curl --output wazuh-dashboard.tar.gz --silent --fail "${package}"; then
+ echo "The given URL or Path to the Wazuh Dashboard package is not working: ${package}"
+ clean 1
+ fi
+ else
+ echo "The given URL or Path to the Wazuh Dashboard package is not valid: ${package}"
+ clean 1
+ fi
+
+ echo
+ echo Building the package...
+ echo
+
+ # Prepare the package
+ directory_name=$(tar tf wazuh-dashboard.tar.gz | head -1 | sed 's#/.*##' | sort -u)
+ tar -zxf wazuh-dashboard.tar.gz
+ rm wazuh-dashboard.tar.gz
+ mv $directory_name wazuh-dashboard-base
+ mkdir -p wazuh-dashboard-base/etc/services
+ cp $config_path/* wazuh-dashboard-base/etc/services
+ echo ${version} >wazuh-dashboard-base/VERSION
+ tar -czf ./wazuh-dashboard.tar.gz wazuh-dashboard-base
+
+ # Copy the necessary files
+ cp ${current_path}/builder.sh ${dockerfile_path}
+
+ # Build the Docker image
+ if [[ ${build_docker} == "yes" ]]; then
+ docker build -t ${container_name} ${dockerfile_path} || return 1
+ fi
+
+ # Build the RPM package with a Docker container
+
+ if [ ! -d "$out_dir" ]; then
+ mkdir -p $out_dir
+ fi
+ volumes="-v ${out_dir}/:/tmp:Z -v ${tmp_dir}/wazuh-dashboard.tar.gz:/opt/wazuh-dashboard.tar.gz"
+ docker run -t --rm ${volumes} \
+ -v ${current_path}/../..:/root:Z \
+ ${container_name} ${architecture} \
+ ${revision} ${version} || return 1
+
+ echo "Package $(ls -Art ${out_dir} | tail -n 1) added to ${out_dir}."
+
+ echo
+ echo DONE!
+ echo
+
+ return 0
+}
+
+build() {
+ build_name="${rpm_x86_builder}"
+ file_path="../${rpm_builder_dockerfile}/${architecture}"
+ build_rpm ${build_name} ${file_path} || return 1
+ return 0
+}
+
+help() {
+ echo
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo " -v, --version Wazuh version"
+ echo " -p, --package Set the location of the .tar.gz file containing the Wazuh Dashboard package."
+ echo " -r, --revision [Optional] Package revision. By default: 1."
+ echo " -o, --output [Optional] Set the destination path of package. By default, an output folder will be created."
+ echo " --dont-build-docker [Optional] Locally built Docker image will be used instead of generating a new one."
+ echo " -h, --help Show this help."
+ echo
+ exit $1
+}
+
+main() {
+ while [ -n "${1}" ]; do
+ case "${1}" in
+ "-h" | "--help")
+ help 0
+ ;;
+ "-p" | "--package")
+ if [ -n "${2}" ]; then
+ package="${2}"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ "-v" | "--version")
+ if [ -n "${2}" ]; then
+ version="${2}"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ "-r" | "--revision")
+ if [ -n "${2}" ]; then
+ revision="${2}"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ "--dont-build-docker")
+ build_docker="no"
+ shift 1
+ ;;
+ "-o" | "--output")
+ if [ -n "${2}" ]; then
+ outdir="${2}"
+ shift 2
+ else
+ help 1
+ fi
+ ;;
+ *)
+ help 1
+ ;;
+ esac
+ done
+
+ if [ -z "$package" ] | [ -z "$version" ]; then
+ help 1
+ fi
+
+ build || clean 1
+
+ clean 0
+}
+
+main "$@"
diff --git a/dev-tools/build-packages/rpm/wazuh-dashboard.spec b/dev-tools/build-packages/rpm/wazuh-dashboard.spec
new file mode 100644
index 000000000000..39e5c924d453
--- /dev/null
+++ b/dev-tools/build-packages/rpm/wazuh-dashboard.spec
@@ -0,0 +1,427 @@
+# Wazuh dashboard SPEC
+# Copyright (C) 2021, Wazuh Inc.
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+Summary: Wazuh dashboard is a user interface and visualization tool for security-related data. Documentation can be found at https://documentation.wazuh.com/current/getting-started/components/wazuh-dashboard.html
+Name: wazuh-dashboard
+Version: %{_version}
+Release: %{_release}
+License: GPL
+Group: System Environment/Daemons
+Source0: %{name}-%{version}.tar.gz
+URL: https://www.wazuh.com/
+buildroot: %{_tmppath}/%{name}-%{version}-%{release}-wazuh-dashboard-%(%{__id_u} -n)
+Vendor: Wazuh, Inc
+Packager: Wazuh, Inc
+Requires(pre): /usr/sbin/groupadd /usr/sbin/useradd
+Requires(preun): /sbin/service
+Requires(postun): /sbin/service
+AutoReqProv: no
+Requires: libcap
+ExclusiveOS: linux
+
+# -----------------------------------------------------------------------------
+
+%global USER %{name}
+%global GROUP %{name}
+%global CONFIG_DIR /etc/%{name}
+%global PID_DIR /run/%{name}
+%global INSTALL_DIR /usr/share/%{name}
+%global DASHBOARD_FILE wazuh-dashboard.tar.gz
+%define _source_payload w9.gzdio
+%define _binary_payload w9.gzdio
+
+# -----------------------------------------------------------------------------
+
+
+%description
+Wazuh dashboard is a user interface and visualization tool for security-related data. This Wazuh central component enables exploring, visualizing, and analyzing the stored security alerts generated by the Wazuh server. Wazuh dashboard enables inspecting the status and managing the configurations of the Wazuh cluster and agents as well as creating and managing users and roles. In addition, it allows testing the ruleset and making calls to the Wazuh API. Documentation can be found at https://documentation.wazuh.com/current/getting-started/components/wazuh-dashboard.html
+
+# -----------------------------------------------------------------------------
+
+%prep
+
+cp /opt/%{DASHBOARD_FILE} ./
+
+groupadd %{GROUP}
+useradd -g %{GROUP} %{USER}
+
+# -----------------------------------------------------------------------------
+
+%build
+
+tar -xf %{DASHBOARD_FILE}
+
+# -----------------------------------------------------------------------------
+
+%install
+
+mkdir -p %{buildroot}%{CONFIG_DIR}
+mkdir -p %{buildroot}%{INSTALL_DIR}
+mkdir -p %{buildroot}/etc/systemd/system
+mkdir -p %{buildroot}%{_initrddir}
+mkdir -p %{buildroot}/etc/default
+
+cp wazuh-dashboard-base/config/node.options %{buildroot}%{CONFIG_DIR}
+cp wazuh-dashboard-base/config/opensearch_dashboards.yml %{buildroot}%{CONFIG_DIR}
+cp wazuh-dashboard-base/VERSION %{buildroot}%{INSTALL_DIR}
+
+mv wazuh-dashboard-base/* %{buildroot}%{INSTALL_DIR}
+
+# Set custom welcome styles
+
+mkdir -p %{buildroot}%{INSTALL_DIR}/config
+
+cp %{buildroot}%{INSTALL_DIR}/etc/services/wazuh-dashboard.service %{buildroot}/etc/systemd/system/wazuh-dashboard.service
+cp %{buildroot}%{INSTALL_DIR}/etc/services/default %{buildroot}/etc/default/wazuh-dashboard
+
+chmod 640 %{buildroot}/etc/systemd/system/wazuh-dashboard.service
+chmod 640 %{buildroot}/etc/default/wazuh-dashboard
+
+rm -rf %{buildroot}%{INSTALL_DIR}/etc/
+
+find %{buildroot}%{INSTALL_DIR} -exec chown %{USER}:%{GROUP} {} \;
+find %{buildroot}%{CONFIG_DIR} -exec chown %{USER}:%{GROUP} {} \;
+
+chown root:root %{buildroot}/etc/systemd/system/wazuh-dashboard.service
+
+find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -exec chown %{USER}:%{GROUP} {} \;
+find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -type f -perm 644 -exec chmod 640 {} \;
+find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -type f -perm 755 -exec chmod 750 {} \;
+find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -type d -exec chmod 750 {} \;
+find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -type f -perm 744 -exec chmod 740 {} \;
+
+# -----------------------------------------------------------------------------
+
+%pre
+# Create the wazuh-dashboard group if it doesn't exists
+if [ $1 = 1 ]; then
+ if command -v getent > /dev/null 2>&1 && ! getent group %{GROUP} > /dev/null 2>&1; then
+ groupadd -r %{GROUP}
+ elif ! getent group %{GROUP} > /dev/null 2>&1; then
+ groupadd -r %{GROUP}
+ fi
+ # Create the wazuh-dashboard user if it doesn't exists
+ if ! getent passwd %{USER} > /dev/null 2>&1; then
+ useradd -g %{GROUP} -G %{USER} -d %{INSTALL_DIR}/ -r -s /sbin/nologin wazuh-dashboard
+ fi
+fi
+# Stop the services to upgrade the package
+if [ $1 = 2 ]; then
+ if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1 && systemctl is-active --quiet wazuh-dashboard > /dev/null 2>&1; then
+ systemctl stop wazuh-dashboard.service > /dev/null 2>&1
+ touch %{INSTALL_DIR}/wazuh-dashboard.restart
+ # Check for SysV
+ elif command -v service > /dev/null 2>&1 && service wazuh-dashboard status 2>/dev/null | grep "is running" > /dev/null 2>&1; then
+ service wazuh-dashboard stop > /dev/null 2>&1
+ touch %{INSTALL_DIR}/wazuh-dashboard.restart
+ fi
+fi
+
+# -----------------------------------------------------------------------------
+
+%post
+setcap 'cap_net_bind_service=+ep' %{INSTALL_DIR}/node/bin/node
+
+if [ ! -f %{INSTALLATION_DIR}/config/opensearch_dashboards.keystore ]; then
+ runuser %{USER} --shell="/bin/bash" --command="%{INSTALL_DIR}/bin/opensearch-dashboards-keystore create" > /dev/null 2>&1
+ runuser %{USER} --shell="/bin/bash" --command="echo kibanaserver | %{INSTALL_DIR}/bin/opensearch-dashboards-keystore add opensearch.username --stdin" > /dev/null 2>&1
+ runuser %{USER} --shell="/bin/bash" --command="echo kibanaserver | %{INSTALL_DIR}/bin/opensearch-dashboards-keystore add opensearch.password --stdin" > /dev/null 2>&1
+fi
+
+# -----------------------------------------------------------------------------
+
+%preun
+if [ $1 = 0 ];then # Remove
+ echo -n "Stopping wazuh-dashboard service..."
+ if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1; then
+ systemctl stop wazuh-dashboard.service > /dev/null 2>&1
+ # Check for SysV
+ elif command -v service > /dev/null 2>&1; then
+ service wazuh-dashboard stop > /dev/null 2>&1
+ fi
+fi
+
+# -----------------------------------------------------------------------------
+
+%postun
+if [ $1 = 0 ];then
+ # If the package is been uninstalled
+ # Remove the wazuh-dashboard user if it exists
+ if getent passwd %{USER} > /dev/null 2>&1; then
+ userdel %{USER} >/dev/null 2>&1
+ fi
+ # Remove the wazuh-dashboard group if it exists
+ if command -v getent > /dev/null 2>&1 && getent group %{GROUP} > /dev/null 2>&1; then
+ groupdel %{GROUP} >/dev/null 2>&1
+ elif getent group %{GROUP} > /dev/null 2>&1; then
+ groupdel %{GROUP} >/dev/null 2>&1
+ fi
+
+ # Remove /etc/wazuh-dashboard and /usr/share/wazuh-dashboard dirs
+ rm -rf %{INSTALL_DIR}
+ if [ -d %{PID_DIR} ]; then
+ rm -rf %{PID_DIR}
+ fi
+fi
+
+# -----------------------------------------------------------------------------
+
+# posttrans code is the last thing executed in a install/upgrade
+%posttrans
+if [ ! -d %{PID_DIR} ]; then
+ mkdir -p %{PID_DIR}
+ chown %{USER}:%{GROUP} %{PID_DIR}
+fi
+
+if [ -f %{INSTALL_DIR}/wazuh-dashboard.restart ]; then
+ rm -f %{INSTALL_DIR}/wazuh-dashboard.restart
+ if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1; then
+ systemctl restart wazuh-dashboard.service > /dev/null 2>&1
+ # Check for SysV
+ elif command -v service > /dev/null 2>&1; then
+ service wazuh-dashboard restart > /dev/null 2>&1
+ fi
+
+fi
+
+
+# -----------------------------------------------------------------------------
+
+%clean
+rm -fr %{buildroot}
+
+# -----------------------------------------------------------------------------
+
+%files
+%defattr(-,%{USER},%{GROUP})
+%dir %attr(750, %{USER}, %{GROUP}) %{CONFIG_DIR}
+
+%attr(0750, %{USER}, %{GROUP}) "/etc/default/wazuh-dashboard"
+%config(noreplace) %attr(0640, %{USER}, %{GROUP}) "%{CONFIG_DIR}/opensearch_dashboards.yml"
+%config(noreplace) %attr(0640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/config/opensearch_dashboards.yml"
+%config(noreplace) %attr(0640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/config/node.options"
+
+%attr(440, %{USER}, %{GROUP}) %{INSTALL_DIR}/VERSION
+%dir %attr(750, %{USER}, %{GROUP}) %{INSTALL_DIR}
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/core"
+%attr(-, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/core/*"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/remove"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/list"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/lib"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/downloaders"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/__fixtures__"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/__fixtures__/replies"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/utils"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/root"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/harden"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/__fixtures__"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/__fixtures__/plugin"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/__fixtures__/plugin/foo"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/plugins"
+%attr(-, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/plugins/*
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve/integration_tests"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve/integration_tests/__fixtures__"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve/integration_tests/__fixtures__/reload_logging_config"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/utils"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/rotate"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/core"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/i18n"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/i18n/localization"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/warnings"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/http"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/config"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/keystore"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/ui_render"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/ui_render/bootstrap"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/apm"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/docs"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/node_modules"
+%attr(-, %{USER}, %{GROUP}) "%{INSTALL_DIR}/node_modules/*"
+%attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/node_modules/.yarn-integrity"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/node"
+%attr(-, %{USER}, %{GROUP}) "%{INSTALL_DIR}/node/*"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/data"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/plugins"
+%attr(-, %{USER}, %{GROUP}) "%{INSTALL_DIR}/plugins/*"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/bin"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/remove/settings.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/remove/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/remove/remove.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/dev.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/list/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/list/list.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/lib/logger.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/lib/errors.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/lib/log_warnings.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/opensearch_dashboards.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/downloaders/file.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/downloaders/http.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/zip.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/download.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/install.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/settings.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/rename.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/__fixtures__/replies/invalid_name.zip"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/__fixtures__/replies/test_plugin_different_version.zip"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/__fixtures__/replies/banana.jpg"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/__fixtures__/replies/test_plugin_no_opensearch_dashboards.zip"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/__fixtures__/replies/test_plugin.zip"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/__fixtures__/replies/corrupt.zip"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/__fixtures__/replies/test_plugin_many.zip"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/cleanup.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/pack.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/install/progress.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/cli.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_plugin/dist.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/cli_keystore.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/add.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/create.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/utils/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/utils/prompt.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/dev.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/get_keystore.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/remove.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/dist.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli_keystore/list.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/apm.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/root/force.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/root/is_root.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/root/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/polyfill.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/node_version_validator.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/harden/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/harden/child_process.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/harden/lodash_template.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/no_transpilation.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/exit_on_warning.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/setup_node_env/dist.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/np_ui_plugin_public_dirs.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/optimize_mixin.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/proxy_bundles_route.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/file_hash.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/file_hash_cache.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/__fixtures__/plugin/foo/plugin.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/__fixtures__/outside_output.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/bundles_route.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/optimize/bundles_route/dynamic_asset_response.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/command.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/help.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/cli.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve/serve.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve/read_keystore.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve/integration_tests/__fixtures__/invalid_config.yml"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve/integration_tests/__fixtures__/reload_logging_config/opensearch_dashboards_log_file.test.yml"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve/integration_tests/__fixtures__/reload_logging_config/opensearch_dashboards_log_console.test.yml"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/serve/integration_tests/__fixtures__/reload_logging_config/opensearch_dashboards.test.yml"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/cli/dist.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/utils/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/utils/unset.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/utils/version.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/utils/artifact_type.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/utils/deep_clone_with_buffers.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/rotate/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/rotate/log_rotator.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/apply_filters_to_keys.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/log_format.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/log_reporter.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/log_format_json.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/log_with_metadata.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/configuration.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/log_interceptor.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/logging/log_format_string.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/core/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/i18n/localization/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/i18n/localization/telemetry_localization_collector.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/i18n/localization/file_integrity.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/i18n/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/i18n/get_translations_path.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/i18n/constants.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/osd_server.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/warnings/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/http/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/http/register_hapi_plugins.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/http/setup_base_path_provider.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/config/override.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/config/complete.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/config/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/config/schema.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/config/config.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/keystore/keystore.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/keystore/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/server/keystore/errors.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/ui_mixin.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/ui_render/ui_render_mixin.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/ui_render/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/ui_render/bootstrap/osd_bundles_loader_source.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/ui_render/bootstrap/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/ui_render/bootstrap/template.js.hbs"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/ui_render/bootstrap/app_bootstrap.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/legacy/ui/apm/index.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/docs/docs_repo.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/src/docs/cli.js"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/package.json"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/LICENSE.txt"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/NOTICE.txt"
+%attr(640, %{USER}, %{GROUP}) "%{INSTALL_DIR}/README.txt"
+%attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/bin/use_node"
+%attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/bin/opensearch-dashboards"
+%attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/bin/opensearch-dashboards-plugin"
+%attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/bin/opensearch-dashboards-keystore"
+%dir %attr(750, %{USER}, %{GROUP}) "%{INSTALL_DIR}/config"
+%attr(640, %{USER}, %{GROUP}) "%{CONFIG_DIR}/node.options"
+%attr(640, root, root) "/etc/systemd/system/wazuh-dashboard.service"
+
+%changelog
+* Fri May 05 2023 support - %{version}
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Mon Apr 24 2023 support - 4.4.2
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Mon Apr 17 2023 support - 4.4.1
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Wed Jan 18 2023 support - 4.4.0
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Thu Nov 10 2022 support - 4.3.10
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Mon Oct 03 2022 support - 4.3.9
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Mon Sep 19 2022 support - 4.3.8
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Mon Aug 08 2022 support - 4.3.7
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Thu Jul 07 2022 support - 4.3.6
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Wed Jun 29 2022 support - 4.3.5
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Tue Jun 07 2022 support - 4.3.4
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Tue May 31 2022 support - 4.3.3
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Mon May 30 2022 support - 4.3.2
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Wed May 18 2022 support - 4.3.1
+- More info: https://documentation.wazuh.com/current/release-notes/
+* Thu May 05 2022 support - 4.3.0
+- More info: https://documentation.wazuh.com/current/release-notes/
diff --git a/dev-tools/signoff-check.sh b/dev-tools/signoff-check.sh
index 683628c5664d..cb147e943cf9 100755
--- a/dev-tools/signoff-check.sh
+++ b/dev-tools/signoff-check.sh
@@ -5,7 +5,7 @@
# Validate input parameters
if [ -z $1 ] || [ -z $2 ]
then
- echo usage: ./signoff-check.sh commit1 commit2
+ echo usage: ./signoff_check.sh commit1 commit2
echo
echo Checks all of the commits between commit1 \(exclusive\) and commit2 \(inclusive\)
echo were made with the --signoff flag enabled
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 000000000000..fa199650b978
--- /dev/null
+++ b/docker/README.md
@@ -0,0 +1,75 @@
+# Frontend development environments
+
+Install [Docker Desktop][docker-desktop] as per its instructions, available for Windows, Mac
+and Linux (Ubuntu, Debian & Fedora).
+This ensures that the development experience between Linux, Mac and Windows is as
+similar as possible.
+
+> IMPORTANT: be methodic during the installation of Docker Desktop, and proceed
+> step by step as described in their documentation. Make sure that your system
+> meets the system requirements before installing Docker Desktop, and read any
+> post-installation note, specially on Linux: [Differences between
+> Docker Desktop for Linux and Docker Engine][docker-variant].
+
+## Pre-requisites
+
+1. Assign resources to [Docker Desktop][docker-desktop]. The requirements for the
+ environments are:
+
+ - 8 GB of RAM (minimum)
+ - 4 cores
+
+ The more resources the better âē
+
+2. Clone the [wazuh-dashboard][app-repo] and the [wazuh-security-dashboards-plugin][security-repo]
+ repositories at the same level.
+
+3. Set up user permissions
+
+ The Docker volumes will be created by the internal Docker user, making them
+ read-only. To prevent this, a new group named `docker-desktop` and GUID 100999
+ needs to be created, then added to your user and the source code folder:
+
+ ```bash
+ sudo groupadd -g 100999 docker-desktop
+ sudo useradd -u 100999 -g 100999 -M docker-desktop
+ sudo chown -R docker-desktop:docker-desktop $WZD_HOME
+ sudo usermod -aG docker-desktop $USER
+ ```
+
+## Understanding Docker contexts
+
+Before we begin starting Docker containers, we need to understand the
+differences between Docker Engine and Docker Desktop, more precisely, that the
+use different contexts.
+
+Carefully read these two sections of the Docker documentation:
+
+- [Differences between Docker Desktop for Linux and Docker Engine][docker-variant].
+- [Switch between Docker Desktop and Docker Engine][docker-context].
+
+Docker Desktop will change to its context automatically at start, so be sure
+that any existing Docker container using the default context is **stopped**
+before starting Docker Desktop and any of the environments in this folder.
+
+## Starting up the environments
+
+Use the sh script to up the environment.
+
+Example:
+
+```bash
+Usage: ./dev.sh {up|down|stop} [security]
+```
+
+Once the `wazuh-dashboard` container is up, attach a shell to it and run `yarn start --no-base-path`
+to start the application.
+
+The dependencies of the project will be installed automatically by the `installed` container,
+even for the security plugin, if the security flag is provided.
+
+[docker-desktop]: https://docs.docker.com/get-docker
+[docker-variant]: https://docs.docker.com/desktop/install/linux-install/#differences-between-docker-desktop-for-linux-and-docker-engine
+[docker-context]: https://docs.docker.com/desktop/install/linux-install/#context
+[app-repo]: https://github.com/wazuh/wazuh-dashboard
+[security-repo]: https://github.com/wazuh/wazuh-security-dashboards-plugin
diff --git a/docker/config/opensearch_dashboards.dev.security.yml b/docker/config/opensearch_dashboards.dev.security.yml
new file mode 100644
index 000000000000..5199aa789c33
--- /dev/null
+++ b/docker/config/opensearch_dashboards.dev.security.yml
@@ -0,0 +1,16 @@
+server.host: "0.0.0.0"
+
+opensearchDashboards.branding:
+ useExpandedHeader: false
+
+opensearch.hosts: ["https://indexer:9200"]
+opensearch.ssl.verificationMode: none
+opensearch.username: "kibanaserver"
+opensearch.password: "kibanaserver"
+opensearch.requestHeadersWhitelist: [ authorization,securitytenant ]
+opensearch_security.multitenancy.enabled: true
+opensearch_security.multitenancy.tenants.preferred: ["Private", "Global"]
+opensearch_security.readonly_mode.roles: ["kibana_read_only"]
+
+# Use this setting if you are running opensearch-dashboards without https
+opensearch_security.cookie.secure: false
diff --git a/docker/config/opensearch_dashboards.dev.yml b/docker/config/opensearch_dashboards.dev.yml
new file mode 100644
index 000000000000..88b30aafe3f4
--- /dev/null
+++ b/docker/config/opensearch_dashboards.dev.yml
@@ -0,0 +1,4 @@
+server.host: "0.0.0.0"
+
+opensearchDashboards.branding:
+ useExpandedHeader: false
diff --git a/docker/dev.sh b/docker/dev.sh
new file mode 100755
index 000000000000..3562d7dbbbf0
--- /dev/null
+++ b/docker/dev.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Change working directory to the root of the repository
+cd "${0%/*}/.."
+
+COMPOSE_FILE=docker/dev.yml
+
+# Check if 2nd argument is security
+if [ "$2" = "security" ]; then
+ export SECURITY_PLUGIN_REPO_PATH="../../wazuh-security-dashboards-plugin"
+ COMPOSE_FILE=docker/dev_security.yml
+
+fi
+
+# Common variables
+export REPO_PATH=$(pwd)
+export NODE_VERSION=$(cat $REPO_PATH/.nvmrc)
+export OPENSEARCH_VERSION=$(bash $REPO_PATH/docker/get_version.sh)
+
+COMPOSE_CMD="docker compose -f $COMPOSE_FILE"
+
+print_variables() {
+ echo "NODE_VERSION: $NODE_VERSION"
+ echo "OPENSEARCH_VERSION: $OPENSEARCH_VERSION"
+}
+
+case $1 in
+up)
+ print_variables
+ $COMPOSE_CMD up -d
+ ;;
+down)
+ echo "Cleaning up..."
+ $COMPOSE_CMD exec wazuh-dashboard yarn osd clean
+ $COMPOSE_CMD down
+ ;;
+stop)
+ $COMPOSE_CMD stop
+ ;;
+*)
+ echo "Usage: $0 {up|down|stop} [security]"
+ exit 1
+ ;;
+esac
diff --git a/docker/dev.yml b/docker/dev.yml
new file mode 100644
index 000000000000..8f41bf45eb0a
--- /dev/null
+++ b/docker/dev.yml
@@ -0,0 +1,35 @@
+version: "3.9"
+
+services:
+ # Runs the bootstrap and exits
+ installer:
+ image: node:${NODE_VERSION}
+ container_name: installer-${OPENSEARCH_VERSION}
+ volumes:
+ - ${REPO_PATH}:/home/node/app
+ user: "1000:1000"
+ working_dir: /home/node/app
+ command: >
+ /bin/bash -c "
+ yarn osd bootstrap
+ "
+
+ wazuh-dashboard:
+ image: node:${NODE_VERSION}
+ container_name: wazuh-dashboard-${OPENSEARCH_VERSION}
+ depends_on:
+ installer:
+ condition: service_completed_successfully
+ ports:
+ - 5601:5601 # Map host port 5601 to container port 5601
+ expose:
+ - "5601" # Expose port 5601 for web access to Wazuh Dashboard
+ volumes:
+ - ${REPO_PATH}:/home/node/app
+ - ${REPO_PATH}/docker/config/opensearch_dashboards.dev.yml:/home/node/app/config/opensearch_dashboards.dev.yml
+ user: "1000:1000"
+ working_dir: /home/node/app
+ command: >
+ /bin/bash -c "
+ yarn opensearch snapshot
+ "
diff --git a/docker/dev_security.yml b/docker/dev_security.yml
new file mode 100755
index 000000000000..7f6b935ae3ee
--- /dev/null
+++ b/docker/dev_security.yml
@@ -0,0 +1,85 @@
+version: "3.9"
+
+services:
+ indexer:
+ # Specifying the latest available image - modify if you want a specific version
+ image: opensearchproject/opensearch:${OPENSEARCH_VERSION}
+ container_name: indexer-${OPENSEARCH_VERSION}
+ environment:
+ # Name the cluster
+ - cluster.name=opensearch-cluster
+ # Name the node that will run in this container
+ - node.name=indexer
+ # Nodes to look for when discovering the cluster
+ - discovery.seed_hosts=indexer
+ # Nodes eligible to serve as cluster manager
+ - cluster.initial_cluster_manager_nodes=indexer
+ # Disable JVM heap memory swapping
+ - bootstrap.memory_lock=true
+ # Set min and max JVM heap sizes to at least 50% of system RAM
+ - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
+ ulimits:
+ # Set memlock to unlimited (no soft or hard limit)
+ memlock:
+ soft: -1
+ hard: -1
+ # Maximum number of open files for the opensearch user - set to at least 65536
+ nofile:
+ soft: 65536
+ hard: 65536
+ volumes:
+ # Creates volume called opensearch-data and mounts it to the container
+ - opensearch-data:/usr/share/opensearch/data
+ ports:
+ - 9200:9200 # REST API
+ - 9600:9600 # Performance Analyzer
+ networks:
+ # All of the containers will join the same Docker bridge network
+ - opensearch-net
+
+ # Runs the bootstrap and exits
+ installer:
+ image: node:${NODE_VERSION}
+ container_name: installer-security-${OPENSEARCH_VERSION}
+ volumes:
+ - ${REPO_PATH}:/home/node/app
+ - ${SECURITY_PLUGIN_REPO_PATH}:/home/node/app/plugins/security
+ user: "1000:1000"
+ working_dir: /home/node/app
+ command: >
+ /bin/bash -c "
+ yarn osd bootstrap
+ cd plugins/security
+ yarn
+ "
+
+ wazuh-dashboard:
+ image: node:${NODE_VERSION}
+ container_name: wazuh-dashboard-security-${OPENSEARCH_VERSION}
+ depends_on:
+ installer:
+ condition: service_completed_successfully
+ # indexer:
+ # condition: service_healthy
+ ports:
+ - 5601:5601 # Map host port 5601 to container port 5601
+ expose:
+ - "5601" # Expose port 5601 for web access to Wazuh Dashboard
+ volumes:
+ - ${REPO_PATH}:/home/node/app
+ - ${SECURITY_PLUGIN_REPO_PATH}:/home/node/app/plugins/security
+ - ${REPO_PATH}/docker/config/opensearch_dashboards.dev.security.yml:/home/node/app/config/opensearch_dashboards.dev.yml
+ user: "1000"
+ working_dir: /home/node/app
+ networks:
+ - opensearch-net
+ command: >
+ /bin/bash -c "
+ tail -f /dev/null
+ "
+
+volumes:
+ opensearch-data:
+
+networks:
+ opensearch-net:
diff --git a/docker/get_version.sh b/docker/get_version.sh
new file mode 100755
index 000000000000..555dd89e9e9c
--- /dev/null
+++ b/docker/get_version.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Copyright OpenSearch Contributors
+# SPDX-License-Identifier: Apache-2.0
+
+set -e
+
+PACKAGE_VERSION=$(cat package.json \
+| grep version \
+| head -1 \
+| awk -F: '{ print $2 }' \
+| sed 's/[",]//g' \
+| tr -d [:space:])
+
+echo "$PACKAGE_VERSION"
\ No newline at end of file
diff --git a/docs/docker-dev/docker-dev-setup-manual.md b/docs/docker-dev/docker-dev-setup-manual.md
index 3263372a3d45..da40ab93f4a2 100644
--- a/docs/docker-dev/docker-dev-setup-manual.md
+++ b/docs/docker-dev/docker-dev-setup-manual.md
@@ -6,10 +6,10 @@ The following instructions demonstrate how to set up a development environment f
2. In the terminal, run the command below.
* This should create a folder named `opensearch-dashboards-docker-dev` and it should contain two files: `docker-compose.yml` and `entrypoint.sh`.
- * Here is the link to the installer script: `https://raw.githubusercontent.com/opensearch-project/OpenSearch-Dashboards/main/dev-tools/install-docker-dev.sh` if needed.
+ * Here is the link to the installer script: `https://raw.githubusercontent.com/opensearch-project/OpenSearch-Dashboards/main/dev_tools/install_docker_dev.sh` if needed.
```bash
-curl -o- https://raw.githubusercontent.com/opensearch-project/OpenSearch-Dashboards/main/dev-tools/install-docker-dev.sh | bash
+curl -o- https://raw.githubusercontent.com/opensearch-project/OpenSearch-Dashboards/main/dev_tools/install_docker_dev.sh | bash
```
3. Open VS Code or [install it](https://code.visualstudio.com/download), if it's not already installed.
@@ -66,7 +66,7 @@ This section explains how to run Selenium functional tests using Docker and debu
2. Make sure you have completed steps 1-5 in the [Docker Development Environment Setup](#docker-development-environment-setup). Now, ensure you have 5 files, `docker-compose.yml`, `docker-compose.selenium.yml`, `Dockerfile.selenium`, `entrypoint.sh` and `start-vnc.sh`. You can also download them by running the installer script. This time you need to pass a parameter `--ftr`.
```bash
-curl -o- https://raw.githubusercontent.com/opensearch-project/OpenSearch-Dashboards/main/dev-tools/install-docker-dev.sh | bash -s -- --ftr
+curl -o- https://raw.githubusercontent.com/opensearch-project/OpenSearch-Dashboards/main/dev_tools/install_docker_dev.sh | bash -s -- --ftr
```
3. In the terminal, run the following commands to stop any running containers, build the new configuration, and start the containers:
diff --git a/package.json b/package.json
index 0737282c4d7c..9b232f8e47e2 100644
--- a/package.json
+++ b/package.json
@@ -19,6 +19,10 @@
"number": 8467,
"sha": "6cb7fec4e154faa0a4a3fee4b33dfef91b9870d9"
},
+ "wazuh": {
+ "version": "4.9.0",
+ "revision": "00"
+ },
"homepage": "https://opensearch.org",
"bugs": {
"url": "http://github.com/opensearch-project/OpenSearch-Dashboards/issues"
@@ -83,7 +87,9 @@
"osd:ciGroup10": "echo \"dashboard_sanity_test_spec.js\"",
"osd:ciGroup11": "echo \"apps/vis_builder/*.js\"",
"generate:opensearchsqlantlr": "./node_modules/antlr4ng-cli/index.js -Dlanguage=TypeScript -o ./src/plugins/data/public/antlr/opensearch_sql/.generated -visitor -no-listener -Xexact-output-dir ./src/plugins/data/public/antlr/opensearch_sql/grammar/OpenSearchSQLLexer.g4 ./src/plugins/data/public/antlr/opensearch_sql/grammar/OpenSearchSQLParser.g4",
- "generate:opensearchpplantlr": "./node_modules/antlr4ng-cli/index.js -Dlanguage=TypeScript -o ./src/plugins/data/public/antlr/opensearch_ppl/.generated -visitor -no-listener -Xexact-output-dir ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLLexer.g4 ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4"
+ "generate:opensearchpplantlr": "./node_modules/antlr4ng-cli/index.js -Dlanguage=TypeScript -o ./src/plugins/data/public/antlr/opensearch_ppl/.generated -visitor -no-listener -Xexact-output-dir ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLLexer.g4 ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4",
+ "wzd-revision": "scripts/use_node -e \"console.log(require('./package.json').wazuh.revision)\"",
+ "wzd-version": "scripts/use_node -e \"console.log(require('./package.json').wazuh.version)\""
},
"repository": {
"type": "git",
diff --git a/packages/osd-config/src/__snapshots__/env.test.ts.snap b/packages/osd-config/src/__snapshots__/env.test.ts.snap
index 74a05672b5d0..a5143dd6d9ea 100644
--- a/packages/osd-config/src/__snapshots__/env.test.ts.snap
+++ b/packages/osd-config/src/__snapshots__/env.test.ts.snap
@@ -34,6 +34,7 @@ Env {
"buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"dist": false,
"version": "v1",
+ "wazuhVersion": "4.x.x",
},
"pluginSearchPaths": Array [
"/test/opensearchDashboardsRoot/src/plugins",
@@ -77,6 +78,7 @@ Env {
"buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"dist": false,
"version": "v1",
+ "wazuhVersion": "4.x.x",
},
"pluginSearchPaths": Array [
"/test/opensearchDashboardsRoot/src/plugins",
@@ -119,6 +121,7 @@ Env {
"buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"dist": false,
"version": "some-version",
+ "wazuhVersion": "4.x.x",
},
"pluginSearchPaths": Array [
"/test/opensearchDashboardsRoot/src/plugins",
@@ -161,6 +164,7 @@ Env {
"buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"dist": false,
"version": "some-version",
+ "wazuhVersion": "4.x.x",
},
"pluginSearchPaths": Array [
"/test/opensearchDashboardsRoot/src/plugins",
@@ -203,6 +207,7 @@ Env {
"buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"dist": false,
"version": "some-version",
+ "wazuhVersion": "4.x.x",
},
"pluginSearchPaths": Array [
"/test/opensearchDashboardsRoot/src/plugins",
@@ -245,6 +250,7 @@ Env {
"buildSha": "feature-v1-build-sha",
"dist": true,
"version": "v1",
+ "wazuhVersion": "4.x.x",
},
"pluginSearchPaths": Array [
"/test/opensearchDashboardsRoot/src/plugins",
@@ -287,6 +293,7 @@ Env {
"buildSha": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"dist": false,
"version": "v1",
+ "wazuhVersion": "4.x.x",
},
"pluginSearchPaths": Array [
"/test/opensearchDashboardsRoot/src/plugins",
@@ -329,6 +336,7 @@ Env {
"buildSha": "feature-v1-build-sha",
"dist": true,
"version": "v1",
+ "wazuhVersion": "4.x.x",
},
"pluginSearchPaths": Array [
"/some/home/dir/src/plugins",
diff --git a/packages/osd-config/src/config_service.test.ts b/packages/osd-config/src/config_service.test.ts
index 0f634537be7e..65a06598a6ec 100644
--- a/packages/osd-config/src/config_service.test.ts
+++ b/packages/osd-config/src/config_service.test.ts
@@ -48,6 +48,9 @@ const packageInfos: RawPackageInfo = {
number: 42,
sha: 'one',
},
+ wazuh: {
+ version: '4.5.0',
+ },
};
const emptyArgv = getEnvOptions();
const defaultEnv = new Env('/opensearch-dashboards', packageInfos, emptyArgv);
@@ -270,6 +273,9 @@ test('correctly passes context', async () => {
number: 100,
sha: 'feature-v1-build-sha',
},
+ wazuh: {
+ version: '4.5.0',
+ },
};
const env = new Env('/opensearch-dashboards', mockPackage, getEnvOptions());
diff --git a/packages/osd-config/src/env.test.ts b/packages/osd-config/src/env.test.ts
index 32febbc52eb0..bffc1af4bf86 100644
--- a/packages/osd-config/src/env.test.ts
+++ b/packages/osd-config/src/env.test.ts
@@ -42,6 +42,9 @@ const packageInfos: RawPackageInfo = {
number: 42,
sha: 'one',
},
+ wazuh: {
+ version: '4.x.x',
+ },
};
beforeEach(() => {
@@ -52,6 +55,9 @@ test('correctly creates default environment in dev mode when isDevClusterMaster
mockPackage.raw = {
branch: 'some-branch',
version: 'some-version',
+ wazuh: {
+ version: '4.x.x',
+ },
};
const defaultEnv = Env.createDefault(
@@ -71,6 +77,9 @@ test('correctly creates default environment in dev mode when isDevClusterManager
mockPackage.raw = {
branch: 'some-branch',
version: 'some-version',
+ wazuh: {
+ version: '4.x.x',
+ },
};
const defaultEnv = Env.createDefault(
@@ -90,6 +99,9 @@ test('correctly creates default environment in dev mode when isDevClusterManager
mockPackage.raw = {
branch: 'some-branch',
version: 'some-version',
+ wazuh: {
+ version: '4.x.x',
+ },
};
const defaultEnv = Env.createDefault(
@@ -114,6 +126,9 @@ test('correctly creates default environment in prod distributable mode.', () =>
number: 100,
sha: 'feature-v1-build-sha',
},
+ wazuh: {
+ version: '4.x.x',
+ },
};
const defaultEnv = Env.createDefault(
@@ -136,6 +151,9 @@ test('correctly creates default environment in prod non-distributable mode.', ()
number: 100,
sha: 'feature-v1-build-sha',
},
+ wazuh: {
+ version: '4.x.x',
+ },
};
const defaultEnv = Env.createDefault(
@@ -158,6 +176,9 @@ test('correctly creates default environment if `--env.name` is supplied.', () =>
number: 100,
sha: 'feature-v1-build-sha',
},
+ wazuh: {
+ version: '4.x.x',
+ },
};
const defaultDevEnv = Env.createDefault(
@@ -191,6 +212,9 @@ test('correctly creates environment with constructor.', () => {
number: 100,
sha: 'feature-v1-build-sha',
},
+ wazuh: {
+ version: '4.x.x',
+ },
},
getEnvOptions({
cliArgs: { dev: false },
diff --git a/packages/osd-config/src/env.ts b/packages/osd-config/src/env.ts
index e27498c341a0..e82355595e99 100644
--- a/packages/osd-config/src/env.ts
+++ b/packages/osd-config/src/env.ts
@@ -67,6 +67,9 @@ export interface RawPackageInfo {
number: number;
sha: string;
};
+ wazuh: {
+ version: string;
+ };
}
export class Env {
@@ -159,6 +162,7 @@ export class Env {
: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
version: pkg.version,
dist: isOpenSearchDashboardsDistributable,
+ wazuhVersion: pkg.wazuh.version,
});
}
}
diff --git a/packages/osd-config/src/types.ts b/packages/osd-config/src/types.ts
index c4a82f68502b..1a0927770d08 100644
--- a/packages/osd-config/src/types.ts
+++ b/packages/osd-config/src/types.ts
@@ -37,6 +37,7 @@ export interface PackageInfo {
buildNum: number;
buildSha: string;
dist: boolean;
+ wazuhVersion: string;
}
/**
diff --git a/src/cli_plugin/install/settings.js b/src/cli_plugin/install/settings.js
index cfd576f8ff5a..3a878dcfffd1 100644
--- a/src/cli_plugin/install/settings.js
+++ b/src/cli_plugin/install/settings.js
@@ -36,9 +36,12 @@ import { fromRoot } from '../../core/server/utils';
const LATEST_PLUGIN_BASE_URL =
'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards';
+const LATEST_WAZUH_PLUGIN_BASE_URL = 'https://packages-dev.wazuh.com/pre-release/ui/dashboard';
-function generateUrls({ version, plugin }) {
- return [plugin, generatePluginUrl(version, plugin)];
+function generateUrls({ version, plugin, wazuhVersion }) {
+ return plugin.includes('wazuh')
+ ? [plugin, generateWazuhPluginUrl(wazuhVersion, plugin)]
+ : [plugin, generatePluginUrl(version, plugin)];
}
function generatePluginUrl(version, plugin) {
@@ -49,6 +52,10 @@ function generatePluginUrl(version, plugin) {
return `${LATEST_PLUGIN_BASE_URL}/${version}/latest/${platform}/${arch}/${type}/builds/opensearch-dashboards/plugins/${plugin}-${version}.zip`;
}
+function generateWazuhPluginUrl(version, plugin) {
+ return `${LATEST_WAZUH_PLUGIN_BASE_URL}/${plugin}-${version}-1.zip`;
+}
+
export function parseMilliseconds(val) {
let result;
@@ -70,6 +77,7 @@ export function parse(command, options, osdPackage) {
config: options.config || '',
plugin: command,
version: osdPackage.version,
+ wazuhVersion: osdPackage.wazuh.version,
pluginDir: fromRoot('plugins'),
};
@@ -77,5 +85,8 @@ export function parse(command, options, osdPackage) {
settings.workingPath = resolve(settings.pluginDir, '.plugin.installing');
settings.tempArchiveFile = resolve(settings.workingPath, 'archive.part');
+ // Clean up.
+ delete settings.wazuhVersion;
+
return settings;
}
diff --git a/src/cli_plugin/install/settings.test.js b/src/cli_plugin/install/settings.test.js
index 60313e3fe9b8..07b19da3ffeb 100644
--- a/src/cli_plugin/install/settings.test.js
+++ b/src/cli_plugin/install/settings.test.js
@@ -61,7 +61,12 @@ describe('parseMilliseconds function', function () {
describe('parse function', function () {
const command = 'plugin name';
const defaultOptions = { pluginDir: fromRoot('plugins') };
- const osdPackage = { version: 1234 };
+ const osdPackage = {
+ version: 1234,
+ wazuh: {
+ version: 1234,
+ },
+ };
afterAll(() => {
Object.defineProperties(process, {
diff --git a/src/core/common/logos/__snapshots__/get_logos.test.ts.snap b/src/core/common/logos/__snapshots__/get_logos.test.ts.snap
index 6c7746f3533a..cfd1b9f7e3cf 100644
--- a/src/core/common/logos/__snapshots__/get_logos.test.ts.snap
+++ b/src/core/common/logos/__snapshots__/get_logos.test.ts.snap
@@ -512,11 +512,11 @@ colorScheme = "light"
exports[`getLogos when unbranded returns the correct logos 1`] = `
AnimatedMark.dark.type = "default"
-AnimatedMark.dark.url = "/mocked/base/path/ui/logos/opensearch_spinner_on_dark.svg"
+AnimatedMark.dark.url = "/mocked/base/path/ui/logos/spinner_on_dark.gif"
AnimatedMark.light.type = "default"
-AnimatedMark.light.url = "/mocked/base/path/ui/logos/opensearch_spinner_on_light.svg"
+AnimatedMark.light.url = "/mocked/base/path/ui/logos/spinner_on_light.gif"
AnimatedMark.type = "default"
-AnimatedMark.url = "/mocked/base/path/ui/logos/opensearch_spinner_on_light.svg"
+AnimatedMark.url = "/mocked/base/path/ui/logos/spinner_on_light.gif"
Application.dark.type = "default"
Application.dark.url = "/mocked/base/path/ui/logos/opensearch_dashboards_on_dark.svg"
Application.light.type = "default"
@@ -546,11 +546,11 @@ colorScheme = "light"
exports[`getLogos when unbranded returns the correct logos when dark color scheme is requested 1`] = `
AnimatedMark.dark.type = "default"
-AnimatedMark.dark.url = "/mocked/base/path/ui/logos/opensearch_spinner_on_dark.svg"
+AnimatedMark.dark.url = "/mocked/base/path/ui/logos/spinner_on_dark.gif"
AnimatedMark.light.type = "default"
-AnimatedMark.light.url = "/mocked/base/path/ui/logos/opensearch_spinner_on_light.svg"
+AnimatedMark.light.url = "/mocked/base/path/ui/logos/spinner_on_light.gif"
AnimatedMark.type = "default"
-AnimatedMark.url = "/mocked/base/path/ui/logos/opensearch_spinner_on_dark.svg"
+AnimatedMark.url = "/mocked/base/path/ui/logos/spinner_on_dark.gif"
Application.dark.type = "default"
Application.dark.url = "/mocked/base/path/ui/logos/opensearch_dashboards_on_dark.svg"
Application.light.type = "default"
@@ -580,11 +580,11 @@ colorScheme = "dark"
exports[`getLogos when unbranded returns the correct logos when light color scheme is requested 1`] = `
AnimatedMark.dark.type = "default"
-AnimatedMark.dark.url = "/mocked/base/path/ui/logos/opensearch_spinner_on_dark.svg"
+AnimatedMark.dark.url = "/mocked/base/path/ui/logos/spinner_on_dark.gif"
AnimatedMark.light.type = "default"
-AnimatedMark.light.url = "/mocked/base/path/ui/logos/opensearch_spinner_on_light.svg"
+AnimatedMark.light.url = "/mocked/base/path/ui/logos/spinner_on_light.gif"
AnimatedMark.type = "default"
-AnimatedMark.url = "/mocked/base/path/ui/logos/opensearch_spinner_on_light.svg"
+AnimatedMark.url = "/mocked/base/path/ui/logos/spinner_on_light.gif"
Application.dark.type = "default"
Application.dark.url = "/mocked/base/path/ui/logos/opensearch_dashboards_on_dark.svg"
Application.light.type = "default"
diff --git a/src/core/common/logos/get_logos.ts b/src/core/common/logos/get_logos.ts
index c27a5306e9e1..6517cd16ab38 100644
--- a/src/core/common/logos/get_logos.ts
+++ b/src/core/common/logos/get_logos.ts
@@ -21,9 +21,9 @@ export const MARK_ON_DARK = 'ui/logos/opensearch_mark_on_dark.svg';
export const CENTER_MARK_THEMED = 'ui/logos/opensearch_center_mark.svg';
export const CENTER_MARK_ON_LIGHT = 'ui/logos/opensearch_center_mark_on_light.svg';
export const CENTER_MARK_ON_DARK = 'ui/logos/opensearch_center_mark_on_dark.svg';
-export const ANIMATED_MARK_THEMED = 'ui/logos/opensearch_spinner.svg';
-export const ANIMATED_MARK_ON_LIGHT = 'ui/logos/opensearch_spinner_on_light.svg';
-export const ANIMATED_MARK_ON_DARK = 'ui/logos/opensearch_spinner_on_dark.svg';
+export const ANIMATED_MARK_THEMED = 'ui/logos/spinner.svg';
+export const ANIMATED_MARK_ON_LIGHT = 'ui/logos/spinner_on_light.gif';
+export const ANIMATED_MARK_ON_DARK = 'ui/logos/spinner_on_dark.gif';
interface AssetOption {
url?: string;
diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx
index 69665006d5b3..f2cef928d63a 100644
--- a/src/core/public/chrome/chrome_service.tsx
+++ b/src/core/public/chrome/chrome_service.tsx
@@ -359,14 +359,14 @@ export class ChromeService {
breadcrumbs$={breadcrumbs$.pipe(takeUntil(this.stop$))}
breadcrumbsEnricher$={breadcrumbsEnricher$.pipe(takeUntil(this.stop$))}
customNavLink$={customNavLink$.pipe(takeUntil(this.stop$))}
- opensearchDashboardsDocLink={docLinks.links.opensearchDashboards.introduction}
+ opensearchDashboardsDocLink={docLinks.links.wazuh.index}
forceAppSwitcherNavigation$={navLinks.getForceAppSwitcherNavigation$()}
helpExtension$={helpExtension$.pipe(takeUntil(this.stop$))}
helpSupportUrl$={helpSupportUrl$.pipe(takeUntil(this.stop$))}
homeHref={application.getUrlForApp('home')}
isVisible$={this.isVisible$}
headerVariant$={this.headerVariant$}
- opensearchDashboardsVersion={injectedMetadata.getOpenSearchDashboardsVersion()}
+ opensearchDashboardsVersion={injectedMetadata.getWazuhVersion()}
navLinks$={navLinks.getNavLinks$()}
recentlyAccessed$={recentlyAccessed.get$()}
navControlsLeft$={navControls.getLeft$()}
diff --git a/src/core/public/chrome/constants.ts b/src/core/public/chrome/constants.ts
index ce65af852e07..2ef1068efd69 100644
--- a/src/core/public/chrome/constants.ts
+++ b/src/core/public/chrome/constants.ts
@@ -28,9 +28,9 @@
* under the License.
*/
-export const OPENSEARCH_DASHBOARDS_ASK_OPENSEARCH_LINK = 'https://forum.opensearch.org/';
-export const GITHUB_CREATE_ISSUE_LINK =
- 'https://github.com/opensearch-project/OpenSearch-Dashboards/issues/new/choose';
+export const OPENSEARCH_DASHBOARDS_FEEDBACK_LINK = 'https://wazuh.com/community/join-us-on-slack';
+export const OPENSEARCH_DASHBOARDS_ASK_OPENSEARCH_LINK = OPENSEARCH_DASHBOARDS_FEEDBACK_LINK;
+export const GITHUB_CREATE_ISSUE_LINK = 'https://github.com/wazuh/wazuh/issues/new/choose';
export enum RightNavigationOrder {
// order of dev tool should be after advance settings
diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap
index 23433a8514e7..79c395bc5c5c 100644
--- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap
+++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap
@@ -130,14 +130,14 @@ exports[`CollapsibleNav renders links grouped by category 1`] = `
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/test/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"Application": Object {
"dark": Object {
@@ -2075,14 +2075,14 @@ exports[`CollapsibleNav renders the default nav 1`] = `
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/test/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"Application": Object {
"dark": Object {
@@ -2380,14 +2380,14 @@ exports[`CollapsibleNav renders the default nav 2`] = `
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/test/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"Application": Object {
"dark": Object {
@@ -2685,14 +2685,14 @@ exports[`CollapsibleNav renders the default nav 3`] = `
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/test/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"Application": Object {
"dark": Object {
@@ -5517,14 +5517,14 @@ exports[`CollapsibleNav without custom branding renders the nav bar in dark mode
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/test/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/test/ui/logos/spinner_on_dark.gif",
},
"Application": Object {
"dark": Object {
@@ -6622,14 +6622,14 @@ exports[`CollapsibleNav without custom branding renders the nav bar in default m
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/test/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/test/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/test/ui/logos/spinner_on_light.gif",
},
"Application": Object {
"dark": Object {
diff --git a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap
index f5a8d1ce5f09..d8049fc3cb45 100644
--- a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap
+++ b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap
@@ -1717,14 +1717,14 @@ exports[`Header handles visibility and lock changes 1`] = `
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/ui/logos/spinner_on_light.gif",
},
"Application": Object {
"dark": Object {
@@ -2410,14 +2410,14 @@ exports[`Header handles visibility and lock changes 1`] = `
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/ui/logos/spinner_on_light.gif",
},
"Application": Object {
"dark": Object {
@@ -2912,14 +2912,14 @@ exports[`Header handles visibility and lock changes 1`] = `
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/ui/logos/spinner_on_light.gif",
},
"Application": Object {
"dark": Object {
@@ -3667,14 +3667,14 @@ exports[`Header handles visibility and lock changes 1`] = `
"AnimatedMark": Object {
"dark": Object {
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_dark.svg",
+ "url": "/ui/logos/spinner_on_dark.gif",
},
"light": Object {
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/ui/logos/spinner_on_light.gif",
},
"type": "default",
- "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ "url": "/ui/logos/spinner_on_light.gif",
},
"Application": Object {
"dark": Object {
@@ -3864,11 +3864,68 @@ exports[`Header handles visibility and lock changes 1`] = `
delay="long"
position="top"
>
+<<<<<<< HEAD