Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command to validate authoritative DNS for providers #162

Merged
merged 7 commits into from Apr 15, 2020

Conversation

sbfaulkner
Copy link
Contributor

this PR adds a validate_authority command to verify provider delegation to authoritative nameservers

Usage:
  record-store validate_authority

Options:
  -v, [--verbose], [--no-verbose]  # Include valid zones in output
  -c, [--config=CONFIG]            # Path to config.yml

Validates that authoritative nameservers match the providers

example output...

bin/record-store validate_authority

Zone: splunkctf.io
- NS1: authoritative nameservers not found for configured provider

Zone: shopifyplus.ar
- DNSimple: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - a.dns.ar.
  - b.dns.ar.
  - c.dns.ar.
  - d.dns.ar.
  - e.dns.ar.
  - f.dns.ar.
  - ar.cctld.authdns.ripe.net.

Zone: buyable-pin.com
- NS1: authoritative nameservers not found for configured provider

Zone: business.new
- DNSimple: authoritative nameservers not found for configured provider
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns-tld1.charlestonroadregistry.com.
  - ns-tld2.charlestonroadregistry.com.
  - ns-tld3.charlestonroadregistry.com.
  - ns-tld4.charlestonroadregistry.com.
  - ns-tld5.charlestonroadregistry.com.

Zone: beyondthecode.io
- NS1: authoritative nameservers not found for configured provider

Zone: tookanl.com
- DNSimple: authoritative nameservers not found for configured provider
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - dns1.registrar-servers.com.
  - dns2.registrar-servers.com.

Zone: shopify.cn
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - dns4.g01.ns1global.org.
  - dns1.g01.ns1global.org.
  - dns2.g01.ns1global.org.
  - dns3.g01.ns1global.org.

Zone: frenzy.fail
- DNSimple: authoritative nameservers not found for configured provider
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - dns1.registrar-servers.com.
  - dns2.registrar-servers.com.

Zone: sto.re
- DNSimple: authoritative nameservers not found for configured provider
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns1162.ispapi.net.
  - ns3167.ispapi.net.
  - ns2163.ispapi.net.

Zone: myshopify.cloud
- NS1: authoritative nameservers not found for configured provider

Zone: shopifyplus.com.kz
- DNSimple: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns2.hoster.kz.
  - ns3.hoster.kz.
  - ns1.hoster.kz.

Zone: shopifyplus.ee
- DNSimple: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns.tld.ee.
  - ee.aso.ee.
  - e.tld.ee.
  - b.tld.ee.
  - ee.eenet.ee.

Zone: activemerchant.org
- NS1: authoritative nameservers not found for configured provider

Zone: shopifyplus.kz
- DNSimple: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns1.hoster.kz.
  - ns3.hoster.kz.
  - ns2.hoster.kz.

Zone: oberlo.com.br
- NS1: authoritative nameservers not found for configured provider

Zone: ecommerce-calendar.com
- DNSimple: authoritative nameservers not found for configured provider
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns1.markmonitor.com.
  - ns3.markmonitor.com.
  - ns4.markmonitor.com.
  - ns2.markmonitor.com.

Zone: buyable-pins.com
- NS1: authoritative nameservers not found for configured provider

Zone: test.recordstore.chrome
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns-tld1.charlestonroadregistry.com.
  - ns-tld2.charlestonroadregistry.com.
  - ns-tld3.charlestonroadregistry.com.
  - ns-tld4.charlestonroadregistry.com.
  - ns-tld5.charlestonroadregistry.com.

Zone: shopify.com.cn
- DNSimple: authoritative nameservers not found for configured provider

Zone: shopify.com.co
- NS1: authoritative nameservers not found for configured provider

Zone: storecontest.com
- NS1: authoritative nameservers not found for configured provider

Zone: buyablepins.com
- NS1: authoritative nameservers not found for configured provider

Zone: buyablepin.com
- NS1: authoritative nameservers not found for configured provider

Zone: joinpopup.com
- DNSimple: authoritative nameservers not found for configured provider
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns33.domaincontrol.com.
  - ns34.domaincontrol.com.

Zone: leetsoft.com
- DNSimple: authoritative nameservers not found for configured provider
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns1.hover.com.
  - ns2.hover.com.

Zone: snowdevil.ca
- NS1: authoritative nameservers not found for configured provider

Zone: shopifyplus.co.th
- DNSimple: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns01.trademarkarea.com.
  - ns02.trademarkarea.com.
  - ns03.trademarkarea.com.

Zone: shopifyplus.ba
- DNSimple: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns01.trademarkarea.com.
  - ns02.trademarkarea.com.
  - ns03.trademarkarea.com.

Zone: shopifyplus.co.za
- DNSimple: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns.coza.net.za.
  - ns3.iafrica.com.
  - coza1.dnsnode.net.
  - ns2us.dns.business.
  - ns0.is.co.za.

Zone: shopifyplus.mk
- DNSimple: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns01.trademarkarea.com.
  - ns02.trademarkarea.com.
  - ns03.trademarkarea.com.

Zone: ecommerce-university.com
- DNSimple: authoritative nameservers not found for configured provider
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns1.markmonitor.com.
  - ns3.markmonitor.com.
  - ns4.markmonitor.com.
  - ns2.markmonitor.com.

Zone: burstmode.com
- NS1: authoritative nameservers not found for configured provider

Zone: plt.co
- DNSimple: authoritative nameservers not found for configured provider
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns4.easily.net.
  - ns3.easily.net.

Zone: shopify-ns1.com
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - dns1.g01.ns1global.org.
  - dns2.g01.ns1global.org.
  - dns3.g01.ns1global.org.
  - dns4.g01.ns1global.org.

Zone: shopifyplus.com.ar
- DNSimple: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - ns2.sedoparking.com.
  - ns1.sedoparking.com.

Zone: showussomethingcool.com
- NS1: authoritative nameservers not found for configured provider

Zone: buildwithshopify.com
- NS1: authoritative nameservers not found for configured provider

Copy link
Contributor

@XaF XaF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't flag:

Zone: shopify.cn
- NS1: authoritative nameservers not found for configured provider
- Unknown: unknown authoritative nameservers found
  - dns4.g01.ns1global.org.
  - dns1.g01.ns1global.org.
  - dns2.g01.ns1global.org.
  - dns3.g01.ns1global.org.

Probably would require other when there?
https://github.com/Shopify/record_store/pull/162/files/5aec3bc28217343f9cad4764be0d68753ea4e7f9#diff-5f6190009b4d6922fcd1b3bf4862de14R27-R28

when /\.nsone\.net\z/
when /\.ns1global\.org\z/
when /\.ns1global\.net\z/
  'NS1'

Comment on lines +8 to +18
case object
when Record::NS
object.nsdname.chomp('.')
else
begin
master_nameserver_for(object)
rescue Resolv::ResolvError
$stderr.puts "Domain doesn't exist (#{object})"
return
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a case here instead of simple if?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to easily match the types... and I'd originally considered when String for the current else case

I can definitely switch to if object.is_a?(Record::NS) instead 🤷

@sbfaulkner
Copy link
Contributor Author

sbfaulkner commented Apr 15, 2020

@XaF added support for ns1 global nameservers in provider detection in 51cbe72

@sbfaulkner sbfaulkner merged commit bc6a958 into master Apr 15, 2020
@sbfaulkner sbfaulkner deleted the validate-authority branch April 15, 2020 21:14
@sbfaulkner sbfaulkner requested a deployment to production April 15, 2020 22:57 Abandoned
@sbfaulkner sbfaulkner temporarily deployed to production April 15, 2020 22:57 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants