Skip to content

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

Closed

Description

@dan-petty

Problem or Motivation

After plan step 14 of the homelab migration (#5120, phase 2), the real hosts are in homelab files at the same paths as the devops-cli files. Agents copy text between the two trees. The existing guard, tests/invariants/test_committed_addresses.py, refuses RFC 1918 addresses and .lan hosts only. No check reads the settings k8s.domain or cloudflare.domain. So a diff that names the configured public domain passes each check and can go into the public repository.

Proposed Solution & Architectural Design

Step 8 of the corrected plan on #5120, together with #5134 step 2. One pull request in devops-cli.

  1. Add a local check to the pre-push hook or to devops ci. The check reads k8s.domain and cloudflare.domain from the local config at run time.
  2. The check refuses a diff that names one of these domains, and names the file and the line. It never prints the value.
  3. The value never goes into git: no fixture, no test data and no output holds it. A test sets a placeholder domain such as example.net in its own config.
  4. If no domain is configured, the check passes and says that it checked nothing.
  5. Public evidence, such as a pull request comment, holds exit codes and counts only. It never holds argocd app diff output or Application YAML, because the live objects hold the real hosts.

Check. The guard refuses a test diff that names the configured domain. It passes a diff that names example.com only. uv run devops ci passes.

Rollback. git revert.

Downtime. None.

Order and dependencies. Plan step 8. It has no open dependency. It must merge before the copy (dan-petty/homelab#23, plan step 9) and before plan step 14 puts the hosts into homelab git. A person merges.

Target Subsystem

Security & Vulnerability Scanners

Existing Tool Considered

gitleaks, which the project already runs (devops_cli.security.gitleaks), refuses a pattern with a custom rule. The check can write that rule at run time to a file in a temporary directory, so the value never goes into git. A plain search of git diff for a fixed string is the other option. The plan of this item picks one. Cost: about 1M tokens to build, 0.1M a quarter to keep, 2 hours.

Source: #5120

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/feature
    scope/security
    status/new
    value/medium
    effort/medium
    on Nov 13, 2026
  3. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 13, 2026
  5. removed
    status/in-review
    owner/agent
    on Nov 13, 2026
  6. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-13 04:03 UTC

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

    effort/mediumpriority/p2-mediumscope/securitysource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions