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

TRANSIP: Audit records verified #2794

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

cafferata
Copy link
Collaborator

@cafferata cafferata commented Jan 11, 2024

Verified the audit records against the TransIP API.

D(
  'dnscontrol.nl',
  NewRegistrar('none'),
  DnsProvider(NewDnsProvider('transip', '-')),

  // ALIAS: Failure
  // ALIAS('LabelNotApex', 'LabelNotApex.com.')

  // TXT: Failure
  // TXT('TxtHasBackticks', '`')
  // TXT('TxtHasBackslash', "\\")
  // TXT('TxtHasTrailingSpace', ' ')
  // TXT('TxtStartsOrEndsWithSpaces', ' test')
  // TXT('TxtIsEmpty', '')

  // TXT: Success
  // TXT('TxtHasDoubleQuotes', '"test"')
  // TXT('TxtHasSemicolon', ';'),
  // TXT('TxtHasSingleQuotes', "'")
  // TXT('TxtHasUnpairedDoubleQuotes', '" test')

  // CAA: Success
  // CAA('CaaTargetContainsWhitespace', 'iodef', ' mailto:info@jcid.nl ')
  // CAA('CaaTargetHasSemicolon', 'issue', 'letsencrypt.org; policy=ev')
);
For completeness/archive purpose my testing steps/output

I ran a local DNSControl build with a modified providers/transip/auditrecords.go.

package transip

import (
	"github.com/StackExchange/dnscontrol/v4/models"
	"github.com/StackExchange/dnscontrol/v4/pkg/rejectif"
)

// AuditRecords returns a list of errors corresponding to the records
// that aren't supported by this provider.  If all records are
// supported, an empty list is returned.
func AuditRecords(records []*models.RecordConfig) []error {
	a := rejectif.Auditor{}
	a.Add("MX", rejectif.MxNull) // Last verified 2023-12-04
	return a.Audit(records)
}
go build
./dnscontrol push --domains dnscontrol.nl

LabelNotApex

******************** Domain: dnscontrol.nl
1 correction (transip)
#1: + CREATE labelnotapex.dnscontrol.nl ALIAS LabelNotApex.com. ttl=300
FAILURE! Alias must be an @ record.: labelnotapex 300 ALIAS LabelNotApex.com.
Done. 1 corrections.
completed with errors

TxtHasBackticks

******************** Domain: dnscontrol.nl
1 correction (transip)
#1: + CREATE txthasbackticks.dnscontrol.nl TXT "`" ttl=300
FAILURE! the content of a TXT record cannot contain invalid characters: txthasbackticks 300 TXT `
Done. 1 corrections.
completed with errors

TxtHasBackslash

******************** Domain: dnscontrol.nl
1 correction (transip)
#1: + CREATE txthasbackslash.dnscontrol.nl TXT "\\" ttl=300
FAILURE! the content of a TXT record cannot contain invalid characters: txthasbackslash 300 TXT \
Done. 1 corrections.
completed with errors

TxtHasTrailingSpace

******************** Domain: dnscontrol.nl
1 correction (transip)
#1: + CREATE txthastrailingspace.dnscontrol.nl TXT " " ttl=300
FAILURE! whitespace at the end or start of the content of a record is not allowed: txthastrailingspace 300 TXT
Done. 1 corrections.
completed with errors

TxtStartsOrEndsWithSpaces

******************** Domain: dnscontrol.nl
1 correction (transip)
#1: + CREATE txtstartsorendswithspaces.dnscontrol.nl TXT " test" ttl=300
FAILURE! whitespace at the end or start of the content of a record is not allowed: txtstartsorendswithspaces 300 TXT  test
Done. 1 corrections.
completed with errors

TxtIsEmpty

******************** Domain: dnscontrol.nl
1 correction (transip)
#1: + CREATE txtisempty.dnscontrol.nl TXT "" ttl=300
FAILURE! record content cannot be empty: txtisempty 300 TXT
Done. 1 corrections.
completed with errors

cc: Maintainer TransIP: @blackshadev

Comment on lines +14 to +28
a.Add("ALIAS", rejectif.LabelNotApex) // Last verified 2024-01-11

a.Add("MX", rejectif.MxNull) // Last verified 2023-12-04

a.Add("TXT", rejectif.TxtHasBackticks) // Last verified 2023-12-04
a.Add("TXT", rejectif.TxtHasBackticks) // Last verified 2024-01-11

a.Add("TXT", rejectif.TxtHasDoubleQuotes) // Last verified 2023-12-04
a.Add("TXT", rejectif.TxtHasBackslash) // Last verified 2024-01-11

a.Add("TXT", rejectif.TxtHasBackslash) // Last verified 2023-12-04
a.Add("TXT", rejectif.TxtStartsOrEndsWithSpaces) // Last verified 2024-01-11

a.Add("TXT", rejectif.TxtStartsOrEndsWithSpaces) // Last verified 2023-12-10
a.Add("TXT", rejectif.TxtIsEmpty) // Last verified 2024-01-11

a.Add("TXT", rejectif.TxtIsEmpty) // Last verified 2023-12-10
a.Add("TXT", rejectif.TxtLongerThan(1024)) // Last verified 2024-01-11

a.Add("TXT", rejectif.TxtLongerThan(1024)) // Last verified 2023-12-15
a.Add("TXT", rejectif.TxtHasTrailingSpace) // Last verified 2024-01-11
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep in sorted order:

  a.Add("ALIAS", rejectif.LabelNotApex) // Last verified 2024-01-11 

  a.Add("MX", rejectif.MxNull) // Last verified 2023-12-04

  a.Add("TXT", rejectif.TxtHasBackslash) // Last verified 2024-01-11

  a.Add("TXT", rejectif.TxtHasBackticks) // Last verified 2024-01-11

  a.Add("TXT", rejectif.TxtHasTrailingSpace) // Last verified 2024-01-11

  a.Add("TXT", rejectif.TxtIsEmpty) // Last verified 2024-01-11

  a.Add("TXT", rejectif.TxtLongerThan(1024)) // Last verified 2024-01-11

  a.Add("TXT", rejectif.TxtStartsOrEndsWithSpaces) // Last verified 2024-01-11

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have not adjusted any ordering. That's the git diff being misleading. Please check commit by commit. ☺️

Copy link
Contributor

Choose a reason for hiding this comment

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

Duh. I'm illiterate.

@tlimoncelli
Copy link
Contributor

FYI:

Another way verify these is to comment them out one at a time and run the integration tests to see if it still fails.

For example, comment out a.Add("MX", rejectif.MxNull) then run the integration tests. If they succeed, you can remove that line.

This means n integration test runs for n lines in the file, but it is easier (to me) than creating a dnsconfig.js file.

@tlimoncelli tlimoncelli merged commit 1db0ae2 into StackExchange:main Jan 11, 2024
3 checks passed
@cafferata cafferata deleted the transip-audit-records branch January 11, 2024 22:29
@cafferata
Copy link
Collaborator Author

This was a continuation of several test cases from #2789. The problem observed from the TransIP API/Go package cannot be reproduced from the TransIP interface. 🙈

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.

2 participants