-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add recommendations for secure deployment #41
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
# How to install Parsec on Linux | ||
# How to securely install Parsec on Linux | ||
|
||
Parsec can be built and installed as a Linux daemon using systemd. The Parsec daemon uses socket | ||
activation which means that the daemon will be automatically started when a client request is made | ||
on the socket. The daemon is a systemd user daemon run by the `parsec` user. | ||
Parsec can be built and installed as a Linux daemon using systemd. The daemon is a systemd user | ||
daemon run by the `parsec` user. Some manual steps are needed to make sure that permissions are set | ||
up correctly so that Parsec is installed respecting the operational mitigations of our [threat | ||
model](../threat_model/threat_model.md). Similarly to the threat model, this guide proposes | ||
different alternatives in case an Identity Provider is available or not. The role and description of | ||
an Identity Provider in Parsec is described in the [System | ||
Architecture](https://parallaxsecond.github.io/parsec-book/parsec_service/system_architecture.html) | ||
page. Currently, Parsec does not support integration with any Identity Provider. To securely install | ||
Parsec, please follow the steps of deployment **without an Identity Provider**. | ||
|
||
If your Linux system uses systemd to manage daemons, you can follow these steps. `$DESIRED_FEATURES` | ||
can be a space or comma-separated subset of: `mbed-crypto-provider`, `pkcs11-provider`, and | ||
|
@@ -24,23 +30,46 @@ git clone https://github.com/parallaxsecond/parsec.git | |
cargo install --features $DESIRED_FEATURES --path parsec | ||
``` | ||
|
||
Copy and adapt the [configuration](configuration.md) you want to use. | ||
Copy and adapt the [configuration](configuration.md) you want to use. For a secure deployment, make | ||
sure to activate the `log_error_details` option and to use a `trace` log level. | ||
|
||
``` | ||
cp parsec/config.toml config.toml | ||
``` | ||
|
||
Create the Parsec socket directory. | ||
|
||
``` | ||
mkdir /tmp/parsec | ||
``` | ||
|
||
In a deployment **without an Identity Provider**, create the `parsec-clients` group and set the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to set a bit of context here around identity provider, which may be an unfamiliar term and could confuse the reader. In fact, since we haven't integrated any identity providers yet, I'm wondering whether we should just assume the absence of it for now, and explain that the socket needs to be protected at deployment time because there is currently no runtime mechanism for Parsec to validate its clients. (We can then explain that future deployments will have more flexible means of protection, and talk about identity providers in that context). Without some context, I think there's a danger that these recommendations could seem arbitrary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright! We'll expand on the idea of Identity Provider There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am personally more in favour of the option where we leave the Identity Provider sections but expand on what it is and the context. To do so, we can point out to the threat model where we make the same distinction of a deployment with and a without an IP:
And also point to the System Architecture where we explain what the Identity Provider is. Having to create a |
||
correct permissions on the socket folder. Mutually trusted Parsec Clients will need to be in that | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is meant by "mutually trusted" Parsec clients? The word "mutually" seems to suggest clients that trust each other. But if we really mean clients that are trusted by the service, then we can probably scrub the word "mutually" here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the idea is that the clients trust each other (i.e. they won't use each other's identities) - this is needed because if you have multiple clients and no identity provider, you must have some sort of trust in the other clients There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To add to what Ionut said, this is directly coming from operational mitigation 10 of the service TM:
Since any client in that group can access the keys of the other ones, we seemed to think that the trust should be in between the clients. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the following paragraph:
|
||
group. | ||
|
||
``` | ||
sudo groupadd parsec-clients | ||
sudo chown :parsec-clients /tmp/parsec | ||
sudo chmod 750 /tmp/parsec | ||
``` | ||
|
||
In a deployment **with an Identity Provider**, set the correct permissions on the socket folder. | ||
|
||
``` | ||
sudo chmod 755 /tmp/parsec | ||
``` | ||
|
||
Install the systemd unit files and activate the Parsec socket. | ||
|
||
``` | ||
mkdir -p ~/.config/systemd/user | ||
cp -r parsec/systemd-daemon/parsec.service parsec/systemd-daemon/parsec.socket ~/.config/systemd/user | ||
systemctl --user enable parsec.socket | ||
systemctl --user start parsec.socket | ||
cp -r parsec/systemd-daemon/parsec.service ~/.config/systemd/user | ||
systemctl --user enable parsec | ||
systemctl --user start parsec | ||
``` | ||
|
||
Every user on the system can now use Parsec! You can test it going inside the `parsec/e2e_tests` | ||
directory and: | ||
`parsec-clients` users (with no IP) or every one (with IP) can now use Parsec! You can test it going | ||
inside the `parsec/e2e_tests` directory and: | ||
|
||
``` | ||
cargo test normal_tests | ||
|
@@ -52,4 +81,10 @@ Check the Parsec logs with: | |
journalclt --user -u parsec | ||
``` | ||
|
||
Reload the service: | ||
|
||
``` | ||
systemctl --user kill -s HUP parsec | ||
``` | ||
|
||
*Copyright 2019 Contributors to the Parsec project.* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Recommendations on a Secure Parsec Deployment | ||
|
||
The following recommendations should be applied in order for Parsec to respect some of the | ||
operational mitigations. These recommendations have been thought of for a Linux system and should be | ||
modified/ported for other operating systems. The linked [operational | ||
mitigations](threat_model.md#operational-mitigations) are noted with `O-n`. | ||
|
||
- The service must be running as the `parsec` user (O-0). | ||
- Key mappings must only be read/write by the `parsec` user (O-3). | ||
- The logs must be redirected to a file only readable by the `parsec` user (O-5). | ||
- The configuration file must only be read/write by the `parsec` user (O-6). | ||
- For the Domain Socket Listener, the socket must be in a folder with specific permissions (O-9). | ||
The folder must be owned by the `parsec` user which must have read, write and execute rights on | ||
it. | ||
- In a deployment **without Identity Provider**, the folder must be group owned by the | ||
`parsec-clients` group which has only read and execute permission on it (O-10). Everyone else | ||
must have no permission on the folder. The `parsec-clients` group is composed of mutually | ||
trusted clients only. | ||
- In a deployment **with Identity Provider**, everyone else can have read and execute permission | ||
on the folder. | ||
- Before accessing the service, clients must check the permissions of the folder containing the | ||
socket (O-2). The owner, group owner and permissions must be the same as the previous point, | ||
depending on an Identity Provider is available or not. | ||
|
||
# Using systemd | ||
|
||
Installing Parsec using systemd with the unit files provided and [following the | ||
guide](../parsec_service/install_parsec_linux.md) will make sure that the recommendations above are | ||
respected. | ||
|
||
*Copyright 2020 Contributors to the Parsec project.* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -324,18 +324,18 @@ cleared. | |
|
||
## Operational mitigations | ||
|
||
| ID | Justification | | ||
|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| 0 | A trusted administrator should start the service in such a way that un-privileged processes cannot send signals to the service. | | ||
| 1 | A trusted administrator should check the validity of the providers and hardware modules written in the service's configuration before starting/reloading it. | | ||
| 2 | Clients need to know from a trusted source that a trusted Parsec service is running on their machine so that they can trust the Listener endpoint. | | ||
| 3 | Mappings should be put in a location that only the Parsec service and the trusted administrator can access. | | ||
| 4 | The trusted administrator needs to be notified when any kind of resource is running out. | | ||
| 5 | Parsec logs coming from the service binary should be redirected to a file that is only writable by the service and readable by the trusted administrator. | | ||
| 6 | Parsec configuration file should be only writable by the trusted administrator and readable by the service. | | ||
| 7 | The trusted administrator needs to check that during the boot process the trusted identity provider has successfully given the root trust bundle to the service. | | ||
| 8 | The hardware descriptors should only be accessible by trusted privileged processes. | | ||
| 9 | The Listener endpoint should be put in a location that only the Parsec service and the trusted administrator can access. | | ||
| *10* | *A set of mutually trusted clients has restricted read-write access to the service IPC endpoint.* | | ||
| ID | Justification | | ||
|------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| 0 | A trusted administrator should start the service in such a way that un-privileged processes cannot send signals to the service. | | ||
| 1 | A trusted administrator should check the validity of the providers and hardware modules written in the service's configuration before starting/reloading it. | | ||
| 2 | Clients need to know from a trusted source that a trusted Parsec service is running on their machine so that they can trust the Listener endpoint. | | ||
| 3 | Mappings should be put in a location that only the Parsec service and the trusted administrator can access. | | ||
| 4 | The trusted administrator needs to be notified when any kind of resource is running out. | | ||
| 5 | Parsec logs coming from the service binary should be redirected to a file that is only writable by the service and readable by the trusted administrator. | | ||
| 6 | Parsec configuration file should be only writable by the trusted administrator and readable by the service. | | ||
| 7 | The trusted administrator needs to check that during the boot process the trusted identity provider has successfully given the root trust bundle to the service. | | ||
| 8 | The hardware descriptors should only be accessible by trusted privileged processes. | | ||
| 9 | The Listener endpoint should be contained in a location that only the Parsec service and the trusted administrator can access (only they can create the endpoint). | | ||
| *10* | *A set of mutually trusted clients has restricted read-write access to the service IPC endpoint.* | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again I'm confused by the sense of "mutual" here. Do we mean that the clients trust each other? |
||
|
||
*Copyright 2020 Contributors to the Parsec project.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the config file be in
/tmp/parsec/
with permissions700
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that folder might be volatile 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! There are other permanent locations where the different files could go, that are used by other services, but the advantage of using the
parsec
user home folder and/tmp
is that the installation steps rely less on usingsudo
.