8000 Implement admin POST method to change controller signing certificate in runtime · Issue #118 · lf-edge/adam · GitHub
[go: up one dir, main page]

Skip to content

Implement admin POST method to change controller signing certificate in runtime #118

Open

Description

@milan-zededa

Recently, we have seen many issues where EVE didn't properly handle a change in the controller signing certificate. It would be therefore beneficial to prepare an eden test in which the signing certificate used by Adam is changed after device is onboarded. This can be combined with poor network connectivity (which can be modeled with eden), etc. (conditions that triggered aforementioned issues).

However, even though there is a POST method declared for /certs (to presumably change the controller certificate), it is not implemented. Handler apiv2.certs does not check the request method type and always behaves as GET method, returning the set of installed certificates.

Edit: As pointed out by @giggsoff, instead of using the mentioned /certs endpoint, which is actually used between EVE and Adam, we should add a new POST method under the Admin handler, that could be then used from Eden CLI to update the controller certificate in runtime.

CC @eriknordmark @rouming

Activity

  1. giggsoff commented on Oct 3, 2023

    @giggsoff
    Collaborator

    The endpoint you point onto responsible for communication between Adam and EVE-OS (described here). It is quite strange that there are POST handler there, but I think that endpoints for communication between admin (Eden?) and Adam should be separated (probably into admin handler).

    Small question: as I can see currently signing certificate configured using command line option, which points onto file from Eden. Will the re-creation of the file (and probably re-start of Adam) be enough in the workflow you want to check? Do we really need to implement any handler?

  2. eriknordmark commented on Oct 3, 2023

    @eriknordmark
    Contributor

    I guess one additional question is whether some POST should take the identical payload as what's returned by the GET, which is the full set of controller certificates (signing, encryption, plus zero or more intermediate certs). Plus the questions from Petr about the file and command line option etc.

  3. changed the title [-]Implement POST method for /certs[/-] [+]Implement POST method to change controller signing certificate in runtime[/+] on Oct 4, 2023
  4. milan-zededa commented on Oct 4, 2023

    @milan-zededa
    ContributorAuthor

    Will the re-creation of the file (and probably re-start of Adam) be enough in the workflow you want to check? Do we really need to implement any handler?

    @giggsoff Wouldn't a restart of Adam lead to a loss of same state information (device UUID, device config, etc.)?

  5. changed the title [-]Implement POST method to change controller signing certificate in runtime[/-] [+]Implement admin POST method to change controller signing certificate in runtime[/+] on Oct 4, 2023
  6. giggsoff commented on Oct 4, 2023

    @giggsoff
    Collaborator

    Will the re-creation of the file (and probably re-start of Adam) be enough in the workflow you want to check? Do we really need to implement any handler?

    @giggsoff Wouldn't a restart of Adam lead to a loss of same state information (device UUID, device config, etc.)?

    It is true, we have the driver with no persistent state, it is memory one. But I hope nobody use it in production (or how we can name it). We have file driver and redis driver as well, both of them recover after restart. Eden uses redis one with persistent redis.

    Potentially we can avoid restart of Adam, assume the next request will read novel certificate file.

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

      0