ansible-collection-hardening icon indicating copy to clipboard operation
ansible-collection-hardening copied to clipboard

No such file directory error triggered by the kernel.unprivileged_userns_clone configuration

Open ana-cc opened this issue 1 year ago • 1 comments

Description

This bug featured in issue #514 now also affects Debian systems, see https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html#linux-user-namespaces.

Reproduction steps

...

Current Behavior

... sysctl: cannot stat /proc/sys/kernel/unprivileged_userns_clone: No such file or directory

Expected Behavior

... No error.

OS / Environment

Debian 12.2

Ansible Version

ansible [core 2.16.0]
  config file = /Users/ana/PycharmProjects/ops/ansible-zammad/ansible.cfg
  configured module search path = ['/Users/ana/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/ana/PycharmProjects/ops/ansible-zammad/venv/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/ana/PycharmProjects/ops/ansible-zammad/collections/local:/Users/ana/PycharmProjects/ops/ansible-zammad/collections/external
  executable location = /Users/ana/PycharmProjects/ops/ansible-zammad/venv/bin/ansible
  python version = 3.11.3 (main, Apr  7 2023, 19:25:52) [Clang 14.0.0 (clang-1400.0.29.202)] (/Users/ana/PycharmProjects/ops/ansible-zammad/venv/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True

Collection Version

v9.0.0

Additional information

To work around this, I used the undocumented variable sysctl_unsupported_entries:

sysctl_unsupported_entries:
  - kernel.unprivileged_userns_clone

ana-cc avatar Nov 22 '23 21:11 ana-cc

Thanks for noticing this. Do you want to create a PR to fix this?

rndmh3ro avatar Nov 24 '23 10:11 rndmh3ro