惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
V
V2EX
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
The Cloudflare Blog
T
Tailwind CSS Blog
H
Help Net Security
腾讯CDC
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
D
DataBreaches.Net
C
Check Point Blog
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
[Az] Day 11: Exposing a Private AKS Application via Cloud...
Steven Hoang · 2026-05-18 · via DEV Community

Steven Hoang

Introduction

In environments with stringent security policies, exposing applications hosted on private AKS clusters to the internet without compromising security can be challenging. These environments often have no inbound internet access and no open ports, limiting conventional methods of application exposure.

In this guide, we’ll walk through how to securely expose an application hosted on a private AKS cluster to the internet using Cloudflare Tunnel, a solution that eliminates the need for public IP addresses or open ports. Additionally, we’ll demonstrate how to secure the application with Cloudflare Access integrated with Azure EntraID Single Sign-On (SSO).

Table of Contents

Prerequisites

Before diving into Cloudflare Tunnel, make sure you have the following set-up:

  • Cloudflare Zero Trust: You need an active Cloudflare account with the Zero Trust feature enabled to set up a Cloudflare Tunnel.

Setting Up Cloudflare Tunnel

Cloudflare Tunnel (formerly Argo Tunnel) provides a secure connection between your services and Cloudflare without the need for public IP addresses or inbound firewall rules.

Generate Tunnel Token

To get started, follow these steps to create a Cloudflare Tunnel token:

  1. Create a Tunnel

    Go to Network and select Tunnels. Click Create a tunnel and choose the cloudflared option.
    cloudflare-tunnel-creation

  2. Name and Save the Tunnel

    Name your tunnel private-aks-tunnel and click Save.

  3. Copy Tunnel Token

    Once the tunnel is created, a token will be generated. Copy the tunnel token and securely store it in Azure Key Vault as a secret named cf-tunnel-token.
    key-vault-secret-cf-tunnel

    Ensure that the token is accurately stored in the Key Vault. This token will be used when deploying the cloudflared Helm chart.

Deploying Cloudflared with Helm

With the secure storage of the tunnel token in Key Vault, follow these refined steps to deploy cloudflared on the AKS cluster using Helm:

  1. Cloudflared Chart:

I created the cloudflared Helm chart, expanding upon the previous chart template.
This implementation establishes an AKS network policy that blocks inbound traffic to the namespace while allowing only the necessary outbound traffic to the internal Nginx Ingress using the private IP 192.168.31.250.

<details><summary><em>View the <code>values-dev.yaml</code> file</em></summary>

[inline](https://github.com/baoduy/drunk-azure-pulumi-articles/blob/main/pipeline/cf-tunnel-helm/values-dev.yaml#1-1000)

</details>

Enter fullscreen mode Exit fullscreen mode

  1. Cloudflared Deployment Pipeline:

This pipeline mirrors the previous pipeline, with an additional enhancement to directly retrieve secrets from the Key Vault, bypassing the need for a Variable Group.

<details><summary><em>View the <code>network-rule.yaml</code> file</em></summary>

[inline](https://github.com/baoduy/drunk-azure-pulumi-articles/blob/main/pipeline/cf-tunnel-helm/templates/network-rule.yaml#1-1000)

</details>

Enter fullscreen mode Exit fullscreen mode

Important:

  • To optimize the Cloudflare Tunnel's outbound operations, adjust the AKS firewall settings in accordance with Cloudflare's recommendations.
  • These settings are required for the tunnel's ability to establish and maintain effective communication with Cloudflare servers, handling inbound requests seamlessly.

Deploying the Cloudflare Tunnel

  1. Create a new pipeline named cf-tunnel-helm with the cf-tunnel-helm.azure-pipelines.yml file, enabling the deployment of this Helm chart to AKS.

Cloudflare Tunnel Deployment Pipeline

  1. Once deployment is successful, the Cloudflare Tunnel pods should be running within the cf-system namespace.
    cf-system Namespace Pods

  2. Return to the Cloudflare Zero Trust dashboard to verify the tunnel status, which should display as healthy.
    Cloudflare Tunnel Dashboard Status

Exposing the Application

With all preparations complete, we can now expose the application to the internet follow these steps:

  1. Go to the Cloudflare Tunnel created previously and click "Edit."
  2. Navigate to the "Public Hostname" section and configure it as follows:
    • Subdomain: The subdomain of the app. in this example, hello is used.
    • Domain: Choose any available domain; in this example, st24.dev is used.
    • Service Type: HTTP
    • URL: Enter the internal Nginx ingress IP address and application port, e.g., 192.168.31.250:80.
    • HTTP Host Header: This should match the internal ingress domain associated with the application, e.g., hello.drunkcoding.net.

cf-tunnel-public-hello-app

  1. Save the configuration. After saving, The application should be able to access publicly via hello.st24.dev.

hello-app-with-st24

Securing the Application with Authentication

Once the application is exposed to the internet, it becomes accessible to everyone, posing security concerns.
To enhance security, we need to restrict access to authorized personnel only, such as company staff or specific group members.
Cloudflare provides a robust solution for securing applications accessible via tunnels.

Configuring Cloudflare SSO with EntraID

First, logging into the Cloudflare Zero Trust dashboard, Navigate to Settings > Authentication, and select "Add New" under the Login methods section.

  1. Login providers: Cloudflare offers multiple login providers; choose Azure AD for this configuration.
    cloudflare-login-providers

  2. EntraID SSO: Follow the provided instructions to integrate Azure AD (EntraID) authentication.
    cloudflare-azure-ad-login

  3. Verification: Test the configuration to verify that authentication can successfully retrieve the name and id of EntraID groups.
    cloudflare-azure-ad-login-test

Creating a New EntraID Group

Next, log into the Azure Portal and create a new EntraID group named DRUNK CF APPS with the ID f8863b0f-3376-4d14-85ba-b376a7d5aeca. This group will be used to control access to the exposed application.
entra-drunk-app-group

The hello App Access Policy

Finally, return to the Cloudflare Zero Trust dashboard and go to Access > Applications. Click "Add an Application" and select the Self-hosted type.

  1. App Configuration: Ensure the domain matches the application you wish to protect. In this example, we'll protect the hello.st24.dev application previously exposed.
    cf-app-config

  2. App Identity: Choose the login provider configured earlier.
    cf-app-identity-providers

  3. App Policy: Configure a policy that requires authentication via required provider and restricts access to users in the specified EntraID group ids.
    cf-app-policy

    The list of permitted Azure Groups should include the EntraID Group IDs that are allowed access to this app. Without this configuration, the app would be accessible to anyone with an EntraID account in the organization.

  4. Testing the App Policy: After creating the application, click "Test Your Policy" to ensure it functions as intended using a specific account.
    cf-app-policy-test

Accessing the Protected App

  1. Visit hello.st24.dev, and We should encounter a login dialog requesting Azure AD authentication before accessing the application.
    cf-apps-login-dialog

  2. After logged in, users will gain normal access to the application.
    hello-app-with-st24

Conclusion

In this guide, we've explored how to securely expose an application running on a private AKS cluster to the internet without relying on public IP addresses or open ports. By leveraging Cloudflare Tunnel, we established a secure outbound-only connection that adheres to stringent security policies. This method eliminates the risks associated with inbound internet access while providing a seamless way to make internal services accessible externally.

We also implemented Cloudflare Access integrated with Azure Entra ID Single Sign-On (SSO) to add an authentication layer to all exposed applications. This integration ensures that only authorized users within your organization can access the applications, enhancing security by centralizing access control through Entra ID Groups. By doing so, we simplified user management and strengthened compliance with organizational policies.

This approach not only maintains the security integrity of your infrastructure but also offers a scalable solution for exposing multiple applications securely. It demonstrates how modern cloud services can be combined to meet complex security requirements without compromising accessibility or user experience.

Reference

Next

Day 12: Exposing a Private AKS Application via Cloudflare Tunnel.

In the next and final tutorial, We'll discover how to safely expose the private AKS cluster and applications to the internet with Cloudflare.
It'll delve into the benefits of using Cloudflare Tunnel and WARP, exploring alternative ways to provide secure access while maintaining the integrity of the corporate network.

Thank You

Thank you for taking the time to read this guide! We hope it has been helpful. Feel free to explore further, and happy coding! 🌟✨

Steven | GitHub