LLI Wiki — My Digital Knowledge Base

Firefox: Kerberos/NTLM SSO, DNS over HTTPS and MikroTik

Firefox about:config and GPO settings for integrated authentication, and DNS over HTTPS setup with a MikroTik router.

Memo of Firefox settings: integrated authentication (Kerberos/NTLM single sign-on) on an Active Directory domain, and DNS over HTTPS (DoH), including a MikroTik router acting as a DoH client.

Integrated Windows authentication (SSO)

In about:config, declare the internal sites allowed to receive Windows credentials:

network.automatic-ntlm-auth.trusted-uris        adfs.contoso.com, sqlserver01.contoso.com, contoso.com
network.automatic-ntlm-auth.allow-non-fqdn      true
network.negotiate-auth.trusted-uris             .contoso.com, https://intranet.contoso.com/
network.negotiate-auth.allow-non-fqdn           true
network.negotiate-auth.allow-insecure-ntlm-v1   true
Setting Purpose
network.automatic-ntlm-auth.trusted-uris Sites for which Firefox answers NTLM authentication automatically
network.negotiate-auth.trusted-uris Sites for which Firefox uses Kerberos/Negotiate (comma-separated list; a leading dot includes subdomains)
...allow-non-fqdn Allows short names (without a domain suffix)
network.negotiate-auth.allow-insecure-ntlm-v1 Allows NTLMv1; avoid it if possible, it is insecure

Deployment by GPO

The same settings can be pushed by group policy (Firefox administrative template) or directly in the registry under Software\Policies\Mozilla\Firefox\Authentication, with one numbered entry per site:

Software\Policies\Mozilla\Firefox\Authentication\NTLM\1        adfs.contoso.com
Software\Policies\Mozilla\Firefox\Authentication\Delegated\1   adfs.contoso.com
Software\Policies\Mozilla\Firefox\Authentication\NTLM\2        sqlserver01.contoso.com
Software\Policies\Mozilla\Firefox\Authentication\Delegated\2   sqlserver01.contoso.com

NTLM is the trusted NTLM list and Delegated is the Kerberos delegation list.

DNS over HTTPS in Firefox

network.trr.mode                 2
network.dns.echconfig.enabled    true

References: enabling DoH in Firefox and a list of public DoH servers.

MikroTik as a DoH client

Principle: the router sends its DNS queries over HTTPS to a provider, for example https://cloudflare-dns.com/dns-query or https://doh.libredns.gr/dns-query. Guides: jcutrer.com and shellhacks.com.

  1. Import trusted certificate authorities so the router can verify the DoH server:
/tool fetch url=https://curl.se/ca/cacert.pem
/certificate import file-name=cacert.pem

For LibreDNS, the server certificate was also exported in PEM format from Firefox (certificate page, "PEM (cert)" or "PEM (chain)" link) and imported the same way.

  1. Add a static DNS entry for the DoH server name (cloudflare-dns.com) so the router can reach it without a DoH resolver.
  2. Set the DoH server in the router's DNS settings (RouterOS 6.47 or later):
/ip dns set use-doh-server=https://cloudflare-dns.com/dns-query verify-doh-cert=yes
  1. Check that DNS queries really leave over HTTPS (port 443) towards the provider's addresses, with the built-in sniffer:
/tool sniffer quick port=443 ip-address=<doh_server_ip_address>

DoH provider certificate page in Firefox, with the PEM download links

Mastodon LLIMastodon SocialFosstodon