What is the castle-and-moat network security model? - Cloudflare
What is the castle-and-moat network security model? | Cloudflare Preview Mode Documentation Log in Sign up Sales: +1 (888) 99 FLARE Languages English English (United Kingdom) Deutsch Español (Latinoamérica) Español (España) Français Italiano 日本語 한국어 Polski Português (Brasil) Русский 繁體中文 简体中文 Platform Connectivity cloud Cloudflare's connectivity cloud delivers 60+ networking, security, and performance services. Enterprise For large and medium organizations Small business For small organizations Partner Become a Cloudflare partner use cases Modernize applications Accelerate performance Ensure app availability Optimize web experience Modernize security VPN replacement Phishing protection Secure web apps and APIs Modernize networks Coffee shop networking WAN modernization Simplify your corporate network CxO topics Adopt AI Bring AI into workforces and digital experiences AI security Secure agentic AI and GenAI applications Data compliance Streamline compliance and minimize risk Post-quantum cryptography Safeguard data and meet compliance standards Industries Healthcare Financial services Retail Gaming Public sector Resources Product guides Reference architectures Analyst reports Engage Events Demos Webinars Workshops Request a demo Connectivity cloud Cloudflare's connectivity cloud delivers 60+ networking, security, and performance services. Enterprise For large and medium organizations Small business For small organizations Partner Become a Cloudflare partner use cases Modernize applications Accelerate performance Ensure app availability Optimize web experience Modernize security VPN replacement Phishing protection Secure web apps and APIs Modernize networks Coffee shop networking WAN modernization Simplify your corporate network CxO topics Adopt AI Bring AI into workforces and digital experiences AI security Secure agentic AI and GenAI applications Data compliance Streamline compliance and minimize risk Post-quantum cryptography Safeguard data and meet compliance standards Industries Healthcare Financial services Retail Gaming Public sector Resources Product guides Reference architectures Analyst reports Engage Events Demos Webinars Workshops Request a demo Products products SASE and workspace security Zero trust network access Secure web gateway Network-as-a-service / SD-WAN Email security Application security L7 DDoS protection Web application firewall API security Bot management Application performance CDN DNS Smart routing Load balancing Networking L3/4 DDoS protection Firewall-as-a-service Network Interconnect Smart routing plans & pricing Enterprise plans Small business plans Individual plans Compare plans Global services Support and success bundles Optimized Cloudflare experience Professional services Expert-led implementation Technical account management Focused technical management Security operations service Cloudflare monitoring and response Domain registration Buy and manage domains 1.1.1.1 Free DNS resolver Resources Product guides Reference architectures Analyst reports Product demos and tours Help me choose Zero trust network access Secure web gateway Network-as-a-service / SD-WAN Email security Application security L7 DDoS protection Web application firewall API security Bot management Application performance CDN DNS Smart routing Load balancing Networking L3/4 DDoS protection Firewall-as-a-service Network Interconnect Smart routing plans & pricing Enterprise plans Small business plans Individual plans Compare plans Global services Support and success bundles Optimized Cloudflare experience Professional services Expert-led implementation Technical account management Focused technical management Security operations service Cloudflare monitoring and response Domain registration Buy and manage domains 1.1.1.1 Free DNS resolver Resources Product guides Reference architectures Analyst reports Product demos and tours Help me choose Developers documentation Developer library Documentation and guides Application demos Explore what you can build Tutorials Step-by-step build tutorials Reference architecture Diagrams and design patterns Products Artificial Intelligence AI Gateway Observe, control AI apps Workers AI Run ML models on our network Compute Observability Logs, metrics, and traces Workers Build, deploy serverless apps Media Images Transform, optimize images Realtime Build real-time audio/video apps Storage & database D1 Create serverless SQL databases R2 Store data without costly egress fees Plans & Pricing Workers Build and deploy serverless apps Workers KV Serverless key-value store for apps R2 Store data without costly egrees fees Explore projects Customer stories AI Demo in 30 seconds Quick guide to get started Explore Workers Playground Build, test, and deploy Developers Discord Join the community Start building Developer library Documentation and guides Application demos Explore what you can build Tutorials Step-by-step build tutorials Reference architecture Diagrams and design patterns Products Artificial Intelligence AI Gateway Observe, control AI apps Workers AI Run ML models on our network Compute Observability Logs, metrics, and traces Workers Build, deploy serverless apps Media Images Transform, optimize images Realtime Build real-time audio/video apps Storage & database D1 Create serverless SQL databases R2 Store data without costly egress fees Plans & Pricing Workers Build and deploy serverless apps Workers KV Serverless key-value store for apps R2 Store data without costly egrees fees Explore projects Customer stories AI Demo in 30 seconds Quick guide to get started Explore Workers Playground Build, test, and deploy Developers Discord Join the community Start building Partners Partner Network Grow, innovate and meet customer needs with Cloudflare Partner Portal Find resources and register deals Partnership Types PowerUP Program Grow your business while keeping your customers connected and secure Technology Partners Explore our ecosystem of technology partners and integrators Global System Integrators Support seamless large-scale digital transformation Service Providers Discover our network of valued service providers Self-serve agency program Manage Self-Serve Accounts for your clients Peer-to-peer portal Traffic insights for your network Find a partner PowerUP your business - connect with Cloudflare Powered+ partners. Partner Network Grow, innovate and meet customer needs with Cloudflare Partner Portal Find resources and register deals Partnership Types PowerUP Program Grow your business while keeping your customers connected and secure Technology Partners Explore our ecosystem of technology partners and integrators Global System Integrators Support seamless large-scale digital transformation Service Providers Discover our network of valued service providers Self-serve agency program Manage Self-Serve Accounts for your clients Peer-to-peer portal Traffic insights for your network Find a partner PowerUP your business - connect with Cloudflare Powered+ partners. Resources Engage Demos + product tours On-demand product demos Case studies Driving success with Cloudflare Webinars Insightful discussions Test Drive Live virtual workshops Library Helpful guides, roadmaps, and more Reports Insights from Cloudflare's research Blog Technical deep dives and product news Learning center Educational tools and how-to content Build Reference architecture Technical guides Solution + product guides Product documentation Documentation Developer documentation Explore theNET Executive insights for the digital enterprise Cloudflare TV Innovative series and events Cloudforce One Threat research and operations Radar Internet traffic and security trends Analyst reports Industry research reports Events Upcoming regional events Trust, privacy, and compliance Compliance information and policies Support Contact us Community forum Lost account access? Developers Discord Get help Demos + product tours On-demand product demos Case studies Driving success with Cloudflare Webinars Insightful discussions Test Drive Live virtual workshops Library Helpful guides, roadmaps, and more Reports Insights from Cloudflare's research Blog Technical deep dives and product news Learning center Educational tools and how-to content Build Reference architecture Technical guides Solution + product guides Product documentation Documentation Developer documentation Explore theNET Executive insights for the digital enterprise Cloudflare TV Innovative series and events Cloudforce One Threat research and operations Radar Internet traffic and security trends Analyst reports Industry research reports Events Upcoming regional events Trust, privacy, and compliance Compliance information and policies Support Contact us Community forum Lost account access? Developers Discord Get help Company Company info Leadership Meet our leaders Investor relations Investor information Press Explore recent news Careers Explore open roles Trust, Privacy, & Safety Privacy Policy, data, and protection Trust Policy, process, and safety Compliance Certification and regulation Transparency Policy and disclosures Public Interest Humanitarian Project Galileo Government Athenian Project Elections Cloudflare For Campaigns Health Project Fair Shot Global network Global locations and status Leadership Meet our leaders Investor relations Investor information Press Explore recent news Careers Explore open roles Trust, Privacy, & Safety Privacy Policy, data, and protection Trust Policy, process, and safety Compliance Certification and regulation Transparency Policy and disclosures Public Interest Humanitarian Project Galileo Government Athenian Project Elections Cloudflare For Campaigns Health Project Fair Shot Global network Global locations and status Log in Contact sales What is the castle-and-moat network security model? 'Castle-and-moat' refers to a network security model in which everyone inside the network is trusted by default. Zero Trust security What is IAM? What is SASE? Zero Trust security Authentication Remote access Access glossary theNET Copy article link What is the castle-and-moat network model? "Castle-and-moat" is a network security model in which no one outside the network is able to access data on the inside, but everyone inside the network can. Imagine an organization's network as a castle and the network perimeter as a moat. Once the drawbridge is lowered and someone crosses it, they have free rein inside the castle grounds. Similarly, once a user connects to a network in this model, they are able to access all the applications and data within that network. Organizations that use this model dedicate a lot of resources to defending their network perimeter, just as a castle might place the most guards near the drawbridge. They deploy firewalls, intrusion detection systems (IDS), intrusion prevention systems (IPS), and other security products that block most external attacks — but are not as effective at stopping internal attacks, insider threats, and data breaches. "Castle-and-moat" is not necessarily a deliberately chosen strategy. The term came into use to contrast traditional network architecture with Zero Trust architecture. What are the problems with the castle-and-moat approach? Today, the castle-and-moat approach is becoming outdated. For most companies, data is spread across multiple cloud vendors, rather than remaining behind an on-premise network perimeter. To further the analogy: it does not make sense to put all one's resources into defending the castle if the queen and her court are scattered around the countryside. Some organizations today continue to keep their data in on-premise networks, and others route all Internet-bound traffic through the central corporate network in order to control access to cloud vendors. But these uses of the castle-and-moat model still have inherent security flaws. The biggest security flaw is that if an attacker gains access to the network — if they cross the "moat" — they can also access any data and systems within. They can breach the network by stealing user credentials, exploiting a security vulnerability, introducing a malware infection, or carrying out a social engineering attack, among other methods. Firewalls and other intrusion prevention tools may stop some of these attacks, but if one gets through, the cost is high. How does the castle-and-moat model differ from Zero Trust security? Zero Trust security is a philosophy for how and when users are allowed to access systems and data. Unlike the castle-and-moat model, Zero Trust security assumes that security risks are present both inside and outside the network. Nothing inside the network is trusted by default — hence the name "Zero Trust." Zero Trust security requires strict verification for every user and device on the network before granting them access to data and applications. How is access control managed in a castle-and-moat model? One way organizations control access when using the castle-and-moat model is virtual private networks, or VPNs. VPNs set up an encrypted connection between connected users — often working remotely — and a VPN server. For certain levels of access, a user has to connect to at least one VPN. Once connected, they can access the resources they need. Since different users within the same company often require different access privileges, IT teams set up multiple VPNs. Each VPN can be thought of as its own "castle," providing a different level of access. There are a few drawbacks to such an approach: Vulnerability to attack: A VPN acts as a single point of failure for the applications and data it protects. It only takes one compromised account or device for an attacker to cross the proverbial moat and gain access to VPN-protected data. Slower performance: VPNs encrypt all traffic, which can add a slight amount of latency to the network, depending on the type of encryption used (compare IPsec vs. SSL). For remote employees, a VPN routes all traffic through the VPN server, which could be far away from the employee, slowing network traffic down further. Scalability: If VPN usage exceeds the VPN server's capacity to handle traffic, the server has to be upgraded — a labor-intensive process. Maintenance: VPNs require a lot of time and resources to maintain. IT teams must install the right VPN client on every remote employee's computer, ensure employees are keeping that software up to date, and upgrade or replace VPN hardware regularly. How does access control work in a Zero Trust architecture? There are a few basic principles that underlie a Zero Trust architecture: Least-privilege access: Users only get the bare minimum amount of access Microsegmentation: Networks are broken down into much smaller security zones Multi-factor authentication (MFA): Users must provide more than one factor to verify identity (for instance a password plus possession of a token) Device monitoring: Every device that connects to a network is carefully tracked These principles are broken down further in What is a Zero Trust network? Moving from castle-and-moat to Zero Trust: 'SASE' Aware of the shortcomings of the castle-and-moat model, many organizations are adopting a Zero Trust architecture. While initially such a move was fairly complex, today many vendors offer streamlined Zero Trust solutions that can be turned on quickly. Cloudflare Zero Trust is one such network security solution. But rather than adopting a separate access management solution, many organizations want Zero Trust security built into the network, not just layered on top of it. Gartner, a global research and advisory firm, has termed this trend "secure access service edge" ( SASE). Cloudflare One is an example of a network with Zero Trust security built in. Related Content Zero Trust security Network perimeter VPN What is an insider threat? What is SASE? Want to keep learning? Subscribe to theNET, Cloudflare's monthly recap of the Internet's most popular insights! Email: * Must be a valid business email. Subscribe to theNET Refer to Cloudflare's Privacy Policy to learn how we collect and process your personal data. GETTING STARTED Free plans Small business plans For enterprises Get a recommendation Request a demo Contact sales About Access Management What is IAM? Access control Network perimeter About Zero Trust Zero Trust security Two-factor authentication Role-based access control (RBAC) Multi-factor authentication What is SAML? Remote workforce security What is OAuth? Browser isolation Castle-and-moat security Mutual TLS (mTLS) What is ZTNA? Principle of least privilege Security service edge (SSE) Microsegmentation How to implement Zero Trust VPN Resources VPN Business VPN VPN security VPN speed Glossary What is account takeover? What is authentication? Authn vs. Authz What is a CASB? Data loss prevention (DLP) DNS filtering GDPR remote access Identity Identity as a service Identity provider (IdP) What is an insider threat? Mutual authentication Network segmentation Phishing attack What is the RDP? RDP security Secure web gateway What is shadow IT? Software-defined perimeter Spear phishing What is SSO? Token-based authentication URL filtering Coffee shop networking Smishing Whale phishing Learning Center Navigation Learning Center Home DDoS Learning Center CDN Learning Center What is DNS Learning Center Serverless Learning Center SSL Learning Center Security Learning Center Performance Learning Center Cloud Learning Center Bots Learning Center Network Layer Learning Center Privacy Learning Center Video Streaming Learning Center What is SASE? Email Security Learning Center AI Learning Center © 2026 Cloudflare, Inc. Privacy Policy Terms of Use Report Security Issues Your Privacy Choices Trademark