Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wazuh.yml link and in-file documentation #4378

Merged
merged 5 commits into from Aug 8, 2022

Conversation

AlexRuiz7
Copy link
Member

Summary

This PR solves the issue noted in the issue #4349 (comment).

Result

---
#
# Wazuh app - App configuration file
# Copyright (C) 2015-2022 Wazuh, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Find more information about this on the LICENSE file.
#
# ======================== Wazuh app configuration file ========================
#
# Please check the documentation for more information about configuration options:
# https://documentation.wazuh.com/4.3/user-manual/wazuh-dashboard/config-file.html
#
# Also, you can check our repository:
# https://github.com/wazuh/wazuh-kibana-app
#
# ---------------------------- Unauthorized roles ------------------------------
#
# Disable Wazuh for the Elasticsearch / OpenSearch roles defined here.
# disabled_roles:
#   - wazuh_disabled
#
# ------------------------------- Index patterns -------------------------------
#
# Default index pattern to use on the app. If there's no valid index pattern, the
# app will automatically create one with the name indicated in this option.
# pattern: wazuh-alerts-*
#
# ----------------------------------- Checks -----------------------------------
#
# Define which checks will be executed by the App's HealthCheck.
# Allowed values are: true, false
#
# Enable or disable the index pattern health check when opening the app.
# checks.pattern: true
#
# Enable or disable the template health check when opening the app.
# checks.template: true
#
# Enable or disable the API health check when opening the app.
# checks.api: true
#
# Enable or disable the setup health check when opening the app.
# checks.setup: true
#
# Enable or disable the known fields health check when opening the app.
# checks.fields: true
#
# Change the default value of the Kibana metaField configuration
# checks.metaFields: true
#
# Change the default value of the Kibana timeFilter configuration
# checks.timeFilter: true
#
# Change the default value of the Kibana max buckets configuration
# checks.maxBuckets: true
#
# --------------------------------- Extensions ---------------------------------
#
# Define the initial state of the extensions (enabled / disabled) for recently
# added hosts. The extensions can be enabled or disabled anytime using the UI.
# Allowed values are: true, false
#
# Enable or disable the PCI DSS tab on Overview and Agents.
# extensions.pci: true
#
# Enable or disable the GDPR tab on Overview and Agents.
# extensions.gdpr: true
#
# Enable or disable the HIPAA tab on Overview and Agents.
# extensions.hipaa: true
#
# Enable or disable the NIST 800-53 tab on Overview and Agents.
# extensions.nist: true
#
# Enable or disable the TSC tab on Overview and Agents.
# extensions.tsc: true
#
# Enable or disable the Audit tab on Overview and Agents.
# extensions.audit: true
#
# Enable or disable the Open SCAP tab on Overview and Agents.
# extensions.oscap: false
#
# Enable or disable the CIS-CAT tab on Overview and Agents.
# extensions.ciscat: false
#
# Enable or disable the Amazon (AWS) tab on Overview.
# extensions.aws: false
#
# Enable or disable the Google Cloud Platform tab on Overview.
# extensions.gcp: false
#
# Enable or disable the VirusTotal tab on Overview and Agents.
# extensions.virustotal: false
#
# Enable or disable the Osquery tab on Overview and Agents.
# extensions.osquery: false
#
# Enable or disable the Docker listener tab on Overview and Agents.
# extensions.docker: false
#
# ------------------------------- Timeout --------------------------------------
#
# Maximum time, in milliseconds, the app will wait for an API response when making
# requests to it. It will be ignored if the value is set under 1500 milliseconds.
# timeout: 20000
#
# --------------------------- Index pattern selector ---------------------------
#
# Define if the user is allowed to change the selected index pattern directly from
# the top menu bar.
# ip.selector: true
#
# Disable certain index pattern names from being available in index pattern
# selector from the Wazuh app.
# ip.ignore: 
#
# ------------------------------ Monitoring ------------------------------------
#
# Enable or disable the wazuh-monitoring index creation and/or visualization.
# wazuh.monitoring.enabled: true
#
# Frequency, in seconds, of API requests to get the state of the agents and create
# a new document in the wazuh-monitoring index with this data.
# wazuh.monitoring.frequency: 900
#
# Define the number of shards to use for the wazuh-monitoring-* indices.
# wazuh.monitoring.shards: 1
#
# Define the number of replicas to use for the wazuh-monitoring-* indices.
# wazuh.monitoring.replicas: 0
#
# Define the interval in which a new wazuh-monitoring index will be created.
# Allowed values are: h (hourly), d (daily), w (weekly), m (monthly)
# wazuh.monitoring.creation: w
#
# Default index pattern to use for Wazuh monitoring.
# wazuh.monitoring.pattern: wazuh-monitoring-*
#
# --------------------------------- Sample data --------------------------------
#
# Define the index name prefix of sample alerts. It must match the template used
# by the index pattern to avoid unknown fields in dashboards.
# alerts.sample.prefix: wazuh-alerts-4.x-
#
# ------------------------------ Background tasks ------------------------------
#
# Define the index prefix of predefined jobs.
# cron.prefix: wazuh
#
# ------------------------------ Wazuh Statistics ------------------------------
#
# Enable or disable the statistics tasks.
# cron.statistics.status: true
#
# Enter the ID of the hosts you want to save data from, leave this empty to run
# the task on every host.
# cron.statistics.apis: 
#
# Define the frequency of task execution using cron schedule expressions.
# cron.statistics.interval: 0 */5 * * * *
#
# Define the name of the index in which the documents will be saved.
# cron.statistics.index.name: statistics
#
# Define the interval in which a new index will be created.
# cron.statistics.index.creation: w
#
# Define the number of shards to use for the statistics indices.
# cron.statistics.shards: 1
#
# Define the number of replicas to use for the statistics indices.
# cron.statistics.replicas: 0
#
# ------------------------------ Logo customization ----------------------------
#
# Set the name of the app logo stored at /plugins/wazuh/public/assets/
# customization.logo.app: 
#
# Set the name of the sidebar logo stored at /plugins/wazuh/public/assets/
# customization.logo.sidebar: 
#
# Set the name of the health-check logo stored at /plugins/wazuh/public/assets/
# customization.logo.healthcheck: 
#
# Set the name of the reports logo (.png) stored at /plugins/wazuh/public/assets/
# customization.logo.reports: 
#
# ---------------------------- Hide manager alerts -----------------------------
#
# Hide the alerts of the manager in every dashboard.
# hideManagerAlerts: false
#
# ------------------------------- App logging level ----------------------------
#
# Logging level of the App.
# Allowed values are: info, debug
# logs.level: info
#
# ------------------------------- Agent enrollment -----------------------------
#
# Specifies the Wazuh registration server, used for the agent enrollment.
# enrollment.dns: 
#
# Specifies the password used to authenticate during the agent enrollment.
# enrollment.password: 
#
#-------------------------------- Wazuh hosts ----------------------------------
#
# The following configuration is the default structure to define a host.
#
# hosts:
# # Host ID / name,
#   - env-1:
#     # Host URL
#     url: https://env-1.example
#     # Host / API port
#     port: 55000
#     # Host / API username
#     username: wazuh-wui
#     # Host / API password
#     password: wazuh-wui
#     # Use RBAC or not. If set to true, the username must be "wazuh-wui".
#     run_as: true
#   - env-2:
#     url: https://env-2.example
#     port: 55000
#     username: wazuh-wui
#     password: wazuh-wui
#     run_as: true

hosts:
  - default:
    url: https://localhost
    port: 55000
    username: wazuh-wui
    password: wazuh-wui
    run_as: false

Test

Remove unused settings. Centralize documentation. Add missing settings. Programatic file generation.
@AlexRuiz7 AlexRuiz7 self-assigned this Aug 4, 2022
This was linked to issues Aug 4, 2022
@AlexRuiz7 AlexRuiz7 mentioned this pull request Aug 4, 2022
6 tasks
Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: the object that contains the default configuration could be muted, so changes in the configuration could do the plugin behaves as not expected ways.

The defaultConfig variable should be a new object, so the changes in its properties doesn't affect to the object that contains the default configuration WAZUH_DEFATUL_APP_CONFIG.

For this case, taking into account that the properties are in the first level, we could use the spread operator to "copy" the properties.

const defaultConfig = { ...WAZUH_DEFATUL_APP_CONFIG };

@AlexRuiz7
Copy link
Member Author

AlexRuiz7 commented Aug 8, 2022

#4378 (review)

Solved in 4bb0519

@Machi3mfl Machi3mfl self-requested a review August 8, 2022 12:25
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2022

Jest Test Coverage % values
Statements 6.89% ( 2513 / 36466 )
Branches 2.72% ( 769 / 28222 )
Functions 4.6% ( 410 / 8916 )
Lines 6.97% ( 2432 / 34890 )

Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review
Code review ✔️
Test ✔️

Copy link
Member

@Machi3mfl Machi3mfl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR ✅
Test ✅

@AlexRuiz7 AlexRuiz7 merged commit 1d44109 into 4.3-7.10 Aug 8, 2022
@AlexRuiz7 AlexRuiz7 deleted the enhancement/4349-wazuh.yml branch August 8, 2022 13:31
github-actions bot pushed a commit that referenced this pull request Aug 8, 2022
* Review Wazuh.yml documentation

Remove unused settings. Centralize documentation. Add missing settings. Programatic file generation.

* Add Changelog

* Fix indentation for hosts in the wazuh.yml

Also fixes some TS warnings

* Deep copy the WAZUH_DEFAULT_APP_CONFIG object

(cherry picked from commit 1d44109)
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2022

The backport to 4.3-1.2-wzd failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.3-1.2-wzd 4.3-1.2-wzd
# Navigate to the new working tree
cd .worktrees/backport-4.3-1.2-wzd
# Create a new branch
git switch --create backport-4378-to-4.3-1.2-wzd
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 1d441096398ed5e34e98048077520c78687788c0
# Push it to GitHub
git push --set-upstream origin backport-4378-to-4.3-1.2-wzd
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.3-1.2-wzd

Then, create a pull request where the base branch is 4.3-1.2-wzd and the compare/head branch is backport-4378-to-4.3-1.2-wzd.

AlexRuiz7 added a commit that referenced this pull request Aug 8, 2022
Fix wazuh.yml link and in-file documentation (#4378)

* Review Wazuh.yml documentation

Remove unused settings. Centralize documentation. Add missing settings. Programatic file generation.

* Add Changelog

* Fix indentation for hosts in the wazuh.yml

Also fixes some TS warnings

* Deep copy the WAZUH_DEFAULT_APP_CONFIG object

(cherry picked from commit 1d44109)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
AlexRuiz7 added a commit that referenced this pull request Aug 8, 2022
* Review Wazuh.yml documentation

Remove unused settings. Centralize documentation. Add missing settings. Programatic file generation.

* Add Changelog

* Fix indentation for hosts in the wazuh.yml

Also fixes some TS warnings

* Deep copy the WAZUH_DEFAULT_APP_CONFIG object

(cherry picked from commit 1d44109)
AlexRuiz7 added a commit that referenced this pull request Aug 8, 2022
* Review Wazuh.yml documentation

Remove unused settings. Centralize documentation. Add missing settings. Programatic file generation.

* Add Changelog

* Fix indentation for hosts in the wazuh.yml

Also fixes some TS warnings

* Deep copy the WAZUH_DEFAULT_APP_CONFIG object

(cherry picked from commit 1d44109)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove unused app settings wazuh.yml in-file documentation
3 participants