diff --git a/.github/workflows/wazuh-build-push-docker-action.yml b/.github/workflows/wazuh-build-push-docker-action.yml index 74c233c965..74be8e29e1 100644 --- a/.github/workflows/wazuh-build-push-docker-action.yml +++ b/.github/workflows/wazuh-build-push-docker-action.yml @@ -55,63 +55,63 @@ jobs: name: Run build and push manager image runs-on: ubuntu-latest steps: - - name: Step 01 - Download wazuh-kibana-app - uses: actions/checkout@v2 - with: + - name: Step 01 - Download wazuh-kibana-app + uses: actions/checkout@v2 + with: path: wazuh-kibana-app - - name: Step 02 - Login to quay.io - run: | - docker login -u=${{ secrets.QUAYIO_USERNAME }} -p=${{ secrets.QUAYIO_TOKEN }} quay.io - - name: Step 03 - Build image - run: | - cd ${{ github.workspace }}/wazuh-kibana-app/test/cypress/images/wazuh_manager_filebeat_sources_cmake - docker build -t quay.io/wazuh/wazuh-manager-image:${{ github.event.inputs.wazuh-manager-version }}-${{ github.event.inputs.elastic-manager-version }} \ - --build-arg WAZUH_VERSION=${{ github.event.inputs.wazuh-manager-version }} \ - --build-arg FILEBEAT_VERSION=${{ github.event.inputs.elastic-manager-version }} \ - --build-arg FILEBEAT_WAZUH_TEMPLATE_URL=https://raw.githubusercontent.com/wazuh/wazuh/4.0/extensions/elasticsearch/7.x/wazuh-template.json \ - --build-arg FILEBEAT_WAZUH_MODULE_URL=https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz . - - name: Step 04 - Push image to quay.io - run: | - docker push quay.io/wazuh/wazuh-manager-image:${{ github.event.inputs.wazuh-manager-version }}-${{ github.event.inputs.elastic-manager-version }} + - name: Step 02 - Login to quay.io + run: | + docker login -u=${{ secrets.QUAYIO_USERNAME }} -p=${{ secrets.QUAYIO_TOKEN }} quay.io + - name: Step 03 - Build image + run: | + cd ${{ github.workspace }}/wazuh-kibana-app/test/cypress/images/wazuh_manager_filebeat_sources_cmake + docker build -t quay.io/wazuh/wazuh-manager-image:${{ github.event.inputs.wazuh-manager-version }}-${{ github.event.inputs.elastic-manager-version }} \ + --build-arg WAZUH_VERSION=${{ github.event.inputs.wazuh-manager-version }} \ + --build-arg FILEBEAT_VERSION=${{ github.event.inputs.elastic-manager-version }} \ + --build-arg FILEBEAT_WAZUH_TEMPLATE_URL=https://raw.githubusercontent.com/wazuh/wazuh/4.0/extensions/elasticsearch/7.x/wazuh-template.json \ + --build-arg FILEBEAT_WAZUH_MODULE_URL=https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.4.tar.gz . + - name: Step 04 - Push image to quay.io + run: | + docker push quay.io/wazuh/wazuh-manager-image:${{ github.event.inputs.wazuh-manager-version }}-${{ github.event.inputs.elastic-manager-version }} job-build-agent-image: if: ${{ github.event.inputs.build-agent-image == 'true' }} name: Run build and push agent image runs-on: ubuntu-latest steps: - - name: Step 01 - Download wazuh-kibana-app - uses: actions/checkout@v2 - with: + - name: Step 01 - Download wazuh-kibana-app + uses: actions/checkout@v2 + with: path: wazuh-kibana-app - - name: Step 02 - Login to quay.io - run: | - docker login -u=${{ secrets.QUAYIO_USERNAME }} -p=${{ secrets.QUAYIO_TOKEN }} quay.io - - name: Step 03 - Build image - run: | - cd ${{ github.workspace }}/wazuh-kibana-app/test/cypress/images/wazuh_agent_ubuntu_sources_cmake - docker build -t quay.io/wazuh/wazuh-agent-image:${{ github.event.inputs.wazuh-agent-version }} \ - --build-arg WAZUH_VERSION=${{ github.event.inputs.wazuh-agent-version }} . - - name: Step 04 - Push image to quay.io - run: | - docker push quay.io/wazuh/wazuh-agent-image:${{ github.event.inputs.wazuh-agent-version }} + - name: Step 02 - Login to quay.io + run: | + docker login -u=${{ secrets.QUAYIO_USERNAME }} -p=${{ secrets.QUAYIO_TOKEN }} quay.io + - name: Step 03 - Build image + run: | + cd ${{ github.workspace }}/wazuh-kibana-app/test/cypress/images/wazuh_agent_ubuntu_sources_cmake + docker build -t quay.io/wazuh/wazuh-agent-image:${{ github.event.inputs.wazuh-agent-version }} \ + --build-arg WAZUH_VERSION=${{ github.event.inputs.wazuh-agent-version }} . + - name: Step 04 - Push image to quay.io + run: | + docker push quay.io/wazuh/wazuh-agent-image:${{ github.event.inputs.wazuh-agent-version }} job-build-cypress-image: if: ${{ github.event.inputs.build-cypress-image == 'true' }} name: Run build and push cypress image runs-on: ubuntu-latest steps: - - name: Step 01 - Download wazuh-kibana-app - uses: actions/checkout@v2 - with: + - name: Step 01 - Download wazuh-kibana-app + uses: actions/checkout@v2 + with: path: wazuh-kibana-app - - name: Step 02 - Login to quay.io - run: | - docker login -u=${{ secrets.QUAYIO_USERNAME }} -p=${{ secrets.QUAYIO_TOKEN }} quay.io - - name: Step 03 - Build image - run: | - cd ${{ github.workspace }}/wazuh-kibana-app/test/cypress/images/ubuntu-cypress - docker build -t quay.io/wazuh/wazuh-ubuntu-cypress:${{ github.event.inputs.image-cypress-version }} \ - --build-arg UBUNTU_CYPRESS_BRANCH=${{ github.event.inputs.ubuntu-cypress-branch }} . - - name: Step 04 - Push image to quay.io - run: | - docker push quay.io/wazuh/wazuh-ubuntu-cypress:${{ github.event.inputs.image-cypress-version }} + - name: Step 02 - Login to quay.io + run: | + docker login -u=${{ secrets.QUAYIO_USERNAME }} -p=${{ secrets.QUAYIO_TOKEN }} quay.io + - name: Step 03 - Build image + run: | + cd ${{ github.workspace }}/wazuh-kibana-app/test/cypress/images/ubuntu-cypress + docker build -t quay.io/wazuh/wazuh-ubuntu-cypress:${{ github.event.inputs.image-cypress-version }} \ + --build-arg UBUNTU_CYPRESS_BRANCH=${{ github.event.inputs.ubuntu-cypress-branch }} . + - name: Step 04 - Push image to quay.io + run: | + docker push quay.io/wazuh/wazuh-ubuntu-cypress:${{ github.event.inputs.image-cypress-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 06dcd51fd8..45522be494 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,12 @@ All notable changes to the Wazuh app project will be documented in this file. - Fixed the scripted fields disappear when the fields of the events index pattern was refreshed [#6237](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6237) +## Wazuh v4.8.2 - OpenSearch Dashboards 2.10.0 - Revision 00 + +### Added + +- Support for Wazuh 4.8.2 + ## Wazuh v4.8.1 - OpenSearch Dashboards 2.10.0 - Revision 00 ### Added @@ -30,17 +36,17 @@ All notable changes to the Wazuh app project will be documented in this file. ### Added - Support for Wazuh 4.8.0 -- Added the ability to check if there are available updates from the UI. [#6093](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6093) +- Added the ability to check if there are available updates from the UI. [#6093](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6093) [#6256](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6256) - Added remember server address check [#5791](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5791) - Added the ssl_agent_ca configuration to the SSL Settings form [#6083](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6083) -- Added global vulnerabilities dashboards [#5896](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5896) [#6179](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6179) [#6173](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6173) [#6147](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6147) +- Added global vulnerabilities dashboards [#5896](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5896) [#6179](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6179) [#6173](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6173) [#6147](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6147) [#6231](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6231) [#6246](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6246) - Added an agent selector to the IT Hygiene application [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840) - Added query results limit when the search exceed 10000 hits [#6106](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6106) - Added a redirection button to Endpoint Summary from IT Hygiene application [6176](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6176) ### Changed -- Moved the plugin menu to platform applications into the side menu [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840) [#6226](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6226) +- Moved the plugin menu to platform applications into the side menu [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840) [#6226](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6226) [#6244](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6244) - Changed dashboards. [#6035](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6035) - Change the display order of tabs in all modules. [#6067](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6067) - Upgraded the `axios` dependency to `1.6.1` [#5062](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5062) @@ -50,7 +56,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Fixed a problem with the agent menu header when the side menu is docked [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840) - Fixed how the query filters apply on the Security Alerts table [#6102](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6102) - Fixed exception in IT-Hygiene when an agent doesn't have policies [#6177](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6177) -- Fixed exception in Inventory when agents don't have S.O. information [#6177](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6177) +- Fixed exception in Inventory when agents don't have OS information [#6177](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6177) - Fixed pinned agent state in URL [#6177](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6177) - Fixed invalid date format in about and agent views [#6234](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6234) @@ -61,7 +67,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Removed the application menu in the IT Hygiene application [#6176](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6176) - Removed the implicit filter of WQL language of the search bar UI [#6174](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6174) -## Wazuh v4.7.2 - OpenSearch Dashboards 2.8.0 - Revision 00 +## Wazuh v4.7.2 - OpenSearch Dashboards 2.8.0 - Revision 01 ### Added diff --git a/docker/kbn-dev/dev.yml b/docker/kbn-dev/dev.yml index f01c481224..c6abeb041b 100755 --- a/docker/kbn-dev/dev.yml +++ b/docker/kbn-dev/dev.yml @@ -1,16 +1,16 @@ -version: "2.2" +version: '2.2' x-logging: &logging logging: driver: loki options: - loki-url: "http://host.docker.internal:3100/loki/api/v1/push" + loki-url: 'http://host.docker.internal:3100/loki/api/v1/push' services: exporter: image: quay.io/prometheuscommunity/elasticsearch-exporter:latest <<: *logging - hostname: "exporter-kbn-${ES_VERSION}" + hostname: 'exporter-kbn-${ES_VERSION}' networks: - es-dev - mon @@ -21,7 +21,7 @@ services: imposter: image: outofcoffee/imposter - hostname: "imposter-kbn-${ES_VERSION}" + hostname: 'imposter-kbn-${ES_VERSION}' networks: - es-dev - mon @@ -32,7 +32,7 @@ services: volumes: - ../imposter:/opt/imposter/config ports: - - ${IMPOSTER_PORT}:8080 + - ${IMPOSTER_PORT}:8080 filebeat: depends_on: @@ -40,7 +40,7 @@ services: condition: service_healthy image: elastic/filebeat:7.10.2 hostname: filebeat - user: "0:0" + user: '0:0' networks: - es-dev - mon @@ -54,7 +54,7 @@ services: echo admin | filebeat keystore add username --stdin --force echo ${ELASTIC_PASSWORD}| filebeat keystore add password --stdin --force curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/4.3/extensions/elasticsearch/7.x/wazuh-template.json - curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz | tar -xvz -C /usr/share/filebeat/module + curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.4.tar.gz | tar -xvz -C /usr/share/filebeat/module # copy filebeat to preserve correct permissions without # affecting host filesystem cp /tmp/filebeat.yml /usr/share/filebeat/filebeat.yml @@ -69,7 +69,7 @@ services: setup: hostname: setup - user: "0" + user: '0' image: docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION} volumes: - certs:/usr/share/elasticsearch/config/certs @@ -120,7 +120,7 @@ services: echo "All done!"; ' healthcheck: - test: ["CMD-SHELL", "[ -f config/certs/es01/es01.crt ]"] + test: ['CMD-SHELL', '[ -f config/certs/es01/es01.crt ]'] interval: 1s timeout: 5s retries: 120 @@ -140,7 +140,7 @@ services: - certs:/usr/share/elasticsearch/config/certs - esdata01:/usr/share/elasticsearch/data environment: - - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - 'ES_JAVA_OPTS=-Xms512m -Xmx512m' - node.name=es01 - discovery.type=single-node - discovery.seed_hosts=es01 @@ -166,7 +166,7 @@ services: healthcheck: test: [ - "CMD-SHELL", + 'CMD-SHELL', "curl -s --cacert config/certs/ca/ca.crt https://localhost:9200 | grep -q 'missing authentication credentials'", ] interval: 10s @@ -186,7 +186,7 @@ services: - mon <<: *logging volumes: - - "${SRC}:/home/node/kbn/plugins/wazuh" + - '${SRC}:/home/node/kbn/plugins/wazuh' - certs:/home/node/kbn/config/certs - kibana_cache:/home/node/.cache - ./config/kibana/kibana.yml:/home/node/kbn/config/kibana.yml @@ -198,7 +198,7 @@ services: # Kibana configuration is in the mounted config file, as the entrypoint # does not generate the config file from the envirtonment - LOGS=/proc/1/fd/1 - entrypoint: ["tail", "-f", "/dev/null"] + entrypoint: ['tail', '-f', '/dev/null'] healthcheck: test: sh /home/node/setup_permissions.sh es01 interval: 5s diff --git a/docker/osd-dev/dev.yml b/docker/osd-dev/dev.yml index 35e7997ce2..c610575eda 100755 --- a/docker/osd-dev/dev.yml +++ b/docker/osd-dev/dev.yml @@ -205,7 +205,7 @@ services: echo admin | filebeat keystore add username --stdin --force echo ${PASSWORD}| filebeat keystore add password --stdin --force curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/4.3/extensions/elasticsearch/7.x/wazuh-template.json - curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz | tar -xvz -C /usr/share/filebeat/module + curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.4.tar.gz | tar -xvz -C /usr/share/filebeat/module # copy filebeat to preserve correct permissions without # affecting host filesystem cp /tmp/filebeat.yml /usr/share/filebeat/filebeat.yml diff --git a/docker/wazuh-4.2-es/pre.yml b/docker/wazuh-4.2-es/pre.yml index 273e304c95..26a2e7a6bb 100755 --- a/docker/wazuh-4.2-es/pre.yml +++ b/docker/wazuh-4.2-es/pre.yml @@ -1,16 +1,16 @@ -version: "2.2" +version: '2.2' x-logging: &logging logging: driver: loki options: - loki-url: "http://host.docker.internal:3100/loki/api/v1/push" + loki-url: 'http://host.docker.internal:3100/loki/api/v1/push' services: exporter: image: quay.io/prometheuscommunity/elasticsearch-exporter:latest <<: *logging - hostname: "exporter-kbn-${ES_VERSION}" + hostname: 'exporter-kbn-${ES_VERSION}' networks: - es-pre - mon @@ -21,7 +21,7 @@ services: imposter: image: outofcoffee/imposter - hostname: "imposter-kbn-${ES_VERSION}" + hostname: 'imposter-kbn-${ES_VERSION}' networks: - es-pre - mon @@ -38,7 +38,7 @@ services: condition: service_healthy image: elastic/filebeat:7.10.2 hostname: filebeat - user: "0:0" + user: '0:0' networks: - es-pre <<: *logging @@ -51,7 +51,7 @@ services: echo admin | filebeat keystore add username --stdin --force echo ${ELASTIC_PASSWORD}| filebeat keystore add password --stdin --force curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/4.2/extensions/elasticsearch/7.x/wazuh-template.json - curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz | tar -xvz -C /usr/share/filebeat/module + curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.4.tar.gz | tar -xvz -C /usr/share/filebeat/module # copy filebeat to preserve correct permissions without # affecting host filesystem cp /tmp/filebeat.yml /usr/share/filebeat/filebeat.yml @@ -72,7 +72,7 @@ services: - certs:/usr/share/elasticsearch/config/certs - ./config/wazuh_indexer_ssl_certs/:/tmp/certs - ./config/setup_permissions.sh:/tmp/setup_permissions.sh - user: "0" + user: '0' command: > bash -c ' if [ x${ELASTIC_PASSWORD} == x ]; then @@ -134,7 +134,7 @@ services: echo "All done!"; ' healthcheck: - test: ["CMD-SHELL", "[ -f config/certs/es01/es01.crt ]"] + test: ['CMD-SHELL', '[ -f config/certs/es01/es01.crt ]'] interval: 1s timeout: 5s retries: 120 @@ -152,7 +152,7 @@ services: - certs:/usr/share/elasticsearch/config/certs - esdata01:/usr/share/elasticsearch/data environment: - - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - 'ES_JAVA_OPTS=-Xms512m -Xmx512m' - node.name=es01 - cluster.name=${CLUSTER_NAME} # - cluster.initial_master_nodes=es01,es02,es03 @@ -180,7 +180,7 @@ services: healthcheck: test: [ - "CMD-SHELL", + 'CMD-SHELL', "curl -s --cacert config/certs/ca/ca.crt https://localhost:9200 | grep -q 'missing authentication credentials'", ] interval: 10s @@ -303,7 +303,7 @@ services: healthcheck: test: [ - "CMD-SHELL", + 'CMD-SHELL', "curl -s -I http://localhost:5601 | grep -q 'HTTP/1.1 302 Found'", ] interval: 10s @@ -312,7 +312,7 @@ services: networks: es-pre: - name: "es-pre-${ES_VERSION}" + name: 'es-pre-${ES_VERSION}' driver: bridge mon: external: true diff --git a/docker/wazuh-4.3-wz/pre.yml b/docker/wazuh-4.3-wz/pre.yml index b203c39355..4757912bb6 100755 --- a/docker/wazuh-4.3-wz/pre.yml +++ b/docker/wazuh-4.3-wz/pre.yml @@ -5,13 +5,13 @@ x-logging: &logging logging: driver: loki options: - loki-url: "http://host.docker.internal:3100/loki/api/v1/push" + loki-url: 'http://host.docker.internal:3100/loki/api/v1/push' services: exporter: image: quay.io/prometheuscommunity/elasticsearch-exporter:latest <<: *logging - hostname: "exporter-kbn-${WAZUH_STACK}" + hostname: 'exporter-kbn-${WAZUH_STACK}' networks: - wzd-pre - mon @@ -22,7 +22,7 @@ services: imposter: image: outofcoffee/imposter - hostname: "imposter-kbn-${WAZUH_STACK}" + hostname: 'imposter-kbn-${WAZUH_STACK}' networks: - wzd-pre - mon @@ -42,64 +42,64 @@ services: - ./config/certs:/conf entrypoint: /bin/bash command: > - -c ' - export certs=/tmp/certs - mkdir $$certs - cd $$certs + -c ' + export certs=/tmp/certs + mkdir $$certs + cd $$certs + + echo "Generating CA" + cfssl gencert -initca /conf/ca.json | cfssljson -bare ca + + echo "Generating servers certificates" + for i in wazuh.indexer wazuh.dashboard wazuh.manager; do + echo "Generating cert for $$i" + cat /conf/host.json | \ + sed "s/HOST/$$i/g" | \ + cfssl gencert \ + -ca $$certs/ca.pem \ + -ca-key $$certs/ca-key.pem \ + -config /conf/cfssl.json \ + -profile=server - | \ + cfssljson -bare $$i + openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key + done + + echo "Generating clients certificates" + for i in admin filebeat; do + echo "Generating cert for $$i" + cat /conf/host.json | \ + sed "s/HOST/$$i/g" | \ + cfssl gencert \ + -ca $$certs/ca.pem \ + -ca-key $$certs/ca-key.pem \ + -config /conf/cfssl.json \ + -profile=client - | \ + cfssljson -bare $$i + openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key + done - echo "Generating CA" - cfssl gencert -initca /conf/ca.json | cfssljson -bare ca + echo "Setting up permissions" - echo "Generating servers certificates" - for i in wazuh.indexer wazuh.dashboard wazuh.manager; do - echo "Generating cert for $$i" - cat /conf/host.json | \ - sed "s/HOST/$$i/g" | \ - cfssl gencert \ - -ca $$certs/ca.pem \ - -ca-key $$certs/ca-key.pem \ - -config /conf/cfssl.json \ - -profile=server - | \ - cfssljson -bare $$i - openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key - done - - echo "Generating clients certificates" - for i in admin filebeat; do - echo "Generating cert for $$i" - cat /conf/host.json | \ - sed "s/HOST/$$i/g" | \ - cfssl gencert \ - -ca $$certs/ca.pem \ - -ca-key $$certs/ca-key.pem \ - -config /conf/cfssl.json \ - -profile=client - | \ - cfssljson -bare $$i - openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key - done - - echo "Setting up permissions" - - rm /certs/wi/* /certs/wd/* /certs/wm/* - - mv $$certs/wazuh.indexer* /certs/wi - mv $$certs/admin* /certs/wi - mv /certs/wi/admin.key /certs/wi/admin-key.pem - cp $$certs/*ca* /certs/wi - - mv $$certs/wazuh.dashboard* /certs/wd - cp $$certs/*ca* /certs/wd - - mv $$certs/*.* /certs/wm - - chmod 640 /certs/wi/* /certs/wd/* /certs/wm/* - chown -R 1000:1000 /certs/* - ls -alR /certs/ - - sleep 30 - ' + rm /certs/wi/* /certs/wd/* /certs/wm/* + + mv $$certs/wazuh.indexer* /certs/wi + mv $$certs/admin* /certs/wi + mv /certs/wi/admin.key /certs/wi/admin-key.pem + cp $$certs/*ca* /certs/wi + + mv $$certs/wazuh.dashboard* /certs/wd + cp $$certs/*ca* /certs/wd + + mv $$certs/*.* /certs/wm + + chmod 640 /certs/wi/* /certs/wd/* /certs/wm/* + chown -R 1000:1000 /certs/* + ls -alR /certs/ + + sleep 30 + ' healthcheck: - test: ["CMD-SHELL", "[ -r /certs/wm/wazuh.manager.pem ]"] + test: ['CMD-SHELL', '[ -r /certs/wm/wazuh.manager.pem ]'] interval: 2s timeout: 5s retries: 10 @@ -110,7 +110,7 @@ services: condition: service_healthy image: elastic/filebeat:7.10.2 hostname: filebeat - user: "0:0" + user: '0:0' networks: - wzd-pre - mon @@ -123,7 +123,7 @@ services: echo admin | filebeat keystore add username --stdin --force echo SecretPassword| filebeat keystore add password --stdin --force curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/4.3/extensions/elasticsearch/7.x/wazuh-template.json - curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz | tar -xvz -C /usr/share/filebeat/module + curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.4.tar.gz | tar -xvz -C /usr/share/filebeat/module # copy filebeat to preserve correct permissions without # affecting host filesystem cp /tmp/filebeat.yml /usr/share/filebeat/filebeat.yml @@ -136,7 +136,6 @@ services: - wm_certs:/etc/ssl/wazuh - ./config/filebeat/filebeat.yml:/tmp/filebeat.yml - wazuh.indexer: depends_on: generator: @@ -148,8 +147,8 @@ services: - mon <<: *logging environment: - - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" - - "OPENSEARCH_PATH_CONF=/usr/share/wazuh-indexer/config" + - 'OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m' + - 'OPENSEARCH_PATH_CONF=/usr/share/wazuh-indexer/config' ulimits: memlock: soft: -1 @@ -165,15 +164,13 @@ services: healthcheck: test: [ - "CMD-SHELL", - "/usr/share/wazuh-indexer/bin/opensearch-plugin list | grep -q security", + 'CMD-SHELL', + '/usr/share/wazuh-indexer/bin/opensearch-plugin list | grep -q security', ] interval: 10s timeout: 10s retries: 120 - - wazuh.dashboard: image: wazuh/wazuh-dashboard:${WAZUH_STACK} hostname: wazuh.dashboard diff --git a/docker/wazuh-4.4-wz/pre.yml b/docker/wazuh-4.4-wz/pre.yml index 632a56405a..f724f3b902 100755 --- a/docker/wazuh-4.4-wz/pre.yml +++ b/docker/wazuh-4.4-wz/pre.yml @@ -5,13 +5,13 @@ x-logging: &logging logging: driver: loki options: - loki-url: "http://host.docker.internal:3100/loki/api/v1/push" + loki-url: 'http://host.docker.internal:3100/loki/api/v1/push' services: exporter: image: quay.io/prometheuscommunity/elasticsearch-exporter:latest <<: *logging - hostname: "exporter-kbn-${WAZUH_STACK}" + hostname: 'exporter-kbn-${WAZUH_STACK}' networks: - wzd-pre - mon @@ -22,7 +22,7 @@ services: imposter: image: outofcoffee/imposter - hostname: "imposter-kbn-${WAZUH_STACK}" + hostname: 'imposter-kbn-${WAZUH_STACK}' networks: - wzd-pre - mon @@ -42,64 +42,64 @@ services: - ./config/certs:/conf entrypoint: /bin/bash command: > - -c ' - export certs=/tmp/certs - mkdir $$certs - cd $$certs + -c ' + export certs=/tmp/certs + mkdir $$certs + cd $$certs + + echo "Generating CA" + cfssl gencert -initca /conf/ca.json | cfssljson -bare ca + + echo "Generating servers certificates" + for i in wazuh.indexer wazuh.dashboard wazuh.manager; do + echo "Generating cert for $$i" + cat /conf/host.json | \ + sed "s/HOST/$$i/g" | \ + cfssl gencert \ + -ca $$certs/ca.pem \ + -ca-key $$certs/ca-key.pem \ + -config /conf/cfssl.json \ + -profile=server - | \ + cfssljson -bare $$i + openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key + done + + echo "Generating clients certificates" + for i in admin filebeat; do + echo "Generating cert for $$i" + cat /conf/host.json | \ + sed "s/HOST/$$i/g" | \ + cfssl gencert \ + -ca $$certs/ca.pem \ + -ca-key $$certs/ca-key.pem \ + -config /conf/cfssl.json \ + -profile=client - | \ + cfssljson -bare $$i + openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key + done - echo "Generating CA" - cfssl gencert -initca /conf/ca.json | cfssljson -bare ca + echo "Setting up permissions" - echo "Generating servers certificates" - for i in wazuh.indexer wazuh.dashboard wazuh.manager; do - echo "Generating cert for $$i" - cat /conf/host.json | \ - sed "s/HOST/$$i/g" | \ - cfssl gencert \ - -ca $$certs/ca.pem \ - -ca-key $$certs/ca-key.pem \ - -config /conf/cfssl.json \ - -profile=server - | \ - cfssljson -bare $$i - openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key - done - - echo "Generating clients certificates" - for i in admin filebeat; do - echo "Generating cert for $$i" - cat /conf/host.json | \ - sed "s/HOST/$$i/g" | \ - cfssl gencert \ - -ca $$certs/ca.pem \ - -ca-key $$certs/ca-key.pem \ - -config /conf/cfssl.json \ - -profile=client - | \ - cfssljson -bare $$i - openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key - done - - echo "Setting up permissions" - - rm /certs/wi/* /certs/wd/* /certs/wm/* - - mv $$certs/wazuh.indexer* /certs/wi - mv $$certs/admin* /certs/wi - mv /certs/wi/admin.key /certs/wi/admin-key.pem - cp $$certs/*ca* /certs/wi - - mv $$certs/wazuh.dashboard* /certs/wd - cp $$certs/*ca* /certs/wd - - mv $$certs/*.* /certs/wm - - chmod 640 /certs/wi/* /certs/wd/* /certs/wm/* - chown -R 1000:1000 /certs/* - ls -alR /certs/ - - sleep 30 - ' + rm /certs/wi/* /certs/wd/* /certs/wm/* + + mv $$certs/wazuh.indexer* /certs/wi + mv $$certs/admin* /certs/wi + mv /certs/wi/admin.key /certs/wi/admin-key.pem + cp $$certs/*ca* /certs/wi + + mv $$certs/wazuh.dashboard* /certs/wd + cp $$certs/*ca* /certs/wd + + mv $$certs/*.* /certs/wm + + chmod 640 /certs/wi/* /certs/wd/* /certs/wm/* + chown -R 1000:1000 /certs/* + ls -alR /certs/ + + sleep 30 + ' healthcheck: - test: ["CMD-SHELL", "[ -r /certs/wm/wazuh.manager.pem ]"] + test: ['CMD-SHELL', '[ -r /certs/wm/wazuh.manager.pem ]'] interval: 2s timeout: 5s retries: 10 @@ -110,7 +110,7 @@ services: condition: service_healthy image: elastic/filebeat:7.10.2 hostname: filebeat - user: "0:0" + user: '0:0' networks: - wzd-pre - mon @@ -123,7 +123,7 @@ services: echo admin | filebeat keystore add username --stdin --force echo SecretPassword| filebeat keystore add password --stdin --force curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/4.3/extensions/elasticsearch/7.x/wazuh-template.json - curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz | tar -xvz -C /usr/share/filebeat/module + curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.4.tar.gz | tar -xvz -C /usr/share/filebeat/module # copy filebeat to preserve correct permissions without # affecting host filesystem cp /tmp/filebeat.yml /usr/share/filebeat/filebeat.yml @@ -136,7 +136,6 @@ services: - wm_certs:/etc/ssl/wazuh - ./config/filebeat/filebeat.yml:/tmp/filebeat.yml - wazuh.indexer: depends_on: generator: @@ -148,8 +147,8 @@ services: - mon <<: *logging environment: - - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" - - "OPENSEARCH_PATH_CONF=/usr/share/wazuh-indexer/config" + - 'OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m' + - 'OPENSEARCH_PATH_CONF=/usr/share/wazuh-indexer/config' ulimits: memlock: soft: -1 @@ -168,15 +167,13 @@ services: healthcheck: test: [ - "CMD-SHELL", - "/usr/share/wazuh-indexer/bin/opensearch-plugin list | grep -q security", + 'CMD-SHELL', + '/usr/share/wazuh-indexer/bin/opensearch-plugin list | grep -q security', ] interval: 10s timeout: 10s retries: 120 - - wazuh.dashboard: image: wazuh/wazuh-dashboard:${WAZUH_STACK} hostname: wazuh.dashboard diff --git a/docker/wazuh-4.5-wz/pre.yml b/docker/wazuh-4.5-wz/pre.yml index 632a56405a..f724f3b902 100755 --- a/docker/wazuh-4.5-wz/pre.yml +++ b/docker/wazuh-4.5-wz/pre.yml @@ -5,13 +5,13 @@ x-logging: &logging logging: driver: loki options: - loki-url: "http://host.docker.internal:3100/loki/api/v1/push" + loki-url: 'http://host.docker.internal:3100/loki/api/v1/push' services: exporter: image: quay.io/prometheuscommunity/elasticsearch-exporter:latest <<: *logging - hostname: "exporter-kbn-${WAZUH_STACK}" + hostname: 'exporter-kbn-${WAZUH_STACK}' networks: - wzd-pre - mon @@ -22,7 +22,7 @@ services: imposter: image: outofcoffee/imposter - hostname: "imposter-kbn-${WAZUH_STACK}" + hostname: 'imposter-kbn-${WAZUH_STACK}' networks: - wzd-pre - mon @@ -42,64 +42,64 @@ services: - ./config/certs:/conf entrypoint: /bin/bash command: > - -c ' - export certs=/tmp/certs - mkdir $$certs - cd $$certs + -c ' + export certs=/tmp/certs + mkdir $$certs + cd $$certs + + echo "Generating CA" + cfssl gencert -initca /conf/ca.json | cfssljson -bare ca + + echo "Generating servers certificates" + for i in wazuh.indexer wazuh.dashboard wazuh.manager; do + echo "Generating cert for $$i" + cat /conf/host.json | \ + sed "s/HOST/$$i/g" | \ + cfssl gencert \ + -ca $$certs/ca.pem \ + -ca-key $$certs/ca-key.pem \ + -config /conf/cfssl.json \ + -profile=server - | \ + cfssljson -bare $$i + openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key + done + + echo "Generating clients certificates" + for i in admin filebeat; do + echo "Generating cert for $$i" + cat /conf/host.json | \ + sed "s/HOST/$$i/g" | \ + cfssl gencert \ + -ca $$certs/ca.pem \ + -ca-key $$certs/ca-key.pem \ + -config /conf/cfssl.json \ + -profile=client - | \ + cfssljson -bare $$i + openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key + done - echo "Generating CA" - cfssl gencert -initca /conf/ca.json | cfssljson -bare ca + echo "Setting up permissions" - echo "Generating servers certificates" - for i in wazuh.indexer wazuh.dashboard wazuh.manager; do - echo "Generating cert for $$i" - cat /conf/host.json | \ - sed "s/HOST/$$i/g" | \ - cfssl gencert \ - -ca $$certs/ca.pem \ - -ca-key $$certs/ca-key.pem \ - -config /conf/cfssl.json \ - -profile=server - | \ - cfssljson -bare $$i - openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key - done - - echo "Generating clients certificates" - for i in admin filebeat; do - echo "Generating cert for $$i" - cat /conf/host.json | \ - sed "s/HOST/$$i/g" | \ - cfssl gencert \ - -ca $$certs/ca.pem \ - -ca-key $$certs/ca-key.pem \ - -config /conf/cfssl.json \ - -profile=client - | \ - cfssljson -bare $$i - openssl pkcs8 -topk8 -inform pem -in $$i-key.pem -outform pem -nocrypt -out $$i.key - done - - echo "Setting up permissions" - - rm /certs/wi/* /certs/wd/* /certs/wm/* - - mv $$certs/wazuh.indexer* /certs/wi - mv $$certs/admin* /certs/wi - mv /certs/wi/admin.key /certs/wi/admin-key.pem - cp $$certs/*ca* /certs/wi - - mv $$certs/wazuh.dashboard* /certs/wd - cp $$certs/*ca* /certs/wd - - mv $$certs/*.* /certs/wm - - chmod 640 /certs/wi/* /certs/wd/* /certs/wm/* - chown -R 1000:1000 /certs/* - ls -alR /certs/ - - sleep 30 - ' + rm /certs/wi/* /certs/wd/* /certs/wm/* + + mv $$certs/wazuh.indexer* /certs/wi + mv $$certs/admin* /certs/wi + mv /certs/wi/admin.key /certs/wi/admin-key.pem + cp $$certs/*ca* /certs/wi + + mv $$certs/wazuh.dashboard* /certs/wd + cp $$certs/*ca* /certs/wd + + mv $$certs/*.* /certs/wm + + chmod 640 /certs/wi/* /certs/wd/* /certs/wm/* + chown -R 1000:1000 /certs/* + ls -alR /certs/ + + sleep 30 + ' healthcheck: - test: ["CMD-SHELL", "[ -r /certs/wm/wazuh.manager.pem ]"] + test: ['CMD-SHELL', '[ -r /certs/wm/wazuh.manager.pem ]'] interval: 2s timeout: 5s retries: 10 @@ -110,7 +110,7 @@ services: condition: service_healthy image: elastic/filebeat:7.10.2 hostname: filebeat - user: "0:0" + user: '0:0' networks: - wzd-pre - mon @@ -123,7 +123,7 @@ services: echo admin | filebeat keystore add username --stdin --force echo SecretPassword| filebeat keystore add password --stdin --force curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/4.3/extensions/elasticsearch/7.x/wazuh-template.json - curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz | tar -xvz -C /usr/share/filebeat/module + curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.4.tar.gz | tar -xvz -C /usr/share/filebeat/module # copy filebeat to preserve correct permissions without # affecting host filesystem cp /tmp/filebeat.yml /usr/share/filebeat/filebeat.yml @@ -136,7 +136,6 @@ services: - wm_certs:/etc/ssl/wazuh - ./config/filebeat/filebeat.yml:/tmp/filebeat.yml - wazuh.indexer: depends_on: generator: @@ -148,8 +147,8 @@ services: - mon <<: *logging environment: - - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" - - "OPENSEARCH_PATH_CONF=/usr/share/wazuh-indexer/config" + - 'OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m' + - 'OPENSEARCH_PATH_CONF=/usr/share/wazuh-indexer/config' ulimits: memlock: soft: -1 @@ -168,15 +167,13 @@ services: healthcheck: test: [ - "CMD-SHELL", - "/usr/share/wazuh-indexer/bin/opensearch-plugin list | grep -q security", + 'CMD-SHELL', + '/usr/share/wazuh-indexer/bin/opensearch-plugin list | grep -q security', ] interval: 10s timeout: 10s retries: 120 - - wazuh.dashboard: image: wazuh/wazuh-dashboard:${WAZUH_STACK} hostname: wazuh.dashboard diff --git a/docker/wazuh-4.x-es/pre.yml b/docker/wazuh-4.x-es/pre.yml index fa1202432c..60d31a1df3 100755 --- a/docker/wazuh-4.x-es/pre.yml +++ b/docker/wazuh-4.x-es/pre.yml @@ -1,16 +1,16 @@ -version: "2.2" +version: '2.2' x-logging: &logging logging: driver: loki options: - loki-url: "http://host.docker.internal:3100/loki/api/v1/push" + loki-url: 'http://host.docker.internal:3100/loki/api/v1/push' services: exporter: image: quay.io/prometheuscommunity/elasticsearch-exporter:latest <<: *logging - hostname: "exporter-kbn-${ES_VERSION}" + hostname: 'exporter-kbn-${ES_VERSION}' networks: - es-pre - mon @@ -21,7 +21,7 @@ services: imposter: image: outofcoffee/imposter - hostname: "imposter-kbn-${ES_VERSION}" + hostname: 'imposter-kbn-${ES_VERSION}' networks: - es-pre - mon @@ -38,7 +38,7 @@ services: condition: service_healthy image: elastic/filebeat:7.10.2 hostname: filebeat - user: "0:0" + user: '0:0' networks: - es-pre <<: *logging @@ -51,7 +51,7 @@ services: echo admin | filebeat keystore add username --stdin --force echo ${ELASTIC_PASSWORD}| filebeat keystore add password --stdin --force curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/4.3/extensions/elasticsearch/7.x/wazuh-template.json - curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz | tar -xvz -C /usr/share/filebeat/module + curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.4.tar.gz | tar -xvz -C /usr/share/filebeat/module # copy filebeat to preserve correct permissions without # affecting host filesystem cp /tmp/filebeat.yml /usr/share/filebeat/filebeat.yml @@ -72,7 +72,7 @@ services: - certs:/usr/share/elasticsearch/config/certs - ./config/wazuh_indexer_ssl_certs/:/tmp/certs - ./config/setup_permissions.sh:/tmp/setup_permissions.sh - user: "0" + user: '0' command: > bash -c ' if [ x${ELASTIC_PASSWORD} == x ]; then @@ -134,7 +134,7 @@ services: echo "All done!"; ' healthcheck: - test: ["CMD-SHELL", "[ -f config/certs/es01/es01.crt ]"] + test: ['CMD-SHELL', '[ -f config/certs/es01/es01.crt ]'] interval: 1s timeout: 5s retries: 120 @@ -152,7 +152,7 @@ services: - certs:/usr/share/elasticsearch/config/certs - esdata01:/usr/share/elasticsearch/data environment: - - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - 'ES_JAVA_OPTS=-Xms512m -Xmx512m' - node.name=es01 - cluster.name=${CLUSTER_NAME} # - cluster.initial_master_nodes=es01,es02,es03 @@ -180,7 +180,7 @@ services: healthcheck: test: [ - "CMD-SHELL", + 'CMD-SHELL', "curl -s --cacert config/certs/ca/ca.crt https://localhost:9200 | grep -q 'missing authentication credentials'", ] interval: 10s @@ -303,7 +303,7 @@ services: healthcheck: test: [ - "CMD-SHELL", + 'CMD-SHELL', "curl -s -I http://localhost:5601 | grep -q 'HTTP/1.1 302 Found'", ] interval: 10s @@ -312,7 +312,7 @@ services: networks: es-pre: - name: "es-pre-${ES_VERSION}" + name: 'es-pre-${ES_VERSION}' driver: bridge mon: external: true diff --git a/plugins/main/opensearch_dashboards.json b/plugins/main/opensearch_dashboards.json index d2beb8d5a5..ba297ced28 100644 --- a/plugins/main/opensearch_dashboards.json +++ b/plugins/main/opensearch_dashboards.json @@ -2,7 +2,9 @@ "id": "wazuh", "version": "4.9.0-00", "opensearchDashboardsVersion": "opensearchDashboards", - "configPath": ["wazuh"], + "configPath": [ + "wazuh" + ], "requiredPlugins": [ "navigation", "data", @@ -29,4 +31,4 @@ ], "server": true, "ui": true -} +} \ No newline at end of file diff --git a/plugins/main/package.json b/plugins/main/package.json index 9f1cc623d6..f047252e2f 100644 --- a/plugins/main/package.json +++ b/plugins/main/package.json @@ -88,4 +88,4 @@ "redux-mock-store": "^1.5.4", "swagger-client": "^3.19.11" } -} +} \ No newline at end of file diff --git a/plugins/main/public/components/health-check/container/health-check.container.tsx b/plugins/main/public/components/health-check/container/health-check.container.tsx index f3be74bc46..de9013fdac 100644 --- a/plugins/main/public/components/health-check/container/health-check.container.tsx +++ b/plugins/main/public/components/health-check/container/health-check.container.tsx @@ -143,6 +143,9 @@ function HealthCheckComponent() { window.location.href = getHttp().basePath.prepend(url); }; + const thereAreErrors = Object.keys(checkErrors).length > 0; + const thereAreWarnings = Object.keys(checkWarnings).length > 0; + useEffect(() => { if (appConfig.isReady && !checksInitiated.current) { checksInitiated.current = true; @@ -154,6 +157,7 @@ function HealthCheckComponent() { // Redirect to app when all checks are ready Object.keys(checks).every(check => checksReady[check]) && !isDebugMode && + !thereAreWarnings && (() => setTimeout( redirectionPassHealthcheck, @@ -210,8 +214,6 @@ function HealthCheckComponent() { ? getAssetURL(appConfig.data['customization.logo.healthcheck']) : getThemeAssetURL('logo.svg'), ); - const thereAreErrors = Object.keys(checkErrors).length > 0; - const thereAreWarnings = Object.keys(checkWarnings).length > 0; const renderChecks = () => { const showLogButton = thereAreErrors || thereAreWarnings || isDebugMode; @@ -364,7 +366,7 @@ function HealthCheckComponent() { )} - {isDebugMode && + {(isDebugMode || thereAreWarnings) && Object.keys(checks).every(check => checksReady[check]) && ( diff --git a/plugins/main/public/components/health-check/services/check-pattern-support.service.ts b/plugins/main/public/components/health-check/services/check-pattern-support.service.ts index aca4d986a4..6e703195ae 100644 --- a/plugins/main/public/components/health-check/services/check-pattern-support.service.ts +++ b/plugins/main/public/components/health-check/services/check-pattern-support.service.ts @@ -65,8 +65,8 @@ export const checkPatternSupportService = ); checkLogger.info('Integrity of saved objects: [ok]'); } catch (error) { - if (error.name === 'WarningError') { - checkLogger.warning(error.message || error); + if (error instanceof WarningError) { + checkLogger.warning(error.message); } else { checkLogger.error( `Error creating index pattern id [${pattern}]: ${ diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels.ts b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels.ts index d4d44a3f23..3269a8d65b 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels.ts +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels.ts @@ -131,7 +131,7 @@ const getVisStateTopVulnerabilities = (indexPatternId: string) => { const getVisStateTopVulnerabilitiesEndpoints = (indexPatternId: string) => { return { id: 'most_vulnerable_endpoints_vulnerabilities', - title: 'The most vulnerable endpoints', + title: 'Most vulnerable endpoints', type: 'horizontal_bar', params: { type: 'histogram', @@ -420,152 +420,6 @@ const getVisStateAccumulationMostDetectedVulnerabilities = ( }; }; -const getVisStateInventoryTable = (indexPatternId: string) => { - return { - id: 'inventory_table_vulnerabilities', - title: 'Inventory table', - type: 'table', - params: { - perPage: 5, - showPartialRows: false, - showMetricsAtAllLevels: false, - showTotal: false, - totalFunc: 'sum', - percentageCol: '', - }, - data: { - searchSource: { - query: { - language: 'kuery', - query: '', - }, - filter: [], - index: indexPatternId, - }, - references: [ - { - name: 'kibanaSavedObjectMeta.searchSourceJSON.index', - type: 'index-pattern', - id: indexPatternId, - }, - ], - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - params: { - customLabel: 'Count', - }, - schema: 'metric', - }, - { - id: '2', - enabled: true, - type: 'terms', - params: { - field: 'package.name', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'name', - }, - schema: 'bucket', - }, - { - id: '3', - enabled: true, - type: 'terms', - params: { - field: 'package.version', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'version', - }, - schema: 'bucket', - }, - { - id: '5', - enabled: true, - type: 'terms', - params: { - field: 'vulnerability.severity', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'severity', - }, - schema: 'bucket', - }, - { - id: '6', - enabled: true, - type: 'terms', - params: { - field: 'vulnerability.id', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'id', - }, - schema: 'bucket', - }, - { - id: '7', - enabled: true, - type: 'terms', - params: { - field: 'vulnerability.score.version', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'score version', - }, - schema: 'bucket', - }, - { - id: '8', - enabled: true, - type: 'terms', - params: { - field: 'vulnerability.score.base', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'score base', - }, - schema: 'bucket', - }, - ], - }, - }; -}; - export const getDashboardPanels = ( indexPatternId: string, ): { @@ -617,19 +471,5 @@ export const getDashboardPanels = ( getVisStateAccumulationMostDetectedVulnerabilities(indexPatternId), }, }, - '9': { - gridData: { - w: 48, - h: 12, - x: 0, - y: 14, - i: '9', - }, - type: 'visualization', - explicitInput: { - id: '9', - savedVis: getVisStateInventoryTable(indexPatternId), - }, - }, }; }; diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_filters.ts b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_filters.ts index 791b505bb1..074ca8947b 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_filters.ts +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_filters.ts @@ -90,8 +90,8 @@ export const getDashboardFilters = ( savedVis: getVisStateFilter( 'topPackageSelector', indexPatternId, - 'Top Packages vulnerabilities', - 'Package', + 'Top packages vulnerabilities', + 'Top 5 package names', 'package.name', ), }, @@ -110,8 +110,8 @@ export const getDashboardFilters = ( savedVis: getVisStateFilter( 'topOSVulnerabilities', indexPatternId, - 'Top Operating system vulnerabilities', - 'Operating system', + 'Top operating system vulnerabilities', + 'Top 5 operating systems', 'host.os.full', ), }, @@ -131,7 +131,7 @@ export const getDashboardFilters = ( 'topAgentVulnerabilities', indexPatternId, 'Agent filter', - 'Agent', + 'Top 5 agents', 'agent.id', ), }, @@ -151,7 +151,7 @@ export const getDashboardFilters = ( 'topVulnerabilities', indexPatternId, 'Top vulnerabilities', - 'Vulnerability', + 'Top 5 vulnerabilities', 'vulnerability.id', ), }, diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_kpis.ts b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_kpis.ts index a4494d9c05..4fc899a67c 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_kpis.ts +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_kpis.ts @@ -75,7 +75,7 @@ const getVisStateSeverityCritical = (indexPatternId: string) => { query: 'vulnerability.severity:"Critical"', language: 'kuery', }, - label: '- Critical Severity Alerts', + label: '- Critical severity alerts', }, ], }, @@ -167,7 +167,7 @@ const getVisStateSeverityHigh = (indexPatternId: string) => { query: 'vulnerability.severity:"High"', language: 'kuery', }, - label: '- High Severity Alerts', + label: '- High severity alerts', }, ], }, @@ -252,7 +252,7 @@ const getVisStateSeverityMedium = (indexPatternId: string) => { query: 'vulnerability.severity:"Medium"', language: 'kuery', }, - label: '- Medium Severity Alerts', + label: '- Medium severity alerts', }, ], }, @@ -337,7 +337,7 @@ const getVisStateSeverityLow = (indexPatternId: string) => { query: 'vulnerability.severity:"Low"', language: 'kuery', }, - label: '- Low Severity Alerts', + label: '- Low severity alerts', }, ], }, diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/vulnerability_detector_filters.scss b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/vulnerability_detector_filters.scss index 041fb3f19c..d27e09efb0 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/vulnerability_detector_filters.scss +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/vulnerability_detector_filters.scss @@ -1,6 +1,7 @@ .vulnerability-dashboard-filters-wrapper { - .euiDataGrid__controls,.euiDataGrid__pagination { - display: none!important; + .euiDataGrid__controls, + .euiDataGrid__pagination { + display: none !important; } } diff --git a/plugins/main/public/components/settings/api/api-table.js b/plugins/main/public/components/settings/api/api-table.js index 607fbc416b..6dfc8e1d5e 100644 --- a/plugins/main/public/components/settings/api/api-table.js +++ b/plugins/main/public/components/settings/api/api-table.js @@ -77,9 +77,8 @@ export const ApiTable = compose( error: { error: error, message: error.message || error, - title: `Error checking available updates: ${ - error.message || error - }`, + title: `Error checking available updates: ${error.message || error + }`, }, }; @@ -128,8 +127,8 @@ export const ApiTable = compose( typeof error === 'string' ? error : (error || {}).message || - ((error || {}).data || {}).message || - 'Wazuh is not reachable'; + ((error || {}).data || {}).message || + 'Wazuh is not reachable'; const status = code === 3099 ? 'down' : 'unknown'; entries[idx].status = { status, downReason }; if (entries[idx].id === this.props.currentDefault) { @@ -175,8 +174,8 @@ export const ApiTable = compose( typeof error === 'string' ? error : (error || {}).message || - ((error || {}).data || {}).message || - 'Wazuh is not reachable'; + ((error || {}).data || {}).message || + 'Wazuh is not reachable'; const status = code === 3099 ? 'down' : 'unknown'; entries[idx].status = { status, downReason }; throw error; @@ -194,9 +193,8 @@ export const ApiTable = compose( error: { error: error, message: error.message || error, - title: `Error checking manager connection: ${ - error.message || error - }`, + title: `Error checking manager connection: ${error.message || error + }`, }, }; @@ -362,13 +360,10 @@ export const ApiTable = compose( name: 'Updates status', sortable: true, render: (item, api) => { - const getColor = () => { - return API_UPDATES_STATUS_COLUMN[item]?.color; - }; + const color = API_UPDATES_STATUS_COLUMN[item]?.color ?? 'subdued'; - const getContent = () => { - return API_UPDATES_STATUS_COLUMN[item]?.text; - }; + const content = + API_UPDATES_STATUS_COLUMN[item]?.text ?? 'Never checked'; if (!this.state.refreshingAvailableUpdates) { return ( @@ -378,13 +373,28 @@ export const ApiTable = compose( responsive={false} > - - {getContent()} + + {content} + + {!item ? ( + + + Click Check updates button to get information +

+ } + > + +
+
+ ) : null} {item === 'availableUpdates' ? ( this.props.copyToClipBoard(api.error.detail)} + color='primary' + iconType='questionInCircle' + aria-label='Info about the error' + onClick={() => + this.props.copyToClipBoard(api.error.detail) + } /> @@ -545,10 +557,10 @@ export const ApiTable = compose( content={ this.state.availableUpdates?.last_check_date ? formatUIDate( - new Date( - this.state.availableUpdates.last_check_date, - ), - ) + new Date( + this.state.availableUpdates.last_check_date, + ), + ) : '-' } > diff --git a/plugins/main/public/react-services/error-management/error-factory/errors/WarningError.ts b/plugins/main/public/react-services/error-management/error-factory/errors/WarningError.ts index 80882c4fe7..60d29ee4f9 100644 --- a/plugins/main/public/react-services/error-management/error-factory/errors/WarningError.ts +++ b/plugins/main/public/react-services/error-management/error-factory/errors/WarningError.ts @@ -5,6 +5,7 @@ export class WarningError extends WazuhError { logOptions: IWazuhErrorLogOpts; constructor(error: Error, info?: IWazuhErrorInfo) { super(error, info); + Object.setPrototypeOf(this, WarningError.prototype); this.logOptions = { error: { message: `[${this.constructor.name}]: ${error.message}`, diff --git a/plugins/main/test/cypress/images/wazuh_manager_filebeat_sources_cmake/Dockerfile b/plugins/main/test/cypress/images/wazuh_manager_filebeat_sources_cmake/Dockerfile index 1dddbbf285..9aeaafc8fa 100755 --- a/plugins/main/test/cypress/images/wazuh_manager_filebeat_sources_cmake/Dockerfile +++ b/plugins/main/test/cypress/images/wazuh_manager_filebeat_sources_cmake/Dockerfile @@ -44,4 +44,4 @@ EXPOSE 55000 # WAZUH_VERSION - Define the Wazuh branch/tag to install. [WAZUH_VERSION=4.1.0] # FILEBEAT_VERSION - Filebeat Version # FILEBEAT_WAZUH_TEMPLATE_URL - Link with the Wazuh template. [FILEBEAT_WAZUH_TEMPLATE_URL=https://raw.githubusercontent.com/wazuh/wazuh/4.0/extensions/elasticsearch/7.x/wazuh-template.json] -# FILEBEAT_WAZUH_MODULE_URL - Link with the Wazuh Filebeat module. [FILEBEAT_WAZUH_MODULE_URL=https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz] +# FILEBEAT_WAZUH_MODULE_URL - Link with the Wazuh Filebeat module. [FILEBEAT_WAZUH_MODULE_URL=https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.4.tar.gz] diff --git a/plugins/wazuh-check-updates/opensearch_dashboards.json b/plugins/wazuh-check-updates/opensearch_dashboards.json index bf69812edc..2f071b5548 100644 --- a/plugins/wazuh-check-updates/opensearch_dashboards.json +++ b/plugins/wazuh-check-updates/opensearch_dashboards.json @@ -13,4 +13,4 @@ "optionalPlugins": [ "securityDashboards" ] -} +} \ No newline at end of file diff --git a/plugins/wazuh-check-updates/package.json b/plugins/wazuh-check-updates/package.json index 4804025d53..a0b22764e4 100644 --- a/plugins/wazuh-check-updates/package.json +++ b/plugins/wazuh-check-updates/package.json @@ -28,4 +28,4 @@ "@types/md5": "^2.3.2", "@types/node-cron": "^3.0.8" } -} +} \ No newline at end of file diff --git a/plugins/wazuh-core/opensearch_dashboards.json b/plugins/wazuh-core/opensearch_dashboards.json index 47ff8cfd52..99195c389b 100644 --- a/plugins/wazuh-core/opensearch_dashboards.json +++ b/plugins/wazuh-core/opensearch_dashboards.json @@ -11,4 +11,4 @@ "optionalPlugins": [ "securityDashboards" ] -} +} \ No newline at end of file diff --git a/plugins/wazuh-core/package.json b/plugins/wazuh-core/package.json index 1317a3b47c..ac1c4ea232 100644 --- a/plugins/wazuh-core/package.json +++ b/plugins/wazuh-core/package.json @@ -29,4 +29,4 @@ "@types/": "testing-library/user-event", "@types/md5": "^2.3.2" } -} +} \ No newline at end of file