Join our Newsletter — 33% off our NHI Course
Home› Guides› SWG, CASB and ZTNA Log Detection Guide: Fields,…
Guide SOC & Detection Engineering

SWG, CASB and ZTNA Log Detection Guide: Fields, Use Cases and Detections

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 13 min read
On this page

Once web, SaaS and private application traffic runs through a security service edge, the SSE platform sees more user activity than any other single control, yet most SOCs only forward its block events. Secure web gateway (SWG), cloud access security broker (CASB) and zero trust network access (ZTNA) logs carry identity, device, destination, data volume and policy outcome in one record, which makes them some of the richest detection sources available. This guide sets out which fields matter in each log type, the detections worth building from them, how to normalise the logs to the Open Cybersecurity Schema Framework (OCSF), and the mistakes that leave the data unused. It is written for detection engineers and the owners of SASE and SSE platforms, and is vendor-neutral: field names are described generically, so map them to your platform's own names. For the architecture itself, see the SASE and SSE Guide.

Key takeaways

  • Forward allowed traffic, not just blocks. Exfiltration, account misuse and policy bypass mostly look like allowed traffic; block-only forwarding misses them.
  • Identity and device context are the value. SSE records tie a user, a device posture and an application to each request, which network logs alone cannot do.
  • Three log families, different questions. SWG answers where users went and what they sent, CASB answers what they did inside SaaS, and ZTNA answers who reached which private application from where.
  • Normalise to OCSF early. HTTP Activity, File Hosting Activity, Web Resource Access Activity, Authentication and Tunnel Activity cover most SSE events and let one rule run across platforms.
  • Watch the gaps as well as the events. A user whose traffic stops appearing in SWG logs while their identity stays active is a detection in its own right.

Why SSE logs matter for detection

NIST SP 800-207 describes zero trust as moving defences from network perimeters to users, assets and resources, with no implicit trust granted because of network location. SSE platforms are where that model is enforced for many organisations, so their logs record each access decision with its context. That gives detection engineers three things that firewall and proxy logs of the past rarely did.

  • Identity on every record: the user principal from the identity provider, not just an IP address, even for users off the corporate network.
  • Decrypted application context: where TLS inspection is in place, the full URL, HTTP method, file name and application activity (for example "upload" or "share") are visible.
  • Policy outcome and risk scoring: the rule that matched, the action taken and the platform's own risk rating of the destination application.

MITRE ATT&CK notes that exfiltration to cloud storage (T1567.002) blends in because hosts already talk to those services, and lists web proxies enforcing outbound policy as a mitigation. The SSE layer is where that traffic is both visible and controllable, which is why it belongs in the detection programme rather than only in the network team's console. For general detection engineering method, see the Detection Engineering Guide.

Key fields by log type

Platforms name fields differently, but the concepts are consistent. The tables list the fields that detections depend on and what each is used for.

Secure web gateway (SWG) logs

Field (generic name)What it holdsDetection use
TimestampRequest time, ideally UTCSequencing, impossible travel, beaconing intervals
User and groupIdentity provider user principal and group membershipPer-user baselines, privileged user watchlists
Device ID and postureManaged or unmanaged, compliance state, client versionUnmanaged device access, outdated client
Source IP and egress locationClient public IP, service point of presenceGeolocation, anonymiser and hosting provider detection
URL, host and domainFull URL where decrypted; otherwise SNI hostNewly registered domains, threat intel matching
URL categoryPlatform category such as file sharing or generative AIPolicy exceptions, risky categories
HTTP method and statusGET, POST, PUT; response codeUpload detection, failed access patterns
Bytes sent and receivedRequest and response sizesExfiltration volume, upload ratio
User agentClient software stringScripted clients, unusual tools
File name, type and hashFiles uploaded or downloadedSensitive file types, malware matches
Policy, rule and actionMatched rule, allow, block, warn, isolateOverride abuse, blocked attempt bursts
TLS inspection statusInspected or bypassed and the bypass reasonBlind spots, bypass list abuse
DLP resultMatched data profile and severitySensitive data leaving

CASB logs (inline and API)

Inline CASB events come from the proxy and look like SWG records with richer application activity. API-mode events come from the SaaS provider's own audit feed via the CASB, so they also cover activity from unmanaged devices and from integrations. See the CASB Guide for the two modes.

Field (generic name)What it holdsDetection use
Application and instanceSaaS application and tenant (corporate or personal instance)Uploads to personal instances of sanctioned apps
ActivityLogin, upload, download, share, delete, admin changeMass download, mass delete, sharing changes
ObjectFile, folder, record or channel acted onSensitive object tracking
Sharing scopeInternal, external named, public linkPublic link creation on sensitive content
Application risk scorePlatform rating of the applicationUse of high-risk or unrated apps
Actor typeHuman user, service account or connected applicationIntegration and token misuse
Third-party app and scopesOAuth application name and granted permissionsNew high-privilege grants
DLP and malware verdictProfile matched, verdictSensitive data at rest or in motion

ZTNA logs

Field (generic name)What it holdsDetection use
User and authentication contextUser, MFA used, identity provider sessionAccess without strong authentication
Device and posture resultDevice ID, posture checks passed or failedAccess from failing or unknown devices
Private application and segmentApplication definition, host and port reachedFirst-time access, crown jewel access
Connector or gatewayWhich connector served the sessionUnexpected path, connector health
Session start, end and durationSession lifecycleLong-lived sessions, odd hours
Bytes transferredPer-session volumeBulk data pulls from internal apps
Decision and reasonAllowed or denied and why (policy, posture, location)Repeated denials, probing of segments
Client source IP and locationPublic IP and geolocationImpossible travel, unexpected countries

For the ZTNA model, see the ZTNA Guide.

Use cases and detections

Each detection below describes the logic, the fields it uses and the main tuning points. Build them as SIEM or data lake rules and test against at least 30 days of history before alerting.

Impossible travel and anomalous access

  • Logic: for each user, compare consecutive SSE events from different client source locations; alert when the implied speed between them is not physically possible, or when access arrives from a country not seen for that user in the baseline period.
  • Fields: user, timestamp, client source IP, geolocation, device ID.
  • Tuning: use the client source IP, not the SSE point of presence egress IP, which reflects the provider's network. Exclude known corporate egress ranges and require a device change or a ZTNA access to a sensitive application to raise severity. The identity provider's own sign-in risk usually covers the authentication event; the SSE version adds what the user did afterwards. See the Impossible Travel and Anomalous Sign-In Detection guide.

Risky application upload

  • Logic: alert on uploads (POST or PUT, or CASB activity "upload") above a byte threshold to applications in file sharing, personal storage or generative AI categories that are unsanctioned, high risk or a personal instance of a sanctioned app.
  • Fields: user, application, instance, category, risk score, HTTP method or activity, bytes sent, file name, DLP result.
  • Tuning: baseline per user over 30 days and alert on deviation plus an absolute floor; raise severity when a DLP profile matches, when the user is on a leaver list, or when an archive file type is uploaded. This maps to ATT&CK T1567.002 Exfiltration to Cloud Storage. For AI tools specifically, see AI Gateway vs CASB/SSE for Controlling Shadow AI.

Policy bypass

  • Client gap: a user or device active in the identity provider or EDR, but with no SWG traffic for a set period during working hours, suggests the client was disabled or traffic is leaving another way.
  • Anonymisers and tunnels: allowed or blocked requests to proxy, VPN and anonymiser categories, and long sessions with steady low-volume traffic to a single uncategorised host, which can indicate tunnelling (ATT&CK T1572 Protocol Tunneling, T1090.003 Multi-hop Proxy).
  • Bypass list growth: changes to TLS inspection bypass lists or steering exceptions, from the platform admin audit log, reviewed against change tickets.
  • Override abuse: users repeatedly clicking through "warn" or "coach" pages to the same risky category.
  • Direct egress: firewall logs showing web traffic from managed endpoints that did not pass through the SSE service.

Further detections worth building

DetectionSourceKey fieldsATT&CK
Mass download from a SaaS app before resignation dateCASB APIUser, activity, object count, HR leaver feedT1530 Data from Cloud Storage
Public link created on content with a DLP matchCASB APISharing scope, DLP resultT1567.002
Service account or token used from a new locationCASB APIActor type, source IP, applicationT1078.004 Cloud Accounts
First access to a crown jewel private appZTNAUser, application, decisionT1133 External Remote Services
Repeated ZTNA denials across many segmentsZTNADecision reason, application countT1133
Beaconing to newly registered domainsSWGHost, interval, bytes, domain age enrichmentT1071.001 Web Protocols

Where identity fits

CASB API logs record actions by connected applications and service accounts as well as people. An OAuth integration that suddenly downloads every file, or an API token used from a hosting provider address, is a non-human identity incident that the identity provider may never see. Tag non-human actors during normalisation and baseline them separately. See the Service Account Behavioural Baselining Guide and Detection Engineering for Non-Human Identities Guide.

Normalisation and enrichment

OCSF mapping

The OCSF schema groups events into categories and classes. The classes below, taken from the OCSF schema repository, cover most SSE records; the class UID is the category number times 1,000 plus the class number.

SSE eventOCSF class (UID)Key OCSF attributes
SWG web requestHTTP Activity (4002)http_request (url, http_method, user_agent, x_forwarded_for), http_response, src_endpoint, dst_endpoint, proxy, tls, traffic, app_name
SWG or CASB allow or block decision on a web resourceWeb Resource Access Activity (6004)activity_id (Access Grant, Access Deny, Access Revoke, Access Error), web_resources, proxy, http_request
CASB file upload, download, shareFile Hosting Activity (6006)activity_id (Upload, Download, Share, Unshare, Sync and others), actor, file, share_type, expiration_time
CASB SaaS object activityWeb Resources Activity (6001)activity_id (Create, Read, Update, Delete, Search, Import, Export, Share), web_resources
ZTNA or SSE client sign-inAuthentication (3002)user, is_mfa, is_remote, auth_protocol, session, dst_endpoint
ZTNA session or client tunnelTunnel Activity (4014)activity_id (Open, Close, Renew), tunnel_type, session, user, src_endpoint, dst_endpoint, traffic
Raw connection recordsNetwork Activity (4001)src_endpoint, dst_endpoint, traffic, connection_info

Map the policy outcome to the OCSF security control attributes: action_id (Allowed, Denied), disposition_id (for example Allowed, Blocked, Logged, Alert), policy, risk_level and risk_score. Put URL categories in url.categories. Keep the vendor's original fields in unmapped or raw_data so nothing is lost during mapping. The OCSF schema is still developing, so pin the version you map to and re-check when you upgrade.

Enrichment

  • Identity: department, manager, privileged role, leaver date and human or non-human type from the identity provider and HR feed.
  • Device: ownership and EDR status from the endpoint management platform.
  • Destination: domain age, threat intelligence matches and sanctioned or unsanctioned application status.
  • Geolocation: resolve client source IP, flag hosting providers and anonymiser ranges.

Rollout

  1. Inventory feeds: list every SSE log type and admin audit log, its delivery method (streaming, API pull, storage export) and latency.
  2. Forward everything to cheap storage: send all allowed and blocked events to the data lake; send a filtered subset to the SIEM if cost requires.
  3. Normalise: map to OCSF classes and validate field fill rates for user, device, URL and bytes.
  4. Build detections in monitor mode: run each rule silently for two to four weeks, measure volume and true positive rate, tune, then promote to alerting.
  5. Roll back safely: keep rules versioned so a noisy release can be reverted, and alert on feed silence so a broken pipeline is not mistaken for a quiet network.

Measuring it

MetricTarget direction
Percentage of SSE events with user and device populated after normalisationUp, towards full coverage
Percentage of managed endpoints seen in SWG logs each dayUp
Share of web traffic exempt from TLS inspectionDown, with every exemption justified
True positive rate per SSE detectionUp after tuning
Median time from SSE event to SIEM availabilityDown

A small organisation with one SSE platform can often rely on its built-in analytics and forward only alerts plus upload and admin events. Large organisations with several platforms gain most from OCSF normalisation, because one rule set then runs across all of them. For metric design, see the Detection Engineering Metrics and KPIs Guide.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-53 Rev 5AU-12 Audit Record Generation; AU-6 Audit Record Review, Analysis, and Reporting; SI-4 System Monitoring; AC-4 Information Flow EnforcementGenerating, collecting and analysing SSE records
NIST CSF 2.0DE.CM-01; DE.AE-02; DE.AE-03Network monitoring, event analysis, correlation across sources
MITRE ATT&CKT1567.002, T1530, T1572, T1090.003, T1078.004, T1133, T1071.001Techniques the detections above target

Common failure patterns

  • Block-only forwarding: only denied events reach the SIEM, so exfiltration through allowed applications is invisible.
  • Egress IP used as user location: impossible travel rules fire on the SSE provider's point of presence changes rather than on the user's real source IP.
  • Uninspected categories treated as safe: large TLS bypass lists for convenience leave file sharing or personal email traffic with host names only.
  • No feed health monitoring: a broken log export goes unnoticed for weeks and looks like a quiet period.
  • Human-only baselines: service accounts and connected applications are mixed in with users, so their unusual behaviour is lost or they flood the user alerts.
  • Admin audit logs ignored: policy and bypass changes on the SSE platform itself are not monitored, although they are the easiest way to switch off controls. See the CASB and SSE platform health check.

Practitioner checklist

  • Forward allowed and blocked SWG, CASB and ZTNA events plus the platform admin audit log.
  • Confirm that user, device, client source IP, URL, bytes and action are populated in every record.
  • Map events to OCSF classes, pin the schema version and keep vendor fields in unmapped.
  • Enrich with identity, HR, device and destination context, and tag non-human actors.
  • Build impossible travel, risky upload and policy bypass detections first, in monitor mode.
  • Add mass download, public sharing, token misuse and ZTNA first-access rules next.
  • Alert on feed silence and on endpoints missing from SWG logs.
  • Review TLS inspection bypass and steering exceptions monthly against change records.
  • Track the five coverage and quality metrics and report them with detection results.

Standards and references

Related NHI Mgmt Group resources: SASE and SSE Guide · CASB Guide · ZTNA Guide · Detection Engineering Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.