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

✨ WIP Configure order of authorizers #3281

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/server/options/authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ type Authorization struct {
// Webhook contains flags to enable an external HTTPS webhook to perform
// authorization against. Note that not all built-in options are supported by kcp.
Webhook *kubeoptions.BuiltInAuthorizationOptions

// AuthorizationSteps are the order of authorizers that allows to rearrange the order.
// The default are four authorizers in a union: AlwaysAllowPaths, AlwaysAllowGroups, RBAC and Webhook.
AuthorizationSteps []string
}

func NewAuthorization() *Authorization {
Expand Down Expand Up @@ -113,6 +117,10 @@ func (s *Authorization) AddFlags(fs *pflag.FlagSet) {
"A list of HTTP paths to skip during authorization, i.e. these are authorized without "+
"contacting the 'core' kubernetes server.")

fs.StringSliceVar(&s.AuthorizationSteps, "authorization-steps", s.AuthorizationSteps,
"A list of authorizers that should be enabled, allowing administrator rearrange the default order."+
" The default order is: AlwaysAllowPaths,AlwaysAllowGroups,RBAC,Webhook")

// Only surface selected, webhook-related CLI flags

fs.StringVar(&s.Webhook.WebhookConfigFile, "authorization-webhook-config-file", s.Webhook.WebhookConfigFile,
Expand Down