Open cameel opened 6 years ago
Update: We can't keep using the current header in gatekeeper. We have to use the authentication message there too.
@cameel
Validate that TaskToCompute is itself signed with the keys it contains.
Which key, provider or requestor ? Or it just depends on use case context ?
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.
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.TaskToCompute
instance associated with the Subtask
so the headers are redundant.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.
After analyzing the amount of work which needs to be done to complete this looks like this:
UTILS:
CORE VIEWS + API_VIEW:
CORE TESTS:
receive
and receive_out_of_band
in testsreceive
and receive_out_of_band
in testsAPI_VIEW TESTS:
GATEKEEPER:
GATEKEEPER TESTS:
LOGGING:
I will create a separate issues for a group of those points.
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/
Concent-Client-Public-Key
andConcent-Other-Party-Public-Key
HTTP headers. Instead always take public keys fromTaskToCompute
. Either from the one included in the message (if this is the first message related to the subtask) or one stored in the database.TaskToCompute
in a message is identical with the one we have in the database (if we already have it there).TaskToCompute
, these instances are identical.TaskToCompute
is itself signed with the keys it contains.In
receive/
andreceive-out-of-band/
Concent-Client-Public-Key
HTTP header.In gatekeeper:
Concent-Client-Public-Key
HTTP header.Concent-Auth
. This header should contain the new authentication message (same as inreceive/
).FileTransferToken
.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.