Add new version of systemd parameter checks#1219
Open
robertwoj-microsoft wants to merge 2 commits intodevfrom
Open
Add new version of systemd parameter checks#1219robertwoj-microsoft wants to merge 2 commits intodevfrom
robertwoj-microsoft wants to merge 2 commits intodevfrom
Conversation
- CIS has reworked the way they match parameter values from regular expressions to matching on section, key and value with few operators
Test Results 21 files - 43 1 281 suites +1 217 33m 55s ⏱️ - 24m 24s Results for commit 2989a89. ± Comparison against base commit 167271a. This pull request removes 8 and adds 1018 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
kkanas
reviewed
Nov 26, 2025
src/modules/complianceengine/src/lib/procedures/EnsureSystemdParameter.cpp
Show resolved
Hide resolved
kkanas
approved these changes
Nov 26, 2025
AhmedBM
reviewed
Dec 2, 2025
| auto result = SystemdCatConfig(filename, context); | ||
| if (!result.HasValue()) | ||
| { | ||
| OsConfigLogError(context.GetLogHandle(), "Failed to execute systemd-analyze command: %s", result.Error().message.c_str()); |
Contributor
There was a problem hiding this comment.
OSConfigTelemetryStatusTrace as well?
AhmedBM
approved these changes
Dec 2, 2025
kkanas
approved these changes
Jan 14, 2026
| namespace | ||
| { | ||
| auto result = context.ExecuteCommand("systemd-analyze cat-config " + filename); | ||
| Result<std::string> DetermineCommandPath(const std::string& command, const ContextInterface& context) |
Contributor
There was a problem hiding this comment.
Can we make it more generic by passing const std::vectorstd::string paths, etc ... ?
| const auto filename = mContext.MakeTempfile(""); | ||
| const std::string systemdOutput = | ||
| "# /etc/systemd/test.conf\n" | ||
| "[foo]\n" |
Contributor
There was a problem hiding this comment.
Pleas add test for
[broken_section
and
[] # invalid no name section
and lastly
[space_idented_section_that_we_do_not_support]
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.
Description
Add new version of systemd parameter checks
Checklist
devbranch prior to this PR submission.devbranch.