Content Security · Topic 2 of 3

Web Filtering

Learn SRX web filtering for JNCIA-SEC: enhanced, local and redirect types, URL categories, custom URL categories, actions and fallback settings.

  • 5 min
In a nutshell
  • Types: juniper-enhanced (cloud categories and reputation, licensed), juniper-local (own lists only), websense-redirect (local Websense server).
  • Actions: permit, log-and-permit, block, quarantine.
  • Custom URL categories are built from custom-objects url-pattern and checked before predefined categories.

What it is

Web filtering controls which websites users may visit. The SRX looks at the URL or host name of each HTTP request, puts it into a category such as gambling or news, and applies the action configured for that category.

It is a Content Security feature, so it is configured under security utm, referenced from a UTM policy, and attached to a security policy that permits web traffic.

HTTP requestCustom categorieschecked firstno matchCategory lookupcache or cloudActionpermit, log or block

How it works

Web filtering types

TypeKeywordHow the category is foundLicense
Enhanced web filteringjuniper-enhancedCloud lookup to Juniper's category service, with a local cacheRequired
Local web filteringjuniper-localOnly your own URL lists on the SRX; no cloudNot required
Redirect web filteringwebsense-redirectThe SRX sends the URL to a separate, locally hosted Websense serverServer software licensed separately

Enhanced web filtering (EWF) is the usual choice. Besides a category, the cloud service returns a site reputation score, so the SRX can act on sites that are new or risky even when no category rule matches.

The type is set under the default configuration, and the profile is built under the matching feature profile.

user@srx# set security utm default-configuration web-filtering type juniper-enhanced

URL categories and actions

An enhanced web filtering profile lists categories and the action for each. Predefined categories have names such as Enhanced_Gambling.

user@srx# set security utm feature-profile web-filtering juniper-enhanced profile EWF-OUT category Enhanced_Gambling action block
user@srx# set security utm feature-profile web-filtering juniper-enhanced profile EWF-OUT default permit
ActionEffect
permitAllow the request
log-and-permitAllow the request and write a log message
blockBlock the request; the user sees a block message
quarantineShow a warning page; the user may choose to continue

The default action applies to any request whose category has no explicit entry in the profile.

Custom URL categories

You can define your own categories from URL patterns. Custom categories are checked before the predefined categories, so they act as your own allow and block lists.

user@srx# set security utm custom-objects url-pattern BAD-SITES value http://www.example.com
user@srx# set security utm custom-objects custom-url-category MY-BLOCKED value BAD-SITES
user@srx# set security utm feature-profile web-filtering juniper-enhanced profile EWF-OUT category MY-BLOCKED action block

Use the same method to permit a site that a predefined category would block: put it in a custom category with action permit.

Fallback settings

If the SRX cannot get a category, for example because the cloud server is unreachable or does not answer in time, the fallback settings decide what happens. Each fallback case can be set to block or log-and-permit.

user@srx# set security utm feature-profile web-filtering juniper-enhanced profile EWF-OUT fallback-settings default block
Watch out

Fallback is a security decision. block keeps users safe during a cloud outage but stops all uncategorized browsing; log-and-permit keeps users working but lets traffic through unfiltered. Exam scenarios often hinge on which one is configured.

Putting it together

security {
    utm {
        utm-policy UTM-OUT {
            web-filtering {
                http-profile EWF-OUT;
            }
        }
    }
    policies {
        from-zone trust to-zone untrust {
            policy WEB-OUT {
                match {
                    source-address any;
                    destination-address any;
                    application [ junos-http junos-https ];
                }
                then {
                    permit {
                        application-services {
                            utm-policy UTM-OUT;
                        }
                    }
                }
            }
        }
    }
}

Web filtering is applied to HTTP through http-profile. For HTTPS, enhanced web filtering can categorize the site from the server name the browser sends in the TLS handshake, so it works without decrypting the traffic. Full URL paths inside HTTPS can only be seen with SSL proxy.

Order of checks

URLCustom URLcategoriesno matchLocal cacheno entryCloudcategory and reputationProfile action

The local cache keeps recent answers from the cloud, so repeat visits to the same site do not need a new lookup.

Local web filtering

With juniper-local, there is no cloud lookup. The SRX uses only your custom URL categories, and anything that matches none of them gets the profile's default action. It suits small, fixed lists or devices without internet access to the category service.

Checking web filtering

Command (operational mode)Shows
show security utm web-filtering statusThe web filtering type and whether the server connection is up
show security utm web-filtering statisticsRequests permitted, blocked and handled by fallback
show security utm statusWhether the Content Security service is running
Exam tip

If every site is suddenly blocked, check show security utm web-filtering status. A server connection that is down with fallback set to block explains it at once.

Common mistakes

Thinking custom categories are checked last. They are checked first, so they override predefined categories.

Confusing block and quarantine. block refuses the request; quarantine warns and lets the user decide.

Forgetting the default action. Categories not listed in the profile get the default action, not an automatic block.

Expecting local web filtering to know categories. juniper-local has no cloud category database; it only knows your own lists.

Forgetting the license. Enhanced web filtering needs a license; local web filtering does not.

What to remember for the exam

  • Types: juniper-enhanced (cloud categories and reputation, licensed), juniper-local (own lists only), websense-redirect (local Websense server).
  • Actions: permit, log-and-permit, block, quarantine.
  • Custom URL categories are built from custom-objects url-pattern and checked before predefined categories.
  • The profile's default action covers unlisted categories.
  • Fallback settings decide what happens when no category can be found: block or log-and-permit.
  • Reference the profile with utm-policy <name> web-filtering http-profile <profile> and attach the UTM policy to a permit policy.
  • Enhanced web filtering can categorize HTTPS by server name without SSL proxy.

Check yourself

  • A site is in a predefined category set to block, but the business needs it. How do you allow it?

    Put its URL in a custom URL category with action permit; custom categories are checked before predefined ones.

  • The cloud category server is unreachable, and fallback is set to log-and-permit. What happens to web requests?

    They are allowed and logged without category filtering until the server is reachable again.

  • Which web filtering type works without any cloud category lookup?

    Local web filtering, juniper-local, which uses only the URL lists configured on the SRX.

Topic 2 of 3 in Content Security

Test yourself on Content Security

The full Juniper JNCIA-SEC JN0-232 question bank has 658 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.