Skip to content
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

API to update the .well-known from DIDroom #59

Closed
andrea-dintino opened this issue Mar 21, 2024 · 5 comments
Closed

API to update the .well-known from DIDroom #59

andrea-dintino opened this issue Mar 21, 2024 · 5 comments
Assignees

Comments

@andrea-dintino
Copy link
Contributor

We need an API, on each the 3 microservices, called /DIDroom-update and one corresponding API on the DIDroom dashboard, that allows the DIDroom user to push an updated well-know file to each of is own the microservices.

Important

We need to insert a mechanism to make sure that only the owner of the microservices can update them [TBD]

The flows:

  • On the dashboard side:

    • The user creates a new credential issuance flow, DIDroom will generate an updated .well-known under the hood
    • The user navigates to the microservices involved and presses the "update microservice" button, this button should trigger the Slangroom DIDroom-send-update.zen scripts that:
      • Reads the existing .well-known of the microservice

      • Reads the jwks": > "keys": > "kid" of the microservice, retrieves the DID and extracts the ecdsa pubkey

      • Manipulates the .well-know locally to reflect the changes

      • Creates a dictionary containing the .well-known as well as the path/name of the file to be changed (different for every microservice type)

      • Encrypts the new .well-know using AES-GCM, and ecdsa pubkey from above

      • does a POST to the /DIDroom-update of the microservice, passing the encrypted payload

  • On the microservice side:

    • Slangroom listens to the api /DIDroom-update and receives the encrypted payload
    • Slangroom reads the ecdsa secret key of the microservice
    • Zenroom decrypts the payload
    • Zenroom picks the content of the .well-known as well as the name/path of the file
    • Slangroom overwrites the existin .well-known with the newly decrypted one, based on the path

Both the scripts (send and update) should ideally be on this repo, keeping in mind that DIDroom should import the "send" script (via git submodule or similar)

@matteo-cristino
Copy link
Collaborator

If I understood well, the micorservice will need the ecdsa public key of the microservice owner to decrypt the updated well-known. How should it know this?

@andrea-dintino
Copy link
Contributor Author

If I understood well, the micorservice will need the ecdsa public key of the microservice owner to decrypt the updated well-known. How should it know this?

That's exactly the problem... it can't be done... ideas:

  • the microservice, along with the announce, creates a unique code (like: "43 56 18") that needs to be passed manually to Signroom each time one updates.

@matteo-cristino
Copy link
Collaborator

I still see two problems:

  • the path of the file to update should not be passed as input data but hardocded in the keys, otherwise a malicous entity could possibily modify any file in the DIDRoom_microservices folder (like the file containing the keyring)
  • in case on zencode/slangroom error the secret key (or unique code) could be leaked

@andrea-dintino
Copy link
Contributor Author

@jaromil comments?

@andrea-dintino
Copy link
Contributor Author

Obsolete, replaced by auto-deployment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants