golemfactory / concent

Repository for Concent Service sources
8 stars 7 forks source link

[Blueprint] Full authentication in Concent API #138

Open cameel opened 6 years ago

cameel commented 6 years ago

Currently Golem clients are not authenticated. We identify them based on the public key they declare but there are no safeguards against one client impersonating another. We need to start verifying that the key matches the message.

In send/

In receive/ and receive-out-of-band/

In gatekeeper:

Note that the mechanism for receive is safe only with the assumption that no one can intercept the authentication message in the short time window where the timestamp is acceptable. This may be a problem later when we switch to a P2P protocol. For now we're going to use SSL (HTTPS) so we can assume that messages cannot be easily intercepted.

cameel commented 6 years ago

Update: We can't keep using the current header in gatekeeper. We have to use the authentication message there too.

rwrzesien commented 6 years ago

@cameel

  1. Validate that TaskToCompute is itself signed with the keys it contains.

Which key, provider or requestor ? Or it just depends on use case context ?

  1. Stop using the Concent-Client-Public-Key and Concent-Other-Party-Public-Key HTTP headers.

But only for authentication, right ? We still need this in request to load golem message.

cameel commented 6 years ago
  1. TaskToCompute is always created and signed by the requestor. Please look at integration tests for core. They always sign it with the right key. TaskToCompute is serialized separately from the message containing it because it's a message passed between the requestor and the provider.
  2. We don't need these headers now at all. We have the keys inside TaskToCompute instance associated with the Subtask so the headers are redundant.
cameel commented 6 years ago

OK, after talking on Slack I see the problem.

It should be technically possible to decode a message without validating its signature. The only question is whether golem-messages lets us do that in an easy easy way, without copying its intenal implementation. If not, we'll need to request changes.

rwrzesien commented 6 years ago

After analyzing the amount of work which needs to be done to complete this looks like this:

UTILS:

CORE VIEWS + API_VIEW:

CORE TESTS:

API_VIEW TESTS:

GATEKEEPER:

GATEKEEPER TESTS:

LOGGING:

I will create a separate issues for a group of those points.