8000 OPENSCAP-5471 Enhance systemd_dropin_configuration template by vojtapolasek · Pull Request #13208 · ComplianceAsCode/content · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

OPENSCAP-5471 Enhance systemd_dropin_configuration template #13208

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

Merged
merged 10 commits into from
Mar 25, 2025

Conversation

vojtapolasek
Copy link
Collaborator

Description:

  • add more parameters to the template for better flexibility, see the commit updating the template documentation
  • repair especially the OVAL criteria part of the oval_check_dropin_files macro because it failed to cover some scenarios
  • fix regex in the oval_line_in_file_object macro which captured too much content including lines following the current one and this is not desired
  • enhance the systemd_dropin_configuration template to be able to use XCCDF variable during remediation. It could be added for OVAL later, but currently it is not needed.
  • add more test scenarios to the networkmanager_dns_mode rule to cover various cases described in an external issue

Rationale:

Review Hints:

  • run tests for rules using the systemd_dropin_configuration template
  • also it might be worth running few profiles with large amount of rules through Automatus in profile mode because one commit touches a regex in a macro which is heavily used in rules checking for configuration in files. In particular oval_line_in_file_object macro.

@vojtapolasek vojtapolasek added bugfix Fixes to reported bugs. Ansible Ansible remediation update. OVAL OVAL update. Related to the systems assessments. Bash Bash remediation update. Update Rule Issues or pull requests related to Rules updates. Update Template Issues or pull requests related to Templates updates. labels Mar 20, 2025
@vojtapolasek vojtapolasek added this to the 0.1.77 milestone Mar 20, 2025
Copy link
github-actions bot commented Mar 20, 2025

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
OVAL for rule 'xccdf_org.ssgproject.content_rule_journald_compress' differs.
--- oval:ssg-journald_compress:def:1
+++ oval:ssg-journald_compress:def:1
@@ -1,3 +1,3 @@
 criteria OR
 criterion oval:ssg-test_journald_compress:tst:1
-criterion oval:ssg-test_journald_compress_dropin_file:tst:1
+criterion oval:ssg-test_journald_compress_config_dir:tst:1

OVAL for rule 'xccdf_org.ssgproject.content_rule_journald_forward_to_syslog' differs.
--- oval:ssg-journald_forward_to_syslog:def:1
+++ oval:ssg-journald_forward_to_syslog:def:1
@@ -1,3 +1,3 @@
 criteria OR
 criterion oval:ssg-test_journald_forward_to_syslog:tst:1
-criterion oval:ssg-test_journald_forward_to_syslog_dropin_file:tst:1
+criterion oval:ssg-test_journald_forward_to_syslog_config_dir:tst:1

OVAL for rule 'xccdf_org.ssgproject.content_rule_journald_storage' differs.
--- oval:ssg-journald_storage:def:1
+++ oval:ssg-journald_storage:def:1
@@ -1,3 +1,3 @@
 criteria OR
 criterion oval:ssg-test_journald_storage:tst:1
-criterion oval:ssg-test_journald_storage_dropin_file:tst:1
+criterion oval:ssg-test_journald_storage_config_dir:tst:1

Copy link

Change in Ansible shell module found.

Please consider using more suitable Ansible module than shell if possible.

@Mab879 Mab879 self-assigned this Mar 21, 2025
@@ -27,6 +27,7 @@ template:
param: ForwardToSyslog
value: no
no_quotes: 'true'
missing_config_file_fail: "false"
Copy link
Member

Choose a reason for hiding this comment

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

Mixing single and double quotes

@@ -54,6 +54,7 @@ template:
param: ForwardToSyslog
value: yes
no_quotes: 'true'
missing_config_file_fail: "false"
Copy link
Member

Choose a reason for hiding this comment

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

Mixing single and double quotes

@@ -54,6 +54,7 @@ template:
param: Storage
value: persistent
no_quotes: 'true'
missing_config_file_fail: "false"
Copy link
Member

Choose a reason for hiding this comment

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

Mixing single and double quotes

@@ -54,6 +54,7 @@ template:
param: Compress
value: yes
no_quotes: 'true'
missing_config_file_fail: "false"
Copy link
Member

Choose a reason for hiding this comment

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

Mixing single and double quotes

@vojtapolasek
Copy link
Collaborator Author

Thank you @Mab879 I fixed it by a fixup to 2202431

Copy link
codeclimate bot commented Mar 24, 2025

Code Climate has analyzed commit 28398e4 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 61.9% (0.0% change).

View more on Code Climate.

@Mab879
Copy link
Member
Mab879 commented Mar 25, 2025

Automatus tests pass locally.

@Mab879 Mab879 merged commit d74d41a into ComplianceAsCode:master Mar 25, 2025
108 of 110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ansible Ansible remediation update. Bash Bash remediation update. bugfix Fixes to reported bugs. OVAL OVAL update. Related to the systems assessments. Update Rule Issues or pull requests related to Rules updates. Update Template Issues or pull requests related to Templates updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0