Skip to content

Commit

Permalink
Added default values for needed tags of ossec.conf (#1894)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Navarro authored and chemamartinez committed Nov 19, 2018
1 parent f7a02af commit e126433
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file.

### Changed

- Add default values to global options to let the manager start. ([#1894](https://github.com/wazuh/wazuh/pull/1894))

### Fixed

- Fix to overwrite FIM configuration when directories come in the same tag separated by commas. ([#1886](https://github.com/wazuh/wazuh/pull/1886))
Expand Down
2 changes: 1 addition & 1 deletion src/analysisd/config.c
Expand Up @@ -51,7 +51,7 @@ int GlobalConf(const char *cfgfile)
Config.zeromq_output_uri = NULL;
Config.zeromq_output_server_cert = NULL;
Config.zeromq_output_client_cert = NULL;
Config.jsonout_output = 0;
Config.jsonout_output = 1;
Config.alerts_log = 1;
Config.memorysize = 8192;
Config.mailnotify = -1;
Expand Down
21 changes: 0 additions & 21 deletions src/config/global-config.c
Expand Up @@ -161,15 +161,6 @@ int Read_Global(XML_NODE node, void *configp, void *mailp)
const char *xml_mailmaxperhour = "email_maxperhour";
const char * xml_queue_size = "queue_size";

/* Needed tags */
static char tags_present[MAX_NEEDED_TAGS] = {0};
char tag_list[MAX_NEEDED_TAGS][25] = {
"<jsonout_output>",
"<alerts_log>",
"<logall>",
"<logall_json>"
};

#ifdef LIBGEOIP_ENABLED
const char *xml_geoip_db_path = "geoip_db_path";
const char *xml_geoip6_db_path = "geoip6_db_path";
Expand Down Expand Up @@ -310,7 +301,6 @@ int Read_Global(XML_NODE node, void *configp, void *mailp)
}
/* jsonout output */
else if (strcmp(node[i]->element, xml_jsonout_output) == 0) {
tags_present[JSONOUT_OUTPUT] = 1;
if (strcmp(node[i]->content, "yes") == 0) {
if (Config) {
Config->jsonout_output = 1;
Expand All @@ -326,7 +316,6 @@ int Read_Global(XML_NODE node, void *configp, void *mailp)
}
/* Standard alerts output */
else if (strcmp(node[i]->element, xml_alerts_log) == 0) {
tags_present[ALERTS_LOG] = 1;
if (strcmp(node[i]->content, "yes") == 0) {
if (Config) {
Config->alerts_log = 1;
Expand All @@ -342,7 +331,6 @@ int Read_Global(XML_NODE node, void *configp, void *mailp)
}
/* Log all */
else if (strcmp(node[i]->element, xml_logall) == 0) {
tags_present[LOGALL] = 1;
if (strcmp(node[i]->content, "yes") == 0) {
if (Config) {
Config->logall = 1;
Expand All @@ -358,7 +346,6 @@ int Read_Global(XML_NODE node, void *configp, void *mailp)
}
/* Log all JSON*/
else if (strcmp(node[i]->element, xml_logall_json) == 0) {
tags_present[LOGALL_JSON] = 1;
if (strcmp(node[i]->content, "yes") == 0) {
if (Config) {
Config->logall_json = 1;
Expand Down Expand Up @@ -669,14 +656,6 @@ int Read_Global(XML_NODE node, void *configp, void *mailp)
i++;
}

/* Check if mandatory tags are present */
int k;
for(k = 0; k < MAX_NEEDED_TAGS;k++){
if(tags_present[k] == 0) {
merror_exit("Label %s not defined",tag_list[k]);
}
}

return (0);
}

Expand Down

0 comments on commit e126433

Please sign in to comment.