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

Add device /dev/net/tun for Docker Desktop #225

Closed
exil-security opened this issue Jul 5, 2024 · 1 comment
Closed

Add device /dev/net/tun for Docker Desktop #225

exil-security opened this issue Jul 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@exil-security
Copy link

exil-security commented Jul 5, 2024

The needs

The device /dev/net/tun can be pass through using the option --vpn but not using the --device directly using Docker Desktop on MacOS.

image

Description

We can add filter to allow this device /dev/net/tun on addUserDevice function to allow this device.

File: exegol/model/ContainerConfig.py

<SNIP>
def addUserDevice(self, user_device_config: str):
        """Add a device from a user parameters"""
        if EnvInfo.isDockerDesktop() and user_device_config != "/dev/net/tun" :
            logger.warning("Docker desktop (Windows & macOS) does not support USB device passthrough.")
            logger.verbose("Official doc: https://docs.docker.com/desktop/faqs/#can-i-pass-through-a-usb-device-to-a-container")
            logger.critical("Device configuration cannot be applied, aborting operation.")
        self.__addDevice(user_device_config)
<SNIP>

Adding fillter can fix the problem for the /dev/net/tun and still abort in case of other device like usb

image

Alternatives

Maybe create a whitelist of working devices on Docker Desktop on the future in order to allow the --device option for those devices

Additional context

No response

@exil-security exil-security added the enhancement New feature or request label Jul 5, 2024
@exil-security exil-security changed the title Add device /dev/net/tun on Docker Desktop Add device /dev/net/tun for Docker Desktop Jul 5, 2024
@Dramelac
Copy link
Member

Dramelac commented Jul 8, 2024

Suggested fix: #226

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

No branches or pull requests

2 participants