Schedule icon
Get icon
Script icon
Docker icon
If icon
Search icon
Create icon
Set icon
Log icon

Track Persistent Dangling CNAMEs with Remediation Issues

Track repeated NXDOMAIN CNAME targets, retain DNS evidence in Kestra KV, and open deduplicated GitHub remediation issues without changing records.

Categories
Infrastructure

A retired service can leave an owned hostname pointing to a DNS name that no longer exists. This flow turns repeated evidence into tracked remediation, rather than another unowned notification. NXDOMAIN is not proof of subdomain takeover.

How it works

  1. A disabled hourly schedule checks one owned hostname. KV holds its previous successful observation.
  2. A Docker Python task resolves the CNAME and asks for the target's A record. NXDOMAIN counts as missing; an empty A answer does not. Timeouts and SERVFAIL fail the run without changing state.
  3. After at least two consecutive missing observations for the same target, an If branch searches GitHub across open and closed issues, then creates one remediation issue if absent.
  4. State is saved only after the branch succeeds. A saved delivery marker prevents repeats while GitHub search catches up. Runs are serialized to avoid local creation races.

What you get

  • A ticket with the hostname, target, observation count and a concrete DNS-owner checklist.
  • No automatic record deletion, provider claims or issue closure.
  • A dry run that leaves both GitHub and the saved baseline untouched.

Who it's for

Platform and security teams responsible for owned public DNS and retired application endpoints.

Why orchestrate this with Kestra

A one-off DNS script cannot distinguish a new transient result from a persistent problem. Kestra supplies the schedule, durable KV evidence, serialized runs and a visible issue-creation branch.

Prerequisites

A Docker-capable worker, outbound DNS access and a repository with Issues enabled. Set dns_server to a trusted recursive resolver (default Cloudflare 1.1.1.1). Restrict inputs to domains you own. Keep one flow instance per hostname/repository pair; do not run multiple copies against the same ticket destination.

Secrets

  • GITHUB_TOKEN: repository-scoped permission to read and create issues. Dry runs do not use it.

Quick start

  1. Set your hostname and repository as input defaults and configure the secret.
  2. Execute with dry_run: true and inspect the DNS status.
  3. Enable the schedule, which sets dry_run: false. The default threshold needs two successful hourly observations. Manual live executions also count, so do not use them to imply elapsed hourly evidence.
  4. Inspect the issue and follow your normal DNS approval process. The KV key includes the hostname and repository.

How to extend

Add authoritative-server confirmation before ticket creation or require DNS-owner approval in a separate change workflow. Keep timeout failures separate from missing records.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.