Hello,
we are using icinga to monitor our linux devices.
icinga executes scripts which are shared to all those devices using an nfs share in read only.
security wants us to either move scripts locally on workstations (which is quite complex because we currently have a lot of old hosts which are not managed via puppet), either we make sure the scripts are safe before executing them.
We would like to be able to check the hash of the script before executing it, unfortunately it seems quite impossible to enter such a command line in the command field, everything we tried so far raised an error, the command we tried in 50+ different ways is:
cmd=/a/b/c/myscript.sh; md5=($(md5sum $cmd)) ; [[ $md5 == xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ]] && $cmd || echo script modified
where xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the md5sum of the script $cmd
there is also the problem with the fact icinga is adding the PluginDir variable at the beginning of the command when it is not starting with a /
is there a way to do that or another method which could do the same kind of thing?
Thank you in advance for your help