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.

APP packages

Package

Version

fred-backend-registry

2.18.0

fred-bsapp

0.1.0

fred-pifd

2.64.0

WHOIS packages

Package

Version

libapache2-mod-whoisd

3.15.0

6.2. Installation steps

This section contains specific steps for installing GlobalBlock extension to the FRED system.

6.2.1. Databases

  1. Create bsapp schema – user postgres, database fred

    -- 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;
    
  2. Run bsapp migrations from the python virtual environment provided by the fred-bsapp package

    #> 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"
    
  3. Verify, that your FRED data model is in version 2.58.0 or newer

    SELECT val FROM enum_parameters WHERE name = 'model_version';
      val
    --------
    2.58.0
    

6.2.2. Configuration

  1. app@/etc/fred/bsapp.conf

  1. 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.conf so 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: app

    • When / Recurrence: hourly

    • Command: fred-bsapp-fetch-orders

  • Cron job description: Process new orders from BSA
    • Server: app

    • When / Recurrence: hourly (offset from fetch by 20 mins)

    • Command: fred-bsapp-process-orders

  • Cron job description: Report unregistrable domains to BSA
    • Server: app

    • When / 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: app

    • When / Recurrence: daily (try to avoid parallel runs with other crons)

    • Command: fred-bsapp-check-domains