Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,22 @@
"GIT_CONFIG_KEY_3": "credential.https://gist.github.com.helper",
"GIT_CONFIG_VALUE_3": "!gh auth git-credential",
"UV_MALWARE_CHECK": "1",
"UV_CACHE_DIR": "${containerWorkspaceFolder}/.uv"
"UV_CACHE_DIR": "${containerWorkspaceFolder}/.uv",
"DO_NOT_TRACK": "1",
"HF_HUB_DISABLE_TELEMETRY": "1",
"SCARF_NO_ANALYTICS": "true",
"NEXT_TELEMETRY_DISABLED": "1",
"CHECKPOINT_DISABLE": "1",
"DOTNET_CLI_TELEMETRY_OPTOUT": "1",
"ANONYMIZED_TELEMETRY": "false",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"DISABLE_TELEMETRY": "1",
"GOTELEMETRY": "off",
"PIP_DISABLE_PIP_VERSION_CHECK": "1",
"npm_config_update_notifier": "false",
"DOCKER_CLI_HINTS": "false",
"MINIKUBE_WANTUPDATENOTIFICATION": "false",
"MINIKUBE_WANTREPORTERRORPROMPT": "false"
},
"forwardPorts": [
9418
Expand Down Expand Up @@ -90,6 +105,9 @@
"saoudrizwan.claude-dev"
],
"settings": {
"telemetry.telemetryLevel": "off",
"redhat.telemetry.enabled": false,
"workbench.enableExperiments": false,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
Expand Down Expand Up @@ -134,6 +152,9 @@
"anthropic.claude-code"
],
"settings": {
"telemetry.telemetryLevel": "off",
"redhat.telemetry.enabled": false,
"workbench.enableExperiments": false,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
Expand Down
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ This document provides foundational context, architectural principles, and opera
- **Defensive Filesystem, Symlink & Resource Containment**:
- Always enforce pre-flight file size caps (e.g. `MAX_REPOMAP_FILE_SIZE_BYTES` $\le 50$MB) before ingesting, parsing, or packing files into memory (via Python AST, Tree-Sitter, or text loaders) to prevent out-of-memory crashes and denial-of-service from minified bundles, database dumps, or large binaries.
- Always defensively resolve filesystem symlinks (`path.resolve()`) and verify that target paths remain strictly confined within the intended root workspace (`resolved_path.is_relative_to(base_root)`), catching `(OSError, RuntimeError)` to prevent circular symlink loops (`ELOOP`) and directory traversal escapes.
- **Mandatory Third-Party Telemetry & Phone-Home Opt-Outs**:
- **Strict Opt-Out of Non-Functional Third-Party Telemetry**: AI agents, automated workflows, and configuration templates MUST always disable and opt out of third-party telemetry, phone-home mechanisms, anonymous usage reporting, crash analytics, and background phone-home update checks across all tools, services, workloads, container environments, and CLI configurations whenever doing so does not impact functional user experience (e.g. Grafana `analytics.reporting_enabled: false`, Alloy `enableReporting: false`, Loki `analytics.reporting_enabled: false`, Traefik `--global.sendanonymoususage=false` / `--global.checknewversion=false`, Open WebUI `ANONYMIZED_TELEMETRY: "false"` / `DO_NOT_TRACK: "true"` / `SCARF_NO_ANALYTICS: "true"` / `ENABLE_VERSION_UPDATE_CHECK: "false"`, LiteLLM Gateway `telemetry: false` / `LITELLM_TELEMETRY: "False"`, and devcontainer environment opt-outs `DO_NOT_TRACK=1`, `GOTELEMETRY=off`, `PIP_DISABLE_PIP_VERSION_CHECK=1`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`, `HF_HUB_DISABLE_TELEMETRY=1`).
- **User Confirmation Required for Functional Web Integrations**: For web integrations and external network calls that provide tangible user-facing functionality or dynamic content (such as IDE plugin and extension update notifications, live community news feeds, or remote marketplace catalogs), AI agents MUST NOT unilaterally disable them without confirming with the user first. Always distinguish purely passive background telemetry and phone-home traffic from active user-facing capabilities, confirming user intent before suppressing functional web integrations.
- **Never Lower Security Standards or Quality Thresholds**: Never lower, relax, disable, bypass, or weaken security standards, quality thresholds (such as minimum 90% code coverage, strict static type checks, or lint rules), or compliance validations unless explicitly instructed by the user.
- **Continuous Standards Compliance & Solution Refinement**: Ensure every proposed solution, design, code change, or architecture meets all project standards and conventions, iteratively refining until every standard is met or exceeded.
- **Strict Pre-Push Quality Gate Mandate (Zero Pushes Without Passing `devops ci`)**:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Task 803: Disable Third-Party Telemetry Across K8s Stack and DevContainer

**Issue**: [#803](https://github.com/dan-petty/devops-cli/issues/803)
**Status**: Done
**Milestone**: `v0.2.24`
**Priority**: `priority/p2-medium`
**Scope**: `type/infra`, `type/security`, `scope/k8s`, `priority/p2-medium`

---

## 1. Description & Objectives

Disables third-party telemetry, phone-home mechanisms, version update checks, and crash reporting across the Kubernetes stack (Grafana, Alloy, Loki, Traefik, Open WebUI, LiteLLM Gateway) and the DevContainer development environment.

Root causes & telemetry vectors addressed:
1. **Grafana & Logging**:
- Grafana sent anonymous telemetry to `stats.grafana.org`, polled `grafana.com` for application and plugin updates, and pulled news feeds.
- Grafana Alloy instances (`alloy-metrics`, `alloy-singleton`, `alloy-logs`) sent periodic usage reports to `https://stats.grafana.org/alloy-usage-report`.
- Grafana Loki reported operational analytics to `https://stats.grafana.org/loki-usage-report`.
2. **Ingress & LLM Services**:
- Traefik sent anonymous usage telemetry and performed version checks.
- Open WebUI polled GitHub releases for version updates and lacked explicit opt-outs for Scarf and anonymized telemetry.
- LiteLLM Gateway lacked explicit telemetry opt-outs in its deployment and ConfigMap.
3. **DevContainer Environment**:
- VS Code / Antigravity editor lacked explicit telemetry opt-outs for `telemetryLevel`, Red Hat extensions, and workbench experiments.
- Developer toolchains (Claude Code, Go, Pip, Minikube, NPM, Docker, Hugging Face, Scarf) lacked explicit opt-out environment variables.

### Key Deliverables Completed:
- [x] **Kubernetes Monitoring & Logging Configuration** (`k8s/monitoring/grafana-values.yaml`, `k8s/monitoring/k8s-monitoring-values.yaml`, `k8s/logging/loki-values.yaml`):
- Added `analytics` and `news` blocks to `grafana.ini` disabling `reporting_enabled`, `check_for_updates`, `check_for_plugin_updates`, `feedback_links_enabled`, and `news_feed_enabled`.
- Added `selfReporting: enabled: false` and `enableReporting: false` across all Alloy collectors (`alloy-metrics`, `alloy-singleton`, `alloy-logs`).
- Added `analytics: reporting_enabled: false` to Loki Helm values.
- [x] **Ingress & LLM Stack Configuration** (`k8s/ingress/traefik-values.yaml`, `k8s/llm/values-open-webui.yaml`, `k8s/llm/gateway/configmap.yaml`, `k8s/llm/gateway/deployment.yaml`):
- Configured `--global.sendanonymoususage=false` and `--global.checknewversion=false` in Traefik values.
- Injected `ENABLE_VERSION_UPDATE_CHECK: "false"`, `ANONYMIZED_TELEMETRY: "false"`, `DO_NOT_TRACK: "true"`, and `SCARF_NO_ANALYTICS: "true"` into Open WebUI values.
- Set `telemetry: false` in LiteLLM Gateway ConfigMap and injected `LITELLM_TELEMETRY: "False"` into LiteLLM deployment.
- [x] **DevContainer Environment & Template** (`.devcontainer/devcontainer.json`, `src/devops_cli/templates/devcontainer.json.j2`):
- Set `telemetry.telemetryLevel: "off"`, `redhat.telemetry.enabled: false`, and `workbench.enableExperiments: false` under editor customizations.
- Injected environment variables into `containerEnv`: `DO_NOT_TRACK`, `HF_HUB_DISABLE_TELEMETRY`, `SCARF_NO_ANALYTICS`, `NEXT_TELEMETRY_DISABLED`, `CHECKPOINT_DISABLE`, `DOTNET_CLI_TELEMETRY_OPTOUT`, `ANONYMIZED_TELEMETRY`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, `DISABLE_TELEMETRY`, `GOTELEMETRY`, `PIP_DISABLE_PIP_VERSION_CHECK`, `npm_config_update_notifier`, `DOCKER_CLI_HINTS`, `MINIKUBE_WANTUPDATENOTIFICATION`, and `MINIKUBE_WANTREPORTERRORPROMPT`.
- [x] **Agent Instructions & Instruction Generator** (`AGENTS.md`, `src/devops_cli/ai/instruction_generator.py`, `tests/test_instruction_generator.py`):
- Codified the Mandatory Third-Party Telemetry & Phone-Home Opt-Outs policy into `AGENTS.md` and `instruction_generator.py`.
- Added requirement for AI agents to disable third-party telemetry and phone-home mechanisms across all tools and configurations when it does not impact functional user experience.
- Added requirement for AI agents to confirm with the user before disabling web integrations that provide tangible functionality (e.g. plugin/extension update checks, news feeds).
- [x] **Automated Regression Test Suite** (`tests/test_third_party_telemetry.py`, `tests/test_instruction_generator.py`):
- Authored comprehensive structural assertions verifying zero telemetry across all modified manifests, configs, and devcontainer definitions.
- Validated 100% pass rate with zero flaky tests.
4 changes: 4 additions & 0 deletions k8s/ingress/traefik-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# Configures Traefik as an internal ClusterIP ingress controller so external traffic
# enters solely through the authenticated Cloudflare Tunnel.

additionalArguments:
- "--global.sendanonymoususage=false"
- "--global.checknewversion=false"

service:
spec:
type: ClusterIP
Expand Down
1 change: 1 addition & 0 deletions k8s/llm/gateway/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ data:
callbacks: ["prometheus"]
require_auth_for_metrics_endpoint: false
drop_params: true
telemetry: false

router_settings:
# simple-shuffle routes requests weighted by throughput (litellm_params.weight),
Expand Down
2 changes: 2 additions & 0 deletions k8s/llm/gateway/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ spec:
# Use the bundled model cost map; egress is limited to the inference backends.
- name: LITELLM_LOCAL_MODEL_COST_MAP
value: "True"
- name: LITELLM_TELEMETRY
value: "False"
- name: LITELLM_REDIS_HOST
value: "valkey.llm.svc.cluster.local"
- name: LITELLM_REDIS_PORT
Expand Down
8 changes: 8 additions & 0 deletions k8s/llm/values-open-webui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ extraEnvVars:
value: "true"
- name: WEBUI_SECRET_KEY_FILE
value: "/app/backend/data/.webui_secret_key"
- name: ENABLE_VERSION_UPDATE_CHECK
value: "false"
- name: ANONYMIZED_TELEMETRY
value: "false"
- name: DO_NOT_TRACK
value: "true"
- name: SCARF_NO_ANALYTICS
value: "true"

# Valkey cache integration (replaces Redis)
websocket:
Expand Down
2 changes: 2 additions & 0 deletions k8s/logging/loki-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ deploymentMode: SingleBinary

loki:
auth_enabled: false
analytics:
reporting_enabled: false

commonConfig:
replication_factor: 1
Expand Down
8 changes: 8 additions & 0 deletions k8s/monitoring/grafana-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ grafana.ini:
auth.anonymous:
enabled: true
org_role: Viewer
analytics:
reporting_enabled: false
check_for_updates: false
check_for_plugin_updates: false
feedback_links_enabled: false
news:
news_feed_enabled: false


datasources:
datasources.yaml:
Expand Down
7 changes: 7 additions & 0 deletions k8s/monitoring/k8s-monitoring-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ destinations:
type: loki
url: http://loki.logging.svc.cluster.local:3100/loki/api/v1/push

# ── Self-Reporting ───────────────────────────────────────────────────────────
selfReporting:
enabled: false

# ── Features ─────────────────────────────────────────────────────────────────
clusterMetrics:
enabled: true
Expand Down Expand Up @@ -93,6 +97,7 @@ collectors:
- clustered
- statefulset
alloy:
enableReporting: false
resources:
requests:
cpu: 100m
Expand All @@ -102,6 +107,7 @@ collectors:
memory: 1024Mi
alloy-singleton:
alloy:
enableReporting: false
resources:
requests:
cpu: 50m
Expand All @@ -114,6 +120,7 @@ collectors:
- daemonset
- filesystem-log-reader
alloy:
enableReporting: false
resources:
requests:
cpu: 50m
Expand Down
15 changes: 15 additions & 0 deletions src/devops_cli/ai/instruction_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,21 @@ def generate_agents_md(meta: ProjectMetadata) -> str:
endpoints.
- Enforce subprocess safety with explicit command argument lists, bounded timeouts, and error
handling.
- **Mandatory Third-Party Telemetry & Phone-Home Opt-Outs**:
- **Strict Opt-Out of Non-Functional Third-Party Telemetry**: AI agents, automated workflows,
and configuration templates MUST always disable and opt out of third-party telemetry, phone-home
mechanisms, anonymous usage reporting, crash analytics, and background update checks across all
tools, services, workloads, container environments, and CLI configurations whenever doing so does
not impact the functional user experience (e.g. Grafana reporting, Alloy telemetry, Loki usage
reports, Traefik anonymous usage, Open WebUI analytics, LiteLLM telemetry, and DevContainer
toolchain opt-outs like `DO_NOT_TRACK=1`, `GOTELEMETRY=off`, `PIP_DISABLE_PIP_VERSION_CHECK=1`,
`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`).
- **Confirmation Required for Functional Web Integrations**: For web integrations and external
network calls that provide tangible user-facing functionality or dynamic content (such as IDE
plugin and extension update notifications, live community news feeds, or marketplace catalogs),
AI agents MUST NOT unilaterally disable them without confirming with the user first. Always
distinguish purely passive background telemetry and phone-home traffic from active user-facing
capabilities, confirming user intent before suppressing functional web integrations.
- **Strict Prohibition of Brittle Pattern Subsets & Mandatory Constants/Defaults Placement**:
- Matching against a list of strings or regular expressions is **ONLY acceptable if it covers 100% of possible scenarios** (i.e. mathematically bounded, closed, exhaustive domains defined by official RFCs or deterministic language grammars).
- Matching against a **limited or arbitrary subset of a larger or unknown list of possible values is strictly prohibited**. Never guess or match against ad-hoc prefixes, suffixes, or partial word lists (e.g. arbitrary identifier prefixes, property suffixes, or selective web TLDs). Instead, use mature, robust engineering solutions such as programming language symbol parsers (e.g. Python AST visitors, tokenizer pipelines), official registries (e.g. Mozilla Public Suffix List via `tldextract`), or system domain lookup tooling.
Expand Down
23 changes: 22 additions & 1 deletion src/devops_cli/templates/devcontainer.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,22 @@
"GIT_CONFIG_VALUE_2": "",
"GIT_CONFIG_KEY_3": "credential.https://gist.github.com.helper",
"GIT_CONFIG_VALUE_3": "!gh auth git-credential",
"UV_MALWARE_CHECK": "1"
"UV_MALWARE_CHECK": "1",
"DO_NOT_TRACK": "1",
"HF_HUB_DISABLE_TELEMETRY": "1",
"SCARF_NO_ANALYTICS": "true",
"NEXT_TELEMETRY_DISABLED": "1",
"CHECKPOINT_DISABLE": "1",
"DOTNET_CLI_TELEMETRY_OPTOUT": "1",
"ANONYMIZED_TELEMETRY": "false",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"DISABLE_TELEMETRY": "1",
"GOTELEMETRY": "off",
"PIP_DISABLE_PIP_VERSION_CHECK": "1",
"npm_config_update_notifier": "false",
"DOCKER_CLI_HINTS": "false",
"MINIKUBE_WANTUPDATENOTIFICATION": "false",
"MINIKUBE_WANTREPORTERRORPROMPT": "false"
},
{% if minikube %}
"forwardPorts": [
Expand Down Expand Up @@ -122,6 +137,9 @@
"anthropic.claude-code"
],
"settings": {
"telemetry.telemetryLevel": "off",
"redhat.telemetry.enabled": false,
"workbench.enableExperiments": false,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
Expand Down Expand Up @@ -151,6 +169,9 @@
"anthropic.claude-code"
],
"settings": {
"telemetry.telemetryLevel": "off",
"redhat.telemetry.enabled": false,
"workbench.enableExperiments": false,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
Expand Down
3 changes: 3 additions & 0 deletions tests/test_instruction_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ def test_generate_agents_md_contains_required_sections() -> None:
assert "asyncio.Semaphore(5)" in content
assert "Comprehensive Sanitization of Internal Systems & Homelab Data" in content
assert "<storage-node>" in content
assert "Mandatory Third-Party Telemetry & Phone-Home Opt-Outs" in content
assert "Strict Opt-Out of Non-Functional Third-Party Telemetry" in content
assert "Confirmation Required for Functional Web Integrations" in content

# Verify external/generic project AGENTS.md omits pre-1.0 alpha lifecycle block
meta_generic = ProjectMetadata(
Expand Down
Loading
Loading