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

Enforce Policy to Require Host Specification in Ingress Resources #4665

Open
barucijah opened this issue Nov 20, 2024 · 0 comments
Open

Enforce Policy to Require Host Specification in Ingress Resources #4665

barucijah opened this issue Nov 20, 2024 · 0 comments

Comments

@barucijah
Copy link

Description

Currently, Kubernetes Ingress resources on AKS allow the creation of rules without specifying a host. This results in ambiguous "catch-all" routing, where the Ingress controller routes traffic for any hostname matching the path. Such behavior introduces the following challenges:

  • Security Risks: Open-ended Ingress definitions can unintentionally expose backend services to unauthorized access.
  • Routing Conflicts: Lack of hostname specificity may lead to unpredictable routing behavior across multiple Ingress resources.
  • Operational Complexity: Debugging and managing Ingress configurations without clear host rules becomes cumbersome.

To improve security, predictability, and operational efficiency, AKS should provide a built-in policy or recommendation to enforce that all Ingress resources include a host in their rules section.

Examples

Without host (current undesired behavior)
Image

  • Problem: This configuration results in a "catch-all" rule that matches requests for any hostname (*) and routes them to the example-service. This is ambiguous and can lead to security and operational issues.

With host (desired behavior)
Image

  • Benefit: This configuration explicitly defines the host as example.com, ensuring that the Ingress rule only applies to requests sent to example.com. This enhances security, predictability, and operational clarity.
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

No branches or pull requests

1 participant