external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

Do not risk exposing unauthenticated webhook port on container

Open kimsondrup opened this issue 1 year ago • 4 comments

Description

The current doc for the webhook provider expect the k8s probe to call localhost but the normal Kubernetes behavior is to call the pods IP so the current doc doesn't work.

Some implementers work around this by expecting users to override the livenessProbe and readinessProbe (see example external-dns-ionos-webhook) but this might as well be upstreamed

Checklist

  • [ ] Unit tests updated
  • [x] End user documentation updated

kimsondrup avatar Aug 19 '24 22:08 kimsondrup

Hi @kimsondrup. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Aug 19 '24 22:08 k8s-ci-robot

/ok-to-test /assign @stevehipwell Apart my little suggestion, it looks good.

mloiseleur avatar Aug 28 '24 17:08 mloiseleur

/lgtm

mloiseleur avatar Aug 29 '24 09:08 mloiseleur

In addition to the inline question, shouldn't the webhook be providing both a /livez and a /readyz endpoint instead of a /healthz endpoint to follow the K98s idiomatic pattern?

I don't think it matters much at the current moment as the base external-dns serves only a /healthz probe. You might want to create an additional PR to bring us within this pattern @stevehipwell .

It also wouldn't cause much of a problem to add these probes as it is a simple addition. I already have it implemented on the external-dns-unifi-webhook, but at a quick glance a couple webhook providers are only supplying the /healthz probe.

kashalls avatar Sep 08 '24 03:09 kashalls

In addition to the inline question, shouldn't the webhook be providing both a /livez and a /readyz endpoint instead of a /healthz endpoint to follow the K98s idiomatic pattern?

Since External DNS webhook only receive traffic from metrics scraping on the pod IP and its webhook API on localhost an separate endpoints for readiness probe will not add much value if any at all. The External DNS process will call localhost:8888 without regard for the readiness probe and I am not even sure if metrics scraping even respects the readiness probe.

As @kashalls said, I think this should be in another PR.

kimsondrup avatar Sep 08 '24 13:09 kimsondrup

/lgtm /approve

stevehipwell avatar Sep 10 '24 14:09 stevehipwell

@mloiseleur could you please approve this?

stevehipwell avatar Sep 10 '24 14:09 stevehipwell

/approve

Raffo avatar Sep 10 '24 19:09 Raffo

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Raffo, stevehipwell

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Sep 10 '24 19:09 k8s-ci-robot

I don't know if it was intentional or not, but this does break existing setups utilizing the webhook provider (since the port name changed).

craigcabrey avatar Sep 11 '24 23:09 craigcabrey

I don't know if it was intentional or not, but this does break existing setups utilizing the webhook provider (since the port name changed).

Anything under major version v1.0.0 is considered an always breaking version.

kashalls avatar Sep 11 '24 23:09 kashalls

Not to be pedantic, but the chart version is 1.15.0.

craigcabrey avatar Sep 11 '24 23:09 craigcabrey

Not to be pedantic, but the chart version is 1.15.0.

My bad, I saw the release was v0.15.0.

kashalls avatar Sep 12 '24 00:09 kashalls