Continuation to the last post of MPF on Cisco ASA series, Juniper’s nextGen firewalls (SRX series that run JunOS software) can also be used for blocking unwanted sites. While SRX supports integration to SurfControl/WebSense etc, this post is more focused on the inbuilt capabilities just like what Cisco’s ASA had.

UTM feature (Unified Threat Management) is integrated into SRX devices. So in order to block a site(s);

1. First create a custom block lists to contain the websites that you want to block.

custom-objects {
    url-pattern {
            badsite {
                    value www.facebook.com;
            }
            addictivesite {
                            value www.twitter.com;
            }
}
    custom-url-category {
        bad-sites {
            value [ addictivesite badsite ];
        }
    }
}

As you can see, the custom URL category block list above contains the site ‘www.facebook.com’ and ‘www.twitter.com’ and based on the preferences time-eating sites like facebook/twitter/myspace etc can be used in here. Again, the advantage is that it doesn’t deal with ip addresses and hence very effective how many ever servers are hosted around the world.

2. Then create a web filtering policy to allow the traffic after screening the type/site to which the traffic is going to, as below;

policies {
    from-zone trust to-zone untrust {
        policy utm {
                match {
                        source-address any;
                        destination-address any;
                        application any;
                    }
        then {
                permit {
                    application-services {
                                            utm-policy wf-block-specfic-categories;
                                        }
                        }
                    }
                }
            }
        }
utm {
    feature-profile {
        web-filtering {
            url-blacklist bad-sites; #This causes sites in the bad-sites category to be blocked

utm-policy wf-block-specfic-categories {
    web-filtering {
        http-profile block-selected-sites;
                }
        }
}

Along with this, SRX also supports usage of ‘Custom Block Messages’ and also make this time bound. Say if you don’t want to block it completely but just block it during business hours that is possible too by scheduling policies.