This Category Blocking Foundry app provides a comprehensive URL filtering solution that simplifies firewall rule management through custom categories and automated rule deployment. Built on CrowdStrike's Foundry platform, this application streamlines URL blocking workflows while providing valuable insights into blocking patterns.
The Category Blocking app allows you to:
- Create and manage custom categories of domains for blocking
- Deploy firewall rules to block categories of domains across host groups
- Import URL categories from CSV files
- Generate analytics on domain blocking patterns
- Python 3.14+ (needed if modifying the app's functions). See Python For Beginners for installation instructions.
- Node.js (needed for React JS development).
- npm 9+ or Yarn (needed for managing UI dependencies). See https://yarnpkg.com/getting-started for installation instructions.
- FalconPy SDK (for CrowdStrike API integration). Install with pip install crowdstrike-falconpy
- pre-commit for secret scanning
Clone this repository to your local system:
git clone https://github.com/CrowdStrike/foundry-sample-url-filtering
cd foundry-sample-url-filteringpip install pre-commit
pre-commit installAfter cloning the repository, follow these steps to deploy the application:
-
Login to Foundry CLI
foundry login
This will prompt you to enter your CrowdStrike API credentials.
-
Deploy the application
foundry apps deploy
This command packages and deploys your application to Foundry.
-
Install the application
- Navigate to the Falcon console
- Go to Foundry > App Library
- Find the Category Blocking app
- Click Install
-
Accept permissions
- Review the requested permissions
- Click Accept to grant the necessary permissions
- The application requires access to firewall management, host groups, and devices
-
Access the application
- Once installed, the application will be available in the Falcon console
- Navigate to the app from the main menu
This app requires the following API scopes:
- firewall-management:read
- firewall-management:write
- host-group:read
- host-group:write
- devices:read
- devices:write
This application demonstrates advanced usage of Functions, Collections and UI Experience in Falcon Foundry, implementing several key capabilities for URL filtering and firewall management:
-
Python functions with multiple handlers:
- urlblock: Fetches host groups information
- create-rule: Creates a firewall policy and rule group that block the selected categories
- list-policies: Lists the policies created by the app
- update-policy: Replaces a policy's categories and whitelist
- delete-policy: Deletes a policy, its rule group and its stored relationships
- simulate-policy: Checks whether a domain would be blocked by any category
- check-enforcement / health-check: Verify that policies are enabled and enforcing
- domain-analytics: Generates domain analytics information (optional
?days=look-back window, 1-90, default 15) - import-csv: Transforms category domain CSV into collections
- list-categories: Lists available categories
- search-categories: Searches for specific categories
- manage-category: Creates or updates categories
-
Collections for data storage:
- domain: Stores URLs and category mappings
- relationship: Stores relationship information about host groups, rule groups, and categories
-
UI Pages with React components:
- Category Blocking Policy: Main interface for creating firewall rules
- Custom Categories: Management of domain categories
- Domain Analytics: Visualization of domain data
- Firewall Rules: Management of the policies created by the app
- collections: Schemas for domain and relationship collections
- ui/pages/urlblocking: React-based frontend application
- functions/urlblock: Python backend handlers
A fresh install has no categories.
- Navigate to the Custom Categories page
- Use "Import CSV" to import from a CSV file, or manually add categories.
sample-categories.csvin this repository contains 54 ready-to-use categories in the expectedcategory,urlformat - View and manage your categories from this interface
- Navigate to the Category Blocking Policy page
- Enter a policy name and select a host group
- Select the categories you want to block
- Click "Preview Domains" to see what will be blocked
- Click "Create blocking rule" to deploy the rule
- Navigate to the Domain Analytics page
- View tables and statistics about blocked domains
- Analyze patterns and effectiveness of your blocking rules
- Navigate to the Firewall Rules page
- Edit a policy's categories and whitelist, or delete it
- The replacement policy is created before the old one is removed, so hosts stay protected during an update
This repository enforces secret scanning on every commit via the pre-commit framework using betterleaks, a tool that detects secrets and credentials in source code before they are committed.
# Install pre-commit (run once)
brew install pre-commit
# Register the git hook (run once after cloning)
pre-commit installOn each git commit, betterleaks scans all staged files for secrets and credentials.
| Scenario | Result |
|---|---|
| Secret detected in staged files | Commit blocked |
| No secrets found | Commit allowed |
| pre-commit not installed | No hook runs (secrets not scanned) |
Bypass (false positives only):
git commit --no-verify

