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 example runArgs to devcountainer to access serial port. #4073

Merged
merged 3 commits into from
Jul 30, 2024

Conversation

axlan
Copy link
Contributor

@axlan axlan commented Jul 25, 2024

I found this capability to be useful for being able to upload directly from the dev container.

@blazoncek blazoncek changed the base branch from main to 0_15 July 25, 2024 05:33
@blazoncek
Copy link
Collaborator

You should base any work off of 0_15 branch.
I have changed destination branch for this PR but you should be careful next time.

@softhack007
Copy link
Collaborator

softhack007 commented Jul 28, 2024

@axlan please add a sentence about security implications of the proposed commands. If I understand correctly, it means that the container runtime gets permission to access any "dialout" device.

dialout Full and direct access to serial ports. Members of this group can reconfigure the modem, dial anywhere, etc.

https://wiki.debian.org/SystemGroups#Other_System_Groups

@axlan
Copy link
Contributor Author

axlan commented Jul 29, 2024

@softhack007 , that's not entirely correct.
For "runArgs": ["--device=/dev/ttyACM0", "--group-add", "dialout"], the container is still sandboxed, so only the serial device /dev/ttyACM0 is exposed. The group is added since typically access to a serial port is restricted to this group. The other ports aren't even visible.

Running with --privileged does actually expose the full set of serial devices, so I can call that out more explicitly, but it's also important to remember that even in that case, the exposure is less then just running outside of a dev container normally. These sandboxing concerns are usually more relevant for running systems that are exposing servers to the network, rather then just providing an environment for building.

@softhack007 softhack007 merged commit ef8f23c into Aircoookie:0_15 Jul 30, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants