πŸ”’ Security

SASE

Secure Access Service Edge

A cloud-based framework integrating networking and security: provides SD-WAN, ZTNA, CASB, and SWG on a single platform

πŸ“– Detailed Explanation

SASE (Secure Access Service Edge, pronounced "sassy") is a concept defined by Gartner in 2019: a framework that integrates previously separate networking (WAN) and network security functions into a single cloud-based service. It emerged as the spread of remote work, growing use of cloud applications, and the ubiquity of mobile devices pushed traditional data-center-centric security architecture to its limits.

SASE's core components are broadly divided into network services and security services. On the network side, SD-WAN (Software-Defined WAN) provides multi-path optimization and application-aware routing. On the security side, ZTNA (Zero Trust Network Access) provides fine-grained access control per user and device, CASB (Cloud Access Security Broker) handles SaaS security, SWG (Secure Web Gateway) handles web traffic filtering, and FWaaS (Firewall as a Service) provides cloud firewall functions.

SASE's biggest advantage is that it can apply consistent security policies "anywhere, on any device." Whether the user is at headquarters, a branch office, at home, or in a cafe, they pass the same security inspection through the nearest SASE PoP (Point of Presence) and reach applications over an optimized path. This solves the backhaul traffic problem of the traditional VPN approach and greatly improves the user experience.

Major SASE vendors include Zscaler, Palo Alto Networks (Prisma Access), Cisco (Umbrella + Viptela), Cloudflare (Cloudflare One), and Netskope. When adopting SASE, you should comprehensively review compatibility with existing network equipment, legacy application support, data residency requirements, and vendor lock-in risk. A full SASE transition usually takes 2-3 years, and phased migration is recommended.

πŸ’» Code Example

SASE component concept diagram (ASCII)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         SASE Architecture                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                     β”‚
β”‚  Users/Devices                    SASE Cloud Platform               β”‚
β”‚  ─────────────                    ───────────────────               β”‚
β”‚                                                                     β”‚
β”‚  [Remote Worker] ──────┐         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚                        β”‚         β”‚   Network Services          β”‚   β”‚
β”‚  [Branch Office] ──────┼────────►│   β€’ SD-WAN                  β”‚   β”‚
β”‚                        β”‚         β”‚   β€’ WAN Optimization        β”‚   β”‚
β”‚  [Mobile User] ────────┼─────────│   β€’ Global PoP Network      β”‚   β”‚
β”‚                        β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  [IoT Device] ──────────                     β”‚                     β”‚
β”‚                        β”‚                     β–Ό                     β”‚
β”‚  [HQ Office] β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚                                  β”‚   Security Services (SSE)    β”‚   β”‚
β”‚                                  β”‚   β€’ ZTNA (Zero Trust Access) β”‚   β”‚
β”‚                                  β”‚   β€’ SWG (Web Gateway)        β”‚   β”‚
β”‚                                  β”‚   β€’ CASB (Cloud Security)    β”‚   β”‚
β”‚                                  β”‚   β€’ FWaaS (Cloud Firewall)   β”‚   β”‚
β”‚                                  β”‚   β€’ DLP (Data Loss Prevent)  β”‚   β”‚
β”‚                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                              β”‚                     β”‚
β”‚                                              β–Ό                     β”‚
β”‚                                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚                                  β”‚   Destinations              β”‚   β”‚
β”‚                                  β”‚   β€’ SaaS (M365, Salesforce) β”‚   β”‚
β”‚                                  β”‚   β€’ IaaS (AWS, Azure, GCP)  β”‚   β”‚
β”‚                                  β”‚   β€’ Private Apps (DC)       β”‚   β”‚
β”‚                                  β”‚   β€’ Internet                β”‚   β”‚
β”‚                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Terraform: Cloudflare Zero Trust (ZTNA) configuration

# providers.tf
terraform {
  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "~> 4.0"
    }
  }
}

provider "cloudflare" {
  api_token = var.cloudflare_api_token
}

# variables.tf
variable "cloudflare_api_token" {
  type      = string
  sensitive = true
}

variable "cloudflare_account_id" {
  type = string
}

variable "tunnel_secret" {
  type      = string
  sensitive = true
}

# Zero Trust Access Application μ •μ˜
resource "cloudflare_access_application" "internal_app" {
  account_id = var.cloudflare_account_id
  name       = "Internal Dashboard"
  domain     = "dashboard.internal.example.com"
  type       = "self_hosted"

  session_duration = "24h"

  # ν—ˆμš©λœ IdP λͺ©λ‘
  allowed_idps = [cloudflare_access_identity_provider.okta.id]

  # μžλ™ λ¦¬λ‹€μ΄λ ‰νŠΈ λΉ„ν™œμ„±ν™” (API μ ‘κ·Όμš©)
  auto_redirect_to_identity = false

  # CORS μ„€μ •
  cors_headers {
    allowed_methods   = ["GET", "POST", "PUT", "DELETE"]
    allowed_origins   = ["https://dashboard.internal.example.com"]
    allow_credentials = true
    max_age           = 600
  }
}

# Access Policy - λˆ„κ°€ μ ‘κ·Όν•  수 μžˆλŠ”μ§€ μ •μ˜
resource "cloudflare_access_policy" "internal_app_policy" {
  account_id     = var.cloudflare_account_id
  application_id = cloudflare_access_application.internal_app.id
  name           = "Allow Engineering Team"
  precedence     = 1
  decision       = "allow"

  # 쑰건: νŠΉμ • κ·Έλ£Ή + κΈ°κΈ° μƒνƒœ 확인
  include {
    group = [cloudflare_access_group.engineering.id]
  }

  require {
    # λ””λ°”μ΄μŠ€ 포슀처 확인 (ν•„μˆ˜)
    device_posture = [cloudflare_device_posture_rule.corporate_device.id]
  }
}

# Access Group μ •μ˜
resource "cloudflare_access_group" "engineering" {
  account_id = var.cloudflare_account_id
  name       = "Engineering Team"

  include {
    email_domain = ["example.com"]
  }

  include {
    okta {
      name                 = "Engineering"
      identity_provider_id = cloudflare_access_identity_provider.okta.id
    }
  }
}

# Device Posture Rule - κΈ°κΈ° λ³΄μ•ˆ μƒνƒœ 확인
resource "cloudflare_device_posture_rule" "corporate_device" {
  account_id = var.cloudflare_account_id
  name       = "Corporate Device Check"
  type       = "file"

  match {
    platform = "mac"
  }

  input {
    id        = "corporate_cert"
    path      = "/Library/Security/corporate-root-ca.pem"
    exists    = true
    sha256    = "abc123..."  # μΈμ¦μ„œ ν•΄μ‹œ
  }
}

# Cloudflare Tunnel (private network μ—°κ²°)
resource "cloudflare_tunnel" "internal_network" {
  account_id = var.cloudflare_account_id
  name       = "internal-network-tunnel"
  secret     = base64encode(var.tunnel_secret)
}

resource "cloudflare_tunnel_config" "internal_network_config" {
  account_id = var.cloudflare_account_id
  tunnel_id  = cloudflare_tunnel.internal_network.id

  config {
    ingress_rule {
      hostname = "dashboard.internal.example.com"
      service  = "http://10.0.1.100:8080"
      origin_request {
        connect_timeout = "30s"
        no_tls_verify   = false
      }
    }

    ingress_rule {
      hostname = "api.internal.example.com"
      service  = "http://10.0.1.200:3000"
    }

    # Catch-all rule (required)
    ingress_rule {
      service = "http_status:404"
    }
  }
}

# Gateway Policy - SWG μ›Ή 필터링
resource "cloudflare_teams_rule" "block_malware_sites" {
  account_id  = var.cloudflare_account_id
  name        = "Block Malware Sites"
  description = "Block access to known malware domains"
  precedence  = 1
  action      = "block"
  enabled     = true

  traffic = "any(dns.security_category[*] in {117 118 119 120})"

  rule_settings {
    block_page_enabled = true
    block_page_reason  = "This site has been blocked due to security risks."
  }
}

# DLP Policy - 민감 데이터 유좜 λ°©μ§€
resource "cloudflare_teams_rule" "dlp_credit_card" {
  account_id  = var.cloudflare_account_id
  name        = "Block Credit Card Data"
  description = "Prevent credit card numbers from being uploaded"
  precedence  = 2
  action      = "block"
  enabled     = true

  traffic = "http.request.body.mime == 'application/json' and any(http.request.body.json[*] matches '\\d{4}[- ]?\\d{4}[- ]?\\d{4}[- ]?\\d{4}')"

  rule_settings {
    block_page_enabled = true
    block_page_reason  = "Uploading credit card information is prohibited."
  }
}

Python: SASE API integration and policy management

"""
SASE μ •μ±… 관리 및 λͺ¨λ‹ˆν„°λ§ 슀크립트
λ‹€μ–‘ν•œ SASE 벀더 API와 ν†΅ν•©ν•˜μ—¬ 쀑앙 집쀑식 관리
"""

import requests
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Optional
import json

@dataclass
class AccessPolicy:
    """μ ‘κ·Ό μ •μ±… 데이터 λͺ¨λΈ"""
    name: str
    users: list[str]
    groups: list[str]
    applications: list[str]
    conditions: dict
    action: str  # allow, block, isolate


class SASEProvider(ABC):
    """SASE 벀더 좔상 클래슀"""

    @abstractmethod
    def create_access_policy(self, policy: AccessPolicy) -> dict:
        pass

    @abstractmethod
    def list_users(self) -> list[dict]:
        pass

    @abstractmethod
    def get_security_events(self, hours: int = 24) -> list[dict]:
        pass


class ZscalerClient(SASEProvider):
    """Zscaler ZPA/ZIA API ν΄λΌμ΄μ–ΈνŠΈ"""

    def __init__(self, client_id: str, client_secret: str, cloud: str = "zscaler"):
        self.base_url = f"https://config.{cloud}.net/api/v1"
        self.client_id = client_id
        self.client_secret = client_secret
        self.token = None

    def _authenticate(self):
        """API 인증"""
        response = requests.post(
            f"{self.base_url}/auth/login",
            json={
                "clientId": self.client_id,
                "clientSecret": self.client_secret
            }
        )
        response.raise_for_status()
        self.token = response.json().get("token")

    def _headers(self):
        if not self.token:
            self._authenticate()
        return {
            "Authorization": f"Bearer {self.token}",
            "Content-Type": "application/json"
        }

    def create_access_policy(self, policy: AccessPolicy) -> dict:
        """ZPA μ ‘κ·Ό μ •μ±… 생성"""
        payload = {
            "name": policy.name,
            "rule_order": "1",
            "action": policy.action.upper(),
            "conditions": [
                {
                    "operands": [
                        {"object_type": "APP", "values": policy.applications}
                    ]
                },
                {
                    "operands": [
                        {"object_type": "SCIM_GROUP", "values": policy.groups}
                    ]
                }
            ]
        }

        response = requests.post(
            f"{self.base_url}/policySet/rules",
            headers=self._headers(),
            json=payload
        )
        response.raise_for_status()
        return response.json()

    def list_users(self) -> list[dict]:
        """μ‚¬μš©μž λͺ©λ‘ 쑰회"""
        response = requests.get(
            f"{self.base_url}/users",
            headers=self._headers()
        )
        response.raise_for_status()
        return response.json().get("users", [])

    def get_security_events(self, hours: int = 24) -> list[dict]:
        """λ³΄μ•ˆ 이벀트 쑰회 (ZIA)"""
        response = requests.get(
            f"{self.base_url}/security/events",
            headers=self._headers(),
            params={"hours": hours}
        )
        response.raise_for_status()
        return response.json().get("events", [])


class CloudflareZeroTrustClient(SASEProvider):
    """Cloudflare Zero Trust API ν΄λΌμ΄μ–ΈνŠΈ"""

    def __init__(self, api_token: str, account_id: str):
        self.base_url = f"https://api.cloudflare.com/client/v4/accounts/{account_id}"
        self.headers = {
            "Authorization": f"Bearer {api_token}",
            "Content-Type": "application/json"
        }

    def create_access_policy(self, policy: AccessPolicy) -> dict:
        """Access Policy 생성"""
        # λ¨Όμ € Application 확인 ν•„μš”
        payload = {
            "name": policy.name,
            "decision": policy.action,
            "include": [
                {"group": {"id": g}} for g in policy.groups
            ],
            "require": []
        }

        if policy.conditions.get("device_posture"):
            payload["require"].append({
                "device_posture": {"integration_uid": policy.conditions["device_posture"]}
            })

        response = requests.post(
            f"{self.base_url}/access/apps/{policy.applications[0]}/policies",
            headers=self.headers,
            json=payload
        )
        response.raise_for_status()
        return response.json().get("result", {})

    def list_users(self) -> list[dict]:
        """Access μ‚¬μš©μž λͺ©λ‘"""
        response = requests.get(
            f"{self.base_url}/access/users",
            headers=self.headers
        )
        response.raise_for_status()
        return response.json().get("result", [])

    def get_security_events(self, hours: int = 24) -> list[dict]:
        """Gateway 둜그 쑰회"""
        response = requests.get(
            f"{self.base_url}/gateway/audit_logs",
            headers=self.headers,
            params={"per_page": 1000}
        )
        response.raise_for_status()
        return response.json().get("result", [])

    def create_gateway_rule(self, name: str, traffic_filter: str, action: str):
        """Gateway μ •μ±… 생성 (SWG/DNS 필터링)"""
        payload = {
            "name": name,
            "enabled": True,
            "action": action,
            "traffic": traffic_filter,
            "rule_settings": {
                "block_page_enabled": True
            }
        }

        response = requests.post(
            f"{self.base_url}/gateway/rules",
            headers=self.headers,
            json=payload
        )
        response.raise_for_status()
        return response.json().get("result", {})


class SASEPolicyManager:
    """λ©€ν‹° 벀더 SASE μ •μ±… 톡합 관리"""

    def __init__(self):
        self.providers: dict[str, SASEProvider] = {}

    def register_provider(self, name: str, provider: SASEProvider):
        self.providers[name] = provider

    def deploy_policy_to_all(self, policy: AccessPolicy):
        """λͺ¨λ“  SASE ν”Œλž«νΌμ— 동일 μ •μ±… 배포"""
        results = {}
        for name, provider in self.providers.items():
            try:
                result = provider.create_access_policy(policy)
                results[name] = {"status": "success", "data": result}
            except Exception as e:
                results[name] = {"status": "error", "message": str(e)}
        return results

    def aggregate_security_events(self, hours: int = 24) -> list[dict]:
        """λͺ¨λ“  ν”Œλž«νΌμ˜ λ³΄μ•ˆ 이벀트 톡합"""
        all_events = []
        for name, provider in self.providers.items():
            events = provider.get_security_events(hours)
            for event in events:
                event["source_provider"] = name
            all_events.extend(events)
        return sorted(all_events, key=lambda x: x.get("timestamp", ""), reverse=True)


# μ‚¬μš© μ˜ˆμ‹œ
if __name__ == "__main__":
    # λ§€λ‹ˆμ € μ΄ˆκΈ°ν™”
    manager = SASEPolicyManager()

    # Cloudflare 등둝
    cf_client = CloudflareZeroTrustClient(
        api_token="your-api-token",
        account_id="your-account-id"
    )
    manager.register_provider("cloudflare", cf_client)

    # μ •μ±… μ •μ˜
    engineering_access = AccessPolicy(
        name="Engineering Internal Access",
        users=["user1@example.com", "user2@example.com"],
        groups=["engineering-team"],
        applications=["internal-dashboard-app-id"],
        conditions={
            "device_posture": "corporate-device-rule-id",
            "location": ["US", "KR"]
        },
        action="allow"
    )

    # μ •μ±… 배포
    results = manager.deploy_policy_to_all(engineering_access)
    print(json.dumps(results, indent=2))

    # λ³΄μ•ˆ 이벀트 쑰회
    events = manager.aggregate_security_events(hours=24)
    print(f"Total security events: {len(events)}")

πŸ—£οΈ How It's Said in Practice

  • "With remote work expanding, the VPN bottleneck is severe. If we adopt SASE, security is handled at the nearest PoP and traffic connects directly to SaaS, so speed should improve."
  • "If we switch to ZTNA, access control is per application instead of per network, so the risk of Lateral Movement drops dramatically."
  • "If we integrate CASB, we can see which SaaS apps employees use, and we can also control shadow IT."
  • "Let's go in phases. First apply SWG and DNS filtering, then replace the VPN with ZTNA, and finally integrate SD-WAN."
  • "Please explain the core components of SASE and how it differs from traditional network security architecture."
  • "What is the relationship between Zero Trust and SASE? What role does ZTNA play?"
  • "What are the strategy and considerations when migrating from existing VPN infrastructure to SASE?"
  • "What are the vendor selection criteria for adopting SASE, and what should be verified most closely during a PoC?"

Take a mock interview on this topic β†’ WIA SOOM AI Interview Β· Start for free

  • "Is this application included in the SASE Gateway policy? I can't see the internet access logs, so please check."
  • "The device posture check condition is missing from the ZTNA policy. Please add device security state verification."
  • "The part that logs the user ID on API calls might be filtered by the CASB DLP policy, so please mask it."
  • "This service should only be accessible from the internal network, so check the Split Tunnel configuration. Internet traffic could bypass it."

⚠️ Cautions

  • Gradual migration is essential: A big-bang SASE transition is very risky. Start by applying it to new branch offices or remote users, and allow a generous period of parallel operation with the existing infrastructure. Among legacy applications, there are many where installing an agent is difficult or there are protocol compatibility issues.
  • PoP locations and latency: Check that the SASE vendor has enough PoPs (Points of Presence) in your service regions. If Korean users are the main target but the only Asian PoP is in Hong Kong, increased latency will degrade the user experience. Be sure to measure actual latency and throughput during the PoC.
  • Data sovereignty and compliance: Because SASE routes traffic through cloud infrastructure, you need to know which countries your data passes through. If you have data residency requirements such as privacy laws or GDPR, clearly confirm the vendor's data processing locations and log storage locations, and specify them in the contract.

πŸ”— Related Terms

πŸ“š Learn More