Skip to content
New issue

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

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

Already on GitHub? # to your account

WIP: spf flattening logic. #126

Merged
merged 58 commits into from
Sep 29, 2017
Merged

WIP: spf flattening logic. #126

merged 58 commits into from
Sep 29, 2017

Conversation

captncraig
Copy link
Contributor

@captncraig captncraig commented May 26, 2017

Currently implemented splitting TXT record at 255 boundaries.

  • Add metadata to flatten / split TXT records
  • Separate subcommand to update caches
  • document everything
  • Pretty up ui thing for docs.

@tlimoncelli
Copy link
Contributor

Awesome stuff so far!

@captncraig
Copy link
Contributor Author

captncraig commented Jun 5, 2017

Old:

var SPF = TXT("@", [
    'v=spf1',
    'ip4:198.252.206.0/24', // ny-mail*
    'ip4:192.111.0.0/24',  // co-mail*
    'include:_spf.google.com', // Google Apps
    'include:mailgun.org',  // Mailgun
    'include:fogcreek.com', // Fogbugz
    'include:mail.zendesk.com', // Zenddesk
    'include:servers.mcsv.net', // MailChimp
    'include:sendgrid.net', //SendGrid
    'include:spf.mtasv.net', //Desk.com (needed by it-team)
    '~all'
].join(" "));

New:

var SPF = TXT("@", [
    'v=spf1',
    'ip4:198.252.206.0/24', // ny-mail*
    'ip4:192.111.0.0/24',  // co-mail*
    'include:_spf.google.com', // Google Apps
    'include:mailgun.org',  // Mailgun
    'include:fogcreek.com', // Fogbugz
    'include:mail.zendesk.com', // Zenddesk
    'include:servers.mcsv.net', // MailChimp
    'include:sendgrid.net', //SendGrid
    'include:spf.mtasv.net', //Desk.com (needed by it-team)
    '~all'
].join(" "), {spf_flatten:"mailgun.org,mail.zendesk.com", spf_split:"_spf%d"});

Validate step will run flatten logic for all txt records with the metadata. If split is specified, generate one or more txt records to replace original with.

Possibly run analysis on final TXT record size:

  • No single TXT records should be over 255
  • All TXTs for a name should fit in a single packet.

@captncraig
Copy link
Contributor Author

dnscontrol -js dnsconfig.js spf-gen

  • Read config
  • For every TXT record with v=spf1:
    • Parse and lookup includes
    • Print statistics of lookups / record count
  • Write dns cache to lookup-cache.json
  • Exit with 1 if it made changes, 0 otherwise.

@tlimoncelli tlimoncelli merged commit 823e8bb into master Sep 29, 2017
@tlimoncelli tlimoncelli deleted the flat branch September 29, 2017 20:00
rblenkinsopp pushed a commit to rblenkinsopp/dnscontrol that referenced this pull request Aug 21, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants