-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YDA-6198: add all users internal option
Add a way to make the ruleset consider all users to be internal, by setting the external domain filter to "*". This is useful in situations where all users are to be authenticated using OIDC. This also makes the is-user-external script use the ruleset function for determining whether a user is external, so that the PAM stack and ruleset use exactly the same logic.
- Loading branch information
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
"""This script is used by the PAM stack to verify whether | ||
a user is external, based on the username.""" | ||
|
||
__copyright__ = 'Copyright (c) 2025, Utrecht University' | ||
__license__ = 'GPLv3, see LICENSE' | ||
|
||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.join(os.path.dirname(__file__), "..")) | ||
sys.path.append(os.path.join(os.path.dirname(__file__), "../util")) | ||
|
||
from yoda_names import is_internal_user | ||
|
||
username = os.environ.get("PAM_USER", "") | ||
exit_code = 1 if is_internal_user(username) else 0 | ||
sys.exit(exit_code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters