Add deny-if-empty feature to ENV authentication#1565
Open
overhacked wants to merge 3 commits intomunkireport:mainfrom
Open
Add deny-if-empty feature to ENV authentication#1565overhacked wants to merge 3 commits intomunkireport:mainfrom
overhacked wants to merge 3 commits intomunkireport:mainfrom
Conversation
Add AUTH_ENV_DENY_EMPTY setting to cause ENV authentication to report "unauthorized" if the value of the AUTH_ENV_USER_VAR environment variable is empty. If the environment variable is missing altogether from the $_SERVER environment, report "failed". Signed-off-by: Ross Williams <[email protected]>
private $auth_status should be $authStatus, based on usage in methods. Signed-off-by: Ross Williams <[email protected]>
Added feature to deny auth if user environment variable is empty Signed-off-by: Ross Williams <[email protected]>
Author
|
I've already posted some Wiki changes related to this pull request. I apologize that the documentation got ahead of the PR; I was writing and forgot that saving to the wiki isn't subject to review. If this doesn't get merged, I'll be happy to go and revert. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using
ENVenvironment variable authentication, add option to deny authentication if the environment variable (defaultREMOTE_USER) is empty or missing from the environment. When a web server defaults toREMOTE_USERbeing empty for unauthenticated sessions, this prevents a user with "blank username" from being logged into MunkiReport. This also allows for fallback to another authentication method; for example:ENVauth to check ifREMOTE_USERis set for users accessing MunkiReport via Tailscale Serve, which can set an authenticated username request header.LDAPorSAMLauth if users are accessing MR not via Tailscale.Notes:
ENVbehavior is preserved, and this is not a breaking changeunauthorized, and a missing environment variable returnsfailed; this would aid in debugging.