Skip to content

Security proposal: trusted services and shared secrets / request signing #23

@joostfarla

Description

@joostfarla

In the file sharing context, security is a serious concern. Therefore, it's a best practice to keep your
attack surface as small as possible. There are various measures to take when it comes to minimizing risk as much as possible.

TLS/SSL

The TLS/SSL protocol (serving traffic over HTTPS) guarantees, when implemented correctly, an end-to-end secure connection. Support for SSL is an absolute MUST for any decent API nowadays. SSL helps encrypting any private data when transferring it over the wire. However, as we will see in the "Request signing" chapter, SSL only is not always enough.

Trust relationships

To be able to initiate resource sharing between different users on different instances, some API endpoints have to be exposed. These endpoints, especially for open-source projects, are an easy target for malicious services and should be secure and only be accessible by services you trust. Therefore, the concept of "trusted services" could be implemented. When you configure a trusted service, you are whitelisting this service to access the endpoints used for the negotiation and revocation of resource shares.

A trusted service means you trust the owner of the service and all code in the service application
to behave itself at all times. You must also be confident that the trusted application will maintain
the security of its shared secret.

Request signing

A common approach for managing trust relationships between services is by providing a
shared secret, which is generally a long sequence of randomly generated characters, known only to the parties involved. This shared secret could be generated by the trusting service admin and should be provided to the trusted party (to be). The shared secret should be provided to the latter party once and not change over time (of course you could decide to rotate all shared secrets once in a while, but we leave this out of scope for now).

Even when using SSL, there is still the small chance of a man-in-the-middle attack. Recent OpenSSL exploits (e.g. Heartbleed) have also demonstrated that the SSL protocol could not be considered 100% secure. Especially because different sharing services of different vendors could be hosted in various different environments with different security risks/policies and management levels, it's not a wise decision to fully trust on SSL encryption. Therefore, a proper choice would be to use the shared secret for signing requests.

Signing API requests means that the shared secret itself is never sent over the wire (which you often see when using traditional API keys), which takes away the risk of the shared secret being intercepted. Instead, the token is used to sign the request on the requester's side using a cryptographic algorithm like HMAC-SHA1. With the same shared secret, the receiver of the request can verify the validity of the token and the integrity of the message to make sure that the contents of the request (including metadata) has been authored by the person who claims to be the sender and has remained untouched during the transfer.

Signing and validating the request still does not mean that messages could not be intercepted. This means you still have the small chance of leaking confidential information to malicious parties. To take away this risk, one could decide to add encryption so that message are unreadable when intercepted.

Discussion

Do we want to go this far when it comes to security? Or is the data mostly not "that" sensitive? Other thoughts or alternatives?

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