<div dir="ltr"><div><span style="font-size:12.8px">Hi Yugo</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">As you mentioned in your watchdog code review comments that there should be a mechanism to authenticate the watchdog IPC commands, Although this was also one of the TODO items in my list but somehow slipped out of radar.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">So please find the attached patch for the purpose.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Basically the patch utilizes the <i>wd_authkey</i> configuration parameter to authenticate the watchdog IPC command clients. And since the IPC is meant for communication between internal pgpool-II processes and with external processes on the same machine, so instead of calculating the hash and inventing a more complicated process of IPC authentication, the simple wd_authkey matching is used to validate the clients. And when the wd_authkey is not provided by the user in pgpool.conf than the authentication is disabled.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">The patch also takes care of other authentication related problem in the watchdog IPC system. Since there are some watchdog functions visible by the IPC commands, and we want to restrict their access to the outer world. Like for example the interlocking command functions and failover related functions. So for those functions, the patch creates a shared key in the shared memory, and execution of these functions is only allowed if that shard key in that function data matches with the current shred key in shared memory. And when some external client tries to call these internal only functions, the authentication error will be returned to that since the key is secret to the pgpool-II only.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">So what are your thoughts on the mechanism and using the </span><i style="font-size:12.8px">wd_authkey</i><span style="font-size:12.8px"> for the purpose.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thanks</span></div><div><span style="font-size:12.8px">Best regards</span></div><div><span style="font-size:12.8px">Muhammad Usama</span></div><div><br></div></div>