Is it possible to use wildcards in the Whitelist as i use about 150 different “executeCommandLine” Calls in my rules and it would be a pain to Whitelist every one of it. I already use a firewall to restrict access to the API.
UPDATE: all my “executeCommandLine” Calls in my rules are working (apparently).
For security reasons all commands need to be whitelisted. Allowed commands need to be added to the misc/exec.whitelist file in the configuration directory. Every command needs to be on a separate line.
OK, i created the folder misc and created the exec.whitelist file, filled it with the one anly only command, set all the permissions, cleaned the cache restarted openHAB2 and:
2020-02-20 13:43:21.470 [WARN ] [ng.exec.internal.handler.ExecHandler] - Tried to execute '/etc/openhab2/scripts/internetspeedcheck.sh >/dev/null 2>&1', but it is not contained in whitelist.
I had a little trouble as well getting this to work after upgrading to version 2.5.2. My experience has been, that you have to copy the command from the things parameters to the whitelist and not the resulting command after parameter expansion. I first had:
/usr/local/bin/ps4-waker check
in the whitelist which did not work, because this got expanded from the things parameter where i entered:
/usr/local/bin/ps4-waker %2$s
When i added this to /etc/openhab2/misc/exec.whitelist all warnings and errors disappeared…
Same error. A couple of reboots fixed it for me. Also, I removed a # comment so there is nothing else in the list
edit… Looking at the logs it shows just after restart the ’ not contained in the white list ’ error but immediately followed by the result of the command. So it did run despite the log message