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

Design and development of the configuration parser module for the new agent #26

Open
TomasTurina opened this issue Jul 2, 2024 · 1 comment
Assignees
Labels
level/subtask Subtask issue module/agent phase/mvp Minimum Viable Product type/enhancement Enhancement issue

Comments

@TomasTurina
Copy link
Member

Description

As part of the development of the new agent MVP, it is necessary to develop a new configuration parser module.

Take into account the following:

  • Configuration will be in TOML format.
    • The name of the configuration file will be wazuh.conf.
  • Avoid to create a new library for this.
    • Select and use a common and maintained library, mention the advantages and disadvantages of its use.
  • This module should be able to parse and save the configuration in memory.
    • Consider STL containers to do this.
  • This module should be able to distribute all configuration to all modules.
    • Each module will be in charge of reading and applying its particular configuration.
@Nicogp
Copy link
Member

Nicogp commented Jul 3, 2024

Libraries investigation

The official TOML Wiki lists three C++ libraries:

toml11

Documentation
Recent activity in the repository.
Licence: MIT
Standar: C++11/14/17/20
Features:

  • It complies with the latest TOML language specification.
  • It supports new features merged into the upcoming TOML version (v1.1.0).
  • It provides clear error messages, including the location of the error.
  • It parses and retains comments, associating them with corresponding values.
  • It provides exception-less parse function.
  • It supports complex type conversions from TOML values.
  • It allows customization of the types stored in toml::value.

tomlcpp

Documentation (Only a Readme)
Last update: two years ago.
Licence: MIT
Standar: This is a C++ wrapper around the C library available here: https://github.com/cktan/tomlc99.
Features:

  • Compatible with TOML v1.0.0.

  • Does not throw C++ exceptions.

  • Provides very simple and intuitive interface.

toml++

Documentation
Last update: 4 months ago.
Licence: MIT
Standar: C++17 (plus some C++20 features where available, e.g. experimental support for [char8_t]
Features:

  • Header-only (optional!)
  • Supports the latest TOML release (v1.0.0), plus optional support for some unreleased TOML features
  • Supports serializing to JSON and YAML
  • Proper UTF-8 handling (incl. BOM)
  • C++17 (plus some C++20 features where available, e.g. experimental support for char8_t strings)
  • Doesn't require RTTI
  • Works with or without exceptions
  • Tested on x64, x86 and ARM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/subtask Subtask issue module/agent phase/mvp Minimum Viable Product type/enhancement Enhancement issue
Projects
Status: In progress
Development

No branches or pull requests

2 participants