Skip to content

Document/Test KIngress use of secrets #421

Closed

Description

@dprotaso

I'm wondering if we should have a conformance test to ensure that ingresses can't reach across namespaces to access secrets. The exception would be unless the operator has intervened - ie. with contour there's TLS delegation - https://projectcontour.io/docs/main/config/tls-delegation/

Context for this issue: knative/serving#11250 (comment)

Activity

  1. dprotaso commented on May 26, 2021

    @dprotaso
    MemberAuthor

    Some discussion: https://knative.slack.com/archives/CA9RHBGJX/p1622035644007800

    from impl (Ambassador):

    Cross-namespace secrets have historically been problematic for Ambassador (it had first-party support for them in its own types/CRDs), so much so that they were eventually deprecated and I believe have now been removed. IMO they're not worth the trouble since the policy upstream (i.e., in Kubernetes itself) is that that mechanism of access is not supported

    it's one of those things that when you run into it it falls more into the bucket of "surprising" instead of "useful"

  2. nak3 commented on Jun 2, 2021

    @nak3
    Contributor

    Although we have a SecretNamespace field, is it really used?
    If nobody uses it, we can remove the field or always sets the SecretNamespace to Ingress namespace.

  3. ZhiminXiang commented on Jun 11, 2021

    @ZhiminXiang

    I think we may want to remove the SecretNamespace. I am wondering if Ingress V2 supports cross-namespace reference as from https://gateway-api.sigs.k8s.io/guides/tls/ I don't see a way to set Secret from different namespace.

    So the side effect of removing SecretNamespace is currently DomainMapping has SecretNamespace which references the Kingress SecretNamespace.

    So for DomainMapping do we really want to support the cross-namespace Secret reference? IMO, DomainMapping is for developer who probably should not have the permission to touch the resources under different namespace.

    For the TLS delegation which is for Operator, I would say we may want to consider a different API for it.

  4. ZhiminXiang commented on Jun 11, 2021

    @ZhiminXiang

    Note that we haven't released the SecretNamespace of DomainMapping. So if we are not sure wether we support it or not, I would suggest we remove it first before cutting this release. We can add it back later if we think this is a valid use case.

  5. dprotaso commented on Jun 11, 2021

    @dprotaso
    MemberAuthor

    @shinigambit removed the SecretNamespace from the DomainMapping TLS override option (when bringing your own certificate)

    I think @nak3 was referring to removing the SecretNamespace from the KIngress or maybe at least deprecate it?

  6. ZhiminXiang commented on Jun 11, 2021

    @ZhiminXiang

    @shinigambit removed the SecretNamespace from the DomainMapping TLS override option (when bringing your own certificate)

    Ah, I did not realize that we already delete SecretNamespace. Thanks for the clarification.

    I think @nak3 was referring to removing the SecretNamespace from the KIngress or maybe at least deprecate it?

    Then I don't have concern to deprecate SecretNamespace. I don't think we have any use case for it.

  7. dprotaso commented on Jun 14, 2021

    @dprotaso
    MemberAuthor

    Note there's some discussion happening upstream re: kubernetes-sigs/gateway-api#455

    I'm going to mark SecretNamespace as +optional and include a comment that it should be set to the same namespace as the Ingress otherwise the behaviour is undefined.

    If upstream makes a decision about supporting cross-namespace secret then we can formally support or deprecate that field

    /assign @dprotaso

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions