apply_blocklist_category
Block domains within predefined categories like adult, malware, ads, or social using OPNsense firewall management for enhanced network security and control.
Instructions
Apply a predefined category of domain blocks
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | Category of domains to block |
Implementation Reference
- The main handler function for the 'apply_blocklist_category' tool. It takes a category parameter and applies the corresponding predefined blocklist by blocking multiple domains using blockMultipleDomains method, delegating to specific block methods for adult and malware.async applyBlocklistCategory(category: 'adult' | 'malware' | 'ads' | 'social'): Promise<{ blocked: string[], failed: string[] }> { switch (category) { case 'adult': return this.blockAdultContent(); case 'malware': return this.blockMalware(); case 'ads': { const adDomains = [ 'doubleclick.net', 'googleadservices.com', 'googlesyndication.com', 'adnxs.com', 'facebook.com/tr', 'amazon-adsystem.com' ]; return this.blockMultipleDomains(adDomains, 'Ad Block'); } case 'social': { const socialDomains = [ 'facebook.com', 'www.facebook.com', 'instagram.com', 'www.instagram.com', 'twitter.com', 'www.twitter.com', 'tiktok.com', 'www.tiktok.com' ]; return this.blockMultipleDomains(socialDomains, 'Social Media Block'); } default: throw new Error(`Unknown category: ${category}`); } }