• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Please don't use AppArmor for plugin security

Scheduled Pinned Locked Moved
DSF Development
3
8
519
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    gtj0
    last edited by gtj0 23 Aug 2020, 15:32

    @chrishamm In https://github.com/Duet3D/DuetSoftwareFramework/issues/103 you mentioned the use of AppArmor for the plugin interface. Please don't do that. The use of AppArmor will eliminate the possibility of running DSF on other distros and I can't imagine why you'd need a sledgehammer like AppArmor (or Selinux) for a fairly closed environment. There as to be a better/easier way.

    adragoset created this issue 19 Jan 2020, 22:13 in Duet3D/DuetSoftwareFramework

    closed Provide official Docker containers for the various pieces of the DuetSoftwareFramework #103

    undefined undefined 2 Replies Last reply 23 Aug 2020, 15:40 Reply Quote 1
    • undefined
      chrishamm administrators @gtj0
      last edited by 23 Aug 2020, 15:40

      @gtj0 We are trying to convince the Raspi kernel team to add optional AppArmor support to the standard 32-bit Linux kernel. It can be already enabled in the 64-bit kernel without rebuilding it so we hope this change will make it into the stock kernel fairly soon.

      We will need to enforce certain security limitations for third-party plugins and AppArmor is a suitable option because it is a lightweight security module compared to SELinux. With AppArmor we can define permissions per app while leaving DAC in charge for everything else. So I don't see why you claim this would be something like a sledgehammer.

      SELinux is certainly no option because it enforces MAC everywhere, which is definitely not the case with AppArmor.

      Duet software engineer

      1 Reply Last reply Reply Quote 2
      • undefined
        T3P3Tony administrators @gtj0
        last edited by 23 Aug 2020, 16:21

        @gtj0 which distro will AppArmour not work with?

        We are not trying to make it impossible to use DSF w/o AppArmour, the idea is that 3rd party plugins to DSF should be limited in what they can do.

        www.duet3d.com

        1 Reply Last reply Reply Quote 1
        • undefined
          gtj0
          last edited by gtj0 23 Aug 2020, 16:42

          I said "sledgehammer" because both AppArmor and SELinux implement kernel level MAC. No RedHat distros (Fedora, CentOS) support AppArmor. It's not built into their shipped kernels nor are there packages for it so you'd have to compile your own kernel and build your own packages. On the other hand, SELinux is supported by all distros. Don't get me wrong, I'm not suggesting SELinux. I'm wondering just what are you trying to prevent plugins from doing and isn't there a cross-platform/distro way of doing it?

          Oh, if you planning to make the use of AppArmor optional, then that's fine as long as there are no library requirements, etc that can't be turned off at build time.

          undefined 1 Reply Last reply 23 Aug 2020, 16:46 Reply Quote 0
          • undefined
            T3P3Tony administrators @gtj0
            last edited by 23 Aug 2020, 16:46

            @gtj0 if we are going to allow third party plugins to be installed by users then we want a way to prevent them from having any access that the user does not explicitly grant.

            This is part of a range of measures that will make it less likely for malicious plugins to cause issues.

            www.duet3d.com

            undefined 1 Reply Last reply 23 Aug 2020, 20:50 Reply Quote 1
            • undefined
              gtj0 @T3P3Tony
              last edited by gtj0 23 Aug 2020, 20:50

              @T3P3Tony Access to what though? System services and data? Specific printer capabilities?

              Is there a plugin architecture doc somewhere yet?
              What framework are plugins expected to be implemented in? Python? Compiled C? .NET assemblies? etc.
              How are plugins expected to be distributed?
              How are plugins going to be sandboxed?
              How do they communicate with the rest of the DSF?
              Are the plugins going to be running in their own processes?
              Can the generic Linux Capabilities facility be used?

              1 Reply Last reply Reply Quote 1
              • undefined
                chrishamm administrators
                last edited by 24 Aug 2020, 07:16

                @gtj0 The following set of permissions has been defined for the first beta but will be likely extended and/or changed: Different DSF capabilities, read/write access to the individual (virtual) SD card directories, generic file system access, ability to launch new processes, stand-alone network access, running certain things as super-user. The preliminary plugin manifest can be found here but again this is work in progress.

                In general, plugins will be installable from the web interface as a ZIP bundle and they may contain files for DWC, RRF, or executables (+ other resources) to be executed on the SBC. Plugin management on the SBC may be done either via DWC or using a new cli tool that I wrote for this purpose. Plugins may be written in JS for the web interface and in .NET (Core), Python, or Go. Any application supporting JSON objects should in principle be able to communicate with DSF, though.

                Certain DWC plugins will be installable in stand-alone operation (i.e. without SBC), too.

                Please let's discuss further details about the plugin interface when 3.2-b1 is out - this is definitely the wrong thread. A documentation about this is coming soon, too.

                Duet software engineer

                undefined 1 Reply Last reply 24 Aug 2020, 12:59 Reply Quote 2
                • undefined
                  gtj0 @chrishamm
                  last edited by 24 Aug 2020, 12:59

                  @chrishamm OK, no problem. In the mean time, I'll go through the latest DSF commits and checkout what's already there.

                  1 Reply Last reply Reply Quote 0
                  8 out of 8
                  • First post
                    8/8
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA