Skip to content

kernel keyring control #950

Open

Description

@justincormack

currently runc run has a command line option --no-new-keyring which disables the creation of an isolated kernel keyring for the process. This is kind of weird - I think this should be part of the OCI spec as it is just a specification of resource allocation, like having a new namespace. I can write up a proposal for this; obviously though this will be a breaking change so want to know what anyone else thinks.

Activity

  1. wking commented on Feb 14, 2018

    @wking
    Contributor
  2. justincormack commented on Feb 15, 2018

    @justincormack
    ContributorAuthor

    I think the most general interface would be for creating a new session keyring to match the config for namespaces

    "keyrings": [
    {
      "type": "session"
    }
    ]
    

    joining an existing keyring/creating a new named on as session keyring:

    "keyrings": [
    {
      "type": "session",
      "name": "mykeyring",
    }
    ]
    

    Initially "session" is probably the only supported value, but it is extensible in future. In theory setting the process keyring might make sense too, but almost all use cases use session.

    --no-new-keyring would correspond to an empty keyrings list; the first example above corresponds to the current default.

    If this looks sane I will do a spec PR.

  3. wking commented on Feb 15, 2018

    @wking
    Contributor

    Would you ever need multiple keyrings of the same type? I can't think of a reason, if it's possible at all. If it's not possible, I recommend using an object with ring-type keys:

    "keyrings": {
      "session": {
        "name": "mykeyring"
      }
    }
  4. justincormack commented on Feb 15, 2018

    @justincormack
    ContributorAuthor

    I followed what we do for namespaces, where you also can't have more than one of a type. The problem is if name is empty, which is the normal null case for create a new keyring, then the session object is empty as far as Go is concerned. Its a bit of a Go-kernel mismatch where we are trying to distinguish between not set and null.

  5. wking commented on Feb 15, 2018

    @wking
    Contributor
  6. justincormack commented on Feb 16, 2018

    @justincormack
    ContributorAuthor

    Ah yes, you can distinguish between empty but nil map value and non existent one, if you try. So default as per current behaviour could be

    "keyrings": {
      "session": {}
    }
    
  7. added a commit that references this issue on Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions