Back to Articles

Building Automated DNS Blocklists with Cisco Umbrella's API and Certificate Transparency Logs

[ View on GitHub ]

Building Automated DNS Blocklists with Cisco Umbrella's API and Certificate Transparency Logs

Hook

The average time between a phishing domain's first appearance in certificate transparency logs and its use in an attack is under 24 hours. Manual blocklist updates can't keep pace—automation isn't optional anymore.

Context

Enterprise DNS filtering has become a cornerstone of defense-in-depth security strategies, but it suffers from a critical timing problem. Security teams typically rely on threat intelligence feeds that aggregate known-bad domains, but by the time a phishing site makes it onto these lists, it's already been active for hours or days. Meanwhile, certificate transparency logs reveal newly registered domains in near real-time, and tools like phishing_catcher use heuristics to flag suspicious registrations based on patterns like typosquatting and brand impersonation. The missing piece? An automated bridge between detection and prevention.

This is where bdwilson/OpenDNS enters the picture. It's a collection of Perl scripts designed to programmatically manage Cisco Umbrella's (formerly OpenDNS) domain blocklists through API calls. The repository provides the glue code needed to take suspicious domains identified by monitoring tools and immediately add them to your organization's DNS filter. Rather than waiting for human intervention or scheduled batch updates, security teams can now block emerging threats within minutes of detection. The scripts handle the mundane but critical work of authentication, API interaction, and validation that newly blocked domains actually propagate across DNS infrastructure.

Technical Insight

Validation

Cisco Umbrella

Core API Client

Automation

New phishing domains

Domain + metadata

API POST with auth

Add to blocklist

DNS updates

Query test domain

Propagation status

CLI commands

GET/DELETE requests

Phishing Catcher

processPhishes.pl

blockSite.pl

Umbrella API

Domain Blocklist

Umbrella DNS

OpenDNSUpdateCheck.sh

Manual Operations

System architecture — auto-generated

The architecture is deliberately simple: three specialized scripts that each handle a distinct phase of the automated blocking workflow. At the core sits blockSite.pl, a straightforward API wrapper that performs CRUD operations against Umbrella's domain list endpoints. The script authenticates using your Umbrella integration keys and provides command-line operations to add, remove, or query domains from your custom blocklist.

Here's how blockSite.pl structures its API interaction:

# Simplified example based on repository patterns
use LWP::UserAgent;
use JSON;

my $base_url = 'https://s-platform.api.opendns.com/1.0';
my $ua = LWP::UserAgent->new();

# Authentication header with integration key
$ua->default_header('Authorization' => "Bearer $api_key");

sub block_domain {
    my ($domain, $list_id) = @_;
    
    my $payload = encode_json({
        domain => $domain,
        comment => "Auto-blocked via phishing detection"
    });
    
    my $response = $ua->post(
        "$base_url/domains/$list_id/destinations",
        Content_Type => 'application/json',
        Content => $payload
    );
    
    return $response->is_success;
}

The elegance here is in what's not included—no complex state management, no local database, no caching layer. The script acts as a thin client that makes idempotent API calls. This design choice means you can safely run it from cron jobs, incident response playbooks, or SIEM automation rules without worrying about lock files or race conditions.

The second script, processPhishes.pl, demonstrates the real power of this approach by consuming output from x0rz's phishing_catcher tool. Phishing_catcher monitors certificate transparency logs and scores new domain registrations based on suspicious patterns. When it flags a domain above a configured threshold, processPhishes.pl parses that output and invokes blockSite.pl to add it to your Umbrella blocklist. This creates a complete pipeline: CT log → pattern detection → DNS blocking, all without human intervention.

What makes this particularly clever is the integration pattern. Rather than tightly coupling to a specific threat intelligence tool, the scripts use standard input/output streams. This means you can swap phishing_catcher for any other domain reputation tool that outputs newline-delimited domain lists. Want to block domains from your SIEM's threat feed? Pipe it through. Have a custom ML model that predicts malicious domains? Same interface.

The third component, OpenDNSUpdateCheck.sh, addresses a critical operational concern: DNS propagation timing. After adding a domain to your blocklist via API, how long before that block is actually enforced across your infrastructure? This shell script performs DNS lookups against Umbrella's resolvers to validate that the block is live:

#!/bin/bash
# Check if domain returns Umbrella block page IP
BLOCK_IP="146.112.61.104"  # Umbrella's block page
DOMAIN=$1

RESULT=$(dig @208.67.222.222 $DOMAIN +short | head -n1)

if [ "$RESULT" = "$BLOCK_IP" ]; then
    echo "Block confirmed for $DOMAIN"
    exit 0
else
    echo "Block not yet active for $DOMAIN (returned: $RESULT)"
    exit 1
fi

This validation step is crucial for automated workflows. If you're blocking domains in response to active phishing campaigns, you need to know when the protection is actually in place. The script can be incorporated into runbooks to prevent declaring an incident "contained" before the DNS blocks have propagated.

From an architectural perspective, this collection represents a "do one thing well" Unix philosophy applied to security automation. Each script has a single responsibility, uses standard interfaces, and can be composed with other tools. The tradeoff is that you need to build your own orchestration layer—these aren't turnkey solutions but rather building blocks for custom automation workflows.

Gotcha

The biggest gotcha isn't in the code—it's in the prerequisites and operational risks. These scripts require a Cisco Umbrella enterprise account with API access enabled, which isn't part of the basic subscription. You'll need to work with Cisco to provision integration keys and configure custom domain lists, a process that can take days and involves security reviews. If you're expecting to clone this repo and start blocking domains within an hour, you're in for disappointment.

More critically, the author explicitly warns about false positive risks that could create serious operational problems. If your phishing detection tool has loose thresholds, you could end up blocking legitimate domains that happen to trigger heuristics—imagine auto-blocking a domain that contains your company name because it was flagged as potential brand impersonation. The scripts have no safeguarding against this; they blindly block whatever you feed them. Production use requires careful tuning of your detection tools, extensive allowlist management, and probably a human-in-the-loop approval process for high-confidence blocks only. The repository includes no examples of these safety mechanisms—you're expected to build them yourself. Additionally, these are utility scripts without comprehensive error handling, logging, or monitoring hooks. If an API call fails, you might not know domains are slipping through until you check manually.

Verdict

Use if: You're a security engineer at an organization with Cisco Umbrella enterprise deployment and you need to automate domain blocking based on certificate transparency monitoring, threat intelligence feeds, or SIEM alerts. These scripts are ideal if you're already running phishing_catcher or similar detection tools and want quick integration with your DNS filtering layer without building API clients from scratch. They're particularly valuable for incident response teams who need scriptable blocklist management to incorporate into runbooks. Skip if: You don't have Umbrella enterprise with API access, you need production-ready code with comprehensive error handling and audit logging, or you're looking for sophisticated policy management beyond simple domain blocking. Also skip if you can't invest time in building proper safeguards against false positives—deploying these scripts without careful threshold tuning and approval workflows is asking for self-inflicted outages. Consider alternatives like Pi-hole with custom blocklist automation for self-hosted environments, or full threat intelligence platforms like MISP if you need more than just DNS blocking capabilities.

// ADD TO YOUR README
[![Featured on Starlog](https://starlog.is/api/badge/cybersecurity/bdwilson-opendns.svg)](https://starlog.is/api/badge-click/cybersecurity/bdwilson-opendns)