Skip to content

CI: Check every allow-list's DNS records #383

Closed

Description

Summary

Make the allow-list DNS check (.github/workflows/allow-list-dns-check.yaml) find the lists it checks, so that a list added under .github/harden-runner/ is covered without anyone editing the workflow, and run the same check on pull requests that change a list.

Today the workflow names two lists, the organisation list and the Gerrit servers list, each with its own pair of jobs. The three bot agent lists under bots/ are not checked, and the directory README says so. Adding them by name would repeat the problem for the next list.

Why

harden-runner resolves every non-wildcard entry before it enables block mode, and reverts to no filtering when one fails. harden-runner-block-action drops such an entry at run time, so a retired hostname does not break a job, but nothing reports it and the list keeps carrying it. The bot lists are where this matters most: each is what an agent job that reads outsiders' text may reach, and they are short enough that every entry should be known to be live.

Nothing checks a new record before it merges, either. The probe workflow loads the organisation list in the action's default filter mode, which drops a name that does not resolve and carries on, so a pull request that adds a dead hostname passes with no more than a warning annotation.

Part 1: the daily check discovers its lists

  1. What a list is. Every *.txt file under .github/harden-runner/, at any depth, at the commit being checked. Today that is five files: lfreleng-actions/allow_list.txt, lf-gerrit-servers/gerrit_servers.txt and the three under bots/.
  2. Discovered per ref. Find the lists at the default branch, and again at the latest release when it points at a different commit. A list that a release does not carry is then simply not checked there, with no special case.
  3. The consumers' resolver. Each check runs harden-runner-block-action in filter mode with the list as an explicit-path config pinned to the commit, as the Gerrit servers check does today. No second resolver.
  4. Reporting. The step summary and the Slack message carry one line per list and ref. Name each list by its path below harden-runner/, since two lists may share a file name. Keep the four outcomes: resolves, records that fail, indeterminate records, and a check that did not complete.
  5. Fail closed. Each of these is a failure the report and Slack carry, never a clean run:
    • discovery fails, or finds no list at the default branch;
    • a check does not complete (the action's step fails and publishes no outputs when every entry of a list is invalid);
    • a discovered list has no result in the report.
  6. Unchanged. The schedule, the test_notification input, audit-mode harden-runner in every job, the production environment on the notify job, and the existing action pins.

Part 2: check lists on pull requests

  1. Trigger. pull_request (never pull_request_target) with a paths filter on .github/harden-runner/** and this workflow file.
  2. What runs. Discover the lists at the pull request's head commit and check each one, with the same action and mode as Part 1.
  3. Outcome. The job fails when any list has records that definitively do not resolve, naming the list and the records. Indeterminate records warn and do not fail: a transient resolver answer must not block a pull request.
  4. No secrets. The pull request path uses no secret and no environment, sends nothing to Slack, and neither checks out nor executes anything from the pull request. The lists are data the action fetches by commit. The probe workflow already loads a list by github.event.pull_request.head.sha, and that works for a pull request from a fork.
  5. Concurrency. The workflow has one concurrency group with cancel-in-progress. A pull request run must not cancel the scheduled run, nor another pull request's.

The pull request for this issue changes the workflow file, so Part 2 runs on it. That is the one part of this change CI can prove before merge.

Constraints

  • Matrix outputs do not fan in. A job's outputs hold one matrix leg's values, so the report cannot read per-list results from a matrix job's outputs. If the checks become a dynamic matrix, the results need another route to the report, and rule 5 of Part 1 has to hold over it.
  • The action works in a pre hook. It runs ahead of any step-level condition, which is why the release checks are separate jobs today. Skip at the job level, and never start a matrix that would be empty.
  • Discovered paths are untrusted. On a pull request the file names come from the contributor. Accept a path only when it matches a strict pattern (the characters a list path needs, no .., under .github/harden-runner/, ending .txt), reject anything else as a failure, and pass paths to scripts through env, never by expanding an expression inside a run block.
  • One variable per list. Two lists must never share an env_var_name in one job.
  • One summary block. The action repeats its allow-list summary on every matrix leg unless allow_list_summary is set; its README shows how.

Choose the layout; the behaviour above is the requirement.

Documents

  • The workflow's header comment, which names the lists it checks and its triggers.
  • .github/harden-runner/README.md: the layout section states the rule that every *.txt under the directory is an allow-list and is checked, so nothing else may take that suffix there; "Every hostname must resolve" drops the sentence saying the bot agent lists are not checked and describes the pull request check.
  • README.md: the workflow's entry under "Workflows", and the Slack section that describes when the DNS check posts.

Validation

No test suite covers this workflow. Before submission: actionlint and the other prek hooks on the changed files, and zizmor --persona auditor with zero findings.

What the pull request cannot prove

The scheduled path runs on a schedule and by workflow_dispatch, neither of which a pull request from a fork triggers. After merge, a maintainer dispatches it once with test_notification on and confirms all five lists appear in the summary and the Slack message, at the default branch and at the latest release. Say so in the pull request, and say what its own Part 2 run showed.

The dispatch of this issue needs allow_workflow_edits, since the change edits a workflow file.

Activity

  1. changed the title [-]CI: Add the bot agent lists to the DNS check[/-] [+]CI: Check every allow-list's DNS records[/+] on Nov 22, 2026
  2. lf-releng-code-monkey-bot commented on Nov 22, 2026

    @lf-releng-code-monkey-bot
    Contributor

    🐒 An AI agent has proposed a change for this issue: pull request #384 (head c0930c3). The Copilot review of it is clean. An antagonistic review was requested from the review bot.

  3. lf-releng-code-monkey-bot commented on Nov 23, 2026

    @lf-releng-code-monkey-bot
    Contributor

    🐒 Round 1: an AI agent revised pull request #384 (head fe26a18). Round 1: one finding, fixed. Commit amended on base_sha (no rebase; nobody asked for one and the PR is mergeable). - Thread PRRT_kwDORqP1Us66pTis (artifact collision on re-run): fixed. Upload result now sets overwrite: true, so a re-run leg replaces its earlier result. ## Antagonistic review - The review body has one finding (stale DNS results after a re-run), which is the same as the inline thread. Fixed as above. Checks: prek, gitlint, zizmor auditor and the aislop gate all pass. What remains: the post-merge test_notification dispatch. It answers antagonistic review round 1 (#384 (review)). GitHub did not confirm whether the pull request can merge with main, so its CI may not have run. No Copilot review of its head arrived within the wait, so the review is pending and a maintainer should check for it.

  4. lf-releng-code-monkey-bot commented on Nov 23, 2026

    @lf-releng-code-monkey-bot
    Contributor

    🐒 Round 2: an AI agent revised pull request #384 (head fe26a18). Round 2: no code change. Head unchanged, still on base_sha. I did not rebase: no maintainer asked for one and the pull request is mergeable. - Thread PRRT_kwDORqP1Us66pTis (result artifacts collide on a re-run): fixed in round 1 with overwrite: true on Upload result. I checked it again on this head; I'm replying on the thread and resolving it. I reviewed the whole workflow again and found no other defect. No antagonistic review, Copilot overview or failing check is in the packet. Checks: prek on the changed files, zizmor auditor and gitlint all exit 0. Remaining: after merge, dispatch the workflow once with test_notification on.. The Copilot review of it is clean. An antagonistic review was requested from the review bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions