From 3e200d2b9c28a6668b303a6d9fbb416331d0ac5f Mon Sep 17 00:00:00 2001 From: JuanGarriuz Date: Wed, 20 Dec 2023 18:50:33 +0100 Subject: [PATCH 1/7] Ugrade filebeat version to 0.4 (#6239) change filebeat version to 0.4 --- .../wazuh-build-push-docker-action.yml | 90 ++++++------ docker/kbn-dev/dev.yml | 26 ++-- docker/osd-dev/dev.yml | 2 +- docker/wazuh-4.2-es/pre.yml | 24 ++-- docker/wazuh-4.3-wz/pre.yml | 131 +++++++++--------- docker/wazuh-4.4-wz/pre.yml | 131 +++++++++--------- docker/wazuh-4.5-wz/pre.yml | 131 +++++++++--------- docker/wazuh-4.x-es/pre.yml | 24 ++-- .../Dockerfile | 2 +- 9 files changed, 276 insertions(+), 285 deletions(-) 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/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 0360a8c55f..11f37f04af 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/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] From bcbd3b3eab3ee6ea5f00922fbcde535cd2f2d9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar=20Biset?= <43619595+jbiset@users.noreply.github.com> Date: Wed, 20 Dec 2023 17:13:01 -0300 Subject: [PATCH 2/7] Fix health check error when there is no vulnerabilities indices (#6231) --- CHANGELOG.md | 2 +- .../health-check/container/health-check.container.tsx | 8 +++++--- .../services/check-pattern-support.service.ts | 4 ++-- .../common/hooks/useCheckIndexFields.tsx | 2 +- .../vulnerabilities/dashboards/overview/dashboard.tsx | 10 ++++++++-- .../error-factory/errors/WarningError.ts | 1 + 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2286fa4cb8..b39b4920d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Added the ability to check if there are available updates from the UI. [#6093](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6093) - 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) - 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) 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 29c1252545..c9e6d38748 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 @@ -129,6 +129,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; @@ -140,6 +143,7 @@ function HealthCheckComponent() { // Redirect to app when all checks are ready Object.keys(checks).every(check => checksReady[check]) && !isDebugMode && + !thereAreWarnings && (() => setTimeout( redirectionPassHealthcheck, @@ -196,8 +200,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; @@ -350,7 +352,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/common/hooks/useCheckIndexFields.tsx b/plugins/main/public/components/overview/vulnerabilities/common/hooks/useCheckIndexFields.tsx index 75112cbc85..08645e47c8 100644 --- a/plugins/main/public/components/overview/vulnerabilities/common/hooks/useCheckIndexFields.tsx +++ b/plugins/main/public/components/overview/vulnerabilities/common/hooks/useCheckIndexFields.tsx @@ -69,7 +69,7 @@ const useCheckIndexFields = ( checkIndexFields(); } - }, [indexPatternId]); + }, [indexPatternId, query, indexPattern]); return { isError, diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx index 911548c996..5c29d40532 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx @@ -62,10 +62,16 @@ const DashboardVulsComponent: React.FC = () => { ) : null} {!isLoadingSearchbar && !isLoading && - (isError || resultIndexData?.hits?.total === 0) ? ( + (isError || + !resultIndexData || + resultIndexData?.hits?.total === 0) ? ( ) : null} - {!isLoadingSearchbar && !isLoading && isSuccess ? ( + {!isLoadingSearchbar && + !isLoading && + isSuccess && + resultIndexData && + resultIndexData?.hits?.total !== 0 ? ( <>
Date: Thu, 21 Dec 2023 13:31:24 +0100 Subject: [PATCH 3/7] Fix links las registered agent and agent most active (#6244) * Fix links las registered agent and agent most active * Update changelog * Fix Stat HTML element warning --------- Co-authored-by: Federico Rodriguez --- CHANGELOG.md | 4 +- .../agent/components/agents-preview.js | 84 +++++++++++-------- 2 files changed, 52 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b39b4920d1..68b0fd3458 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ All notable changes to the Wazuh app project will be documented in this file. ### 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) @@ -27,7 +27,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) diff --git a/plugins/main/public/controllers/agent/components/agents-preview.js b/plugins/main/public/controllers/agent/components/agents-preview.js index 06494f4929..b8ee210bb9 100644 --- a/plugins/main/public/controllers/agent/components/agents-preview.js +++ b/plugins/main/public/controllers/agent/components/agents-preview.js @@ -24,6 +24,7 @@ import { EuiCard, EuiLink, EuiProgress, + EuiText, } from '@elastic/eui'; import { AgentsTable } from './agents-table'; import { WzRequest } from '../../../react-services/wz-request'; @@ -54,8 +55,9 @@ import { agentStatusColorByAgentStatus, agentStatusLabelByAgentStatus, } from '../../../../common/services/wz_agent_status'; -import { AppNavigate } from '../../../react-services/app-navigate.js'; -import { endpointSumary } from '../../../utils/applications'; +import { endpointSumary, itHygiene } from '../../../utils/applications'; +import { getCore } from '../../../kibana-services'; +import { RedirectAppLinks } from '../../../../../../src/plugins/opensearch_dashboards_react/public'; export const AgentsPreview = compose( withErrorBoundary, @@ -313,26 +315,33 @@ export const AgentsPreview = compose( - { - ev.stopPropagation(); - AppNavigate.navigateToModule(ev, 'agents', { - tab: 'welcome', - agent: this.state.lastRegisteredAgent?.id, - }); - } - } + this.state.lastRegisteredAgent?.id ? ( + - {this.state.lastRegisteredAgent?.name || '-'} - - + + + {this.state.lastRegisteredAgent?.name} + + + + ) : ( + - + ) } titleSize='s' description='Last registered agent' @@ -342,6 +351,7 @@ export const AgentsPreview = compose( { - { - ev.stopPropagation(); - AppNavigate.navigateToModule(ev, 'agents', { - tab: 'welcome', - agent: this.state.agentMostActive?.id, - }); - } - } + this.state.agentMostActive?.id ? ( + - {this.state.agentMostActive?.name || '-'} - - + + + {this.state.agentMostActive?.name} + + + + ) : ( + - + ) } titleSize='s' description='Most active agent' From d6d6796fc9df8bcde5ab054309fcc4149b7c724c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar=20Biset?= <43619595+jbiset@users.noreply.github.com> Date: Thu, 21 Dec 2023 11:33:06 -0300 Subject: [PATCH 4/7] Fix responsive view on vulnerability dashboard (#6246) * Add responsive styles * Add CHANGELOG --- CHANGELOG.md | 2 +- .../dashboards/overview/dashboard.tsx | 4 ++-- .../overview/vulnerability_detector_filters.scss | 12 ++++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b0fd3458..aa599bc0fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Added the ability to check if there are available updates from the UI. [#6093](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6093) - 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) [#6231](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6231) +- 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) diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx index 5c29d40532..2bb57348f5 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx @@ -72,7 +72,7 @@ const DashboardVulsComponent: React.FC = () => { isSuccess && resultIndexData && resultIndexData?.hits?.total !== 0 ? ( - <> +
{ hidePanelTitles: false, }} /> - +
) : null} 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 631158a73e..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,14 @@ .vulnerability-dashboard-filters-wrapper { - .euiDataGrid__controls,.euiDataGrid__pagination { - display: none!important; + .euiDataGrid__controls, + .euiDataGrid__pagination { + display: none !important; } } +.vulnerability-dashboard-responsive { + @media (max-width: 767px) { + .react-grid-layout { + height: auto !important; + } + } +} From c7e48d8d7162bbd7f63ac62c37e68d1f983305b5 Mon Sep 17 00:00:00 2001 From: Antonio <34042064+Desvelao@users.noreply.github.com> Date: Fri, 22 Dec 2023 09:39:45 +0100 Subject: [PATCH 5/7] Bump revision to 01 for Wazuh 4.7.2 (#6248) bump: Bump revision to 01 --- CHANGELOG.md | 2 +- plugins/main/opensearch_dashboards.json | 2 +- plugins/main/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22dfd50f3c..44334830ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the Wazuh app project will be documented in this file. -## 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/plugins/main/opensearch_dashboards.json b/plugins/main/opensearch_dashboards.json index bc6cd7757f..c30d3294f1 100644 --- a/plugins/main/opensearch_dashboards.json +++ b/plugins/main/opensearch_dashboards.json @@ -1,6 +1,6 @@ { "id": "wazuh", - "version": "4.7.2-00", + "version": "4.7.2-01", "opensearchDashboardsVersion": "opensearchDashboards", "configPath": [ "wazuh" diff --git a/plugins/main/package.json b/plugins/main/package.json index 99b489d459..94d4865054 100644 --- a/plugins/main/package.json +++ b/plugins/main/package.json @@ -1,7 +1,7 @@ { "name": "wazuh", "version": "4.7.2", - "revision": "00", + "revision": "01", "pluginPlatform": { "version": "2.8.0" }, From 50ae4e9bed4b45443f76c9aa39d04381be2275be Mon Sep 17 00:00:00 2001 From: Luciano Gorza <103193307+lucianogorza@users.noreply.github.com> Date: Tue, 2 Jan 2024 13:11:18 -0300 Subject: [PATCH 6/7] Fix Server APIs table updates status column (#6256) * Fix Server APIs table updates status column * Update CHANGELOG * Improve color and content definition * Format file --------- Co-authored-by: Federico Rodriguez --- CHANGELOG.md | 2 +- .../components/settings/api/api-table.js | 218 ++++++++++++------ 2 files changed, 143 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa599bc0fb..7827413f3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ 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) [#6231](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6231) [#6246](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6246) diff --git a/plugins/main/public/components/settings/api/api-table.js b/plugins/main/public/components/settings/api/api-table.js index 53e6056e33..89bed290c1 100644 --- a/plugins/main/public/components/settings/api/api-table.js +++ b/plugins/main/public/components/settings/api/api-table.js @@ -41,7 +41,7 @@ import { formatUIDate } from '../../../react-services/time-service'; export const ApiTable = compose( withErrorBoundary, - withReduxProvider + withReduxProvider, )( class ApiTable extends Component { constructor(props) { @@ -62,7 +62,9 @@ export const ApiTable = compose( async getApisAvailableUpdates(forceUpdate = false) { try { this.setState({ refreshingAvailableUpdates: true }); - const availableUpdates = await this.state.getAvailableUpdates(forceUpdate); + const availableUpdates = await this.state.getAvailableUpdates( + forceUpdate, + ); this.setState({ availableUpdates }); } catch (error) { const options = { @@ -73,7 +75,9 @@ 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 + }`, }, }; @@ -141,7 +145,12 @@ export const ApiTable = compose( refreshingEntries: false, }); } catch (error) { - if (error && error.data && error.data.message && error.data.code === 2001) { + if ( + error && + error.data && + error.data.message && + error.data.code === 2001 + ) { this.props.showAddApiWithInitialError(error); } } @@ -154,7 +163,7 @@ export const ApiTable = compose( async checkApi(api) { try { const entries = this.state.apiEntries; - const idx = entries.map((e) => e.id).indexOf(api.id); + const idx = entries.map(e => e.id).indexOf(api.id); try { await this.props.checkManager(api); entries[idx].status = 'online'; @@ -183,7 +192,9 @@ 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 + }`, }, }; @@ -213,13 +224,14 @@ export const ApiTable = compose( }, }; - const isLoading = this.state.refreshingEntries || this.state.refreshingAvailableUpdates; + const isLoading = + this.state.refreshingEntries || this.state.refreshingAvailableUpdates; const items = [ - ...this.state.apiEntries?.map((apiEntry) => { + ...this.state.apiEntries?.map(apiEntry => { const versionData = this.state.availableUpdates?.apis_available_updates?.find( - (apiAvailableUpdates) => apiAvailableUpdates.api_id === apiEntry.id + apiAvailableUpdates => apiAvailableUpdates.api_id === apiEntry.id, ) || {}; return { @@ -272,44 +284,56 @@ export const ApiTable = compose( name: 'Status', align: 'left', sortable: true, - render: (item) => { + render: item => { if (item) { return item === 'online' ? ( - + Online ) : item.status === 'down' ? ( - + - + Warning - + this.props.copyToClipBoard(item.downReason)} + color='primary' + iconType='questionInCircle' + aria-label='Info about the error' + onClick={() => + this.props.copyToClipBoard(item.downReason) + } /> ) : ( - + - + Offline - + this.props.copyToClipBoard(item.downReason)} + color='primary' + iconType='questionInCircle' + aria-label='Info about the error' + onClick={() => + this.props.copyToClipBoard(item.downReason) + } /> @@ -318,7 +342,7 @@ export const ApiTable = compose( } else { return ( - +   Checking ); @@ -336,41 +360,70 @@ 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 ( - + - - {getContent()} + + {content} + {!item ? ( + + + Click Check updates button to get information +

+ } + > + +
+
+ ) : null} {item === 'availableUpdates' ? ( - View available updates

}> + View available updates

} + > this.setState({ apiAvailableUpdateDetails: api })} + aria-label='Availabe updates' + iconType='eye' + onClick={() => + this.setState({ apiAvailableUpdateDetails: api }) + } />
) : null} {item === 'error' && api.error?.detail ? ( - + this.props.copyToClipBoard(api.error.detail)} + color='primary' + iconType='questionInCircle' + aria-label='Info about the error' + onClick={() => + this.props.copyToClipBoard(api.error.detail) + } /> @@ -380,7 +433,7 @@ export const ApiTable = compose( } else { return ( - +   Checking ); @@ -393,20 +446,20 @@ export const ApiTable = compose( align: 'center', sortable: true, width: '80px', - render: (value) => { + render: value => { return value === API_USER_STATUS_RUN_AS.ENABLED ? ( - + ) : value === API_USER_STATUS_RUN_AS.USER_NOT_ALLOWED ? ( - + ) : ( '' @@ -415,15 +468,19 @@ export const ApiTable = compose( }, { name: 'Actions', - render: (item) => ( + render: item => ( Set as default

}} - iconType={item.id === this.props.currentDefault ? 'starFilled' : 'starEmpty'} - aria-label="Set as default" + iconType={ + item.id === this.props.currentDefault + ? 'starFilled' + : 'starEmpty' + } + aria-label='Set as default' onClick={async () => { const currentDefault = await this.props.setDefault(item); this.setState({ @@ -433,12 +490,12 @@ export const ApiTable = compose( />
- Check connection

}> + Check connection

}> await this.checkApi(item)} - color="success" + color='success' />
@@ -456,8 +513,8 @@ export const ApiTable = compose( return ( - - + + @@ -469,8 +526,8 @@ export const ApiTable = compose( this.props.showAddApi()} > @@ -478,26 +535,33 @@ export const ApiTable = compose( - await this.refresh()}> + await this.refresh()} + > Refresh await this.getApisAvailableUpdates(true)} > Check updates{' '} - + @@ -508,32 +572,34 @@ export const ApiTable = compose( - - From here you can manage and configure the API entries. You can also check their - connection and status. + + From here you can manage and configure the API entries. You + can also check their connection and status. this.setState({ apiAvailableUpdateDetails: undefined })} + onClose={() => + this.setState({ apiAvailableUpdateDetails: undefined }) + } /> ); } - } + }, ); ApiTable.propTypes = { From db97880528fc0d5096d376f196025ea036fa650a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar=20Biset?= <43619595+jbiset@users.noreply.github.com> Date: Wed, 3 Jan 2024 15:22:20 -0300 Subject: [PATCH 7/7] Remove Inventory table from vulnerability dashboard tab and change filter titles (#6260) * Remove Inventory table from vulnerability dashboard tab and change filter titles * Change KPIs and filters titles * Change title of Most vulnerable endpoints visualization --- .../dashboards/overview/dashboard_panels.ts | 162 +----------------- .../overview/dashboard_panels_filters.ts | 12 +- .../overview/dashboard_panels_kpis.ts | 8 +- 3 files changed, 11 insertions(+), 171 deletions(-) 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', }, ], },