{
  "id": "unit1-stage-a",
  "version": "0.1.0",
  "stage": "A",
  "title_en": "Domain and Mail Closure, Stage A (Mail Alignment)",
  "titles_json": {
    "en": "Domain and Mail Closure, Stage A (Mail Alignment)"
  },
  "inputs_schema": {
    "domain": "string",
    "origin": "own_property | test_domain",
    "selectors": [
      "string"
    ],
    "hosts": [
      "string"
    ],
    "mail_use": "none | sends | null (the client says whether the domain sends mail; null when not said)",
    "dnssec_supported": "boolean | null (the client records whether its registrar and DNS host support DNSSEC)",
    "registrar_lock_supported": "boolean | null (the client records whether its registrar has a transfer lock)",
    "org_domain": "string | null (the Organizational Domain when the scanned name is a subdomain)"
  },
  "steps": [
    "SPF valid under 10 lookups",
    "DKIM signing on every sender whose console the client or partner gives access to",
    "every other known sender listed in the signed ramp plan with a hold reason (no access to the sender's console)",
    "SPF and DKIM alignment",
    "DMARC at p=none with aggregate reporting to a mailbox on the client's own subdomain",
    "registrar lock on",
    "DNSSEC where the registrar supports it",
    "parked domains that send no mail set to reject",
    "dangling records removed",
    "certificate validity checked (automation is Unit 2)",
    "retest",
    "signed ramp plan naming every sender seen"
  ],
  "acceptance_tests_json": [
    {
      "test_id": "spf_present_single",
      "test_version": "1",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "Exactly one TXT record at the domain starts with v=spf1 followed by a space or the end (RFC 7208 s3.2, s4.5)."
    },
    {
      "test_id": "spf_syntax_valid",
      "test_version": "1",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "Every term of every reached SPF record parses (RFC 7208 s4.6.1, s5, s6), redirect and exp appear at most once each, and every include and redirect target has exactly one SPF record (s5.2, s6.1). Not applicable when spf_present_single fails."
    },
    {
      "test_id": "spf_lookup_limit",
      "test_version": "2",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "The include, a, mx, ptr, exists and redirect terms across reached records number 10 or fewer, and each mx term names 10 or fewer MX hosts (RFC 7208 s4.6.4). Mechanisms after all are not evaluated and are not counted (RFC 7208 s4.6.2). Not applicable when spf_present_single fails."
    },
    {
      "test_id": "spf_void_lookups",
      "test_version": "3",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "Lookups that answer nxdomain or nodata number 2 or fewer, counting the TXT lookup of each include and redirect target, the A lookup of each a term, the MX lookup of each mx term and the A lookup of each exists term with no macro, before any all term (RFC 7208 s4.6.2, s4.6.4, s5.7). An a term is counted from its A answer, as for an IPv4 sender (s5.3). Not applicable when spf_present_single fails."
    },
    {
      "test_id": "spf_no_pass_all",
      "test_version": "2",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "No reached SPF record has all with the qualifier + or no qualifier (RFC 7208 s5.1); terms after the first all are not evaluated (s4.6.2). Not applicable when spf_present_single fails."
    },
    {
      "test_id": "dkim_key_present",
      "test_version": "2",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "At least one probed selector (the default list plus the selectors given) has a TXT key record with a non empty p= (RFC 6376 s3.6.1, s3.6.2.1). When a mailbox provider is known from MX and has documented selectors, a key must sit at one of them or at a selector the client gave (plan 5.2: DKIM signing on every sender whose console the client gives access to). Not applicable when the domain sends no mail."
    },
    {
      "test_id": "dkim_key_strength",
      "test_version": "3",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "Every found key parses, every found RSA key is 1024 bits or more (RFC 8301 s3.2), no found key allows only sha1 (h= without sha256, RFC 8301 s3.1) and every found key is for mail (s= absent, or naming email or *, RFC 6376 s3.6.1). Not applicable when the domain sends no mail or no key was found."
    },
    {
      "test_id": "dmarc_present_single",
      "test_version": "3",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "Exactly one TXT record at _dmarc.<domain> starts with v=DMARC1, the v tag name read without case (RFC 7489 s6.6.3 steps 2 and 5, s6.4); or, when the name has no record, exactly one at _dmarc.<org_domain> when org_domain is given, or else at the nearest parent of the name (down to two labels) that has a record, taken as the organizational domain in place of a public suffix list; that record's policy then applies (s6.6.3 step 3)."
    },
    {
      "test_id": "dmarc_syntax_valid",
      "test_version": "3",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "v=DMARC1 is the first tag and p the second; p and sp are none, quarantine or reject; adkim and aspf are r or s; pct is an integer from 0 to 100; ri is an integer; fo items are 0, 1, d or s; rua and ruf are comma lists of URIs with an optional size; no tag appears twice, tag names compared without case (RFC 7489 s6.3, s6.4; RFC 6376 s3.2). Not applicable when dmarc_present_single fails."
    },
    {
      "test_id": "dmarc_rua_present",
      "test_version": "2",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "rua holds at least one valid mailto URI. An empty tag spec is a syntax fault (test 9) but the other tags are still read. Not applicable when dmarc_present_single fails or the domain sends no mail."
    },
    {
      "test_id": "dmarc_rua_authorised",
      "test_version": "2",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "For each rua mailto address outside the Organizational Domain (the domain, or org_domain when given), <record domain>._report._dmarc.<address domain> has a TXT record starting with v=DMARC1 (RFC 7489 s7.1). Not applicable when there is no valid rua or every rua is under the Organizational Domain."
    },
    {
      "test_id": "mx_valid",
      "test_version": "1",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "MX is a lone null MX (RFC 7505 s3), or every MX exchange answers A or AAAA. Not applicable when the domain has no MX."
    },
    {
      "test_id": "parked_no_mail_locked",
      "test_version": "2",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "For a domain that sends no mail: MX is a lone null MX, the SPF record is v=spf1 -all and DMARC passes dmarc_present_single and dmarc_syntax_valid with p=reject, or sp=reject when inherited (RFC 7505 s4.2). A domain sends no mail when the client says so (mail_use none), or, while the client has not said, when it has no MX or only a null MX, no SPF sender and no DKIM key at the probed selectors; that second case is a guess, so a fail carries a hold until the client confirms. Not applicable when the domain sends mail or the client says it does."
    },
    {
      "test_id": "dnssec_signed",
      "test_version": "2",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "DS and DNSKEY both answer, a DS key tag and algorithm match the computed key tag (RFC 4034 Appendix B) and algorithm of a DNSKEY, and the DNSKEY answers without checking disabled (a zone that answers only with cd=1 is broken). Read at org_domain when given. Not applicable when there is no DS and the client records that its registrar or DNS host does not support DNSSEC (dnssec_supported false). While support is not recorded, a fail for a missing DS carries a hold and is settled when the client records support or its absence."
    },
    {
      "test_id": "registrar_lock_on",
      "test_version": "2",
      "outside_observable": true,
      "evidence_source": "rdap",
      "definition": "The RDAP status list holds client transfer prohibited or server transfer prohibited (RFC 8056 mapping). Read at org_domain when given. Not applicable when the TLD has no RDAP service, when the registry shows no transfer lock status (.uk), or when the client records that its registrar has no transfer lock (registrar_lock_supported false). While support is not recorded, a fail carries a hold."
    },
    {
      "test_id": "registration_not_expiring",
      "test_version": "2",
      "outside_observable": true,
      "evidence_source": "rdap",
      "definition": "The RDAP expiration event is at least 30 days after the scan. Read at org_domain when given. Not applicable when the TLD has no RDAP service."
    },
    {
      "test_id": "tls_apex_valid",
      "test_version": "1",
      "outside_observable": true,
      "evidence_source": "tls_handshake",
      "definition": "The certificate served on the apex is authorized, matches the host name, is already valid and has 14 or more days left. Not applicable when the host has no address or refuses the connection."
    },
    {
      "test_id": "tls_www_valid",
      "test_version": "1",
      "outside_observable": true,
      "evidence_source": "tls_handshake",
      "definition": "The same as tls_apex_valid for www.<domain>."
    },
    {
      "test_id": "no_dangling_cname",
      "test_version": "1",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "For each host of the list (given, or the default list), a CNAME target exists: its A lookup does not answer nxdomain."
    },
    {
      "test_id": "no_firm_host",
      "test_version": "4",
      "outside_observable": true,
      "evidence_source": "public_dns",
      "definition": "No firm host appears in the MX of the domain, the TXT at the domain and at _dmarc, the CNAME at _dmarc (and at the parent _dmarc when the record is inherited), every SPF record at or under the domain reached from its own SPF record (such as _spf), the rua and ruf address domains, the MX, TXT and CNAME of each rua address domain under the domain, the CNAME of each DKIM selector where a key was found, or the CNAME targets of the host list (plan 5.2 Stage A acceptance test). The firm hosts are marsadel.com and the names under it."
    }
  ],
  "risk_class": "read_only",
  "signer_type": "accountable_reviewer",
  "turnaround_hours": 72,
  "price_direct_usd": "290.00",
  "price_wholesale_usd": "190.00",
  "tier_rule": {
    "tier_share": {
      "1": "1.00",
      "2": "0.85",
      "3": "0.55",
      "4": "0.35"
    },
    "runbook_mode_discount": "0.20",
    "runbook_price_direct_usd": "232.00",
    "runbook_price_wholesale_usd": "152.00"
  },
  "warranty_terms_hash": "82cce7d78d24e308b045d0f24b6864d083ee93ef685e86016f8720932a684b99",
  "allowed_tools": [
    "doh_read",
    "rdap_read",
    "tls_handshake"
  ],
  "approval_rules": {
    "mode": "runbook",
    "client_applies_every_change": true,
    "write_tools": []
  },
  "review_level": "full",
  "bench_min_cases": 60,
  "bench_pass_rate": null,
  "bench_passed_at": null,
  "status": "bench_pending"
}
