After applying USG hardening (CIS level 1) in our Ubuntu 22.04 LTS workstations, all Landscape remote script executions are failing with the following error:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpqzwjlzmy'
I was able to simulate this in a fresh system installation. A similar issue have been reported here.
So far, I was not able to determine which CIS control is triggering this conflict with the Landscape client behavior. It would be of great help if anyone might have an idea of which control is causing this, as having a fix for landscape in the short term is unlikely.
Here is the full error stack output:
Upon execvpe /tmp/tmpqzwjlzmy ('/tmp/tmpqzwjlzmy',) in environment id 140110680300224
:Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/internet/process.py", line 397, in _fork
self._execChild(path, uid, gid, executable, args, environment)
File "/usr/lib/python3/dist-packages/twisted/internet/process.py", line 468, in _execChild
os.execvpe(executable, args, environment)
File "/usr/lib/python3.10/os.py", line 584, in execvpe
_execvpe(file, args, env)
File "/usr/lib/python3.10/os.py", line 598, in _execvpe
exec_func(file, *argrest)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpqzwjlzmy'

Doesn’t matter the script complexity, in this example even a simple echo "hello" will result in the same permission error.

landscape-client/landscape/client/manager/scriptexecution.py at main · canonical/landscape-client
