feat: restrict backend API to private access in WAF mode #39405#608
Merged
Prajwal-Microsoft merged 4 commits intodevfrom Apr 21, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ate DNS name handling in deployment script
…ess configurations, and improve deployment documentation
There was a problem hiding this comment.
Pull request overview
Implements a WAF (Well-Architected Framework) deployment mode that keeps backend APIs (aiservice/kernelmemory) off the public ingress, routing browser /backend requests through the frontend’s server-side proxy and enforcing pod-level isolation via Kubernetes NetworkPolicy. Also improves deployment idempotency by reusing an existing Public IP DNS label on reruns.
Changes:
- Add WAF-specific public ingress template (frontend-only) and a backend-restricting NetworkPolicy.
- Update deployment script to detect WAF mode via RG tag, choose the WAF ingress, apply NetworkPolicy, and reuse existing DNS label.
- Add Vite proxying for
/backendand/api, and update deployment guide/docs for WAF networking.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/DeploymentGuide.md | Documents WAF-mode network architecture and backend private-access expectations. |
| Deployment/resourcedeployment.ps1 | Detects WAF mode, reuses DNS label, selects WAF ingress template, and applies NetworkPolicy; updates frontend API base for WAF. |
| Deployment/kubernetes/deploy.networkpolicy.yaml.template | Adds NetworkPolicy intended to block direct external access to backend pods. |
| Deployment/kubernetes/deploy.ingress.waf.yaml.template | Adds WAF public ingress template that routes only to the frontend service. |
| App/frontend-app/vite.config.ts | Adds Vite proxy rules to forward /backend and /api to the internal backend service target. |
| App/frontend-app/src/components/documentViewer/iFrameComponent.tsx | Makes PDF URL construction robust for relative URLs by providing a base origin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Prajwal-Microsoft
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
/backendroute (should return 404)deny-external-to-backendis active and enforcing traffic restrictionsOther Information
New Files
Deployment/kubernetes/deploy.ingress.waf.yaml.template- WAF-specific public ingress that routes frontend only (no backend route)Deployment/kubernetes/deploy.networkpolicy.yaml.template- Kubernetes NetworkPolicy restricting direct external access to backend podsModified Files
App/frontend-app/vite.config.ts- Added Vite server-side proxy to forward/backendand/apirequests internally to aiservice ClusterIPApp/frontend-app/src/components/documentViewer/iFrameComponent.tsx- Fixed PDF URL construction for relative API pathsDeployment/resourcedeployment.ps1- WAF mode detection, conditional ingress template selection, frontend proxy config, DNS name reuse, NetworkPolicy deploymentdocs/DeploymentGuide.md- Added WAF network architecture documentation with traffic flow diagramArchitecture (WAF Mode)
/backendroute exists on public ingress/backendand/apirequests internally toaiservice-service:80via ClusterIP DNSTraffic Flow