Skip to content

Conversation

@rikatz
Copy link
Member

@rikatz rikatz commented Nov 3, 2025

What type of PR is this?
/kind documentation

What this PR does / why we need it:
Adds a security considerations guide for Gateway API
Which issue(s) this PR fixes:
Related #3709

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/documentation Categorizes issue or PR as related to documentation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 3, 2025
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2025
@rikatz
Copy link
Member Author

rikatz commented Nov 3, 2025

/hold
wait for some reviews

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 3, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rikatz
Once this PR has been reviewed and has the lgtm label, please assign robscott for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2025
Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @rikatz, this is great!

## Avoiding hostname/domain hijacking

Gateway controllers work to disambiguate and detect conflicts caused by sharing
different ports, protocols, etc. between various listeners. (?)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe instead of focusing on listeners, focus on the overall theme that it's possible in Gateway API for different Routes or ListenerSets to both claim the same hostname + path, and that Gateway controllers are responsible for conflict resolution.

Copy link
Member Author

Choose a reason for hiding this comment

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

Rob, I am having some bad time here to give you a proper resolution :D do you mind doing a suggestion on how this should look like (unless it is more than 1 line of change!)

Comment on lines 51 to 53
* Because the number of listeners is limited on a Gateway, the administrator should
instead rely on some validation (like ValidationAdmissionPolicy or some other mechanism)
that limits what hostnames can be used on routes of each namespaces.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this should be a default recommendation. Maybe "If you need more listeners than a single Gateway can support, you should consider...".

Copy link
Member

Choose a reason for hiding this comment

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

Since this feels like the start of a new section, I think it would benefit from another subheading, maybe ### More than 64 Listeners.

Copy link
Member Author

Choose a reason for hiding this comment

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

changed to:

### More than 64 listeners

Gateway resource has a limitation of 64 listener entries. If you need more than 64
listeners, you should consider allowing your users to set their hostnames directly
on the routes of each namespaces but limiting what namespace can use what hostname
by relying on a mechanism like `ValidatingAdmissionPolicy`.

In case you opt to use (the still experimental) `ListenerSet`, a similar mechanism
should also be considered to limit what hostnames a `ListenerSet` can claim.

Kept the ValidatingAdmissionPolicy on its own section to be sure people udnerstand it is an example!

Owners of resources should be aware of the usage of [ReferenceGrants](../api-types/referencegrant.md).
This should be audited and limited by admins (needs some better writing here).

The intended use of ReferenceGrants is to allow for the *owner* of an object where
Copy link
Member

Choose a reason for hiding this comment

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

One concern here is that we may end up rewriting/duplicating some of the ReferenceGrant docs. I think it makes sense to keep most ReferenceGrant-specific information in those docs, and then keep this doc for suggestions on how to further limit the use of ReferenceGrant.

Copy link
Member Author

Choose a reason for hiding this comment

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

@robscott do you think the referencegrant docs already cover enough of this?

I am adding then just a reference on the ReferenceGrant docs for the security considerations, and on this document I am removing almost all of this text, and leaving bare minimum related to security.

cc @youngnick I didn't erased your text from the original document :) so if you feel we still should add that part of ReferenceGrant here or on ReferenceGrant api-reference lmk!

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/documentation Categorizes issue or PR as related to documentation. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants