How to block or ignore signals from certain processes?

We know that a process can block certain signals by call sigprocmask(), but sometimes we may want to block signals from certain processes for safety concerning.

For example, a system may have a process management daemon, and it will response to certain signals from certain processes managed by it. A process in this system may have certain request by sending certain signals to the process manager, in this case, if the process manager just response according to the received signal value without checking the signal sender, then other hacker processes may disguise to attack the system. Therefore, it is critical to block signals from other processes that the process manager does not recognize.

Of course, we can check the pid of signal senders in the signal handler, but it may seem awkard if there are dozens of processes monitored by the process manager.
Is there any neat method to block or ignore signals from certain processes ?

Thank you in advance !

Only the owner or root is allowed to signal a process in the first place.

man sigprocmask.

If you are that worried about security from other processes, you should instead set up a socket for all the processes to communicate through. And if you really want to do it right, each message contains a sequence number and a secret token of some sort. Of course, this won't prevent someone with root from attaching a debugger and reverse-engineering the protocol or finding the secret token.

To era:
yes, I really neglected this fact that only the owner or root has permission to signal a process.. Thank you for reminding me of it. And, in our implementation, we just check whether the pid of signal sender is in the authorized list.

To otheus:
You really give pretty pratical advice, thanks a lot !