Skip to content

fix bug - #3120

Merged
tharindu1st merged 1 commit into
wso2:mainfrom
tharindu1st:config-dump-disable
Aug 12, 2026
Merged

fix bug#3120
tharindu1st merged 1 commit into
wso2:mainfrom
tharindu1st:config-dump-disable

Conversation

@tharindu1st

Copy link
Copy Markdown
Contributor

fix bug

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@tharindu1st, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0963e3d2-ea9f-467c-83a5-58dcb6a86e50

📥 Commits

Reviewing files that changed from the base of the PR and between cbc5570 and 7f39ea0.

📒 Files selected for processing (1)
  • .claude/rules/go-control-plane-xds-security.md
📝 Walkthrough

Walkthrough

The change gates controller and policy-engine /config_dump endpoints by configuration. It makes the Envoy router admin interface opt-in, updates health checks and graceful draining, and removes Kubernetes admin-port exposure by default.

Changes

Admin endpoint controls

Layer / File(s) Summary
Configuration dump contracts and enforcement
gateway/gateway-controller/pkg/config/config.go, gateway/gateway-controller/pkg/adminserver/*, gateway/gateway-runtime/policy-engine/internal/config/config.go, gateway/gateway-runtime/policy-engine/internal/admin/*, gateway/configs/*.toml, gateway/it/test-config*.toml, kubernetes/helm/gateway-helm-chart/{values.yaml,templates/gateway/gateway-config.yaml}
Both admin servers now provide config_dump.enabled, defaulting to false. Disabled requests return 404. Local and integration configurations enable the route where required.

Router admin runtime

Layer / File(s) Summary
Opt-in Envoy admin interface
gateway/gateway-runtime/docker-entrypoint*.sh, gateway/gateway-runtime/router/config/envoy-bootstrap.yaml, gateway/gateway-runtime/policy-engine/configs/envoy*.yaml
Startup injects the Envoy admin listener only when enabled. Configured listeners use loopback defaults.
Health and shutdown behavior
gateway/gateway-runtime/health-check.sh, gateway/gateway-runtime/docker-entrypoint*.sh
Enabled admin interfaces use /ready. Disabled interfaces use a TCP check on ROUTER_HTTP_PORT. Graceful draining is skipped when the admin interface is disabled.

Deployment and documentation wiring

Layer / File(s) Summary
Runtime and test deployment settings
gateway/{distribution/docker-compose.yaml,docker-compose*.yaml}, gateway/it/docker-compose.test*.yaml, kubernetes/helm/gateway-helm-chart/templates/gateway/gateway-runtime/deployment.yaml, kubernetes/helm/gateway-helm-chart/values.yaml
Local, performance, debug, and integration-test deployments configure router admin access. Helm exposes routerAdminEnabled, disabled by default.
Kubernetes probes and exposure
kubernetes/gateway-operator/internal/controller/resources/api-platform-gateway-k8s-manifests.yaml
The router Service and container no longer publish port 9901. Liveness and readiness probes use health paths on port 8080.
Operational guidance
kubernetes/helm/gateway-helm-chart/README.md, .claude/rules/go-control-plane-xds-security.md
Documentation defines default-disabled behavior, loopback binding, read-only runtime protection, and restrictions on Kubernetes admin-port exposure.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RuntimeEntrypoint
  participant Envoy
  participant RouterHealthCheck
  RuntimeEntrypoint->>Envoy: Inject admin listener when ROUTER_ADMIN_ENABLED=true
  RuntimeEntrypoint->>Envoy: Omit admin listener when disabled
  RouterHealthCheck->>Envoy: GET /ready when admin is enabled
  RouterHealthCheck->>Envoy: TCP check on ROUTER_HTTP_PORT when admin is disabled
Loading

Possibly related PRs

Suggested reviewers: renuka-fernando, lasanthas, ashera96

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description contains only "fix bug" and omits the required purpose, goals, approach, tests, security checks, documentation, and environment details. Complete the repository template with the change rationale, implementation details, documentation impact, test results, security checks, related PRs, and test environment.
Title check ❓ Inconclusive The title "fix bug" is too vague and does not identify the configuration or admin-interface change. Replace the title with a specific summary, such as "Disable sensitive admin config-dump endpoints by default".
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
gateway/gateway-runtime/policy-engine/internal/admin/server_test.go (1)

79-79: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add disabled-state coverage for /config_dump.

The changed test verifies only the enabled route. Add a separate test that leaves ConfigDump.Enabled false and asserts that /config_dump returns HTTP 404. This protects the fail-closed default.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gateway/gateway-runtime/policy-engine/internal/admin/server_test.go` at line
79, Add a separate test function that verifies the disabled-state behavior of
the /config_dump endpoint. In this new test, set ConfigDump.Enabled to false in
the configuration, then make a request to /config_dump and assert that it
returns HTTP 404. This ensures the endpoint properly enforces the fail-closed
default when the feature is disabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gateway/gateway-runtime/docker-entrypoint.sh`:
- Around line 184-193: Enforce loopback-only Router admin binding before
generating the admin configuration in the ROUTER_ADMIN_ENABLED branch of
gateway/gateway-runtime/docker-entrypoint.sh and the corresponding branch at
gateway/gateway-runtime/docker-entrypoint-debug.sh; reject non-loopback
ROUTER_ADMIN_HOST values. Update the debug entrypoint’s loopback documentation
to match the enforced behavior. In kubernetes/helm/gateway-helm-chart/README.md,
do not describe the admin interface as loopback-only unless both entrypoints
enforce that boundary.

In `@gateway/gateway-runtime/health-check.sh`:
- Around line 32-46: Remove the HTTP listener TCP fallback from the
ROUTER_ADMIN_ENABLED=false branch of health-check.sh, since it cannot establish
Envoy readiness. Use a genuine Envoy readiness check instead, or separate the
probe behavior so TCP is used only for liveness and readiness validates loaded
routes, clusters, listeners, and ext_proc configuration.

In
`@kubernetes/gateway-operator/internal/controller/resources/api-platform-gateway-k8s-manifests.yaml`:
- Around line 37-40: Update the Deployment readiness and liveness probes near
the existing port 9901 `/ready` checks to target a listener that is enabled and
reachable, such as the runtime health endpoint or a TCP probe on the HTTP
listener. Do not rely on the disabled or loopback-only Envoy admin listener
unless the Deployment explicitly enables and locally exposes it.

---

Nitpick comments:
In `@gateway/gateway-runtime/policy-engine/internal/admin/server_test.go`:
- Line 79: Add a separate test function that verifies the disabled-state
behavior of the /config_dump endpoint. In this new test, set ConfigDump.Enabled
to false in the configuration, then make a request to /config_dump and assert
that it returns HTTP 404. This ensures the endpoint properly enforces the
fail-closed default when the feature is disabled.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 34116d44-b762-4c78-be7c-afb6645f9a24

📥 Commits

Reviewing files that changed from the base of the PR and between e498dd0 and 067f59f.

📒 Files selected for processing (29)
  • gateway/configs/config-template.toml
  • gateway/configs/config.toml
  • gateway/distribution/docker-compose.yaml
  • gateway/docker-compose-perf.yaml
  • gateway/docker-compose.debug.yaml
  • gateway/docker-compose.yaml
  • gateway/gateway-controller/pkg/adminserver/server.go
  • gateway/gateway-controller/pkg/adminserver/server_test.go
  • gateway/gateway-controller/pkg/config/config.go
  • gateway/gateway-runtime/docker-entrypoint-debug.sh
  • gateway/gateway-runtime/docker-entrypoint.sh
  • gateway/gateway-runtime/health-check.sh
  • gateway/gateway-runtime/policy-engine/internal/admin/server.go
  • gateway/gateway-runtime/policy-engine/internal/admin/server_test.go
  • gateway/gateway-runtime/policy-engine/internal/config/config.go
  • gateway/gateway-runtime/router/config/envoy-bootstrap.yaml
  • gateway/it/docker-compose.test.postgres.yaml
  • gateway/it/docker-compose.test.sqlserver.yaml
  • gateway/it/docker-compose.test.vhosts-multi.yaml
  • gateway/it/docker-compose.test.vhosts-single.yaml
  • gateway/it/docker-compose.test.yaml
  • gateway/it/test-config.toml
  • gateway/it/test-config.vhosts-multi.toml
  • gateway/it/test-config.vhosts-single.toml
  • kubernetes/gateway-operator/internal/controller/resources/api-platform-gateway-k8s-manifests.yaml
  • kubernetes/helm/gateway-helm-chart/README.md
  • kubernetes/helm/gateway-helm-chart/templates/gateway/gateway-config.yaml
  • kubernetes/helm/gateway-helm-chart/templates/gateway/gateway-runtime/deployment.yaml
  • kubernetes/helm/gateway-helm-chart/values.yaml

Comment thread gateway/gateway-runtime/docker-entrypoint.sh
Comment thread gateway/gateway-runtime/health-check.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/rules/go-control-plane-xds-security.md:
- Around line 64-67: Update the shell example comments to use Bash-style #
syntax instead of //. Change the ROUTER_ADMIN_HOST handling so it validates the
value is loopback-only or sets it explicitly to 127.0.0.1, ensuring the injected
admin interface cannot bind to a non-loopback address.

In `@gateway/it/docker-compose.test.vhosts-single.yaml`:
- Around line 78-81: Enforce loopback-only binding for ROUTER_ADMIN_HOST: update
gateway/it/docker-compose.test.vhosts-single.yaml lines 78-81 to stop
configuring 0.0.0.0 while preserving host-side readiness access, and update
.claude/rules/go-control-plane-xds-security.md lines 68-74 to document or
require validation that rejects non-loopback admin hosts.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: acc29c53-5c2d-4ebe-a819-95c09487f5c2

📥 Commits

Reviewing files that changed from the base of the PR and between 067f59f and a92b9d5.

📒 Files selected for processing (9)
  • .claude/rules/go-control-plane-xds-security.md
  • gateway/gateway-runtime/policy-engine/configs/envoy-backup.yaml
  • gateway/gateway-runtime/policy-engine/configs/envoy.yaml
  • gateway/it/docker-compose.test.postgres.yaml
  • gateway/it/docker-compose.test.sqlserver.yaml
  • gateway/it/docker-compose.test.vhosts-multi.yaml
  • gateway/it/docker-compose.test.vhosts-single.yaml
  • gateway/it/docker-compose.test.yaml
  • kubernetes/gateway-operator/internal/controller/resources/api-platform-gateway-k8s-manifests.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • gateway/it/docker-compose.test.yaml
  • gateway/it/docker-compose.test.postgres.yaml
  • gateway/it/docker-compose.test.sqlserver.yaml
  • gateway/it/docker-compose.test.vhosts-multi.yaml

Comment thread .claude/rules/go-control-plane-xds-security.md Outdated
Comment thread gateway/it/docker-compose.test.vhosts-single.yaml
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 11, 2026
@renuka-fernando renuka-fernando self-assigned this Aug 11, 2026
Comment thread gateway/configs/config.toml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/rules/go-control-plane-xds-security.md:
- Around line 69-73: Update the ROUTER_ADMIN_HOST validation case to accept only
the literal 127.0.0.1 address, rejecting ::1, localhost, and all other values
while preserving the existing fatal error behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 12e1d3bf-2a00-420d-a402-dfd6b82a08f9

📥 Commits

Reviewing files that changed from the base of the PR and between a92b9d5 and cbc5570.

📒 Files selected for processing (2)
  • .claude/rules/go-control-plane-xds-security.md
  • gateway/configs/config.toml

Comment thread .claude/rules/go-control-plane-xds-security.md
@tharindu1st
tharindu1st merged commit 4b5a7bc into wso2:main Aug 12, 2026
12 checks passed
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

Successfully merging this pull request may close these issues.

3 participants