-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add support to disable the namespace ownership checks #12441
Conversation
…utes to claim non-overlapping hosts (+ paths) and wildcards across namespace boundaries. Update generated docs and completions.
[test] |
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.
The code LGTM. But I think we need to be a little more strident about the safety implications in the help text.
@@ -36,6 +36,10 @@ If a router does not exist with the given name, this command will create a deplo | |||
Optional path to a certificate file that be used as the default certificate. The file should contain the cert, key, and any CA certs necessary for the router to serve the certificate. | |||
|
|||
.PP | |||
\fB\-\-disable\-namespace\-ownership\-check\fP=false | |||
Disables the namespace ownership check and allows different namespaces to claim either different paths to a route host or overlapping host names in case of a wildcard route. The default behavior (false) to restrict claims to the oldest namespace that has claimed either the host or the subdomain. |
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.
I think we need to add some dire warnings to this. Something like:
Beware: A user in a different can use this to "steal" sub-paths for existing domains if they can create routes. This is only safe if route creation privilege is restricted, or if all users are trusted.
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.
ack - will do.
@@ -68,6 +68,10 @@ You may restrict the set of routes exposed to a single project (with \-\-namespa | |||
List of comma separated domains to deny in routes | |||
|
|||
.PP | |||
\fB\-\-disable\-namespace\-ownership\-check\fP=false | |||
Disables the namespace ownership checks for a route host with different paths or for overlapping host names in the case of wildcard routes |
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.
Should this be the same message as elsewhere? Also, should it end with a .?
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.
This is generated from the pkg/cmd/infra/router/f5.go
and the prior one from pkg/cmd/admin/router/router.go
- will make sure the text syncs up.
// www.example.org/path2 to be claimed by namespaces nsone and | ||
// nstwo respectively. And for wildcard routes, this allows | ||
// overlapping host names (*.example.test vs foo.example.test) | ||
// to be claimed by different namespaces. |
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.
Please put a warning here too
@@ -68,6 +69,7 @@ func (o *RouterSelection) Bind(flag *pflag.FlagSet) { | |||
flag.StringSliceVar(&o.DeniedDomains, "denied-domains", envVarAsStrings("ROUTER_DENIED_DOMAINS", "", ","), "List of comma separated domains to deny in routes") | |||
flag.StringSliceVar(&o.AllowedDomains, "allowed-domains", envVarAsStrings("ROUTER_ALLOWED_DOMAINS", "", ","), "List of comma separated domains to allow in routes. If specified, only the domains in this list will be allowed routes. Note that domains in the denied list take precedence over the ones in the allowed list") | |||
flag.BoolVar(&o.AllowWildcardRoutes, "allow-wildcard-routes", cmdutil.Env("ROUTER_ALLOW_WILDCARD_ROUTES", "") == "true", "Allow wildcard host names for routes") | |||
flag.BoolVar(&o.DisableNamespaceOwnershipCheck, "disable-namespace-ownership-check", cmdutil.Env("ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK", "") == "true", "Disables the namespace ownership checks for a route host with different paths or for overlapping host names in the case of wildcard routes") |
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.
... wildcard routes. This is unsafe in many environments, please read the documentation
[test] |
No errors in test log - https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_integration/9928/console
@marun do you have any ideas? Or is this a known flake? |
|
…ocs. Fix failing integration test.
e92985c
to
b97a0d2
Compare
thanks @knobunc - aargh, my bad!! :^( |
[test] |
No worries, it was hard to spot, but I've had to find those before so I knew where to look. |
Evaluated for origin test up to b97a0d2 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12818/) (Base Commit: 831b981) |
@rajatchopra @openshift/networking @JacobTanenbaum PTAL |
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
[merge] |
Evaluated for origin merge up to b97a0d2 |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13039/) (Base Commit: 7a315d5) (Image: devenv-rhel7_5726) |
This allows routes to claim non-overlapping hosts (+ paths) and wildcards across namespace
boundaries. Update generated docs and completions.
Associated trello card: https://trello.com/c/jd6RksVX/368-5-allow-host-claims-to-be-disabled-in-the-router-ingress
@knobunc PTAL
cc: @openshift/networking if any one else can also review. Thx