permissions on files containing secrets #219
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#219
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A unix user wanted a tahoe node to belong to a set of unix accounts instead of a single account, and he used unix groups to set up the permissions, but tahoe foiled him by executing "chmod(secretfile, 0600)" on several secret files.
http://allmydata.org/pipermail/tahoe-dev/2007-December/000254.html
There are a couple of ways that we could enable this kind of usage without exposing the secret files by default to "other". One is just change the constant in our chmod lines to 0660. Nowadays, the default group tends to be quite small -- typically just the same user, so that should be safe.
Oh, I just realized that the way we are doing this is a race condition. An attacker could read the contents of the secret file after we've written it but before we've chmodded it. Oops. (I checked, and we do not currently make sure to chmod the file before writing secret data into it in every case. This should be fixed immediately.)
Perhaps we should chmod the tahoe basedir itself instead of specific files. That would solve the race condition, and perhaps make it slightly easier for unix users to adjust the permissions manually.
Alternately, we could create a subdirectory inside the basedir named "private". This appeals to me because I like to share information which isn't secret -- the other parts of the tahoe config and state can be examined by other users for their edification. It also helps document to the user which files they ought to be more careful with.
stop calling chmod()?to facilitate sharing a tahoe node with a unix groupI wasn't able to tell if the original user wanted to run multiple instances
of the same tahoe node, or if they wanted to have a single instance be
startable by any member of a group of users. Multiple instances of the same
node is a no-no, since the tubids must be unique.
Here's the response I wrote on this topic:
My impression was that it was a simple matter of sharing the "start/stop/restart" button.
In the allmydata.com operations, we accomplish this by having a separate user account, and everyone who should have access to the start/stop/restart button gets the password to that user account.
Francesco and his friends can't create user accounts on their machines, so they tried to accomplish the same sharing using unix group permissions.
That's my reading of it.
Okay, even if we don't want to or can't facilitate (my interpretation of) Francesco's use case, we still have an open security problem here -- secret data is written into files while they are world-readable, and then they are chmodded to no longer be world-readable.
One way to fix this is to check the five or so places where we do this and make sure it is right in each place.
Another way that might be nicer would be to create a subdirectory of the basedir named "private", and
chmod go-x
that directory. This is is nicer because:chmod g+x .tahoe/private
.Anyway, we need to do something for v0.7.0 release.
facilitate sharing a tahoe node with a unix groupto permissions on files containing secretsP.S. Oh yeah, and let's redefine all the files containing secrets to live inside the
private
subdirectory, too.Ok, we decided that we'd write a Node.get_or_create_private_config(), which
always prefixes its filename with "private/", creates the private/ directory
if necessary, and chmods it to 0700 the first time it is created. Then we
change the various places that do their own 0600-chmod to use this method
instead.
access to the 'control port', mostly used by automated tests. We'll
need to update those tests to look for private/control.furl instead of
just control.furl
by foolscap, but we need to tell foolscap to use private/logport.furl
instead of just logport.furl . There are also tools (flogtool tail)
which can accept a directory and look for DIR/logport.furl: those tools
will need to be invoked differently
but for now simply doing Tub(certFile="private/blah.pem") is fine
at their BASEDIR/private/start.html file, instead of BASEDIR/start.html
Also, there should be a $basedir/private/README.private that explains why
this directory is chmodded this way.
I'll do this.
fixed by changeset:a983f6d60c49d71b