Add DNS dangling scanner with examples, requirements, and readme#182
Add DNS dangling scanner with examples, requirements, and readme#182Pnkcaht wants to merge 1 commit intokubernetes:mainfrom
Conversation
Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Pnkcaht The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Pnkcaht. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
What I Did
sig-security-tooling/scan-dangling-dns/.dns_scan.pywith:examples/dns_records.yaml.PyYAMLandrequests).Related Issue
Test: DNS Dangling Scanner
Objective:
Verify that
dns_scan.pycorrectly detects dangling Netlify DNS records from a sample YAML file.Command executed:
Explanation:
The scanner reads examples/dns_records.yaml and iterates over all DNS records.
For each record pointing to a Netlify target, it performs a passive HTTP GET to check if the site exists.
Sites that respond with known Netlify “not found” signatures are flagged as dangling.
The scanner outputs INFO logs for each check and ERROR logs for detected dangling records.
A JSON structured list of dangling records is printed for CI/Prow integration.
Exit codes:
0 → No dangling records
2 → Dangling records detected
Result:
Conclusion:
The scanner successfully detected all dangling Netlify DNS records in the example YAML.
Logs are detailed, and JSON output is ready for CI/Prow automation.
Diagram
flowchart TD A[Load DNS records from YAML] --> B{For each record} B --> C{Is target a Netlify site?} C -- No --> B C -- Yes --> D[Normalize hostname] D --> E[Perform HTTP GET with retries] E --> F{Check for dangling signatures} F -- Found --> G[Log ERROR & add to dangling list] F -- Not found --> H[Log INFO - site exists] G --> B H --> B B --> I[Print JSON of dangling records] I --> J[Exit with code 0 or 2]Remaining future step:
Investigate flagged records and remove or reassign DNS entries to prevent subdomain takeover