CIS-CAT: Support full and relative paths in configuration#419
Merged
Conversation
vikman90
requested changes
Mar 1, 2018
src/wazuh_modules/wm_ciscat.c
Outdated
| case 1: | ||
| // Relative path | ||
| #ifdef WIN32 | ||
| if (current) |
Member
There was a problem hiding this comment.
current will always be a valid pointer, but it may be empty.
Should be if (*current) {}
Missing else part.
If current is empty, cis_path may not be initialized and copy trash data.
I think we may use a relative path if we can't get the current directory:
else {
strncpy(cis_path, ciscat->ciscat_path, OS_MAXSTR - 1);
cis_path[OS_MAXSTR - 1] = '\0;
}
src/wazuh_modules/wm_ciscat.c
Outdated
| break; | ||
| case 1: | ||
| #ifdef WIN32 | ||
| if (current) |
Member
There was a problem hiding this comment.
Missing else part (same as line 136)
src/wazuh_modules/wm_ciscat.c
Outdated
| } else { | ||
| #ifdef WIN32 | ||
| snprintf(cis_path, OS_MAXSTR - 1, "%s", WM_CISCAT_DEFAULT_DIR_WIN); | ||
| if (current) |
src/wazuh_modules/wm_ciscat.c
Outdated
| mterror(WM_CISCAT_LOGTAG, "Couldn't find benchmark path. Skipping..."); | ||
| } | ||
|
|
||
| os_strdup(bench_fullpath, eval->path); |
Member
There was a problem hiding this comment.
May duplicate trash data (very long string) if the path is empty: wm_relative_path would return -1 and bench_fullpath won't be initialized.
Consider null the string after mterror() and/or leave eval->path as NULL.
vikman90
approved these changes
Mar 2, 2018
6f8d338 to
d7a2c14
Compare
d7a2c14 to
6f8d338
Compare
6f8d338 to
c8ad8c2
Compare
Darioortegaleyva
pushed a commit
that referenced
this pull request
Feb 6, 2026
#419) Add script to add new compliance standards to SCA checks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added the possibility of defining the configurable paths of the CIS-CAT wodle configuration in two different ways:
For Windows systems, it is also possible to set the location in shared folders as follows:
Both ways allow the wodle to validate the input paths.
If a relative path is specified for the benchmark file, it will be relative to the location of the CIS-CAT scripts. On the other hand, when setting a relative path for Java or CIS-CAT location, it is relative to the Installation directory.
The three modified paths have been tested on Linux (Ubuntu 16.04) and Windows 7 for the following cases:
Always with the desired behavior.