OVAL service templates should check if service is running/not running#2433
Merged
yuumasato merged 1 commit intoComplianceAsCode:masterfrom Oct 31, 2017
Merged
Conversation
0dc643c to
7ea14eb
Compare
yuumasato
requested changes
Oct 31, 2017
Member
yuumasato
left a comment
There was a problem hiding this comment.
Added tests for service_disabled and service_enabled that helped find some issues.
| <linux:dependency entity_check="at least one">%SERVICENAME%.socket</linux:dependency> | ||
| </linux:systemdunitdependency_state> | ||
|
|
||
| <linux:systemdunitproperty_test id="test_service_running_%SERVICENAME%" check="all" check_existence="at_least_one_exists" comment="Test that the %SERVICENAME% service is running" version="1"> |
Member
There was a problem hiding this comment.
All test_service_running_ should have check="at least one". It is enough that either service or socket is in active state.
| <linux:dependency entity_check="none satisfy">%SERVICENAME%.socket</linux:dependency> | ||
| </linux:systemdunitdependency_state> | ||
|
|
||
| <linux:systemdunitproperty_test id="test_service_not_running_%SERVICENAME%" check="all" check_existence="at_least_one_exists" comment="Test that the %SERVICENAME% service is not running" version="1"> |
Member
There was a problem hiding this comment.
All test_service_not_running_ should have `check_existence="any_exist", as it should be ok to not find the unit.
Member
|
@redhatrises Is the reference to the issue in "Fixes" list correct? I don't understand the relationship. |
19d22d0 to
dd020c0
Compare
Contributor
Author
Thanks @yuumasato. The reference to the issue was a typo. |
yuumasato
approved these changes
Oct 31, 2017
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:
Rationale:
Current OVAL 5.11 service templates only check if a service is enabled/disabled but not if it is running/not running.
Fixes DISA: service_firewalld_enabled does not check if service is enabled #2065