Skip to content

Commit 99c622b

Browse files
author
Joe Ellis
committed
Add documentation for Unix domain socket authenticator
Signed-off-by: Joe Ellis <[email protected]>
1 parent f8fbde3 commit 99c622b

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

src/parsec_client/api_overview.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ Clients present their identity strings to the service on each API call. As set o
146146
protocol specification**](wire_protocol.md), they do this using the **authentication** field of the
147147
API request.
148148

149-
There are two ways in which the client can use the authentication field to share its identity with
150-
the service: **direct authentication** and **authentication tokens**.
149+
There are currently three ways in which the client can use the authentication field to share its
150+
identity with the service:
151+
152+
- **direct authentication**.
153+
- **authentication tokens**.
154+
- **peer credentials**.
151155

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

166+
With **peer credentials**, the client authenticates by self-declaring its UID inside the
167+
**authentication** field of the request. The Parsec service verifies that this self-declared UID
168+
matches the actual UID of the connecting process using some peer credentials mechanism. For example,
169+
Unix domain sockets support peer credentials, allowing the endpoints to get each other's effective
170+
UIDs and GIDs via the operating system, which is trusted implicitly.
171+
162172
When it makes an API request, the client needs to tell the server which kind of authentication is
163173
being used. This is so that the server knows how to interepret the bytes in the **authentication**
164174
field of the request. As described in the [**wire protocol specification**](wire_protocol.md), the
@@ -177,6 +187,10 @@ permitted numerical values for this field are given as follows:-
177187
- A value of 2 (`0x02`) indicates authentication tokens. The service will expect the
178188
**authentication** field to contain a JWT token. Tokens must be signed with the private key of
179189
the identity provider and their validity period must cover the moment when the check is done.
190+
- A value of 3 (`0x03`) indicates peer credentials authentication. The service will expect the
191+
**authentication** field to contain the stringified UID of the connecting process. The Parsec
192+
service will verify that this self-declared UID is consistent with the UID from the peer
193+
credentials.
180194

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

src/parsec_service/authenticators.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@
55
The direct authenticator, [currently
66
named](https://github.com/parallaxsecond/parsec-interface-rs/issues/22) "simple authenticator" in
77
the code, directly parse the authentication field as a UTF-8 string and uses that as application
8-
identity. The direct authenticator is the one currently used by the Parsec service.
8+
identity.
9+
10+
## Peer Credentials Authenticator
11+
12+
The peer credentials authenticator uses peer credentials to authenticate the client. In this
13+
context, 'peer credentials' refers to metadata about the connection between client and server that
14+
contains the effective user ID (UID) and group ID (GID) of the connecting process.
15+
16+
To use this authenticator, the application must self-declare its UID in the authentication field of
17+
the request as a UTF-8 string. This authenticator will then verify that the UID sourced from the
18+
peer credentials matches the one self-declared in the request. If they match up, authentication is
19+
successful and the application identity is set to the UID.
20+
21+
Currently, the peer credentials authenticator only supports authentication via the peer credentials
22+
sourced from a Unix domain socket. However, the authenticator will likely support different
23+
transports in the future.
24+
25+
GID is currently unused by the peer credentials authenticator.
926

1027
*Copyright 2019 Contributors to the Parsec project.*
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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+rhp2fWTvk4uJN4pXjhk+V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kFrphwWXmlAKGlQjqyquxKH1ZVHd5cZMuy1UxZayrLlOYijvoZxZswiFHWY7SdJ9soi7LOI3S+E9WMipBCrLLyIqSAw3JgS5uuzOaw02FMf+8Eyy22Yaoh9coGAFgFDuLtesPfwPM8EaBS1s2sdCIfEwDNUYYD9c+soFmV/T7ZSvECmU9vijdTbYO3kGFs7svK6CNzfsPwvwieqyU399VN4LkzZHJcVqHLcqPUy+OzQvFZIz6jFrcC6B86xodRmNJ9Zwpgeqw+YGM/veIf</diagram></mxfile>
1+
<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+TFXwoK96G2ekxqC6CqpdVpClWdIaqmcGgKpNFUg1JpGoQBYsgJWewuFgswF4RdW6GpzEIX2jwqm7KozCOy4eOfffOIvyyT7MXzhkWIX7xKfuPvbUhOzOJMwt/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2qiKQfWkjzvbdSmk3Vv+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>

src/parsec_service/system_architecture.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,9 @@ receipt by the identity provider. The orchestrator will use its own private key
284284
verification will be via the shared public key. See the section above on trust relationships for
285285
details of how these keys are generated and shared.
286286

287-
### Authentication Tokens
287+
### Authentication
288+
289+
#### Authentication Tokens
288290

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

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

323+
#### Peer Credentials
324+
325+
Another solution to the authentication problem is to use peer credentials with the [peer credentials
326+
authenticator](authenticators.md). Peer credentials are connection metadata which specifies the user
327+
ID (UID) and group ID (GID) of the connecting process. For example, Unix domain sockets support peer
328+
credentials, allowing the endpoints to get each other's UID and GID via the operating system.
329+
330+
In peer credential authentication, the connecting process self-declares its (effective) UID inside
331+
the authentication header of the request. The Parsec service validates that the self-declared UID
332+
matches the actual UID from the peer credentials. If they match, authentication was successful, and
333+
the application identity is set to the stringified UID.
334+
321335
## Block Architecture Summary
322336

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

0 commit comments

Comments
 (0)