Secure Internal Applications with Layered Access Controls on Envoy Gateway
Use IP allowlisting for a basic perimeter, combine with OIDC for identity verification.
Use IP allowlisting for a basic perimeter, combine with OIDC for identity verification, and consider zero trust overlays like OpenZiti for scalable security.
Internal applications like Grafana require strict access controls that scale beyond brittle IP whitelists. Here’s a field-tested approach for Envoy Gateway users.
Diagnose Current Access Patterns
Start by mapping who/what needs access:
- Users: WFH employees, contractors, or services (e.g., CI/CD pipelines).
- Locations: Offices, cloud VPCs, or hybrid environments.
- Protocols: HTTP(S), WebSockets, or gRPC.
Example: Grafana may need access from CI/CD (service account) and internal users (OIDC-authenticated).
Implement IP Allowlisting as First Layer
Use Envoy’s IP mapping for basic perimeter defense:
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: HTTPRoute
metadata:
name: grafana-route
spec:
parentRefs:
- name: main-ingress-gateway
rules:
- matches:
- uri:
exact: /grafana
host: internal-tools.example.com
backend:
service:
name: grafana
port: 80
extensions:
envoy:
config:
accessControl:
ipDenyList:
- "192.168.1.0/24"
- "10.0.0.0/8"
Caveat: IP ranges break with dynamic NAT (e.g., mobile users, cloud load balancers). Use sparingly.
Add OIDC Authentication for Identity Verification
Configure Envoy Gateway with an OIDC provider (Keycloak, Auth0, etc.):
- Deploy an OIDC provider with groups/roles (e.g.,
platform-engineers). - Configure Envoy’s authentication middleware:
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: Extension
metadata:
name: oidc-auth
spec:
gateway:
gatewayClassName: envoy
config:
type: authz
oidc:
issuer: https://auth.example.com
clientID: envoy-gateway
clientSecret: "secret"
scopes: ["openid", "groups"]
Policy Example: Restrict Grafana to users in the platform-engineers group:
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: HTTPRoute
spec:
rules:
- matches:
- uri:
exact: /grafana
backend:
service:
name: grafana
extensions:
envoy:
config:
authorization:
rules:
- groups:
- "platform-engineers"
Tradeoff: Adds latency (OIDC token validation) and requires maintaining an auth provider.
Consider Zero Trust Overlay (OpenZiti)
For environments where IP-based controls fail entirely:
- Deploy OpenZiti with a Zero Trust controller.
- Enroll user devices/services as identities.
- Expose Grafana via OpenZiti’s internal DNS (e.g.,
grafana.mycompany.internal).
Why It Works:
- No public exposure: Services are only accessible via the Ziti network.
- Identity-based: Devices/users must authenticate to join the overlay.
Caveat: Adds operational complexity (new control plane, client configuration).
Tooling
- Envoy Gateway: For OIDC and IP-based routing.
- OpenZiti: Zero trust overlay (https://www.openziti.com).
- Keycloak/Auth0: OIDC identity providers.
- Prometheus/Grafana: Monitor access patterns and auth failures.
Troubleshooting Common Issues
-
OIDC Token Validation Failures:
- Check clock sync between Envoy and OIDC provider.
- Verify
audclaim matches clientID.
-
OpenZiti DNS Resolution:
- Ensure
corednsorziti-dnsis correctly configured. - Test with
digornslookupinside the overlay.
- Ensure
-
IP Allowlist Bypass:
- Audit logs for requests from unexpected IPs.
- Use network policies to restrict service exposure.
Final Workflow
- Start with IP allowlists for immediate protection.
- Layer OIDC for identity verification.
- Adopt OpenZiti for full zero trust if scale/complexity demands it.
- Monitor access logs and iterate on policies.
Avoid relying on any single control—layer defenses to mitigate failure modes.
Source thread: What is the best way for me to protect internal company only applications which I need to expose?

Share this post
Twitter
Google+
Facebook
Reddit
LinkedIn
StumbleUpon
Pinterest
Email