-
Notifications
You must be signed in to change notification settings - Fork 86
Wildcard support for all users at a given domain #291
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
Conversation
|
This is very cool, can you put exactly how this rule would work in the documentation and the PR description.
This is going in the right direction. I can help you out with the tests when we get to that point
I want to avoid having an order in which auth_id and plugin_policy rules are applied. That said, a file which has a list of users which can never login via opkssh would be helpful. Maybe a line in Borrowing the AllowUsers/DenyUsers configuration directive from OpenSSH sshd_config. |
the comment above changes the alignment requirements?
docs/config.md
Outdated
| We support matching on email, sub (subscriber) or group. | ||
|
|
||
| We support email "wildcard" validation using the `oidc-match-end:email:` prefix. This allows administrators to match user emails by domain or other patterns at the end of the email string. | ||
| - This matching is **case-sensitive**. |
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.
Can you provide a justification for this being case sensitive? Is it that linux usernames are case sensitive? It seems strange since email addresses and domains are case insensitive.
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.
yeah, it was more a statement about behaviour of the code, just to ensure its in the docs, more than about correctness. But I need now its wrong anyhow, its the deny users that are case sensitive.
Yeah, insensitive makes more sense. I'll update the code and the tests
|
This looks pretty close to mergeable. I might try to merge it tommorrow |
|
Next week when I get some time, i'm going to fix this up, and PR some other features that work well with this |
|
Congrats on getting your first PR merged in opkssh! Thanks for all the work on this PR, hope to see more PRs from you in the future. |
Add wildcard support
Adds email "wildcard" validation using the
oidc-match-end:email:prefix. This allows administrators to match user emails by domain or other patterns at the end of the email string.In the system authorized identity file
/etc/opk/auth_idyou can now add an email suffix wildcard matching all emails ending in, for example,@example.comAlso adds a
deny_emailsfield to the server config.This field is a YAML array of strings, where each string is an email address you wish to deny access to.
deny_emailslist.deny_emailsis consulted. If one of these plugins succeeds, authentication will be successful regardless of the contents ofdeny_emailsDescription before edit
picking up from #73
I'm a little uncertain about the tests, mostly because its my first time with go, and this repo.
If its going in the right direction, i'd add some comments explaining the intent of including those policies, and which tests they relate to., I think it'd be helpful for newcomers reading the codebase
While we are here, is there a way to deny some subset of emails first, before allowing the wildcard match?
edit: Changes name to use
deny_emailsinstead ofdeny_usersso I can adddeny_userslater