-
Notifications
You must be signed in to change notification settings - Fork 4
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
The README states docker must be run with --privileged #4
Comments
The D-Bus system_bus_socket is by default owned by root. Having privileged allows access to the socket inside the Docker container. The Docker Linux Capabilities might work better to limit the root access to just this one socket. |
The dbus socket is "srw-rw-rw-" so everyone has read/write access, so why does the container need to run privileged ? |
Running the Docker container without --privileged gives the following error message.
|
@Dylsic Is it possible to modify the apparmor rules to allow access ? |
@SteveOss Unsure at the current moment. I will have to investigate it further as it isn't clear to me whether D-Bus or BlueZ that creates the policy. |
The AppArmor restriction doesn't come from D-Bus or BlueZ, it comes from docker, when you run with @Dylsic do you see any denials in the system journal with |
@anonymouse64 I would appreciate your help with writing an AppArmor policy. I've run the Docker container without
|
So that snippet you posted is actually the same denial being logged twice (from apparmor and from the kernel), the relevant bits are:
which effectively means that a process running under the label I'll post again in a bit with an example command line option to docker to apply this |
An AppArmor Security policy has been included for users to apply to their systems to run the DS without the --privileged flag. This will only work on Linux distributions that use AppArmor as their Linux kernel security module though I have been trying to figure out something similar for Linux distributions that use SELinux but have had no luck as of yet. Even with the --privileged flag the DS fails to contact Dbus when SELinux is enabled. |
I think you should just add a disclaimer to the top-level README that says it's only possible to run this device service fully confined on distros with AppArmor enabled (maybe listing a few), and that at this time, this device service is not supported on any distro with SE Linux enabled by default (I actually wonder if anyone has done a full test of EdgeX on SE Linux?). I'd also file a bug specifically for the issue that the service can't be run on an SE Linux enabled distro (even with --priviledged specified), and close this issue. |
Closing this as it's been addressed in the latest update to the README. |
Just want to say thanks for this issue; I successfully managed to expose a printer to CUPS container with your profile with little adjustment. |
The README file states that a docker container of device-bluetooth-c must be run via the following command:
docker run
-v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
--privileged -p 49971:49971 device-bluetooth
In general, we should avoid use of the "--privileged" option as it basically disables confinement. Ideally docker should be run with the minimum extra options that allow the device service to function.
Why is use of --privileged required?
The text was updated successfully, but these errors were encountered: