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

Move away from using privileged for device mounts #247

Closed
Ornias1993 opened this issue Mar 7, 2021 · 4 comments
Closed

Move away from using privileged for device mounts #247

Ornias1993 opened this issue Mar 7, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Ornias1993
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently we use/advice privileged for basic device mounts.
This is bad advice and a significant security concern.

Describe the solution you'd like
Need to find and set the correct securityContext capabilities as needed for mounting devices.

@Ornias1993 Ornias1993 added the enhancement New feature or request label Mar 7, 2021
@tprelog
Copy link
Contributor

tprelog commented Mar 7, 2021

The requirements for this are still a good bit above my (current) level...

There's a related issue for Z-Wave to MQTT here - although it's for the non JS version, I believe the same would apply

@Ornias1993
Copy link
Member Author

Ornias1993 commented Mar 7, 2021

@tprelog I think you heavily underestimate your current level...

it's nothing more than adding capabilities using:

securityContext:
  capabilities:
    add:
       - THIS_IS_A_CAPABILITY

I think you're pretty decent in wiki hunting for the right capabilities ;-)

Indeed like the link, linked in your link:
https://github.com/chaos-mesh/chaos-mesh/pull/1126/files

The things is: privileged gives ALL permissions, even if we half them thats a win security wise.

Don't worry it's not something that needs to be rushed though ^^

But I also think it's something that might be of interest for you in the long run, considering usb devices are quite relevant for Zwave and HASS.

@Ornias1993
Copy link
Member Author

Research indicates the following:
supplementalGroups can be used to use devices as non-root users inside containers.

However:
Even when running non-root, privilaged true is required for usb mounts and (possibly) for other devices mounted via the storage system.
I'm not sure if this is required for graphics and/or graphics mounted via resources, it might.
In both cases there is not really a sane workaround however.

The supplementalGroups feature has been added to staging (#216) and hence this can be closed!

@truecharts-admin
Copy link
Collaborator

This issue is locked to prevent necro-posting on closed issues. Please create a new issue or contact staff on discord of the problem persists

@truecharts truecharts locked and limited conversation to collaborators Feb 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants