-
Notifications
You must be signed in to change notification settings - Fork 91
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
[security] Incorrect file permissions for ccache file #357
Comments
Why would we want to allow more than the owner to access the ticket cache for their own user? |
No, we don't want that. See also: https://github.com/krb5/krb5/blob/master/src/lib/krb5/ccache/cc_file.c#L866-L873 |
Hey, I'm trying to save my ccache file inside my linux container but it doesn't seem to work and I don't see any error. Anyone knows what might be the issue ? |
up. would like to know how to achieve this too |
I think it boils down to File.Open("test", FileMode.Create, FileAccess.Write, FileShare.None); creates file like
This file is readable by anybody as the base While many distributions create unique group for each user I would expect that Kerberos.Net should not depend on it and locations like "/tmp/XXXX" may be viewed as security weakness @SteveSyfuhs. Starting with .NET 7.0 File.SetUnixFileMode is available and it should probably be called explicitly if I could probably craft PR @SteveSyfuhs - but I'm not sure if we care about Framework or .NET Standard...? |
Note that since the cache location if known, anybody who needs to can use the |
Yeah we need to continue supporting Framework for a while still. There's a hacky workaround I use in other places that does a reflection call to find the relevant method: https://github.com/dotnet/Kerberos.NET/blob/develop/Kerberos.NET/Crypto/Pal/Rfc2898DeriveBytes.cs That would probably work well enough here? |
yes, one can possibly multi-target and have separate binaries ... but that is pain IMHO. This is not perf critical IMHO and the API is unlikely to change or vanish. |
I manage to get it work locally by configuring the right volume mount and permission. Kerberos.NET config
docker-compose.override.yml
krb5.conf
dockerfile (to copy the modified default cache file krb5.conf to etc)
|
Describe the bug
Only owner can read/write ccache file (when krb5 tiket cache store as local file).
Currently (at least on Linux) the generated ccache file has the wrong permissions (because of umask?).
To Reproduce
Additional context
The same problem was previously fixed in nuget cli: https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Packaging/NuGetExtractionFileIO.cs
The text was updated successfully, but these errors were encountered: