eclipse-ankaios / ankaios

Eclipse Ankaios provides workload and container orchestration for automotive High Performance Computing (HPC) software.
https://eclipse-ankaios.github.io/ankaios/
Apache License 2.0
62 stars 23 forks source link

Secure communication between server, agent and CLI using mTLS #6

Closed windsource closed 3 months ago

windsource commented 1 year ago

Description

Currently the communication between server and agent via gRPC is unencrypted. In order to provide authentication and encryption mTLS shall be used.

Goals

Tasks

windsource commented 1 year ago

The project https://github.com/eclipse/kuksa.val also uses gRPC between client and databroker via TLS so maybe we can check that before.

christoph-hamm commented 11 months ago

I think we should first evaluate if we really need TLS.

windsource commented 11 months ago

I think we need confidentiality at least for the CLI connecting to the Ankaios server as the CLI might be remote.

windsource commented 6 months ago

Besides using mTLS we could also use TLS + JWT (TLS for encryption + JWT for authentication and authorization). This seems to be simpler plus more flexible.

krucod3 commented 6 months ago

As agreed, we first need a concept and we can discuss it together to decide how to proceed.

windsource commented 6 months ago

If this issue is implemented, secure communication shall be on by default. If insecure communication shall be used (e.g. during development or evaluation of Ankaios), a parameter like --insecure needs to be passed or a variable like ANK_INSECURE=true for the CLI should be set.

krucod3 commented 6 months ago

As proposed by @christoph-hamm, we can use certificates also for scoping (later if needed) the same way Kubernetes does (via the organization and organizational unit fields).

I looked a bit into what tonic supports. There is an example on how to setup mTLS here: https://github.com/hyperium/tonic/tree/master/examples/src/tls_client_auth and it looks quite straight forward. (I'll also add the link to the description.)

Just a couple of hints:

krucod3 commented 6 months ago

Also also should check the permissions of the pem and key files read by server and agent and reject starting if the files are readable by group and others.

lingnoi commented 3 months ago

The PR with the implementation has been reviewed and merged into main.