From af5e76c43d1fd7e1b5fd64e1cdc4feb82ec19a78 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 2 Dec 2024 14:48:54 -0300 Subject: [PATCH 1/7] Rename opensearch_dashboards.json to opensearch_dashboard1.json --- .../{opensearch_dashboards.json => opensearch_dashboard1.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename plugins/main/{opensearch_dashboards.json => opensearch_dashboard1.json} (100%) diff --git a/plugins/main/opensearch_dashboards.json b/plugins/main/opensearch_dashboard1.json similarity index 100% rename from plugins/main/opensearch_dashboards.json rename to plugins/main/opensearch_dashboard1.json From 1e920692ef9db6f414435027e5b7428cc931819c Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 2 Dec 2024 14:50:38 -0300 Subject: [PATCH 2/7] Remove unnecessary plugin configuration for 'Main'. --- .github/workflows/dev-environment.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/dev-environment.yml b/.github/workflows/dev-environment.yml index bad08f81bd..1c1b9e101b 100644 --- a/.github/workflows/dev-environment.yml +++ b/.github/workflows/dev-environment.yml @@ -49,11 +49,6 @@ jobs: matrix: plugins: [ - { - name: 'Main', - path: 'wazuh/plugins/main', - container_path: 'wazuh', - }, { name: 'Wazuh Check Updates', path: 'wazuh/plugins/wazuh-check-updates', From 1041b21ed84c420b7e3a18a4ca3f3a99acdf5605 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 2 Dec 2024 14:50:49 -0300 Subject: [PATCH 3/7] Update OpenSearch Dashboards configurationwith consistent single quotes and defaultRoute change --- .../config/2.x/osd/opensearch_dashboards.yml | 17 ++++++++--------- .../2.x/osd/opensearch_dashboards_saml.yml | 18 +++++++++--------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/docker/osd-dev/config/2.x/osd/opensearch_dashboards.yml b/docker/osd-dev/config/2.x/osd/opensearch_dashboards.yml index d73088264b..f5105d3865 100755 --- a/docker/osd-dev/config/2.x/osd/opensearch_dashboards.yml +++ b/docker/osd-dev/config/2.x/osd/opensearch_dashboards.yml @@ -6,17 +6,16 @@ opensearch.ssl.verificationMode: certificate # opensearch.requestHeadersWhitelist: ["securitytenant","Authorization"] # # osd 2.0 -opensearch.requestHeadersAllowlist: ["securitytenant", "Authorization"] +opensearch.requestHeadersAllowlist: ['securitytenant', 'Authorization'] # opensearch_security.multitenancy.enabled: false -opensearch_security.readonly_mode.roles: ["kibana_read_only"] +opensearch_security.readonly_mode.roles: ['kibana_read_only'] server.ssl.enabled: true -server.ssl.key: "/home/node/kbn/certs/osd.key" -server.ssl.certificate: "/home/node/kbn/certs/osd.pem" -opensearch.ssl.certificateAuthorities: ["/home/node/kbn/certs/ca.pem"] -uiSettings.overrides.defaultRoute: /app/wz-home -opensearch.username: "kibanaserver" -opensearch.password: "kibanaserver" +server.ssl.key: '/home/node/kbn/certs/osd.key' +server.ssl.certificate: '/home/node/kbn/certs/osd.pem' +opensearch.ssl.certificateAuthorities: ['/home/node/kbn/certs/ca.pem'] +uiSettings.overrides.defaultRoute: /app/home +opensearch.username: 'kibanaserver' +opensearch.password: 'kibanaserver' opensearchDashboards.branding: useExpandedHeader: false - diff --git a/docker/osd-dev/config/2.x/osd/opensearch_dashboards_saml.yml b/docker/osd-dev/config/2.x/osd/opensearch_dashboards_saml.yml index 4fb845adf8..b55b3705ae 100755 --- a/docker/osd-dev/config/2.x/osd/opensearch_dashboards_saml.yml +++ b/docker/osd-dev/config/2.x/osd/opensearch_dashboards_saml.yml @@ -6,19 +6,19 @@ opensearch.ssl.verificationMode: certificate # opensearch.requestHeadersWhitelist: ["securitytenant","Authorization"] # # osd 2.0 -opensearch.requestHeadersAllowlist: ["securitytenant", "Authorization"] +opensearch.requestHeadersAllowlist: ['securitytenant', 'Authorization'] # opensearch_security.multitenancy.enabled: false -opensearch_security.readonly_mode.roles: ["kibana_read_only"] +opensearch_security.readonly_mode.roles: ['kibana_read_only'] server.ssl.enabled: true -server.ssl.key: "/home/node/kbn/certs/osd.key" -server.ssl.certificate: "/home/node/kbn/certs/osd.pem" -opensearch.ssl.certificateAuthorities: ["/home/node/kbn/certs/ca.pem"] -uiSettings.overrides.defaultRoute: /app/wazuh -opensearch.username: "kibanaserver" -opensearch.password: "kibanaserver" +server.ssl.key: '/home/node/kbn/certs/osd.key' +server.ssl.certificate: '/home/node/kbn/certs/osd.pem' +opensearch.ssl.certificateAuthorities: ['/home/node/kbn/certs/ca.pem'] +uiSettings.overrides.defaultRoute: /app/home +opensearch.username: 'kibanaserver' +opensearch.password: 'kibanaserver' -opensearch_security.auth.type: "saml" +opensearch_security.auth.type: 'saml' server.xsrf.allowlist: [ /_plugins/_security/saml/acs, From e873879c6f61910ddbea7b81e27b1382609b9b0a Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 2 Dec 2024 14:54:01 -0300 Subject: [PATCH 4/7] Add handling for no changed .js, .jsx, .ts or .tsx files --- .github/workflows/eslint.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index f4694141d7..e195cb7049 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -43,7 +43,11 @@ jobs: echo "Listing branches" git branch -a echo "Getting diff files ignoring deleted and getting the changed or renamed files" - CHANGED_FILES=$(git diff --name-status --diff-filter d ${REMOTE_NAME}/${GITHUB_BASE_REF}..${REMOTE_NAME}/${GITHUB_HEAD_REF} | awk '{print $NF}' | grep -E '.*\.[jt]sx?$') + CHANGED_FILES=$(git diff --name-status --diff-filter d ${REMOTE_NAME}/${GITHUB_BASE_REF}..${REMOTE_NAME}/${GITHUB_HEAD_REF} | awk '{print $NF}' | grep -E '.*\.[jt]sx?$' || echo "false") + if [CHANGED_FILES = "false"]; then + echo "No changed files found with the extension .js, .jsx, .ts or .tsx" + exit 0 + fi echo "Changed files:" echo "${CHANGED_FILES}" git checkout $GITHUB_HEAD_REF From 7714990126bd1fdeb99f4519ec9a79aa07ab1b84 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 2 Dec 2024 14:55:34 -0300 Subject: [PATCH 5/7] Fix syntax error in the if condition --- .github/workflows/eslint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index e195cb7049..75c202112f 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -44,7 +44,7 @@ jobs: git branch -a echo "Getting diff files ignoring deleted and getting the changed or renamed files" CHANGED_FILES=$(git diff --name-status --diff-filter d ${REMOTE_NAME}/${GITHUB_BASE_REF}..${REMOTE_NAME}/${GITHUB_HEAD_REF} | awk '{print $NF}' | grep -E '.*\.[jt]sx?$' || echo "false") - if [CHANGED_FILES = "false"]; then + if [ $CHANGED_FILES = "false" ]; then echo "No changed files found with the extension .js, .jsx, .ts or .tsx" exit 0 fi From dfc99da4cb2f2f29ea3238634eb16b16098689c6 Mon Sep 17 00:00:00 2001 From: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Date: Mon, 23 Dec 2024 20:59:38 +0100 Subject: [PATCH 6/7] Refactor GitHub Actions workflow - Remove the download step for the main plugin's artifact in the manual build workflow. --- .github/workflows/manual-build.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index e062d570fe..abcf966491 100644 --- a/.github/workflows/manual-build.yml +++ b/.github/workflows/manual-build.yml @@ -53,13 +53,6 @@ jobs: echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV echo "versionPlatform=$(jq -r '.pluginPlatform.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV - - name: Step 03 - Download the main plugin's artifact - uses: actions/download-artifact@v4 - with: - name: wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip - path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip - overwrite: true - - name: Step 04 - Download the core plugin's artifact uses: actions/download-artifact@v4 with: From e0de2e627cf4b684a7fb4f39cd2eb1ac856dda80 Mon Sep 17 00:00:00 2001 From: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Date: Tue, 24 Dec 2024 18:04:53 +0100 Subject: [PATCH 7/7] Remove POC Wazuh plugins from GitHub Actions workflows - Deleted references to the Wazuh Engine and Wazuh Fleet plugins in both the dev-environment and manual-build workflows. - Streamlined the workflows by eliminating unnecessary download steps for these plugins' artifacts. --- .github/workflows/dev-environment.yml | 10 ---------- .github/workflows/manual-build.yml | 14 -------------- 2 files changed, 24 deletions(-) diff --git a/.github/workflows/dev-environment.yml b/.github/workflows/dev-environment.yml index 919ae0474a..89ab56d47b 100644 --- a/.github/workflows/dev-environment.yml +++ b/.github/workflows/dev-environment.yml @@ -59,16 +59,6 @@ jobs: path: 'wazuh/plugins/wazuh-core', container_path: 'wazuh-core', }, - { - name: 'Wazuh Engine', - path: 'wazuh/plugins/wazuh-engine', - container_path: 'wazuh-engine', - }, - { - name: 'Wazuh Fleet', - path: 'wazuh/plugins/wazuh-fleet', - container_path: 'wazuh-fleet', - }, ] steps: diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index abcf966491..a82ae56a95 100644 --- a/.github/workflows/manual-build.yml +++ b/.github/workflows/manual-build.yml @@ -67,20 +67,6 @@ jobs: path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip overwrite: true - - name: Step 06 - Download the engine plugin's artifact - uses: actions/download-artifact@v4 - with: - name: wazuh-dashboard-plugins_wazuh-engine_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip - path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-engine_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip - overwrite: true - - - name: Step 07 - Download the fleet plugin's artifact - uses: actions/download-artifact@v4 - with: - name: wazuh-dashboard-plugins_wazuh-fleet_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip - path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-fleet${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip - overwrite: true - - name: Step 06 - Build the Docker image run: | echo "current=${{ env.currentDir }}"