Skip to content

v1.3.11

Latest

Choose a tag to compare

@github-actions github-actions released this 24 Nov 23:02
Immutable release. Only release title and notes can be modified.
12ab9bd

What's Changed

The DNS upstream is allowed whatever the policy's source (#226). The DNS proxy forwards every query to --dns-upstream, so under a default-deny policy the upstream has to be allowed on UDP 53. Only the CI-mode loader added that allow. A policy loaded from the CodeCargo API, or from a config file outside CI mode, carried only its own rules, so unless one of them happened to cover the upstream, every DNS lookup in the job timed out.

cargowall now adds the allow after whichever source loaded, for 127.0.0.1, the upstream and the Docker bridge address. Whether an address is already covered is judged by the verdict the firewall itself would give it on UDP 53:

  • Already allowed there: nothing is added.
  • Covered only by a rule that doesn't reach it, such as a port-scoped rule for its subnet, or by a port-scoped deny: a /32 allow for UDP 53 is added. It opens nothing else.
  • Covered by an all-ports deny: the deny is kept, and cargowall logs Skipping auto-allow: a deny rule covers this address.

Reverse lookups are scoped to addresses the run already knows. Under DNS query filtering:

  • A PTR query for an address the run knows is answered. That is an address with a name (from a DNS answer, a CNAME chain from an allowed name, or a confirmed reverse lookup), one inside an allow rule's CIDR, or a local address (private, loopback, link-local, unique-local, or in 100.64.0.0/10).
  • Any other query for a name under in-addr.arpa or ip6.arpa is refused when a deny rule matches it, and otherwise follows the default action. No hostname allow rule, CNAME allowance or search domain allows one.
  • The answer to a PTR query never changes what is allowed: no record in it is mapped, learned or installed.
  • cargowall's own reverse lookups of blocked destinations are bounded: at most 2 distinct addresses per IPv4 /24 and per IPv6 /48, and 256 IPv4 and 64 IPv6 addresses per run. These lookups, and the forward lookups that confirm them, now go to the DNS upstream directly instead of through the proxy.
  • v1: Scope reverse lookups to known addresses, bound own lookups, and resolve them upstream-direct by @matthewdevenny in #225

Behavior changes:

  • Under an enforcing policy, a job's reverse lookup of an address the run doesn't know is refused, and recorded as dns_blocked with the address as its destination IP and no hostname. The job summary shows it by address and never suggests allowing it.
  • A hostname allow rule, or a search domain, for a name under in-addr.arpa or ip6.arpa is dropped at load with a warning, and the rest of the policy loads. Deny rules, and other .arpa names such as home.arpa, are kept.
  • A blocked destination past the lookup caps goes unnamed, so one that only a reverse name could allow stays blocked. Allow it by its address range, or by a hostname that resolves to it.
  • A port-scoped deny that covers the DNS upstream no longer keeps cargowall from allowing the upstream on UDP 53. An all-ports deny still does.
  • An audit event logged without a timestamp is now stamped with the time it is logged.

CI only, with no change to the binary:

  • v1 CI: carry the step environment through sudo with scripts/ci/sudo-env.sh by @matthewdevenny in #228
  • v1 CI: run the build and e2e workflows on PRs and pushes to release branches by @matthewdevenny in #229

Full Changelog: v1.3.10...v1.3.11