Skip to content

Add documentation for Unix domain socket authenticator #57

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/parsec_client/api_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,12 @@ Clients present their identity strings to the service on each API call. As set o
protocol specification**](wire_protocol.md), they do this using the **authentication** field of the
API request.

There are two ways in which the client can use the authentication field to share its identity with
the service: **direct authentication** and **authentication tokens**.
There are currently three ways in which the client can use the authentication field to share its
identity with the service:

- **direct authentication**.
- **authentication tokens**.
- **Unix peer credentials**.

With **direct authentication**, the client authenticates the request by directly copying the
application identity string into the **authentication** field of the request.
Expand All @@ -159,6 +163,11 @@ extracted by the service after verifying the authenticity of the token. A more d
of authentication tokens and their lifecycle is present in the [**sytem architecture
specification**](../parsec_service/system_architecture.md).

With **Unix peer credentials**, the client authenticates by self-declaring its Unix user identifier
(UID) inside the **authentication** field of the request. The Parsec service verifies that this
self-declared UID matches the actual UID of the connecting process via the Unix peer credentials
mechanism.

When it makes an API request, the client needs to tell the server which kind of authentication is
being used. This is so that the server knows how to interepret the bytes in the **authentication**
field of the request. As described in the [**wire protocol specification**](wire_protocol.md), the
Expand All @@ -177,6 +186,11 @@ permitted numerical values for this field are given as follows:-
- A value of 2 (`0x02`) indicates authentication tokens. The service will expect the
**authentication** field to contain a JWT token. Tokens must be signed with the private key of
the identity provider and their validity period must cover the moment when the check is done.
- A value of 3 (`0x03`) indicates Unix peer credentials authentication. The service expects the
**authentication** field to contain the Unix user identifier (UID, **not** username) of the
connecting process as a zero-padded little-endian 32-bit unsigned integer. The Parsec service
will verify that this self-declared UID is consistent with the UID from the Unix peer
credentials.

Other values are unsupported and will be rejected by the service.

Expand Down
21 changes: 20 additions & 1 deletion src/parsec_service/authenticators.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@
The direct authenticator, [currently
named](https://github.com/parallaxsecond/parsec-interface-rs/issues/22) "simple authenticator" in
the code, directly parse the authentication field as a UTF-8 string and uses that as application
identity. The direct authenticator is the one currently used by the Parsec service.
identity.

## Unix Peer Credentials Authenticator

The Unix peer credentials authenticator uses Unix peer credentials to authenticate the client. Here
'Unix peer credentials' refers to metadata about the connection between client and server that
contains the effective Unix user identifier (UID) and Unix group identifier (GID) of the connecting
process.

To use this authenticator, the application must self-declare its UID (**not** username) in the
authentication field of the request as a zero-padded little-endian 32-bit unsigned integer. This
authenticator will then verify that the UID sourced from the peer credentials matches the one
self-declared in the request. If they match up, authentication is successful and the application
identity is set to the UID.

Note that a Unix domain socket transport is not limited to the Unix peer credentials authenticator;
this transport can be used with a different authenticator if required.

The GID and PID components of the Unix peer credentials are currently unused by the peer credentials
authenticator.

*Copyright 2019 Contributors to the Parsec project.*
2 changes: 1 addition & 1 deletion src/parsec_service/diagrams/interfaces_and_dataflow.drawio
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mxfile modified="2020-02-10T15:11:10.440Z" host="www.draw.io" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0" etag="FkZW2A3bjEKAokGpyY6v" version="12.6.6" type="device"><diagram id="r3fCkxUuyQpxchEkL19v" name="Page-1">7V1bd5s6Fv41WWvmwVkgcX1Mk5PTzmmn6WWm7SMxss0qBh/ATdJff8RFGCRhLpYwtuOs1RoBMuz9aWvftHUFb9fPf0bOZvUhdJF/BRT3+QreXQEAgQ7xf2nLS94CNNvMW5aR5+Zt6q7hi/cbFY1K0br1XBTXLkzC0E+8Tb1xHgYBmie1NieKwqf6ZYvQr//qxlkipuHL3PHZ1m+em6zyVguYu/a3yFuuyC+rhp2fWTvk4uJN4p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uH7exOGkFrphwWXmlAKGlQjqyquxKH1ZVHd5cZMuy1UxZayrLlOYijvoZxZswiFHWY7SdJ9soi7LOI3S+E9WMipBCrLLyIqSAw3JgS5uuzOaw02FMf+8Eyy22Yaoh9coGAFgFDuLtesPfwPM8EaBS1s2sdCIfEwDNUYYD9c+soFmV/T7ZSvECmU9vijdTbYO3kGFs7svK6CNzfsPwvwieqyU399VN4LkzZHJcVqHLcqPUy+OzQvFZIz6jFrcC6B86xodRmNJ9Zwpgeqw+YGM/veIf</diagram></mxfile>
<mxfile modified="2020-08-11T09:38:52.879Z" host="app.diagrams.net" agent="5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36" etag="YgjPYXcEKpH_Ape6CRQq" version="13.6.2" type="device"><diagram id="r3fCkxUuyQpxchEkL19v" name="Page-1">7V1bd5s6Fv41WWvmwVkgcX1Mk5PTzmmn6WWm7SMxss0qBh/ATdJff8RFGCRhLpYwtuOs1RoBMuz9aWvftHUFb9fPf0bOZvUhdJF/BRT3+QreXQEAVNPC/6UtL0WLohl5yzLy3LxN3TV88X6jolEpWreei+LahUkY+om3qTfOwyBA86TW5kRR+FS/bBH69V/dOEvENHyZOz7b+s1zk1XeagFz1/4WecsV+WXVsPMza4dcXLxJvHLc8KnSBP+4grdRGCb5t/XzLfJT6hG65PfdN5wtHyxCQdLlhuTTe/3TJ/cJap8+P8SJ/cP2vZmp5d38cvxt8cbF0yYvhARRuA1clPaiXME3TysvQV82zjw9+4S5jttWydrHRyr+GidR+BPdhn4YZXfDN9lfeYYQUU0vXni+X7nUdZC1mON29tWKt/2FogQ9V5qKV/0ThWuURC/4kuLsTDUKur+QhuL4acdGVbOKxlWFhwZpdArsLMved+TFXwoK96G2ekxqC6CqpdVpClWdIaqmcGgKpNFUg1JpGoQBYsgJWewuFgswF4RdW6GpzEIX2jwqm7KozCOy4eOfffOIvyyT7MXzhkWIX7xKfuPvbUhOzOJM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DBM2qiKQfWkjzvbdSmk3Vv+cEtevHUi9wljZBYXVfGvSE1AD6W5lXmw9y7y0qVZPSzvSSnk1O4j5a0CJJxKJ05pAJRVM6rKus4VcwZoBvlBYo5bbnQEMSeuYpBIMddZp+fTclpKlapoGr1KRRlcO8iyme1I6dwFycJOSplUrrB7SJeXxsV6lS9JGDlLwcU2SJ3O+YvvBW4mfNrqKOdS8P1jW2HlHvZEn0WpVAYTL8GFWyhZxJYve5eEyYfDbbbgONm5laYwrx2/yJMGATt9ySrytLdQm3wIlBGI13pfPCjw7LVx3Y57yjcN5Tzf/awohpHKtNYFSEJlTy9wdXMQYKJ6mxgNwltGAp5KLQBe0LbpyCan9LbNUZLJFibiwSVgVewUwfU+U3IuCFvANBgl9sjYIpLz3LBVWR/Vb/HuaSOMygMHgGPiqxx8iVjizceXgFybKeIrj/RmQd/4gvBlUdke5a4kVYBpPM1Loy1/cRAD5wmxYtnvBaGLk1VGtolusfM1ITsk8+ElK5noNkyZqyxRQG2hdVaxNaoKHHHatZQcARL5KTBd/bDIWkfX8VBfdSPzWl3OJK7T6nImkaupuJyZmlu6Whaz6x1dg3RZsZGja4S4IzicMdUXYbTGF5BAm2AH0ypcP25jcdIKXDHhsvJKAUJLhXRkVdlVRayqOry5yJZlq5my1lSWKc1FHPUzijdhEKOsx2g7T7ZRFmWdR+h8J6oZFSGFWGXlRUgBh+XAljZdmc1hp8OY/t4Jlltsw1RD6pW9AbAKHMTb9Ya/t+d5IkClrJtZ6UQ+JgCaowwH6p9ZrbMq+32yy+IFMp/eL2+m2gZvIcPY3JeV0Ufm/IbhfxE8V0tulmFl1jzhujNkclxWDcxyD9XL47NC8VkjPqMWtwLoHzrGh1GY0n1nCmB6rD5gYz+94h8=</diagram></mxfile>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the diagram as well! Could you also please keep the white background? I believe that in the png you exported from draw.io the background is transparent. Just so that it is easier to read on our book 😃!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked the other .drawio files in the repository and they all seem to have transparent backgrounds as well? Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, you're right -- the .drawio files do have transparent background, but I had selected the 'export with transparent background' option.

Binary file modified src/parsec_service/diagrams/interfaces_and_dataflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 17 additions & 2 deletions src/parsec_service/system_architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ receipt by the identity provider. The orchestrator will use its own private key
verification will be via the shared public key. See the section above on trust relationships for
details of how these keys are generated and shared.

### Authentication Tokens
### Authentication

#### Authentication Tokens

When client applications invoke API operations in the security service, they must include their
application identity string somehow. This allows the security service to provide the required level
Expand All @@ -301,7 +303,7 @@ purpose). This is simple, and works well in a demo or proof-of-concept environme
suitable for a deployed system architecture, because it does not fulfil the stated design goal of
secretless communication.

The solution to this problem is for the authentication header to contain a payload that not only
One solution to this problem is for the authentication header to contain a payload that not only
includes the application identity, but also proves cryptographically that it is from a valid client.
This payload takes the form of a [**signed JSON Web Token
(JWT)**](https://tools.ietf.org/html/rfc7519).
Expand All @@ -318,6 +320,19 @@ private key to sign the JWT. The security service has the public part of this ke
to perform the verification. The identity provider and the security service share one of the trust
relationships that were defined above.

#### Unix Peer Credentials

Another solution to the authentication problem is to use Unix peer credentials with the [Unix peer
credentials authenticator](authenticators.md). Unix peer credentials are connection metadata which
specify the effective Unix user ID (UID) and group ID (GID) of the connecting process. When using a
Unix domain sockets tranport, the endpoints can get each other's UID and GID via the operating
system.

In Unix peer credential authentication, the connecting process self-declares its UID inside the
authentication header of the request. The Parsec service validates that the self-declared UID
matches the actual UID from the peer credentials. If they match, authentication was successful, and
the application identity is set to the stringified UID.

## Block Architecture Summary

Refer to the figure below for a block representation of the key architectural components.
Expand Down