-
Notifications
You must be signed in to change notification settings - Fork 19
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
Socket path security checks can fail when the client is in a container #51
Comments
Part of the resolution of this issue would have to be done with this one on Parsec. I have just realised that our checks in the client were useless now that the socket is in If we decide for now that Parsec will only be deployed with one authenticator there are two options:
|
I'll have a look at what changes we need to make in the threat model with the new and improved filesystem locations, and the changes required for this issue - with a focus on making the TM easier to extend for new authenticators. |
Probably worth noting that I actually did this experiment with a build of Parsec that was still using |
So the overall conclusion is that we don't need the checks and can just drop them, it seems. The threat model updates should cover our backsides |
Summary
Client-side socket path security checks can (and most likely will) fail if client is running in a Docker container.
Repro
On any Linux system, create a secure deployment of Parsec according to these documented steps.
Use the following numeric UIDs and GIDs (or else change the examples used in this repro recipe for different values)
2000
for theparsec
user3000
for theparsec-clients
group2001
for theparsec-client-1
example client userStart the Parsec service as the
parsec
user.Clone and build the parsec-tool. Use
cargo build
to build the default set of features. This will include the rust client with the socket folder permission checks.Install Docker.
Change directory to where
parsec-tool
is checked out.Create a
Dockerfile
with the following contents:FROM debian
ADD target/debug/* /
CMD ["/parsec-tool", "ping"]
From the same directory run
docker build --tag parsec-ping .
A docker image should be created. Run the image as follows:
docker run -v /run/parsec:/run/parsec -u 2001:3000 parsec-ping
EXPECTED: The docker container should execute the
parsec-tool ping
command running as user2001
in group3000
(which isparsec-client-1
in groupparsec-clients
). The output should be a successful ping of the service, reporting the supported wire protocol version.OBSERVED: The container image runs, but the ping fails with an error saying
Socket permission checks failed.
Root Cause
The issue is caused by the rust client checking the folder permissions by name and group name rather than by uid and gid respectively. The
parsec
andparsec-clients
names are known to the host, but not known within the container, hence the permission checks fail.Required Fix
We either need to relax the restrictions on the socket folder, or do the checks based on numeric ids rather than names. For the latter, we would need to document well-known numeric IDs for the
parsec
user andparsec-clients
group.The text was updated successfully, but these errors were encountered: