6. GlobalBlock¶
GlobalBlock is a unified domain name blocking services created by the Brand Safety Alliance (BSA). It is used for blocking domain registration across many TLDs.
6.1. Prerequisites¶
Before activating GlobalBlock extension, you need to have a valid contract with the BSA.
Before installing GlobalBlock, make sure you have the following packages in the correct (or newer) versions installed.
Package |
Version |
|---|---|
|
2.18.0 |
|
0.1.0 |
|
2.64.0 |
Package |
Version |
|---|---|
|
3.15.0 |
6.2. Installation steps¶
This section contains specific steps for installing GlobalBlock extension to the FRED system.
6.2.1. Databases¶
Create
bsappschema – userpostgres, databasefred-- Create roles CREATE USER bsapp WITH PASSWORD '...'; -- Create schema CREATE SCHEMA bsapp AUTHORIZATION bsapp; ALTER USER bsapp SET search_path = 'bsapp'; -- Create priviledges REVOKE ALL ON SCHEMA public FROM bsapp; -- It's needed to provide privileges to schema *and* tables. GRANT ALL ON SCHEMA bsapp TO bsapp; GRANT ALL ON ALL TABLES IN SCHEMA bsapp TO bsapp;
Run
bsappmigrations from the python virtual environment provided by thefred-bsapppackage#> app source /opt/venvs/fred-bsapp/bin/activate export ALEMBIC_CONFIG=/opt/venvs/fred-bsapp/lib/python3.9/site-packages/bsapp/alembic.ini echo "Migrations started" echo "Alembic config: $ALEMBIC_CONFIG" alembic history -i echo "Running migrations..." alembic upgrade head alembic history -i deactivate echo "Migrations completed"
Verify, that your FRED data model is in version
2.58.0or newerSELECT val FROM enum_parameters WHERE name = 'model_version'; val -------- 2.58.0
6.2.2. Configuration¶
app@/etc/fred/bsapp.conf
Whois apache configuration:
Add the following line:
WhoisBlacklistMessage "BSAPP" "% This name has been blocked by a GlobalBlock service."
to virtualhost section of
/etc/apache2/sites-available/whois.nic.cz.confso it will look like this:<VirtualHost *:43> CorbaEnable On CorbaNameservice "{{ corba.host }}:{{ corba.port }}" CorbaObject "Whois" "Whois_alias" CorbaObject "LoggerNew" "Logger_alias" WhoisLogdObject "Logger_alias" WhoisProtocol On WhoisDisclaimer "/etc/fred/disclaimer.txt" WhoisObject "Whois_alias" WhoisBlacklistMessage "BSAPP" "% This name has been blocked by a GlobalBlock service." ...
6.2.3. Cron jobs¶
- Cron job description: Fetch new orders from BSA
Server:
appWhen / Recurrence: hourly
Command:
fred-bsapp-fetch-orders
- Cron job description: Process new orders from BSA
Server:
appWhen / Recurrence: hourly (offset from fetch by 20 mins)
Command:
fred-bsapp-process-orders
- Cron job description: Report unregistrable domains to BSA
Server:
appWhen / Recurrence: daily (try to avoid parallel runs with other crons)
Command:
fred-bsapp-report-domains <space separated list of zones to report> --managed-zone <managed zone> [--managed-zone <another managed zone>]
- Cron job description: Daily check of blocked domains
Server:
appWhen / Recurrence: daily (try to avoid parallel runs with other crons)
Command:
fred-bsapp-check-domains