Skip to content

feat(security): refuse a commit that names the configured domain - #5347

Merged
dan-petty merged 4 commits into
mainfrom
feat/5295-refuse-configured-domain
Nov 13, 2026
Merged

dan-petty merged 4 commits into
mainfrom
feat/5295-refuse-configured-domain

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

A new row domain of devops ci reads k8s.domain and cloudflare.domain from the config at run time. It reads each added line and each path of each commit from origin/main to HEAD (git log -p and unidiff), and fails on the domain or a name under it. The row reads the domain in ASCII with no final dot, and also finds its Unicode form. Each finding names the path, the line, the commit and the settings key, never the value. The pre-push hook runs devops ci --check --only lint,format,domain, so no push sends such a commit to the public repository. Where no domain is configured, such as on the GitHub runners, the row is skipped with its cause.

Why: the address guard refuses RFC 1918 addresses and .lan hosts only, and agents copy text between the homelab tree and this repository. The runner image holds no Gitleaks, so a Gitleaks rule would not run before the runner Job pushes.

Closes #5295

Change: openspec/changes/archive/2026-11-13-5295-refuse-configured-domain/

The new row `domain` reads `k8s.domain` and `cloudflare.domain` from the
config at run time. It reads the patch of each commit from origin/main to
HEAD with `git log -p`, and unidiff gives the path and the line of each
added line. The row fails on a line or a path that holds a configured
domain with no letter, digit or hyphen next to it. Each finding names the
path, the line, the commit and the settings key, never the value. Where no
domain is configured, the row is skipped with its cause.

The pre-push hook `devops-ci-pre-push` runs the row with lint and format,
so a push of a person, an agent or the runner Job reads the commits of
the branch before they go to GitHub.

Refs #5295
SECURITY.md rule 8 says how the row reads the configured domains, and
that public evidence holds exit codes and counts only, never `argocd app
diff` output or Application YAML. CONTRIBUTING.md, docs/SDLC.md and the
knowledge base list the row among the checks of the pre-push hook.
docs/TESTING.md lists the row and its invariant test file. ADR 0014 gets
a Status History line, because its pre-push hook now also runs the row.

Refs #5295
The config keeps the text of k8s.domain and cloudflare.domain. A domain
with a final dot or blank space, such as "example.net.", gave a pattern
that found no host under example.net, so the domain row passed a commit
that named the domain. configured_domains now gives each domain from
dnspython in ASCII with no blank space and no final dot. The pattern of
the row also holds the Unicode form, so a Unicode label is found in both
forms.

Refs #5295
@dan-petty dan-petty added type/feature Type feature: a new function scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault labels Nov 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Local evidence for the head 1ab609f97 (reviewer):

  • Review fix e57a91a7d: the config keeps a final dot and blank space in k8s.domain and cloudflare.domain. Before the fix, example.net. in the config found no host under example.net, so the row passed such a commit. On the code before the fix, 4 of the new cases failed (test_a_configured_domain_finds_its_hosts_in_each_spelling_of_the_config[example.net.], [ example.net ], and 2 cases of test_a_domain_with_a_unicode_label_is_found_in_its_ascii_and_its_unicode_form). With the fix: 108 passed.
  • uv run devops ci --check --only lint,format,constructs,openspec,test-tree,swallowed-failures,startup-imports,domain: all pass.
  • uv run mypy --python-version 3.14 --strict on src/devops_cli/core/dns_names.py, tests/gate/configured_domain.py and tests/invariants/test_configured_domain_check.py: no issues.
  • uv run devops ci test on the tests of the domain row, the gate rows, test_ci.py, the runner tools, the instruction generator, the workflow contracts, the change folders, the living specs, the ADR records, tests/core/test_validation.py, tests/commands/k8s/test_k8s_networking.py and tests/config: 813 passed.
  • The pre-push hooks passed on the push, with a configured domain: branch-current, and devops ci --check --only lint,format,domain.
  • Count-only probe with the real config: the commit messages, the diff and the branch name hold the configured domains 0 times.

Render diff: the branch changes no path under k8s/ (git diff --name-only origin/main...HEAD -- k8s gives 0 files). The kustomize and helm renders are the same at origin/main and at the branch. Nothing restarts.

@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 03:36
@dan-petty
dan-petty merged commit c0a53b7 into main Nov 13, 2026
24 checks passed
@dan-petty
dan-petty deleted the feat/5295-refuse-configured-domain branch November 13, 2026 03:46
dan-petty pushed a commit that referenced this pull request Nov 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.126.0](v0.125.5...v0.126.0)
(2026-11-13)


### Features

* **security:** refuse a commit that names the configured domain
([#5347](#5347))
([c0a53b7](c0a53b7))


### Bug Fixes

* **github:** correct readiness files and merged monitor output
([#5349](#5349))
([e477ab2](e477ab2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
@devops-cli-service devops-cli-service Bot mentioned this pull request Nov 15, 2026
1 of 21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(security): refuse a diff that names the configured domain

1 participant