Skip to content
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

Cache collections APIs and commands only support default collections #1146

Open
nicowilliams opened this issue Jun 3, 2023 · 2 comments · May be fixed by #1143
Open

Cache collections APIs and commands only support default collections #1146

nicowilliams opened this issue Jun 3, 2023 · 2 comments · May be fixed by #1143
Assignees

Comments

@nicowilliams
Copy link
Contributor

nicowilliams commented Jun 3, 2023

See discussion in #1143 for problems this causes.

Using non-default credentials caches / cache collections with commands that want to search them causes the default credentials cache collections to be searched instead, and worse, credentials possible to be created there.

The cache collection APIs we copied from MIT Kerberos all lack a suitable way to identify a collection, and all instead search all the default collections:

  • krb5_cc_cache_match() -- no cache [collection] name in sight in its prototype
  • krb5_cccol_cursor_new() / krb5_cccol_cursor_next() -- no cache [collection] name in sight in its prototype

On the other hand, krb5_cc_cache_get_first() does have a const char *type argument that we can change to const char *type_or_collection (i.e., allow it to accept SCC but also SCC:${HOME}/.scc, for example), but then the get_cache_first() method of krb5_cc_ops doesn't itself take a similar argument, thus we cannot extend ``krb5_cc_cache_get_first()'s semantics in this way without adding a new method to krb5_cc_ops` that is like `get_cache_first()` but which takes that same extra `const char *` argument.

Things we could do about this:

  • nothing, except maybe document the problem and how to avoid it by avoiding command options that lead to the use of these APIs, or by using command options that cause these APIs to not be used
  • add per-cache type environment variables by which to change the default collection for each cache type (like KRB5CCNAME, but x6)
  • add new versions of all these APIs that take an optional string argument naming either a cache collection to search or a type whose default collection to search

We should probably also ask @greghudson what MIT Kerberos might or might not accept in this space. We can diverge, naturally, but if we can at least get consensus on whether one ought to even be able to have non-default cache collections, that'd be great.

@nicowilliams nicowilliams self-assigned this Jun 3, 2023
@nicowilliams nicowilliams linked a pull request Jun 5, 2023 that will close this issue
10 tasks
@nicowilliams
Copy link
Contributor Author

@nicowilliams nicowilliams changed the title The get_cache_first() method of krb5_cc_ops should have had a collection name argument. Using non-default credentials caches / cache collections with commands that want to search them causes the default credentials cache collections to be searched instead, and worse, credentials possible to be created there Jun 5, 2023
@nicowilliams
Copy link
Contributor Author

So there is some appetite to fix these things in MIT, but it's gone undone for a long time. And my own energy on this may be running out.

@nicowilliams nicowilliams changed the title Using non-default credentials caches / cache collections with commands that want to search them causes the default credentials cache collections to be searched instead, and worse, credentials possible to be created there Cache collections APIs and commands only support default collections Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant