SaltDns.Zones.Dnssec (Salt v1.0.0)

DNSSEC settings and lifecycle state of a zone, embedded in the zone record.

Signing itself is done by Knot; the zone's writer (SaltDns.Knot.Reconcile) makes Knot match knot_mode/1. This records what the user asked for (enabled, denial) and where the zone is in the lifecycle (SaltDns.Dnssec.Lifecycle):

  • state - the lifecycle state, :unsigned for a zone that was never signed or is fully unsigned again;
  • state_since - when the state was entered;
  • wait_until - in :ds_removed_waiting, the time before which the zone must not be unsigned (the DS and negative TTLs, with a margin);
  • ds_ttl - the longest TTL seen on the parent's DS, which sets that wait;
  • last_check and last_checked_at - what the last parent-side DS check saw ("match", "none", "other" or "inconclusive"), for display.

enabled is "the user wants this zone signed": true while signing and signed, false once the guided switch-off has started. Callers that go through changeset/2 (zone settings forms, the REST API's zone creation, PowerDNS dnssec: true) ask for a change and the lifecycle decides; the driver (SaltDns.Dnssec) moves the state itself with put_state/3.

Summary

Functions

A request to change enabled or denial, turned into a lifecycle transition: switching on from :unsigned starts signing, switching off while signed starts the guided switch-off, switching on during it cancels it, and a new denial while signed re-signs. Anything the lifecycle does not allow in the current state is an error on the field.

What Knot should be doing for this state: signing with the zone's denial, or not signing.

The embedded value with the lifecycle state set by the driver (not a user request). fields may hold :wait_until, :ds_ttl, :last_check, :last_checked_at; the state timestamp is set when the state changes.

Types

t()

@type t() :: %SaltDns.Zones.Dnssec{
  denial: term(),
  ds_ttl: term(),
  enabled: term(),
  last_check: term(),
  last_checked_at: term(),
  state: term(),
  state_since: term(),
  wait_until: term()
}

Functions

changeset(dnssec, attrs)

A request to change enabled or denial, turned into a lifecycle transition: switching on from :unsigned starts signing, switching off while signed starts the guided switch-off, switching on during it cancels it, and a new denial while signed re-signs. Anything the lifecycle does not allow in the current state is an error on the field.

knot_mode(dnssec)

@spec knot_mode(t()) :: SaltDns.Knot.dnssec_mode()

What Knot should be doing for this state: signing with the zone's denial, or not signing.

put_state(dnssec, state, fields \\ %{})

@spec put_state(t(), SaltDns.Dnssec.Lifecycle.state(), map()) :: t()

The embedded value with the lifecycle state set by the driver (not a user request). fields may hold :wait_until, :ds_ttl, :last_check, :last_checked_at; the state timestamp is set when the state changes.