Most engineers think…
Most engineers first meet an SWG as 'the web filter that blocks Facebook' — a glorified blocklist that checks the domain name and moves on. So they assume HTTPS traffic is a black box it can only allow or deny by URL.
Wrong — and that gap is exactly where modern malware hides. Over 95% of web traffic is HTTPS, so a filter that only reads domain names is blind to the page body, the file download and the data being uploaded. A real SWG performs TLS inspection: it acts as a controlled man-in-the-middle, decrypting traffic with its own CA certificate, scanning the actual content for malware and policy violations, sandboxing risky downloads, then re-encrypting onward. URL filtering is one of five jobs — and the easy one. The decryption is what makes the other four possible.
① What an SWG actually does — the checkpoint on every outbound click
Picture Rahul, an L1 security analyst at Infosys. Every laptop in his org — in the office, at home, at a client site — sends its web traffic through one cloud checkpoint before it touches the internet. That checkpoint is a Secure Web Gateway (SWG). Think of it as the society gate-pass register at the entrance of an apartment complex: every visitor (every outbound request) is checked against the rules before they are let in or turned away. Nothing reaches the internet un-inspected.
An SWG isn't one feature — it's five jobs stacked on the same outbound stream. (1) URL filtering by category: every request's destination is mapped to a category — Gambling, Adult, Malware, Social Networking, Streaming, Business — and a rule allows, cautions or blocks it. (2) Malware scanning: the actual response body is scanned with signatures and heuristics. (3) TLS/SSL decryption + inspection: because most traffic is HTTPS, the SWG decrypts it to do jobs 1, 2, 4 and 5 properly (that's all of Section ②). (4) Sandboxing of downloads: an unknown .exe or macro-laden .docx is detonated in an isolated sandbox and watched before the user receives it. (5) Tenant restrictions: the SWG can force traffic so that only your corporate Google or Microsoft 365 tenant is reachable, blocking a personal Gmail login that could be used to exfiltrate data.
For years job #1 to #5 lived on a physical on-prem proxy box in the data centre. Every branch backhauled its web traffic to that box, got it inspected, then sent it out. With staff now working from home and apps living in SaaS, backhauling a work-from-home laptop in Lucknow through a Mumbai data centre to reach a server in Mumbai is absurd. The cloud SWG moves the checkpoint to a provider's edge (Zscaler ZIA, Netskope, Palo Alto Prisma Access, Cisco Secure Access) near the user, so inspection happens close by and the box-in-the-DC disappears. Same five jobs, no hardware to backhaul to.
The five jobs, one tap each
Tap each card — these are the five reasons a web filter is now called a 'gateway', and every SWG interview starts here.
Maps each request to a category (Gambling, Malware, Social) and allows/cautions/blocks. So: acceptable-use + a first threat layer in one rule.
Signatures + heuristics on the real response body. So: a drive-by payload on an allowed site is still caught — category isn't enough.
Unknown .exe/.docx is detonated in isolation and watched first. So: zero-day files are judged by behaviour, not just signatures.
Forces only the corporate SaaS tenant to be reachable. So: a user can't log into personal Gmail to smuggle company data out.
Priya at Wipro sets a URL-filtering rule that blocks the 'Malware' category, and is told that's 'full protection'. A user then visits an allowed news site that's been compromised and silently serves a trojan. Why does category-only filtering miss it?
Pause & Predict
Predict: an org moves from an on-prem proxy box in its Mumbai data centre to a cloud SWG near each user. Name ONE thing that gets better for a work-from-home user and ONE new dependency the org now has. Type your guess.
② TLS inspection — why the SWG must become a man-in-the-middle
Here's the uncomfortable truth that defines a modern SWG: over 95% of web traffic is HTTPS. The payload — the page body, the file you download, the form you submit — is encrypted end-to-end between the browser and the server. So an SWG that only reads the domain name is blind to everything that matters. To scan content, sandbox a download or stop a data upload, it must see inside the tunnel. That requires TLS/SSL inspection.
How can a checkpoint read traffic that's encrypted for the real server? By becoming a deliberate, trusted man-in-the-middle (MITM). The SWG splits the one HTTPS session into two: it terminates the browser's session by presenting its own certificate, and it opens a fresh HTTPS session to the real server. In the middle, for a brief moment, the traffic is in clear text — and that's where the five jobs run.
The trick that makes the browser accept this is the enterprise CA certificate. Your org pushes the SWG provider's (or its own) root CA certificate into every managed laptop's trust store via Intune/Jamf/GPO. Now, when Sneha visits flipkart.com, the SWG generates a fake flipkart.com certificate on the fly, signs it with that trusted CA, and hands it to her browser. The browser sees a cert chaining to a CA it trusts → no warning. The SWG separately validates the real Flipkart certificate on its onward session. If the device doesn't have the CA installed, the user gets a scary certificate-warning page — the #1 symptom of a botched TLS-inspection rollout.
Decryption isn't optional for real security — but it forces a privacy conversation, and that's where do-not-decrypt exceptions come in. Reading a user's online banking session, health portal, or payroll page is both a privacy issue and, in regulated contexts, a compliance one. So mature SWG policy inspects most categories but explicitly bypasses sensitive ones: traffic categorised as Finance, Banking, Health, Government, Legal is set to Do Not Inspect — the SWG still sees the domain and applies URL filtering, but it doesn't crack the payload open. You get security on the 90% and privacy on the sensitive 10%.
Symptom: an analyst adds a Do Not Inspect rule for a banking domain to protect privacy, and later finds that other web policies stopped applying to it as well. Cause: in Zscaler ZIA, the Do Not Inspect action has a sub-choice — Evaluate Other Policies vs Bypass Other Policies. Picking Bypass Other Policies skips not just decryption but the URL Filtering and Cloud App Control engines too, so that traffic is no longer access-controlled at all. Fix: use Do Not Inspect → Evaluate Other Policies for privacy exceptions, so the domain stays un-decrypted but URL filtering and logging still apply. Reserve full bypass for cert-pinned apps that genuinely break.
Karthik at ICICI is told to 'turn on TLS inspection for everything, no exceptions, for maximum security'. What's the strongest professional objection to a blanket no-exceptions decrypt policy?
Pause & Predict
Predict: a managed laptop has the enterprise CA installed and HTTPS inspection works perfectly. The same user installs a personal app (say a fitness tracker) that uses certificate pinning. What happens when its traffic hits the SWG, and why? Type your guess.
③ Steering traffic to the SWG — and where it sits in SSE
An SWG only protects traffic that actually reaches it. So the real-world question on day one is: how do you steer every device's web traffic into the gateway? There are three standard methods, and a mature org uses more than one.
Method 1 — Explicit proxy via a PAC file. A PAC (Proxy Auto-Config) file is a tiny JavaScript file the browser fetches; its FindProxyForURL(url, host) function returns either the SWG's proxy address or DIRECT for traffic that should skip it. You point devices at the PAC URL via GPO/MDM. It's flexible and granular — but a single typo in the PAC logic can send all traffic DIRECT (no inspection) or, worse, loop it. Method 2 — Endpoint client / connector. A lightweight agent (Zscaler Client Connector, Netskope Client, Cisco Secure Client) installed on the laptop tunnels web traffic to the nearest SWG node automatically, wherever the user roams — best for laptops that leave the office. Method 3 — IPsec/GRE tunnel from the edge. The branch firewall/router builds an IPsec or GRE tunnel straight to the SWG, so everything from that site — including guest Wi-Fi, printers and IoT with no agent — is steered without touching each device.
Now place the SWG in the bigger picture. An SWG is one pillar of SSE (Security Service Edge), the security half of SASE. Its siblings: CASB governs your sanctioned SaaS apps and the data in them (the next lesson); ZTNA replaces the VPN for private-app access. The SWG owns the outbound, user-to-internet direction. Critically, because the SWG already decrypts the stream, DLP rides on the same decrypted traffic — the same inspection that scans for malware can also catch a user pasting a customer database or an Aadhaar number into a web form and block the upload. One decrypt, many checks.
▶ Watch one HTTPS click ride through the SWG
Sneha at Infosys clicks a file-sharing link. Follow her request from the laptop, into the SWG, through decryption and inspection, and out to the internet — step by step. Press Play for the healthy path, then Break it to see the failure.
function FindProxyForURL(url, host) {
// Internal + bank → go DIRECT (no SWG)
if (isInNet(host, "10.0.0.0", "255.0.0.0")) return "DIRECT";
if (dnsDomainIs(host, ".icicibank.com")) return "DIRECT";
// Everything else → send to the SWG, fail open to DIRECT
return "PROXY gateway.swg.example.net:80; DIRECT";
}# client fetches the PAC, then for app.box.com: host=app.box.com -> PROXY gateway.swg.example.net:80 host=intranet (10.4.2.9) -> DIRECT host=www.icicibank.com -> DIRECT (bank bypass, privacy) # proxy log: app.box.com category=File-Share action=ALLOW tls=inspected
Two quick checks any L1 can run. (1) Steering: from the user's browser open the provider's status page (e.g. ip.zscaler.com for ZIA) — it confirms whether you're going through the SWG and which node. (2) Inspection: click the padlock on any HTTPS site and view the certificate — if the issuer is your enterprise/SWG CA (not the site's real CA like DigiCert), that session is being decrypted and inspected. If the issuer is the site's real CA, that domain is on a Do-Not-Inspect/bypass list. These two together tell you exactly what's happening to the traffic.
A Flipkart branch has 200 guest Wi-Fi devices, IP printers and IoT sensors — none of which can run an agent or be reconfigured. You must still send their web traffic through the SWG. Which steering method fits?
Pause & Predict
Predict: DLP (Data Loss Prevention) and the SWG's malware scanner both run on the same decrypted web stream. So if you put a banking domain on the Do-Not-Inspect list for privacy, what happens to DLP's ability to catch a user pasting an Aadhaar number into THAT site? Type your guess.
④ Policy in practice — rules, bypass lists, the gotchas & the cheat-sheet
Time to build real policy. An SWG rule is layered: category + threat + tenant rules evaluated in order, with bypass lists as exceptions. In Zscaler ZIA you build URL rules under Policy → URL & Cloud App Control, and decryption choices under Policy → SSL Inspection. A clean baseline reads like this: block the obvious bad categories (Malware, Phishing, Adult, Gambling), caution the productivity-drainers (Streaming, Social), allow Business, force tenant restriction on M365/Google, and inspect everything except a tight Do-Not-Inspect list (Finance, Health, Government + known cert-pinned apps).
The three classic gotchas that page an L1 at 2 a.m.: (1) Cert-pinned apps break under decryption — Microsoft 365 native clients, WebEx, Dropbox, many banking and Aadhaar/UPI apps pin their certs and refuse the SWG's cert; fix is a Do-Not-Inspect/SSL-bypass entry for their domains. (2) PAC misconfig — a wrong isInNet mask or a missing semicolon sends all traffic DIRECT (silent no-inspection) or breaks the internet entirely. (3) Latency — decrypt + inspect + sandbox adds milliseconds; over-broad inspection of huge streaming/backup flows can feel slow, which is one reason streaming is often Do-Not-Inspect.
Aditya at HCL faces this
Aditya, an L1 analyst, gets a flood of tickets right after TLS inspection goes live: users can browse normal websites fine, but the Microsoft 365 Outlook and Teams desktop apps won't connect, and one team's banking-portal upload silently fails.
Certificate pinning. The M365 native clients and the banking app ship with pinned certificates and reject the SWG's CA-minted cert — even though the OS trusts the enterprise CA, the apps enforce pinning themselves, so the handshake is refused. Browser traffic works because browsers honour the OS trust store; pinned apps don't.
Aditya separates browser vs app: HTTPS sites load (so the CA push worked), but specific apps fail. That pattern = pinning, not a CA problem. He checks the SWG's recommended SSL-bypass list and confirms the M365 and banking domains aren't yet excepted.
Zscaler ZIA Admin Portal → Policy → SSL Inspection → SSL Inspection Policy → Add rule → Action: Do Not Inspect → Evaluate Other Policies (and enable the one-click Microsoft 365 bypass)Add a Do-Not-Inspect rule for the cert-pinned domains (turn on the one-click recommended Microsoft 365 bypass, plus the banking app's domains), using 'Evaluate Other Policies' so URL filtering and logging still apply — only decryption is skipped.
Re-open Outlook/Teams and the banking upload — they now connect; on a normal HTTPS site the cert issuer is still the enterprise CA (proving inspection is intact for everything that isn't excepted).
One sober, recent note from the real world: because the SWG sits inline on all your web traffic, the provider's platform and your tenant of it are high-value targets. In August 2025, the Salesloft Drift OAuth supply-chain attack (tracked as UNC6395) used stolen OAuth tokens to reach the Salesforce environments of 700+ orgs — including security vendors like Zscaler and Palo Alto Networks — exposing business-contact and support data (Zscaler revoked the integration and rotated tokens). And in 2025, researchers disclosed authentication-bypass flaws across multiple ZTNA/SSE products (e.g. CVE-2025-54982, a SAML signature-validation bypass). The takeaway for you: an SWG is a control you trust deeply, so its admin access, SSO and integrations must be hardened — a compromised SWG tenant can see (and mis-route) everything.
For your certification path, this lesson maps onto the CompTIA Security+ SY0-701 blueprint, where SASE/SSE appears in Domain 3 (Security Architecture). The exam expects you to know that SASE = SD-WAN (networking) + SSE (security), that SSE bundles SWG + CASB + ZTNA, and that an SWG does URL filtering, TLS inspection and malware/sandbox on outbound web traffic delivered from the cloud edge. Get the SWG-vs-CASB-vs-ZTNA boundaries clear and you've locked a reliable cluster of Domain 3 questions.
An SWG is your apartment society's gate-pass register plus an X-ray scanner. The watchman checks every visitor's name against the rules (URL filtering), opens and X-rays every sealed parcel before it goes up (TLS decryption + malware scan), holds a suspicious package in a side room to watch it (sandbox), and only lets in your registered domestic help, not a stranger using their name (tenant restriction). But for a sealed legal/medical envelope addressed to a resident, the watchman logs who it's from and lets it pass un-opened (Do-Not-Inspect for Finance/Health) — security on the parcels, privacy on the personal mail.
Cold, in 30 seconds: name the five jobs (URL filter, malware scan, TLS decrypt, sandbox, tenant control); explain why TLS inspection is a controlled MITM with an enterprise CA; list the three steering methods (PAC, client, IPsec/GRE) and which fits agentless devices; and say what goes on the Do-Not-Inspect list (cert-pinned apps + Finance/Health/Gov) and why. If you can do that without notes, you're ready for the CASB lesson and the SASE/SSE questions on SY0-701.
An interviewer asks Meera: 'In one sentence, why does a Secure Web Gateway have to perform TLS inspection at all, and what's the cost of doing it?' Best answer?
🤖 Ask the AI Tutor
Tap any question — instant, scoped to this lesson. No login, no waiting.
Pre-curated from SASE docs + community Q&A, scoped to this lesson. For a live prod issue, paste your export into chat.techclick.in.
📝 Wrap-up assessment — six more
You've answered 4 inline. Six left. 70% (7 of 10) marks the lesson complete on your profile. Tap Submit all answers at the end.
🧠 In your own words
Type one line: In one line, why must a Secure Web Gateway decrypt HTTPS to do its job, and what does that force it to become? Then compare to the expert version.
🗣 Teach a friend
Best way to lock it in — explain it in one line to a teammate. Tap to generate a paste-ready summary.
📖 Glossary
- Secure Web Gateway (SWG)
- A proxy between users and the internet that enforces acceptable-use and security on outbound web traffic — URL filtering, malware scan, TLS inspection, sandbox, tenant control.
- URL filtering
- Mapping each request's destination to a category (Gambling, Malware, Business) and allowing, cautioning or blocking by rule.
- TLS/SSL inspection
- Decrypting HTTPS, inspecting the clear content, then re-encrypting onward — so the SWG can scan what's otherwise opaque.
- Man-in-the-middle (MITM)
- A party sitting between two endpoints reading/altering traffic. For an SWG it's a controlled, consented interception your org runs.
- Enterprise CA certificate
- A root CA your org installs on every managed device; the SWG signs on-the-fly fake site certs with it so browsers trust them.
- Certificate pinning
- An app hard-codes the exact cert/key it expects and rejects anything else — so it breaks under SWG decryption and needs a bypass.
- Sandbox
- An isolated environment where an unknown download is detonated and watched before it reaches the user.
- PAC file
- Proxy Auto-Config — JavaScript with FindProxyForURL() that tells a browser, per destination, to use the proxy or go DIRECT.
- IPsec / GRE tunnel
- An encrypted (IPsec) or lighter (GRE) tunnel from a site edge that steers all that site's traffic to the SWG — good for agentless devices.
- Do-Not-Inspect
- A policy that skips decryption for chosen destinations (cert-pinned apps, Finance/Health/Gov) while still applying URL filtering and logging.
- SSE
- Security Service Edge — the cloud-security half of SASE, bundling SWG, CASB and ZTNA (often DLP/FWaaS) at the provider edge.
- DLP
- Data Loss Prevention — rules that detect and block sensitive data (cards, Aadhaar, customer records) leaving via the decrypted web stream.
📚 Sources
- Zscaler Help — "SSL Inspection" and "Configuring SSL/TLS Inspection Policy" (TLS/SSL decrypt-inspect-re-encrypt with the org CA; Action: Inspect / Do Not Inspect / Block; Do-Not-Inspect sub-choice Evaluate Other Policies vs Bypass Other Policies; menu Policy → SSL Inspection). help.zscaler.com/zia/about-ssl-inspection · help.zscaler.com/zia/configuring-ssltls-inspection-policy
- Zscaler Help — "ZIA SSL Inspection Leading Practices Guide" (cert-pinned apps like Microsoft 365/WebEx/Dropbox can't be inspected; recommended SSL bypass lists; one-click Microsoft 365 configuration under Policy → URL & Cloud App Control). help.zscaler.com/zscaler-deployments-operations/zia-ssl-inspection-leading-practices-guide
- Microsoft Security 101 — "What Is a Secure Web Gateway (SWG)?" + Zscaler glossary "What Is a Secure Web Gateway" (the five SWG functions: URL filtering, malware/AV, TLS inspection, sandboxing, app/tenant control; cloud SWG replaces the on-prem proxy; SWG as an SSE pillar). microsoft.com/en-us/security/business/security-101/what-is-secure-web-gateway-swg · zscaler.com/resources/security-terms-glossary/what-is-secure-web-gateway
- Cisco Secure Access / Umbrella docs — "Troubleshoot Non-Browser Applications" + "Troubleshoot SWG Website Access Issues" (certificate pinning enforced on the client breaks per-app; PAC/explicit-proxy vs tunnel steering; cert-warning symptoms when the CA isn't trusted). cisco.com/c/en/us/support/docs/security/umbrella/225056-troubleshoot-non-browser-applications.html · cisco.com/c/en/us/support/docs/security/secure-access/225927-troubleshoot-secure-web-gateway-swg.html
- Zscaler company blog + SecurityAffairs / Infosecurity Magazine — "Salesloft Drift supply-chain incident" (Aug 2025, UNC6395 stole OAuth tokens, 700+ orgs incl. Zscaler & Palo Alto; business-contact/support data exposed; tokens revoked) and 2025 ZTNA/SSE auth-bypass research incl. CVE-2025-54982 (SAML signature-validation bypass). zscaler.com/blogs/company-news/salesloft-drift-supply-chain-incident-key-details-and-zscaler-s-response · securityaffairs.com/181801/data-breach/supply-chain-attack-hits-zscaler-via-salesloft-drift-leaking-customer-info.html
- CompTIA Security+ SY0-701 exam objectives — Domain 3 Security Architecture (SASE = SD-WAN + SSE; SSE bundles SWG, CASB, ZTNA; SWG = cloud URL filtering + TLS inspection + malware/sandbox on outbound web) + zero-trust as a core testable concept. comptia.org/certifications/security · professormesser.com/security-plus/sy0-701/sy0-701-video/sy0-701-comptia-security-plus-course/
What's next?
An SWG can decide whether you reach Dropbox at all — but once you're inside your sanctioned Google Workspace or M365 tenant, who stops a user sharing a customer file externally? That's the blind spot CASB fills, governing the SaaS apps and data the SWG can't see into.