mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 00:55:06 -05:00
cmdmon: make open commands configurable
Replace the hardcoded list of open commands (accessible over UDP), with a list that can be configured with a new "opencommands" directive. The default matches the original list. All read-only commands except accheck and cmdaccheck can be enabled. The naming follows the chronyc naming. Enable the N_SOURCES request only when needed. This makes it possible to have a full monitoring access without access to the Unix domain socket. It also allows restricting the monitoring access to a smaller number of commands if some commands from the default list are not needed. Mention in the man page that the protocol of the non-default commands is not consider stable and the information they provide may have security implications.
This commit is contained in:
@@ -195,6 +195,33 @@ do
|
||||
check_chronyc_output "501 Not authorised$" || test_fail
|
||||
done
|
||||
|
||||
for chronyc_conf in \
|
||||
"activity" \
|
||||
"authdata" \
|
||||
"clients" \
|
||||
"manual list" \
|
||||
"ntpdata" \
|
||||
"rtcdata" \
|
||||
"selectdata" \
|
||||
"serverstats" \
|
||||
"smoothing" \
|
||||
"sourcename 192.168.123.1" \
|
||||
"sources" \
|
||||
"sourcestats" \
|
||||
"tracking"
|
||||
do
|
||||
server_conf="opencommands ${chronyc_conf% *}"
|
||||
run_test || test_fail
|
||||
check_chronyd_exit || test_fail
|
||||
check_chronyc_output "501 Not authorised$" && test_fail
|
||||
|
||||
server_conf="opencommands"
|
||||
run_test || test_fail
|
||||
check_chronyd_exit || test_fail
|
||||
check_chronyc_output "501 Not authorised$" || test_fail
|
||||
done
|
||||
|
||||
server_conf="server 192.168.123.1"
|
||||
cmdmon_unix=1
|
||||
|
||||
chronyc_conf="
|
||||
|
||||
Reference in New Issue
Block a user