Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Hairpinning allowlist#324

Merged
geofffranks merged 7 commits intocloudfoundry:mainfrom
Mrizwanshaik:hairpinnig-allowlist
Aug 24, 2022
Merged

Hairpinning allowlist#324
geofffranks merged 7 commits intocloudfoundry:mainfrom
Mrizwanshaik:hairpinnig-allowlist

Conversation

@Mrizwanshaik
Copy link
Copy Markdown
Contributor

@Mrizwanshaik Mrizwanshaik commented Aug 9, 2022

  • A short explanation of the proposed change:

Gorouter route service hairpinning / internal resolution had caused CVE-2019-3789. The main issue was that external domains can be hijacked by declaring an external domain as 'private domain' and mapping it to a route service, which would mask the request to the external resource.

In #281, we proposed do add an allowlist for route service host names that are allowed to be resolved internally via Gorouter's route registry.

This PR implements the new property and handling of allowlists.

  • An explanation of the use cases your change solves

This PR allows enabling Gorouter internal route serice resolution / hairpinning for a subset of safe domains. This subset is defined in the allowlist and is under the operator's control.

  • Instructions to functionally test the behavior change using operator interfaces (BOSH manifest, logs, curl, and metrics)

The functionality is covered via unit tests.

Otherwise, a route service can be declared and the route's host added to the hairpinning allowlist. An app configured with the route service will result in a call to the route service resolved internally instead of externally. This should be visible, e.g. in the LB logs: i.e. the request issued by gorouter will not be shown on the LB.

  • Expected result after the change

When hairpinning is disabled, the behaviour remains the same as before, i.e. route service requests are carried out via external request. This is the default.

When hairpinning is enabled and an allowlist is set, only route service URLs, whose host name matches one of the entries on the allowlist will be resolved internally. Other requests will be requested externally in order to avoid CVE-2019-3789.

When hairpinning is enabled and no allowlist is set, the allowlist is ignored and all route service requests that can be resolved internally via the route registrar are resolved internally. The Gorouter is subject to CVE-2019-3789.

  • Current result before the change

When hairpinning is disabled, all route service requests lead to external requests. This incurs another hop on the ingress and potential added delay of the overall request.

When hairpinning is enabled, all route service requests that can be resolved internally via the route registrar are resolved internally. The Gorouter is subject to CVE-2019-3789.

  • Links to any other associated PRs

  • I have viewed signed and have submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using scripts/run-unit-tests-in-docker from routing-release.

  • (Optional) I have run Routing Acceptance Tests and Routing Smoke Tests on bosh lite

  • (Optional) I have run CF Acceptance Tests on bosh lite

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Aug 9, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@peanball peanball force-pushed the hairpinnig-allowlist branch 2 times, most recently from b375f40 to b59864f Compare August 10, 2022 14:48
@Mrizwanshaik Mrizwanshaik marked this pull request as ready for review August 11, 2022 07:40
@peanball peanball force-pushed the hairpinnig-allowlist branch from b59864f to c4ff757 Compare August 11, 2022 11:46
@peanball peanball deleted the hairpinnig-allowlist branch August 11, 2022 11:48
@Mrizwanshaik Mrizwanshaik changed the title Hairpinnig allowlist Hairpinning allowlist Aug 11, 2022
@peanball peanball restored the hairpinnig-allowlist branch August 11, 2022 11:51
@domdom82 domdom82 self-assigned this Aug 11, 2022
@peanball peanball force-pushed the hairpinnig-allowlist branch 2 times, most recently from 0bfdcf2 to 8135ee8 Compare August 11, 2022 16:01
@peanball peanball force-pushed the hairpinnig-allowlist branch from 8135ee8 to 90c3e73 Compare August 12, 2022 04:58
Alexander Lais and others added 2 commits August 12, 2022 10:50
Co-authored-by: Dominik Froehlich <Dominik.Frolic@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants