CMP-3618 added chrony-wait fix#14649
CMP-3618 added chrony-wait fix#14649vickeybrown wants to merge 1 commit intoComplianceAsCode:masterfrom
Conversation
|
Hi @vickeybrown. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
Mab879
left a comment
There was a problem hiding this comment.
Thanks for the PR.
- I would suggest putting this fix into a new rules
| {{{ ansible_set_config_file(file=chrony_conf_path, parameter='bindcmdaddress', separator=' ', value='/run/chrony/chronyd.sock', create='yes', rule_title=rule_title) }}} | ||
|
|
||
| # Fix chrony-wait.service to use Unix socket instead of network socket | ||
| - name: Check if chrony-wait.service exists |
There was a problem hiding this comment.
| - name: Check if chrony-wait.service exists | |
| - name: "{{{ rule_title }} - Check if chrony-wait.service exists" |
| path: /usr/lib/systemd/system/chrony-wait.service | ||
| register: chrony_wait_service | ||
|
|
||
| - name: Replace chrony-wait.service to use Unix socket (KCS 7064388) |
There was a problem hiding this comment.
| - name: Replace chrony-wait.service to use Unix socket (KCS 7064388) | |
| - name: {{{ rule_title }}} - Replace chrony-wait.service to use Unix socket (KCS 7064388) |
|
I broke the change into its own rule, and added it to the profiles that currently have the "chronyd_no_chronyc_network" rule since that was what was causing the issue - not sure if that's the move or not so let me know if it needs adjustment |
Mab879
left a comment
There was a problem hiding this comment.
The CI fails are valid, please take a look.
Also, please organize commits before we merge this.
|
/ok-to-test |
9d67a7e to
e3becf9
Compare
e3becf9 to
091a18a
Compare
091a18a to
a43d97c
Compare
|
Looks like there still one merge conflict. |
a43d97c to
22f97a2
Compare
Mab879
left a comment
There was a problem hiding this comment.
$ ./automatus.py rule --datastream ../build/ssg-rhel9-ds.xml [VM NAME] chronyd_configure_local_socket
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/mburket/Developer/github.com/ComplianceAsCode/content/tests/logs/rule-custom-2026-04-21-1230/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_chronyd_configure_local_socket
INFO - Script cmdport_zero.fail.sh using profile (all) OK
INFO - Script missing_marker.fail.sh using profile (all) OK
INFO - Script not_installed.pass.sh using profile (all) OK
ERROR - Rule 'chronyd_configure_local_socket' test setup script 'service_fixed.pass.sh' failed with exit code 2
ERROR - Environment failed to prepare, skipping test
I think the main issue is the leading indent in service_fixed.pass.sh.
|
|
||
| <ind:textfilecontent54_object id="obj_chrony_wait_service_description" version="1"> | ||
| <ind:filepath>/etc/systemd/system/chrony-wait.service</ind:filepath> | ||
| <ind:pattern operation="pattern match">^Description=.*KCS 7064388.*$</ind:pattern> |
There was a problem hiding this comment.
It might be better to check the ExecStart for the correct flags.
1982e83 to
ebbb2d8
Compare
|
@vickeybrown: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
adjustment moved change into its own rule added rule title to ansible file added rule to components removed bindcmdaddress
ebbb2d8 to
3c7772d
Compare
Description:
Fixed chrony-wait.service timeout failures when "cmdport 0" is configured by the "chronyd_no_chronyc_network" rule. The default chrony-wait.service uses
-h 127.0.0.1,::1which forces network connection to chronyd's command port, but the STIG-requiredcmdport 0setting disables network access. This causes chrony-wait.service to timeout and fail, preventing time-sync.target from being reached.The fix replaces the entire chrony-wait.service unit file to:
-hflag so chronyc uses the Unix socket at/run/chrony/chronyd.sockPrivateUsers=yesand other sandboxing restrictions that block Unix socket accessRationale:
The "chronyd_no_chronyc_network" rule implements STIG requirements by setting "cmdport 0" to disable network access to chronyd's command port, while enabling local access via
bindcmdaddress/run/chrony/chronyd.sock. However, chrony-wait.service bypasses the Unix socket by hard-coding network addresses, causing it to fail when cmdport is disabled. This breaks time synchronization verification on RHCOS nodes and can cause compliance remediation failures in OpenShift environments.Review Hints:
Testing on OpenShift/RHCOS: