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

Router TLS configuration #63

Closed
olix0r opened this issue Feb 3, 2016 · 7 comments · Fixed by #73
Closed

Router TLS configuration #63

olix0r opened this issue Feb 3, 2016 · 7 comments · Fixed by #73
Milestone

Comments

@olix0r
Copy link
Member

olix0r commented Feb 3, 2016

Once #21 is merged, we'll need a way to configure clientside TLS on the router. I can think of at least 2 or 3 different configurations we'll want to support, so this should be modular (and perhaps pluggable, so that users may implement their own crazy policies).

Static validation
routers:
- protocol: http
  tls:
    kind: static
    name: buoyant.io
Per-service validation
routers:
- protocol: http
  baseDtab: /http/1.1/GET => /io.l5d.k8s/default/http
  tls:
    kind: boundPath
    certPath: /path/to/ca.pem
    matches:
    - prefix: /io.l5d.k8s
      name: ${3}.buoyant.io

The matchers should:

  • extract the Name.Bound.id (we may want to explicitly put this on the stack rather than relying on BindingFactory.Dest).
  • Path.read(Name.Bound.id)
  • If a prefix matches:
    • strip the prefix
    • compute offsets in name against the path post-prefix-stripping. If the offset is out of range, the match should not apply
  • if any of these steps fail or a match is not found, TLS should not be applied
  • multiple matches should be able to specify overlapping prefixes

Parsing the name values may be slightly tricky, but we can probably write a parser-generator to do this.

No validation
routers:
- protocol: http
  baseDtab: /http/1.1/GET => /io.l5d.k8s/default/http
  tls:
    kind: noValidationYoloSwag

(And, yes, i think that's what that option should be called.)

Per-host validation

We can probably punt this down the road, but, we can use the IP or Hostname of the individual destination address as the peer's name.

@olix0r olix0r added this to the 0.0.10 milestone Feb 3, 2016
@olix0r
Copy link
Member Author

olix0r commented Feb 3, 2016

I've split out per-service validation into #64 so that establishing base functionality (no validation + static name validation) can be done independently of figuring out all of the matcher stuff.

@adleong adleong self-assigned this Feb 3, 2016
@olix0r
Copy link
Member Author

olix0r commented Feb 3, 2016

It occurs to me that we don't need a special static tls client configuration, as this is just a special case of per-service validation:

- kind: dstRewrite
  matches:
  - prefix: /
    dst: linkerd.io

(i still haven't found a great name for this module)

See #65 for more details, but this should be effectively the same as a static configuration. I'm not sure if it makes sense to provide 2 modules for this or not...

@adleong
Copy link
Member

adleong commented Feb 3, 2016

I'm going to do Static and No Validation in this ticket. I've filed #64 for per-service and we can delete the Static module then if it's just a special case of that.

@klingerf
Copy link
Member

klingerf commented Feb 4, 2016

Quick question about the config file format for TLS. I notice that all of your example configs look something like:

routers:
- kind: http
  tls:
    kind: boundPath

But in master right now, we use protocol for each router, not kind, in which case the config ends up looking like:

routers:
- protocol: http
  tls:
    kind: boundPath

Since TLS is itself part of the protocol, how would you feel about nesting all of the tls options under the protocol section? Having a protocol and a separate tls section feels confusing to me.

@adleong
Copy link
Member

adleong commented Feb 4, 2016

Are you suggesting:

routers:
- protocol:
    name: http
    tls:
      kind: boundPath
  servers:
  - port: 0

That seems pretty reasonable to me.

@klingerf
Copy link
Member

klingerf commented Feb 4, 2016

Yep, or we could keep the "kind" field, like:

routers:
- protocol:
    kind: http
    tls:
      kind: boundPath
  servers:
  - port: 0

@olix0r
Copy link
Member Author

olix0r commented Feb 4, 2016

kind on the protocol was just an oversight. It should be protocol. I don't think we should change it. I think the TLS field should be called kind or module or something

@adleong adleong removed the reviewable label Feb 5, 2016
Tim-Brooks pushed a commit to Tim-Brooks/linkerd that referenced this issue Dec 20, 2018
…rd#63)

Stop ignoring the most significant labels of Destination names

Previously the destinations service was ignoring all the labels in a
destination name after the first two labels. Thus, for example,
"name.ns.another.domain.example.com" would be
considered the same as "name.ns.svc.cluster.local". This was very
wrong.

Match destination names taking into consideration every label in the
destination name.

Provisions have been made for the case where the controller and the
proxies with the zone name to use. However, currently neither the
controller nor the proxies are actually configured with the zone, so
the implementation was made to work in the current configuration too,
as long as fully-qualified names are not used.

A negative consequence of this change is that a name like
"name.ns.svc.cluster.local" won't resolve in the current configuration,
because the controller doesn't know the zone is "cluster.local"

Unit tests are included for the new mapping rules.

Signed-off-by: Brian Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants