margo / specification

Margo Specification
https://specification.margo.org/
Other
23 stars 6 forks source link

Security - Access to Private Registries #15

Open arne-broering opened 4 months ago

arne-broering commented 4 months ago

What authentication method? e.g.:

Who provides credentials?

Where / how to store credentials?

arne-broering commented 4 months ago

The following sequence represents the current state of discussion:

  1. WOA (representing the device) offers a way for the device owner to put a key pair (as first step).
  2. Public key is sent by the WOA (maybe as part of device onboarding) to the WOS.
  3. Once a desired state is requested, the WOS encrypts the secret with the public key and sends it along the desired state.
  4. WOA can then decrypt the secret, interpret the deployment spec and get the required packages from the registry.

Image

Open questions are:

arne-broering commented 4 months ago

This extended sequence diagram attempts to answer the open question (1):

image

phil-abb commented 4 months ago

I think this can get quite complicated depending on what we need (or want) to support.

I don't know that application vendors are going to want to be giving out credentials to customers.

In addition to credentials, do we also need to ensure the application is only installed by the customer who has the right to install the application? I don't think we want to get into software licensing with Margo but do we need to do something as part of Margo to ensure the application is only deployable by customers getting access to the application through approved means?

So, how complex does this need to be, and what options do we have?

I can think of several different options:

If we add on top of this the need to support air-gapped deployments then the problems just keep getting bigger.

stormc commented 4 months ago

I think this can get quite complicated depending on what we need (or want) to support.

This is the very question to answer IMO. What is the concern of Margo and what is out of scope, i.e., not the concern of Margo. There are many ― secure ― ways how to transport an application from a registry/repository down to the device and likewise many how an app developer gets the apps into such a registry/repository. Alike, there are many ways how to do licensing and license enforcement, even neglecting it altogether because of the effort-result ratio :) For any of these, you can find a technical solution to cater for them, however, IMO, this is not a pure technical but rather a business question: What would a Margo user/app developer expect improving the current situation out there?

I don't know that application vendors are going to want to be giving out credentials to customers.

With imposing this on app developers/vendors, we impose on them a particular Margo way how their process has to look like. The next question would be how to handle/advertise application updates, deprecations, ...

So, IMO, given all the different ways how to handle (a) app distribution and (b) licensing and no unifying layer in sight (to my knowledge at least), shouldn't we sidestep the problem and define+implement an interface including hooks for both concerns into which you can then hook the various ways of doing things out there in the field(s)... ?

phil-abb commented 4 months ago

Regardless of where we end up with securing credentials for OCI registries, I think the approach above can still be applied to enable the use of secret parameters that a customer may need to enter as part of configuring their application to be deployed to the edge. For example, configuring database passwords or sensitive connection strings.

g0zilla commented 4 months ago

We should at least cover the situation that image pulls require a docker login (or an equivalent to other container/image formats) and a way to configure certificates to avoid insecure registry configurations. Even within an organization, image registries will be protected.

arne-broering commented 4 months ago

Here is an approach that hides the secure access behind a PackageProvider interface:

image

I created a basic python implementation of this here: app-securtiy-trials

The design is inspired by Symphony's provider approach. Many thanks to @Haishi2016 !

Let's discuss on this in tomorrow's telco.

phil-abb commented 4 months ago

@arne-broering a few questions about this:

  1. Who owns the PackageProvider, SecretProvider, and SecretStore?
  2. Where does the PackageProvider, SecretProvider and SecretStore run?
  3. Who populates the SecretStore with the secrets?
arne-broering commented 4 months ago

@arne-broering a few questions about this:

  1. Who owns the PackageProvider, SecretProvider, and SecretStore?
  2. Where does the PackageProvider, SecretProvider and SecretStore run?
  3. Who populates the SecretStore with the secrets?

The PackageProvider could be (similar to 'Pulling Service' and 'Deployment Service' on the WOA) a component that margo defines as part of the WOS. Then, the PackageProvider could also run on the same (central) machine as the WOS, or it could even be considered a part that makes up the WOS. The SecretProvider and SecretStore are hidden behind the PackageProvider and margo could decide to not specify their details, as they can be implementation specific. Thereby, margo can indicate that secrets would be specified during installation of the WOS and onboarding of apps (and devices) and a central SecretStore would be filled in that process, without detailing the interface.