Skip to content

Commit

Permalink
Add compatibility with OpenSearch 2.11.0 (#121)
Browse files Browse the repository at this point in the history
Signed-off-by: yenienserrano <[email protected]>
Signed-off-by: Álex Ruiz <[email protected]>
Signed-off-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Maximiliano Ibarra <[email protected]>
Co-authored-by: Nicolas Agustin Guevara Pihen <[email protected]>
Co-authored-by: Antonio <[email protected]>
Co-authored-by: yenienserrano <[email protected]>
  • Loading branch information
6 people authored Nov 17, 2023
1 parent 3c83816 commit f3b228c
Show file tree
Hide file tree
Showing 131 changed files with 3,921 additions and 682 deletions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/compatibility_request.md
Original file line number Diff line number Diff line change
@@ -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_
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/new_release.md
Original file line number Diff line number Diff line change
@@ -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)
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This is a basic workflow that is manually triggered

name: Build

on:
workflow_dispatch

jobs:
generate-linux-image:
runs-on: ubuntu-latest
name: Generate Linux image
defaults:
run:
working-directory: ./artifacts
strategy:
matrix:
include:
- name: Linux x64
ext: tar.gz
suffix: linux-x64
script: build-platform --linux --skip-os-packages --release

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: ./artifacts

- 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 [email protected]
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
- name: Get artifact build name
run: |
echo "ARTIFACT_BUILD_NAME=opensearch-dashboards-${{ env.VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}" >> $GITHUB_ENV
- name: Run bootstrap
run: yarn osd bootstrap

- name: Build `${{ matrix.name }}`
run: yarn ${{ matrix.script }} --release

- uses: actions/upload-artifact@v3
if: success()
with:
name: ${{ matrix.suffix }}-${{ env.VERSION }}
path: ./artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
retention-days: 30
77 changes: 77 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -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}}"
13 changes: 6 additions & 7 deletions .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
FTR_PATH: 'ftr'
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch'
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false'
SPEC: ${{ inputs.specs != '' && inputs.specs || 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,' }}
SPEC: ${{ inputs.specs != '' && inputs.specs || 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,' }}
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false
Expand All @@ -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:
Expand Down Expand Up @@ -104,8 +105,7 @@ jobs:
with:
path: ${{ env.FTR_PATH }}
repository: ${{ env.TEST_REPO }}
ref: '${{ env.TEST_BRANCH }}'

ref: ${{ env.OPENSEARCH_VERSION }}
- name: Get Cypress version
id: cypress_version
run: |
Expand All @@ -128,7 +128,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
Expand All @@ -137,7 +137,7 @@ jobs:
name: ftr-cypress-screenshots
path: ${{ env.FTR_PATH }}/cypress/screenshots
retention-days: 1

- uses: actions/upload-artifact@v3
if: always()
with:
Expand All @@ -151,7 +151,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 != '' }}
Expand Down Expand Up @@ -188,6 +187,6 @@ jobs:
'${{ env.SPEC }}'
```
#### Link to results:
#### Link to results:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
edit-mode: replace
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.aws-config.json
.signing-config.json
.ackrc
/dev_tools/build_packages/*/output
/.opensearch
/.chromium
/package.json.bak
Expand Down
55 changes: 27 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
<img src="https://opensearch.org/assets/brand/SVG/Logo/opensearch_dashboards_logo_darkmode.svg" height="64px"/>
<div style="text-align:center">
<img src="https://wazuh.com/uploads/2022/05/Logo-blogpost.png"/>
</div>

- [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](ttps://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 [[email protected]](mailto:[email protected]) 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

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.

<!-- Links -->

[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
9 changes: 9 additions & 0 deletions config/node.options.prod
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions config/opensearch_dashboards.prod.yml
Original file line number Diff line number Diff line change
@@ -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/wazuh

opensearchDashboards.branding:
useExpandedHeader: false
Loading

0 comments on commit f3b228c

Please sign in to comment.