Skip to content

Router metrics should be protected by delegated auth #16975

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

Merged

Conversation

smarterclayton
Copy link
Contributor

Allow additional authorization checking from the master by performing
delegating auth when the router metrics endpoint is accessed. Use the
cmux library to put HTTP and HTTPS on the same port so that we can avoid
complex setup requirements for routers which must be HTTP available for
healthchecks, but should be HTTPS protected for accepting client
authentication.

Uses the delegating authorizer to protect the endpoint with the SAR for

group: route.openshift.io
resource: routers
name: <router-name>
subresource: metrics for /metrics and debug for /debug

@deads2k this is a compromise between three factors:

  1. we can't change the stats port easily (exposing another port makes me die a bit)
  2. we have to remain backwards compatible with existing deployments
  3. we would prefer to use delegated auth for metrics over the other options (username/pass)

Opinions?

Allow additional authorization checking from the master by performing
delegating auth when the router metrics endpoint is accessed. Use the
cmux library to put HTTP and HTTPS on the same port so that we can avoid
complex setup requirements for routers which must be HTTP available for
healthchecks, but should be HTTPS protected for accepting client
authentication.

Uses the delegating authorizer to protect the endpoint with the SAR for

    group: route.openshift.io
    resource: routers
    name: <router-name>
    subresource: metrics for /metrics and debug for /debug
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 20, 2017
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 20, 2017
},
Checks: []healthz.HealthzChecker{check},
}
if certFile := util.Env("ROUTER_METRICS_TLS_CERT_FILE", ""); len(certFile) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an env var and not a mounted file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an env var and not a mounted file?

Oh, nm. Misread. It's the name. Why isn't that a flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following convention mostly for things we aren't sure we want a formal API in flags for. I could set it experimental as a flag I guess.

@deads2k
Copy link
Contributor

deads2k commented Oct 20, 2017

It's not particularly pretty, but I think it works. How many releases are we going to continue allowing http access to healthz?

Password: o.StatsPassword,
Authenticator: authn,
Authorizer: authz,
Record: authorizer.AttributesRecord{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This structure looks ok to me. It allows subdivision for particular routers and the subresource pattern lets you say things like: you can see metrics for all routers.

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Oct 20, 2017 via email

@smarterclayton
Copy link
Contributor Author

/test extended_conformance_gce

@smarterclayton
Copy link
Contributor Author

/test extended_conformance_install_update

@deads2k
Copy link
Contributor

deads2k commented Oct 24, 2017

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 24, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, smarterclayton

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@smarterclayton smarterclayton added kind/delivery-blocker kind/bug Categorizes issue or PR as related to a bug. and removed kind/delivery-blocker labels Oct 25, 2017
@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue.

@openshift-merge-robot openshift-merge-robot merged commit ce78d7a into openshift:master Oct 25, 2017
@pecameron
Copy link
Contributor

@smarterclayton Do you have a PR for the doc changes?

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Oct 25, 2017 via email

@knobunc
Copy link
Contributor

knobunc commented Oct 26, 2017

/lgtm Thanks @smarterclayton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants