-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Authentication option doesn't take effect if there's no authorization policy #3392
Authentication option doesn't take effect if there's no authorization policy #3392
Conversation
d8e152b
to
4f1b438
Compare
44398fe
to
a26ea96
Compare
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.
Starting to look good! :)
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.
LGTM. You'll need to squash the commits before merge though. Thanks @kale-amruta!
This commit gives a message stating authetication will be ineffective when you run the opa server with authentication as TOKEN and no authorization Fixes open-policy-agent#3380 Signed-off-by: Amruta Kale <[email protected]>
51a0851
to
82cb075
Compare
@anderseknert Thanks! I dont think I have access to merge the PR. Will you be merging it? |
It looks good from my POV, but never hurts to get a second opinion before merge so leaving this for someone else to review. |
@anderseknert sure, makes sense. |
@@ -305,6 +305,10 @@ func (rt *Runtime) Serve(ctx context.Context) error { | |||
"diagnostic-addrs": *rt.Params.DiagnosticAddrs, | |||
}).Info("Initializing server.") | |||
|
|||
if rt.Params.Authorization == server.AuthorizationOff && rt.Params.Authentication == server.AuthenticationToken { | |||
logrus.Error("Token authentication enabled without authorization. Authentication will be ineffective. See https://www.openpolicyagent.org/docs/latest/security/#authentication-and-authorization for more information.") |
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.
Nit: Should we log a warning (ie. logrus.Warn
) ?
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.
Better check the resolved conversations ;)
This fix gives a Error msg when you start the opa runtime server with authentication as TOKEN and authorization OFF
Fixes #3380