DevSecOps guide 7 min read Updated

Pre-screening codebase domains and external endpoints in CI/CD pull requests

Catch newly registered domains, dangling CNAMEs, blocklisted webhooks and supply-chain risks before code merges.

For DevSecOps, AppSec and platform teams
Short answer

Codebase endpoint pre-screening extracts public domains from pull request diffs (.env templates, Terraform, Bicep, Helm charts, webhooks and app config) locally inside your CI runner, then queries outside-in risk APIs before merge. Checking domain age, RDAP expiry, dangling CNAMEs, DNSBL reputation and ASN routing catches supply-chain and takeover risks that SAST and SCA scanners never inspect.

Who it is for
AppSec, DevSecOps and platform teams reviewing PRs that add third-party APIs, webhooks or DNS records.
What it covers
A local PR diff extractor that screens new public hostnames against live RDAP, takeover, CT log and DNSBL checks.
Why it matters
SAST checks code and SCA checks packages, leaving typo-squatted APIs, expiring partner domains and dangling CNAMEs unverified.
How to integrate
Run a 30-line script in GitHub Actions, GitLab CI or Azure DevOps that sends only public hostnames to the middle.network API.
Try an outside-in endpoint screen right now

Test a partner hostname for domain age, dangling cloud CNAMEs or DNSBL listings before wiring it into CI.

Why SAST and SCA miss external domain and endpoint risk

Repositories reference dozens of external hostnames: OAuth callbacks, payment webhooks, analytics scripts, object storage buckets and third-party SaaS APIs. SAST and SCA scan syntax and lockfiles, leaving every external domain in config and Infrastructure as Code unverified.

When someone mistypes a vendor hostname, pastes a staging URL pointing at a deleted cloud app, or wires up a four-day-old domain, every internal unit test still passes. The failure only shows up in production as data leakage, broken webhooks or subdomain takeover.

What risks to flag before a pull request merges

Risk signalWhy it mattersAPI checkSuggested PR gate
Newly registered domain (< 30 days)Strong indicator of typo-squatting, lookalike SaaS domains or unvetted vendors.domain-ageWarn or require AppSec approval
Imminent expiry (< 30 days) or NXDOMAINHardcoded dead or expiring domains can be drop-caught by attackers to hijack traffic.domain-age, whoisFail PR build
Claimable dangling CNAMESubdomains pointing at deleted Azure, AWS, GitHub Pages or Netlify resources can be taken over.subdomainsFail PR build
DNSBL / threat list hitIndicates compromised infrastructure, active spam/malware or abusive hosting.blacklistFail PR build
Unexpected ASN or jurisdictionFlags endpoints routed through unapproved cloud providers or regions for regulated workloads.asn, geoipWarn for compliance review
Unexpected certificate issuerCertificate Transparency logs reveal unauthorised or shadow subdomains and CAs.ct-logsInfo / audit log
Passive API checks vs active web inspection
Domain age, WHOIS/RDAP, subdomain takeover fingerprinting, CT logs, DNSBL blacklists, ASN and GeoIP are all ready for self-serve API automation today. For deeper active page checks (Malicious Website Checker, TLS handshake grading and security headers), link PR reviewers straight to the pre-filled website tool or a full domain health check.

How to wire privacy-preserving endpoint pre-screening in CI

Keep source code and secrets strictly inside your CI runner. Use a short Node.js script on git diff to extract candidate hostnames from added lines, strip private IP ranges and placeholder suffixes (.local, .test, .example, localhost), and call the middle.network API for each unique public domain.

Local PR diff extractor + middle.network API pre-screen
// scripts/prescreen-diff.mjs - run on PR changed files
import { execSync } from 'node:child_process';

const API = 'https://api.middle.network/v1/tools';
const KEY = process.env.MN_API_KEY;
const IGNORE = /(?:localhost|\.local|\.internal|\.test|\.example|example\.(?:com|org|net))$/i;

// 1. Extract public hostnames only from added lines in the PR diff
const diff = execSync('git diff --unified=0 origin/main...HEAD', { encoding: 'utf8' });
const hosts = new Set();
for (const line of diff.split('\n')) {
  if (!line.startsWith('+') || line.startsWith('+++')) continue;
  for (const m of line.matchAll(/https?:\/\/([a-z0-9.-]+\.[a-z]{2,})/gi)) {
    const h = m[1].toLowerCase().replace(/\.$/, '');
    if (!IGNORE.test(h)) hosts.add(h);
  }
}

// 2. Pre-screen each unique public domain via /v1/
const call = async (tool, input) => (await fetch(`${API}/${tool}`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ input }),
})).json();

let failed = false;
for (const domain of hosts) {
  const [age, bl, subs] = await Promise.all([
    call('domain-age', { domain }),
    call('blacklist', { target: domain }),
    call('subdomains', { domain }),
  ]);
  const issues = [];
  if (age.data?.ageDays != null && age.data.ageDays < 30) issues.push(`domain only ${age.data.ageDays}d old`);
  if (age.data?.expiresInDays != null && age.data.expiresInDays < 30) issues.push(`expires in ${age.data.expiresInDays}d`);
  if (bl.status === 'fail') issues.push(bl.summary.plain);
  if (subs.status === 'fail') issues.push(subs.summary.plain);
  console.log(`${issues.length ? 'FAIL' : 'PASS'} ${domain} - ${issues.join(' | ') || age.summary.plain}`);
  if (issues.length) failed = true;
}
if (failed) process.exit(1);
# .github/workflows/endpoint-prescreen.yml
name: External Endpoint Pre-Screen
on:
  pull_request:
    paths: ['**/*.tf', '**/*.bicep', '**/*.yaml', '**/*.yml', '**/*.json', '**/.env*']
jobs:
  prescreen:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - name: Pre-screen newly added public domains
        env:
          MN_API_KEY: ${{ secrets.MN_API_KEY }}
        run: node scripts/prescreen-diff.mjs
Tip: Cache results for already-approved domains in a committed allowlist (such as .mn-approved-domains.json) so CI only spends API units on newly introduced endpoints and periodic re-verification.

Turning raw findings into action for reviewers and auditors

Every middle.network response returns summary.plain for pull request comments and summary.tech plus raw data for security logs. When a check flags a risk, print summary.plain in the PR summary so the developer understands why the merge paused without decoding RDAP or DNSBL codes, and archive the JSON artifact alongside your release evidence for ISO 27001 A.5.19 and A.8.8.

How middle.network makes PR endpoint pre-screening practical

Stitching together RDAP clients, DNS resolvers, CT log scrapers and blocklists inside a CI runner is brittle and noisy. Our REST API puts live RDAP domain-age, cloud CNAME takeover fingerprinting, ASN/GeoIP and self-testing DNSBL checks behind one fast JSON contract - while your source code never leaves your runner.

Zero source-code exposure

Only public hostnames hit our API; private IPs, secrets and source files stay inside your build environment.

Live takeover + CT correlation

We resolve Certificate Transparency names live and match CNAME targets against claimable cloud-service fingerprints.

No false passes on throttled sources

When public CT logs or registries rate-limit, limited: true lets your pipeline warn cleanly instead of failing blindly.

Questions people ask

Will pre-screening expose our private source code or internal hostnames?
No. The extraction runs locally in your CI runner and filters out private IPs and internal suffixes before sending only public hostnames to the API.
How many API units does pre-screening one domain cost?
Standard passive lookups (domain-age, blacklist, subdomains, asn) cost 2 units each. With 1,000 free units per UTC day per API key, a team can pre-screen hundreds of newly introduced domains daily.
What if an upstream data source like crt.sh is rate-limited during a CI run?
middle.network sets limited: true on the result instead of reporting a fake pass. Check !res.limited in your script so upstream throttling logs a warning rather than breaking unrelated deployments.
Can this detect if an endpoint sends hostile HTTP payloads or cryptominers?
The Malicious Website Checker (hostile-check) tests for 18 families of header and page attacks including Log4Shell, shell injection, hidden IP iframes and cryptominers. It runs free on the website today and can be linked directly from PR review checklists.
Which files in a repository should trigger endpoint pre-screening?
Focus on Terraform (.tf), Bicep (.bicep), Kubernetes/Helm manifests, Dockerfiles, Nginx/Caddy configs, .env templates, CSP header configs and webhook registries - where external domains are actually wired into production.

Sources and further reading

Written by the middle.network engineering team (Middle Enterprises Pty Ltd, ABN 88 633 909 412), who build and operate these tools. Last reviewed 2026-11-27.