Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] disable user namespace flag #773

Closed
TheKangaroo opened this issue Jun 10, 2022 · 5 comments
Closed

[RFE] disable user namespace flag #773

TheKangaroo opened this issue Jun 10, 2022 · 5 comments
Labels
kind/feature A feature request

Comments

@TheKangaroo
Copy link

Current situation

With CVE-2022-1966 we see another vulnerability which can be mitigated by disabling user namespaces at all, e.g. with the
kernel.unprivileged_userns_clone=0 flag implemented in some linux distributions.
As long as kubernetes/enhancements#127 is still open it would be great to disable user namespaces on kubernetes worker completely to reduce attack surface.

Impact

Reduce attack surface on systems where user namespaces are not in use.

Ideal future situation

We could disable user namespaces like in other distributions.

Implementation options

Additional information

@TheKangaroo TheKangaroo added the kind/feature A feature request label Jun 10, 2022
@jepio
Copy link
Member

jepio commented Jun 10, 2022

The unprivileged_userns_clone sysctl is an out-of-tree kernel patch. Are you suggesting that Flatcar carry that patch?

@jepio
Copy link
Member

jepio commented Jun 10, 2022

The upstream supported way of achieving this is:

# echo 0 > /proc/sys/user/max_user_namespaces

This is stronger than unprivileged_userns_clone because it disables the feature altogether.

@TheKangaroo
Copy link
Author

Oh I wasn't aware of user.max_user_namespaces, I think this will do the job for me.
Just to make sure I understand correctly:
unprivileged_userns_clone = 0 prevents non root users to spawn new (unprivileged) user namespaces
and
max_user_namespaces = 0 disables user namespaces altogether,
right?

@jepio
Copy link
Member

jepio commented Jun 13, 2022

That is correct.

@TheKangaroo
Copy link
Author

Perfect, thank you for pointing this out.

I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A feature request
Projects
None yet
Development

No branches or pull requests

2 participants