Skip to content

Commit e426a59

Browse files
committed
Address review comments on the book
Signed-off-by: Hugues de Valon <[email protected]>
1 parent 1fb1015 commit e426a59

File tree

13 files changed

+54
-152
lines changed

13 files changed

+54
-152
lines changed

src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Find here all the technical documentation of Parsec, alongside user and develope
77

88
Go straight to the [overview](overview.md) to learn more about the project! Then, depending on what
99
you want to know, you can go to the [users](parsec_users.md), [client
10-
developpers](parsec_client/README.md), [service developpers](parsec_service/README.md) or
10+
developers](parsec_client/README.md), [service developers](parsec_service/README.md) or
1111
[security](parsec_security/README.md) sections.
1212

1313
# Disclaimer

src/SUMMARY.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
- [PsaMacVerify](parsec_client/operations/psa_mac_verify.md)
3838
- [PsaSignMessage](parsec_client/operations/psa_sign_message.md)
3939
- [PsaVerifyMessage](parsec_client/operations/psa_verify_message.md)
40-
- [AddClient](parsec_client/operations/add_client.md)
41-
- [ProveClient](parsec_client/operations/prove_client.md)
42-
- [ShareTrustBundle](parsec_client/operations/share_trust_bundle.md)
4340
- [Parsec for service developers](parsec_service/README.md)
4441
- [System Architecture](parsec_service/system_architecture.md)
4542
- [Interfaces and Dataflow](parsec_service/interfaces_and_dataflow.md)

src/parsec_client/api_overview.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,10 @@ permitted numerical values for this field are given as follows:-
184184
- A value of 1 (`0x01`) indicates direct authentication. The service will expect the
185185
**authentication** field to contain a cleartext copy of the application identity, encoded as a
186186
UTF-8 string.
187-
- A value of 2 (`0x02`) indicates authentication tokens. The service will expect the
188-
**authentication** field to contain a JWT token. Tokens must be signed with the private key of
189-
the identity provider and their validity period must cover the moment when the check is done.
187+
- A value of 2 (`0x02`) indicates authentication tokens. This authentication type is not currently
188+
supported. The service will expect the **authentication** field to contain a JWT token. Tokens
189+
must be signed with the private key of the identity provider and their validity period must cover
190+
the moment when the check is done.
190191
- A value of 3 (`0x03`) indicates Unix peer credentials authentication. The service expects the
191192
**authentication** field to contain the Unix user identifier (UID, **not** username) of the
192193
connecting process as a zero-padded little-endian 32-bit unsigned integer. The Parsec service

src/parsec_client/operations/README.md

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ translated to the specific operation implementation language used.
3636
| [PsaSignMessage](psa_sign_message.md) | `0x0018` |
3737
| [PsaVerifyMessage](psa_verify_message.md) | `0x0019` |
3838

39-
Find here the [current level of support](service_api_coverage.md) of those operations in Parsec.
39+
Find [here](service_api_coverage.md) the current level of support of those operations in Parsec.
4040

4141
## Status Note
4242

@@ -45,15 +45,6 @@ Some operations are listed without being linked to documentation pages. These op
4545
currently supported, but are intended for future roadmap. Only a small number of the PSA Crypto
4646
operations are supported in the current version.
4747

48-
## Identity Operations
49-
50-
Identity operations are not supported by the security service. These operations are reserved for use
51-
only by the identity provider, which is a separate service in the system, but supports a common wire
52-
protocol.
53-
54-
- [AddClient](add_client.md)
55-
- [ProveClient](prove_client.md)
56-
5748
## Core Operations
5849

5950
Core operations are non-cryptographic operations supported by the core provider. Set the
@@ -69,10 +60,6 @@ Core operations are non-cryptographic operations supported by the core provider.
6960
- [ListOpcodes](list_opcodes.md)
7061
- [ListAuthenticators](list_authenticators.md)
7162

72-
### Trust
73-
74-
- [ShareTrustBundle](share_trust_bundle.md)
75-
7663
## PSA Crypto Operations
7764

7865
These operations are all derived from equivalent function definitions in the [**PSA Crypto API
@@ -83,78 +70,29 @@ Most of the documentation in this book directly come from the specification.
8370

8471
- [PsaImportKey](psa_import_key.md)
8572
- [PsaGenerateKey](psa_generate_key.md)
86-
- PsaCopyKey
8773
- [PsaDestroyKey](psa_destroy_key.md)
88-
- PsaPurgeKey
8974
- [PsaExportKey](psa_export_key.md)
9075
- [PsaExportPublicKey](psa_export_public_key.md)
9176

9277
### Message Digests
9378

9479
- [PsaHashCompute](psa_hash_compute.md)
9580
- [PsaHashCompare](psa_hash_compare.md)
96-
- PsaHashOperationInit
97-
- PsaHashSetup
98-
- PsaHashUpdate
99-
- PsaHashFinish
100-
- PsaHashVerify
101-
- PsaHashAbort
102-
- PsaHashSuspend
103-
- PsaHashResume
104-
- PsaHashClone
10581

10682
### Message Authentication Codes (MAC)
10783

10884
- [PsaMacCompute](psa_mac_compute.md)
10985
- [PsaMacVerify](psa_mac_verify.md)
110-
- PsaMacOperationInit
111-
- PsaMacSignSetup
112-
- PsaMacVerifySetup
113-
- PsaMacUpdate
114-
- PsaMacSignFinish
115-
- PsaMacVerifyFinish
116-
- PsaMacAbort
11786

11887
### Unauthenticated Ciphers
11988

12089
- [PsaCipherEncrypt](psa_cipher_encrypt.md)
12190
- [PsaCipherDecrypt](psa_cipher_decrypt.md)
122-
- PsaCipherOperationInit
123-
- PsaCipherEncryptSetup
124-
- PsaCipherDecryptSetup
125-
- PsaCipherGenerateIv
126-
- PsaCipherSetIv
127-
- PsaCipherUpdate
128-
- PsaCipherFinish
129-
- PsaCipherAbort
13091

13192
### Authenticated Encryption with Associated Data (AEAD)
13293

13394
- [PsaAeadEncrypt](psa_aead_encrypt.md)
13495
- [PsaAeadDecrypt](psa_aead_decrypt.md)
135-
- PsaAeadOperationInit
136-
- PsaAeadEncryptSetup
137-
- PsaAeadDecryptSetup
138-
- PsaAeadGenerateNonce
139-
- PsaAeadSetNonce
140-
- PsaAeadSetLengths
141-
- PsaAeadUpdateAd
142-
- PsaAeadUpdate
143-
- PsaAeadFinish
144-
- PsaAeadVerify
145-
- PsaAeadAbort
146-
147-
### Key Derivation
148-
149-
- PsaKeyDerivationOperationInit
150-
- PsaKeyDerivationSetup
151-
- PsaKeyDerivationGetCapacity
152-
- PsaKeyDerivationSetCapacity
153-
- PsaKeyDerivationInputBytes
154-
- PsaKeyDerivationInputKey
155-
- PsaKeyDerivationOutputBytes
156-
- PsaKeyDerivationOutputKey
157-
- PsaKeyDerivationAbort
15896

15997
### Asymmetric Signature
16098

@@ -171,7 +109,6 @@ Most of the documentation in this book directly come from the specification.
171109
### Key Agreement
172110

173111
- [PsaRawKeyAgreement](psa_raw_key_agreement.md)
174-
- PsaKeyDerivationKeyAgreement
175112

176113
### Random Number Generation
177114

src/parsec_client/operations/add_client.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/parsec_client/operations/prove_client.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/parsec_client/operations/share_trust_bundle.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/parsec_client/wire_protocol.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ protocol itself is neither of these things: it is an entirely bespoke protocol.
5959

6060
### Synchronous Operation
6161

62-
The wire protocol operation is synchronous: the client initiates a connection and transmits a
63-
request. It then blocks while the service performs the request and transmits the response on the
64-
return stream. The protocol therefore only supports short-lived operations (meaning that the
65-
fulfillment time must be well within any timeout limitations that the transport might impose). The
66-
protocol can support longer-lived operations, but it is the responsibility of the service API to
67-
define how these are managed. There could, for example, be a pattern whereby there are separate
68-
initiation and status polling operations.
62+
The wire protocol is based on requests and responses, and therefore models synchronous patterns of
63+
interaction. There is nothing in current versions of the protocol to assist with asynchronous
64+
patterns of interaction between the client and the service. Future versions of the protocol may
65+
introduce such concepts. In the meantime, depending on the type of transport used, it may be
66+
possible for the service or the clients to take advantage of asynchronous features of the transport
67+
(such as the non-blocking mode of a socket) to provide certain levels of asynchronous control.
6968

7069
### Separation of Protocol and Transport
7170

@@ -115,10 +114,9 @@ encoding is defined for use in the message bodies, and this encoding is based on
115114
buffers**](https://developers.google.com/protocol-buffers/), also known as **protobuf**.
116115

117116
For each operation in the API, two separate protobuf message definitions will exist: one for that
118-
operation's inputs, and another for its outputs. The content bytes in a request message can be
119-
converted through protobuf-generated code into a model object for the inputs. Likewise, the content
120-
bytes in a response message can be converted through protobuf-generated code into a model object for
121-
the outputs.
117+
operation's inputs, and another for its outputs. The body in a request message can be converted
118+
through protobuf-generated code into a model object for the inputs. Likewise, the body in a response
119+
message can be converted through protobuf-generated code into a model object for the outputs.
122120

123121
Processing any message is, therefore, a two-phase process: firstly, the header must be processed by
124122
writing code that is conformant with this specification; and secondly, the content must be processed
@@ -151,8 +149,8 @@ cleanly separated from those of another. But while this identifier string is the
151149
authentication, there are different ways that it can be used, and consequently there are different
152150
ways for the authentication field to be populated. One simple method is for the client identifier to
153151
be passed directly. But it is also possible to use the identifier as input to an HMAC algorithm over
154-
the content bytes, in which case the authentication field would contain the computed HMAC, rather
155-
than the identifier itself.
152+
the body, in which case the authentication field would contain the computed HMAC, rather than the
153+
identifier itself.
156154

157155
### Sessions
158156

@@ -249,7 +247,7 @@ following diagram, the bytes go left to right from least significant to most sig
249247
| Content type | Common | 1 | Defines how the message body should be processed. The only currently-supported value is `0x01`, which indicates that the message body should be treated as a serialized protobuf message. |
250248
| Accept type | Requests only | 1 | Defines how the service should provide its response. The only currently-supported value is `0x01`, which indicates that the service should provide a response whose body is a serialized protobuf message. |
251249
| Auth type | Requests only | 1 | Defines how the authentication bytes should be interpreted. |
252-
| Content length | Common | 4 | Provides the exact number of bytes of content. |
250+
| Content length | Common | 4 | Provides the exact number of bytes of body. |
253251
| Auth length | Requests only | 2 | Provides the exact number of bytes of authentication. |
254252
| Opcode | Common | 4 | Indicates the operation being performed by this request. See the [section](#opcodes) above on opcodes. |
255253
| Status | Responses only | 2 | Indicates the overall success or failure of the operation. A value of zero is used universally to mean success. Other values should be interpreted according to the [API specification](status_codes.md). |

src/parsec_security/rust_client_threat_model/threat_model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ sensitive information.
130130
| ID | Justification | Details |
131131
|----|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
132132
| 0 | Parsec interface uses an IPC mechanism respecting confidentiality and integrity of messages transmitted between the clients and the service (once the initial connection has been made). | Unix Domain Socket: the sockets used on the client and service side for the communication are represented by file descriptors that are only accessible by those processes. |
133-
| 1 | The Parsec client is coded with safety in mind and is tested extensively. | [Done](https://github.com/parallaxsecond/parsec-book/issues/35) |
133+
| 1 | The Parsec client is coded with safety in mind and is tested extensively. | [Open](https://github.com/parallaxsecond/parsec-client-rust/issues/49) |
134134

135135
## Operational mitigations
136136

src/parsec_service/authenticators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Direct Authenticator
44

5-
The direct authenticator directly parse the authentication field as a UTF-8 string and uses that as
5+
The direct authenticator directly parses the authentication field as a UTF-8 string and uses that as
66
application identity.
77

88
## Unix Peer Credentials Authenticator

src/parsec_service/install_parsec_linux.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
Parsec can be built and installed as a Linux daemon using systemd. The daemon is a systemd user
44
daemon run by the `parsec` user. Some manual steps are needed to make sure that permissions are set
55
up correctly so that Parsec is installed respecting the operational mitigations of our [threat
6-
model](../parsec_security/parsec_threat_model/threat_model.md). Similarly to the threat model, this
7-
guide proposes different alternatives in case an Identity Provider is available or not. The role and
8-
description of an Identity Provider in Parsec is described in the [System
9-
Architecture](https://parallaxsecond.github.io/parsec-book/parsec_service/system_architecture.html)
10-
page. Currently, Parsec does not support integration with any Identity Provider. To securely install
11-
Parsec, please follow the steps of deployment **without an Identity Provider**.
6+
model](../parsec_security/parsec_threat_model/threat_model.md). Currently, Parsec does not support
7+
integration with any Identity Provider. More installation methods will be added in the future when
8+
new identity providers/authenticators are supported.
129

1310
If your Linux system uses systemd to manage daemons, you can follow these steps. `$DESIRED_FEATURES`
1411
can be a space or comma-separated subset of: `mbed-crypto-provider`, `pkcs11-provider`, and
@@ -21,9 +18,8 @@ Create the Parsec socket directory.
2118
mkdir /tmp/parsec
2219
```
2320

24-
In a deployment **without an Identity Provider**, create the `parsec-clients` group and set the
25-
correct permissions on the socket folder. Mutually trusted Parsec Clients will need to be in that
26-
group.
21+
Create the `parsec-clients` group and set the correct permissions on the socket folder. Mutually
22+
trusted Parsec Clients will need to be in that group.
2723

2824
```
2925
sudo groupadd parsec-clients
@@ -39,12 +35,6 @@ sudo usermod -a -G parsec-clients parsec-client-1
3935

4036
Users just added to that group might need to log-out and log-in again to make sure the change apply.
4137

42-
In a deployment **with an Identity Provider**, set the correct permissions on the socket folder.
43-
44-
```
45-
sudo chmod 755 /tmp/parsec
46-
```
47-
4838
Create and log in to a new user named `parsec`.
4939

5040
```
@@ -81,8 +71,8 @@ systemctl --user enable parsec
8171
systemctl --user start parsec
8272
```
8373

84-
`parsec-clients` users (with no IP) or every one (with IP) can now use Parsec! You can test it
85-
(having logged in a `parsec-clients` user) going inside the `parsec/e2e_tests` directory and:
74+
`parsec-clients` users can now use Parsec! You can test it (having logged in a `parsec-clients`
75+
user) going inside the `parsec/e2e_tests` directory and:
8676

8777
```
8878
cargo test normal_tests

src/parsec_service/providers.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ One instance of the core provider must always be running with a provider ID of z
2020

2121
**Provider UUID: 1c1139dc-ad7c-47dc-ad6b-db6fdb466552**
2222

23-
The Mbed Crypto provider is a software-based provider built on top of Mbed Crypto - the reference
24-
implementation of the PSA cryptography specification. Mbed Crypto is loaded as a static library and
25-
executes with the rest of the service in user-space.
26-
27-
The software version of the Mbed Crypto provider is meant as a proof-of-concept and should not be
28-
used in real-world environments. Future improvements will expand the security guarantee of Mbed
29-
Crypto-based providers.
23+
The [Mbed Crypto](https://os.mbed.com/docs/mbed-os/v6.3/apis/mbed-crypto.html) provider is a
24+
software-based provider built on top of Mbed Crypto - the reference implementation of the PSA
25+
cryptography specification. Mbed Crypto is loaded as a static library and executes with the rest of
26+
the service in user-space.
27+
28+
As a software provider, Mbed Crypto does not offer the same security guarantees as other
29+
hardware-based providers and does not store its keys in a secure location in hardware, but directly
30+
on disk. Because of that, the Mbed Crypto provider should not be used securely for private key
31+
operations but can be used to simplify proof of concept projects.
3032

3133
## TPM Provider
3234

0 commit comments

Comments
 (0)