Skip to content

[OC-2042] Constrain subdomains to be RFC 1034-conformant.

Uman Shahzad requested to merge uman/subdomain-constraints into master

Problem

As it stands, a beta tester can register a subdomain that isn't RFC 1034-conformant, or that conflicts with another without raising any errors by changing letter case.

Solution

This PR introduces a regex based validation scheme to ensure RFC 1034 conformance. It also cleans the subdomain to be lower case.

Testing

  1. Open up a local Ocim and go to /registration/.
  2. Try subdomains you'd expect to fail under RFC 1034, and ensure that they do.
  3. Try subdomains you'd expect to pass under RFC 1034, and ensure that they do.
  4. Register the instance with a subdomain in all caps.
  5. Check the instance in the admin panel and ensure that the subdomain is actually in lower case.

Remaining work

The remaining work must be done outside of this PR, and that is:

  1. Convert any existing non-conformant subdomains to meet RFC 1034 standards. This will require contacting the instance owner. This includes making sure all subdomains are lower case.
  2. We may need to add some subdomains to the SUBDOMAIN_BLACKLIST setting in our production Ocim instance.
  3. There are some extra details of remaining work on the internal ticket.

Merge request reports