Skip to content

WIP: spf flattening logic.#126

Merged
tlimoncelli merged 58 commits intomasterfrom
flat
Sep 29, 2017
Merged

WIP: spf flattening logic.#126
tlimoncelli merged 58 commits intomasterfrom
flat

Conversation

@captncraig
Copy link
Copy Markdown
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
Copy Markdown
Contributor

Awesome stuff so far!

@captncraig
Copy link
Copy Markdown
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
Copy Markdown
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
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.

3 participants