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

add opaque Bearer Token to approved authentication methods #398

Merged
merged 13 commits into from
Mar 6, 2018

Conversation

jboyd01
Copy link
Contributor

@jboyd01 jboyd01 commented Dec 19, 2017

fixes #381

per https://tools.ietf.org/html/rfc6750 I explicitly called out that when using bearer tokens you must be using TLS.

@cfdreddbot
Copy link

Hey jboyd01!

Thanks for submitting this pull request!

All pull request submitters and commit authors must have a Contributor License Agreement (CLA) on-file with us. Please sign the appropriate CLA (individual or corporate).

When sending signed CLA please provide your github username in case of individual CLA or the list of github usernames that can make pull requests on behalf of your organization.

If you are confident that you're covered under a Corporate CLA, please make sure you've publicized your membership in the appropriate Github Org, per these instructions.

Once you've publicized your membership, one of the owners of this repository can close and reopen this pull request, and dreddbot will take another look.

@duglin
Copy link
Contributor

duglin commented Dec 19, 2017

I'm not sure we can do it this way w/o breaking backwards compat. Rather I think we can get the same net results by adding a subsection that basically talks about how "if" bearer tokens are used then this is how you do it.

@arschles
Copy link
Contributor

+1 to @duglin. It would be nice to keep the MUST language under the "If bearer tokens are used" subsection though.

@jboyd01 jboyd01 closed this Dec 19, 2017
@jboyd01 jboyd01 reopened this Dec 19, 2017
@cfdreddbot
Copy link

Hey jboyd01!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

@jboyd01
Copy link
Contributor Author

jboyd01 commented Dec 19, 2017

@duglin , @arschles I've attempted a rework on this, happy to go a different direction if you think there is something better.

Copy link
Contributor

@arschles arschles left a comment

Choose a reason for hiding this comment

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

I think this looks ok, thanks @jboyd01. LGTM

@mattmcneeney
Copy link
Contributor

This looks good to me too.

As a side note @jboyd01, do you have any documentation outlining how you see this working generally?

@mattmcneeney mattmcneeney added this to the 2.14 milestone Jan 5, 2018
@mattmcneeney mattmcneeney added this to Top priorities in Roadmap & Release Planning Jan 5, 2018
spec.md Outdated
An alternative to carrying basic authentication on every request is to utilize a
bearer token via the `Authorization: Bearer` header. When a bearer token is
used additional processes are often required to deal with token expiration and
renewal. These are details not covered by this specification and must be worked
Copy link
Contributor

Choose a reason for hiding this comment

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

Travis will complain about lowercase must

spec.md Outdated
@@ -165,6 +165,13 @@ Service Broker using HTTP basic authentication (the `Authorization:` header)
on every request. This specification does not specify how Platform and Service
Brokers agree on other methods of authentication.

An alternative to carrying basic authentication on every request is to utilize a
bearer token via the `Authorization: Bearer` header. When a bearer token is
used additional processes are often required to deal with token expiration and
Copy link
Contributor

Choose a reason for hiding this comment

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

Travis will complain about lowercase required

@jboyd01
Copy link
Contributor Author

jboyd01 commented Jan 8, 2018

@mattmcneeney, thanks for the review. regarding your question above about "any documentation outlining how you see this working generally" - I don't think we have any doc, but as a concrete example:

Service Catalog uses opaque tokens on Open Shift for authenticating with our service brokers such as the Ansible Service Broker. When a new Broker is created, the broker authentication information specifies to use a specific secret whose content contains the necessary bearer token. The bearer token secret is created external to Catalog by the Broker installation and the token does not expire.

If you desire token expiration, you would need a mechanism to update the K8s secret. The updated secret would automatically be picked up by Service Catalog the next time it is referenced.

@duglin
Copy link
Contributor

duglin commented Jan 9, 2018

The text itself looks good. Just one higher-level question... why are we calling out this one specific security mechanism? Will this open the door to people wanted to add guidance for others as well? For now I guess its ok, but I'm not keen on duplicating what should really be part of the "out of bands agreement(spec)" that we say the platform and broker decide on. Its kind of like we're saying "its none of our business, but we're gonna tell you want to do anyway" :-)

@avade avade self-assigned this Jan 9, 2018
spec.md Outdated
used additional processes are often needed to deal with token expiration and
renewal. These are details not covered by this specification and need to be
worked out by the Platform. If bearer tokens are used communication with the
Broker MUST be secured over TLS.
Copy link
Contributor

Choose a reason for hiding this comment

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

Broker -> Service Broker

@duglin
Copy link
Contributor

duglin commented Jan 12, 2018

Per our last call, I believe Jay, Aaron and Alex are going to talk off-line about rewording this. I think to mainly focus on how using TLS is good when any auth mechanism is used.

@jboyd01 jboyd01 changed the title add opaque Bearer Token to approved authentication methods [WIP] add opaque Bearer Token to approved authentication methods Jan 23, 2018
@jboyd01
Copy link
Contributor Author

jboyd01 commented Jan 23, 2018

Alex, Aaron and I are doing some additional rework on this removing the specifics about opaque token and clarifying some aspects around authentication. Marked as Work In Progress for now, not ready for review.

@mattmcneeney
Copy link
Contributor

Hey @jboyd01 You may want to rebase this PR on top of master as I believe it's showing many changes that aren't part of this change!

@jboyd01
Copy link
Contributor Author

jboyd01 commented Jan 24, 2018

@mattmcneeney Yes, it was a rebase gone bad, got it straightened out now. Thanks

spec.md Outdated
@@ -163,9 +163,15 @@ Service Broker using HTTP basic authentication (the `Authorization:` header)
on every request. This specification does not specify how Platform and Service
Brokers agree on other methods of authentication.

Platforms and brokers may agree on an authentication mechanism other than
Copy link
Contributor

Choose a reason for hiding this comment

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

s/brokers/Service Brokers/
s/may/MAY/

profile.md Outdated

The [specification](spec.md) requires that brokers implement HTTP Basic authentication, but also allows for other mechanisms if the platform and the broker agree upon them outside of the specification. This section contains a list of supported mechanisms that platforms and brokers support. The list will be growing as time goes on.

- The [Kubernetes Service Catalog](https://github.com/kubernetes-incubator/service-catalog) supports arbitrary HTTP Bearer tokens over TLS as an authentication mechanism
Copy link
Contributor

@duglin duglin Jan 29, 2018

Choose a reason for hiding this comment

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

I'm not sure we want to add this to the profile - it feels kind of awkward since each time an impl changes what it supports we'd need to publish a new version of the profile. Putting it in our wiki might be ok though. Or just pointing people to the docs for each impl.

Copy link
Contributor

@duglin duglin Jan 29, 2018

Choose a reason for hiding this comment

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

If we wanted to add something to the Profile about auth, then I think having auth-specific rules or guidance would be appropriate - stuff that all impls should adhere to.

Copy link
Contributor

Choose a reason for hiding this comment

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

As a service author, where can I go to learn how to build a broker against this? The service-catalog readme doesn't direct me anywhere to learn this

Copy link
Contributor

Choose a reason for hiding this comment

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

This is why the info here shouldn't really be platform specific, rather, if anything, it would be auth specific. E.g. I don't think svc-cat's use of HTTP bearer tokens is unique, or at least I hope not, otherwise we wouldn't have interop.

I kind of wonder what the purpose of this text is. I don't think we should just reiterate what each platform's docs say w.r.t. which auth mechanisms it supports. That's not only duplicate info but requires us to keep things in sync. I'd prefer for this section to be more about any OSB API specific aspects of the various auth mechanisms Platforms support that people will need to know about if they want to write code - that way the odds of having interop go up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

re Matt's comment

As a service author, where can I go to learn how to build a broker against this? The service-catalog readme doesn't direct me anywhere to learn this

We've got a general documentation issue we hope to address for the next major release which will help, but you are right, presently there isn't much doc on this

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to ^^ - we don't have much to put here yet, but it would be nice to set the precedent. if we don't want to put specific systems in here, I would be ok with something like a "coming soon" in this section

Copy link
Contributor

Choose a reason for hiding this comment

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

Per offline conversation with @duglin, @jboyd01 and myself, we will:

  • move this section into the spec.md, replacing it with the link to profile.md
  • link to a wiki page which @duglin will create
  • the wiki page will be non-normative and contain at least a non-exhaustive list of known platforms (and possibly brokers in the future?) that implement other auth. mechanisms

profile.md Outdated
@@ -232,6 +233,12 @@ part of a Kubernetes API call:
}
```

## Platform to Service Broker Authentication

The [specification](spec.md) requires that brokers implement HTTP Basic authentication, but also allows for other mechanisms if the platform and the broker agree upon them outside of the specification. This section contains a list of supported mechanisms that platforms and brokers support. The list will be growing as time goes on.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/brokers/Service Brokers

profile.md Outdated

The [specification](spec.md) requires that brokers implement HTTP Basic authentication, but also allows for other mechanisms if the platform and the broker agree upon them outside of the specification. This section contains a list of supported mechanisms that platforms and brokers support. The list will be growing as time goes on.

- The [Kubernetes Service Catalog](https://github.com/kubernetes-incubator/service-catalog) supports arbitrary HTTP Bearer tokens over TLS as an authentication mechanism
Copy link
Contributor

Choose a reason for hiding this comment

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

As a service author, where can I go to learn how to build a broker against this? The service-catalog readme doesn't direct me anywhere to learn this

spec.md Outdated
using the predetermined authentication mechanism and MUST return a `401
Unauthorized` response if the authentication fails.
using the predetermined authentication mechanism, securing communications
via TLS, and MUST return a `401 Unauthorized` response if the authentication
Copy link
Member

Choose a reason for hiding this comment

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

A dependency on TLS makes service broker development more difficult. For production TLS is a must, for development not necessarily. If we insist on TLS, do we allow self-signed certificates?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be ok with self-signed certs for non-production deployments, or honestly even not requiring TLS in those cases

Copy link
Contributor

Choose a reason for hiding this comment

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

Per offline conversation with @duglin, @jboyd01 and myself, we will change this language to require TLS only in production, and say that it's a decision between the broker and the platform whether they use root or self signed certs

@duglin
Copy link
Contributor

duglin commented Feb 6, 2018

rebase needed

@duglin
Copy link
Contributor

duglin commented Feb 7, 2018

there are a ton of other changes in here, did you mean to make those?

@arschles
Copy link
Contributor

arschles commented Feb 7, 2018

sorry @duglin @jboyd01 - my markdown linter went nuts in f50a287. I'm gonna back that out and this should be ready to go

@arschles
Copy link
Contributor

arschles commented Feb 8, 2018

@duglin @jboyd01 I have removed the lame commit I made that linted all the markdown. This should be good to go now

Platforms and Service Brokers MAY agree on an authentication mechanism other
than basic authentication, but the specific agreements are not covered by this
specification. Please see the
[Platform Features authentication mechanisms wiki document](https://github.com/openservicebrokerapi/servicebroker/wiki/Platform-Features)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand why this isn't in the spec, but I'm happy with this for now.

@pmorie
Copy link
Contributor

pmorie commented Feb 20, 2018

LGTM

Approved with PullApprove

@jboyd01
Copy link
Contributor Author

jboyd01 commented Feb 21, 2018

@duglin this should be all set, PTAL.

@duglin
Copy link
Contributor

duglin commented Feb 21, 2018

LGTM!

Approved with PullApprove

@fmui
Copy link
Member

fmui commented Feb 27, 2018

LGTM

Approved with PullApprove

spec.md Outdated
using the predetermined authentication mechanism, and MUST return a `401 Unauthorized`
response if the authentication fails.

Additionally, the Service Broker MUST secure communucations with TLS. The Platform
Copy link
Contributor

Choose a reason for hiding this comment

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

communucations -> communications

@duglin
Copy link
Contributor

duglin commented Mar 6, 2018

LGTM
3 more needed

Approved with PullApprove

@fmui
Copy link
Member

fmui commented Mar 6, 2018

LGTM

Approved with PullApprove

1 similar comment
@mattmcneeney
Copy link
Contributor

mattmcneeney commented Mar 6, 2018

LGTM

Approved with PullApprove

@n3wscott
Copy link
Contributor

n3wscott commented Mar 6, 2018

LGTM

Approved with PullApprove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Add support for opaque bearer token auth to spec
9 participants