Repository navigation
feat(release): v0.2.15 - #92
Conversation
…loop - Remediate all 11 verified findings across security, sandbox isolation, and resource bounds: - CodeMode: Remove reflection primitives (getattr, hasattr, type) and sys module from safe_builtins to prevent sandbox escape - K8s: Remove hardcoded default password for Open-WebUI admin account, generating a cryptographically secure random token when omitted - SSH: Mask secrets in key rotation error messages and provide actionable connectivity guidance - Harness Memory: Enforce bounded LIMIT clause and cursor iteration on SQLite search queries - Pydantic AI Tools: Enforce unconditional path traversal validation across all tool parameters regardless of schema presence - Harness Compaction: Enforce bounded capacity and FIFO eviction for overflow fallback memory using OrderedDict - Pipeline Protocol: Sanitize stage exception messages using mask_secrets in StageExecutionRecord - Ollama Models: Add URL scheme validation and block link-local cloud metadata (169.254.169.254) in base_url - Ollama Client: Sanitize HTTP status and streaming error messages using mask_secrets - Valkey: Centralize and sanitize error messages across all Valkey CLI commands using mask_secrets - Update DevSecOps review prompts, verification falsification rules, and task manuals for the closed-loop feedback loop - Export verified findings into the continuous learning feedback dataset - Bump version to 0.2.15 in pyproject.toml and package init - Synchronize CLI documentation and README Closes #87
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical and moderate findings remain in sandbox isolation, SSRF validation, telemetry sanitization, credential handling, resource bounds, and release metadata.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Release v0.2.15 adds security hardening for sandboxing, credentials, SSRF protection, error handling, resource bounds, and review workflows.
Changes:
- Applies security remediations across core CLI and AI components.
- Adds regression tests and updates prompts, knowledge-base, and task documentation.
- Bumps package and lockfile versions and refreshes CLI documentation.
File summaries
| File | Reviewed change / status |
|---|---|
uv.lock |
Updates the locked package version. |
tests/test_valkey.py |
Tests Valkey error masking. |
tests/test_ssh.py |
Tests SSH error sanitization. |
tests/test_security_sandbox_and_protection.py |
Tests direct sandbox restrictions. Moderate (1): add coverage and protection for attribute-traversal escapes. |
tests/test_pydantic_ai_tools.py |
Tests traversal validation. |
tests/test_pydantic_ai_ollama.py |
Tests Ollama URL validation. |
tests/test_pipeline_protocol.py |
Tests pipeline error masking. |
tests/test_k8s.py |
Tests generated Open-WebUI credentials. |
tests/test_harness.py |
Tests memory bounds and fallback eviction. |
tests/test_ai_client_security.py |
Tests Ollama response masking. |
src/devops_cli/commands/valkey.py |
Centralizes sanitized Valkey errors. Moderate (1): private IPs and internal hostnames remain exposed. |
src/devops_cli/commands/ssh.py |
Masks SSH registration errors. |
src/devops_cli/commands/k8s/stack_lifecycle.py |
Generates Open-WebUI credentials. Moderate (3): empty configuration can create an inaccessible account; reruns can print unapplied credentials. Critical (3): credentials are printed by default. |
src/devops_cli/ai/tools/__init__.py |
Validates all tool arguments for traversal. |
src/devops_cli/ai/tasks/verify_finding_system.md |
Adds finding verification rules. |
src/devops_cli/ai/tasks/review_output_instruction.md |
Strengthens review criteria. |
src/devops_cli/ai/pipeline_protocol.py |
Masks recorded stage errors. Critical (3): raw exceptions and traces can still enter telemetry. |
src/devops_cli/ai/personas/devsecops/prompt.md |
Expands security review focus. |
src/devops_cli/ai/models/ollama.py |
Adds scheme and metadata checks. Critical (3): private, loopback, DNS-resolved, and alternate metadata destinations remain possible. |
src/devops_cli/ai/knowledge_base/devops_cli/tasks/ai_code_review.md |
Documents the remediation workflow. |
src/devops_cli/ai/harness/os_access.py |
Removes selected sandbox capabilities. Critical (1): unrestricted object traversal can still escape the sandbox. |
src/devops_cli/ai/harness/memory.py |
Adds bounded SQLite search iteration. Moderate (3): the computed limit has no upper cap. Moderate (1): pre-filter limiting can cause false negatives. |
src/devops_cli/ai/harness/compaction.py |
Adds overflow fallback eviction. Moderate (1): large payloads can still exceed the intended memory bound. |
src/devops_cli/ai/client/ollama.py |
Masks Ollama response errors. Moderate (1): truncation occurs before masking for both normal and streaming responses. |
src/devops_cli/__init__.py |
Sets the runtime version to 0.2.15. Nit (1): release notes and changelog remain on v0.2.14. |
pyproject.toml |
Sets the project version to 0.2.15. Moderate (1): other release metadata remains on v0.2.14. |
docs/commands/k8s.md |
Updates the Kubernetes command reference. |
docs/CLI_REFERENCE.md |
Updates the CLI reference. |
docs/agent/task.md |
Records remediation tasks. Nit (1): completed work remains under the in-progress section. |
AGENTS.md |
Adds feedback-loop guidance. |
Review details
Suppressed comments (9)
docs/agent/task.md:961
- Every item in this block is marked
[x], yet it remains under### In-Progress Tasks (WIP). The repository lifecycle rules define completed work asDone/Completed Tasks; leaving it in WIP makes project/task status inconsistent. Move the completed phase to the completed section or leave only active work here.
- [x] Phase 50.12: Remediate Review Findings (Session 20260909-122649) & Strengthen Self-Improvement Review Loop (Closes #87)
pyproject.toml:7
- The package version is bumped to v0.2.15, but release metadata remains on v0.2.14 (
_config.yaml:6,CHANGELOG.md:10, anddocs/RELEASE_NOTES.md:1). This makes the published site and release documentation disagree with the package and the PR's v0.2.15 release claim; update all release metadata in the same release change.
version = "0.2.15"
src/devops_cli/init.py:7
- The version is bumped to 0.2.15, but
CHANGELOG.mdstill starts with 0.2.14 anddocs/RELEASE_NOTES.mdstill identifies v0.2.14. Merging this release PR would publish stale release documentation and omit the security remediations described here; add synchronized v0.2.15 changelog and release-note entries before merging.
__version__ = "0.2.15"
src/devops_cli/ai/client/ollama.py:154
- Sanitization happens after truncating the response to 300 characters. If a credential begins near that boundary, the truncated fragment may no longer match its masking regex and leaks into
AIClientError. Mask the full body before applying the 300-character display limit.
msg_text = mask_secrets(exc.response.text[:300].strip()) or "(empty)"
src/devops_cli/ai/client/ollama.py:311
- Sanitization happens after truncating the response to 300 characters. If a credential begins near that boundary, the truncated fragment may no longer match its masking regex and leaks into the streaming
AIClientError. Mask the full body before applying the display limit.
body = mask_secrets(exc.response.text[:300].strip())
src/devops_cli/ai/harness/compaction.py:146
- Bounding the number of fallback entries does not bound fallback memory:
Spill.reducepasses the entire output towrite, and 128 arbitrarily large byte strings can remain strongly referenced when disk writes fail. Add a byte budget or cap each payload before inserting into the in-memory fallback.
if len(_OVERFLOW_MEMORY_FALLBACK) >= _MAX_OVERFLOW_FALLBACK_ENTRIES:
_OVERFLOW_MEMORY_FALLBACK.popitem(last=False)
_OVERFLOW_MEMORY_FALLBACK[handle] = data
src/devops_cli/ai/harness/memory.py:468
- This
LIMITis applied before the code performs any term filtering or scoring, and the query has noORDER BY. Once the table exceedssearch_limit, a matching memory row beyond the arbitrary first batch is never examined and search can return a false negative. Move the predicate/ranking into SQLite/FTS or use bounded pagination with an explicit completeness contract.
cur = conn.execute(
"SELECT path, content FROM memory_files LIMIT ?",
(search_limit,),
src/devops_cli/commands/valkey.py:32
mask_secretsonly recognizes credential/token patterns; it does not redact private IPs or internal hostnames.ValkeyClientinterpolatesself.hostinto its validation errors (src/devops_cli/valkey/client.py:71,87,91), so these commands can still expose network topology; use a sanitizer that also handles network targets or emit only a generic user-facing error.
safe_msg = mask_secrets(exc.message)
tests/test_security_sandbox_and_protection.py:79
- These tests cover only direct name/import lookups. Attribute traversal remains unrestricted, so a payload such as
().__class__.__base__.__subclasses__()can reach preloaded classes/globals withoutgetattr,type, orsys; add a regression for this escape path and enforce AST/attribute restrictions or isolate execution in a process/container.
# Dangerous reflection builtins (getattr, hasattr, type) and sys import must be blocked
for dangerous_snippet in [
"getattr(math, 'sqrt')(16)",
"hasattr(math, 'sqrt')",
"type(123)",
"import sys",
]:
- Files reviewed: 29/30 changed files
- Comments generated: 7
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…l masking, and query bounds
…anner and ScannerRegistry (#93) * feat(security): complete security scanner migration to BaseSecurityScanner and ScannerRegistry * fix(security): address review feedback on security scanner base migration
…d backwards compatibility remnants (#95) * refactor(core): eliminate obsolete shims, aliases, proxy wrappers, and backwards compatibility remnants - Strip unicode icons and emojis from README bullets and markdown files - Remove numeric counts, timestamps, and arbitrary identifiers from test names, variables, and documentation - Remove legacy __getattr__ proxies, wrapper functions, and private aliases across commands and AI modules - Replace private re-exports with canonical functions in security.sanitizer - Extract clean GhCliClient and eliminate inner class shims in GitHub commands - Clean up stopwatch timers and semantic schema variable identifiers - Update all impacted tests and verify complete 10-gate CI suite Closes #94 * fix(review): address copilot feedback on paginated json, adapter tests, and git boundary - Add parse_paginated_json to handle concatenated multi-page JSON arrays from gh api --paginate in GhCliClient and gh commands - Implement edit_milestone method on GhCliClient for full synchronizer compatibility - Author focused unit tests for GhCliClient and parse_paginated_json in test_github_client.py - Exercise real git repository boundary and gitignore filtering in test_review_runner.py * refactor(pages,review): eliminate legacy config paths and harden secret redaction * fix(review,security): decouple secret redaction and resolve CodeQL clear-text false positives
…#96) * feat(k8s): centralized kubernetes logging stack and LogQL integration - Add declarative Loki and Fluent Bit manifests under k8s/logging with PSA labels and network isolation - Register logging stack in deploy-stack and teardown-stack lifecycle - Implement native LogQL query parser, line filter evaluator, and stream engine in k8s.logql - Add OpenTelemetry trace_id extraction and trace correlation in LogQL entries and Grafana Loki datasource - Support live follow and transparent fallback to kubectl logs in devops k8s logs - Register FastMCP tools k8s_logs_query and k8s_logs_tail - Author unit tests and verify 10-gate CI suite Closes #89 * fix(k8s): remediate code review findings on centralized logging stack and logql integration * feat(k8s): configure qdrant service with nodePort 31744 for direct host RAG access * fix(k8s): resolve code review feedback on centralized logging stack and logql integration * fix(k8s): confine rich markup escaping to output submodule and restore qdrant clusterip security perimeter
* feat(tf): infracost finops cloud cost estimation and reporting * fix(tf): address code review feedback on Infracost FinOps cost engine - Enforce DependencyError when Infracost binary is missing in non-mock execution - Raise typed SubprocessError on non-zero Infracost breakdown/diff subprocess exit - Add ToolExecutionError error boundaries around breakdown and diff JSON deserialization - Add --compare-to baseline option to run_infracost_diff and CLI command - Validate budget thresholds before rendering and serializing JSON output - Register dynamic MCP resource resource://tf/cost/latest - Add comprehensive unit tests covering parsing, baseline diffs, and budget serialization
) * feat(argo): multi-cluster argocd fleet synchronization and rollouts - Implement multi-cluster fleet coordination engine with bounded concurrency under devops argo fleet sync - Add progressive delivery rollout controls (promote, abort, restart) wrapping kubectl argo rollouts - Introduce automated metric-driven rollback gates evaluating Prometheus/LogQL error rates with auto-abort capability - Add format_argo_fleet_sync_table and format_argo_rollout_analysis_table formatters - Register argo_fleet_sync, argo_rollout_analyze FastMCP tools and resource://argo/fleet/status resource - Add comprehensive test suite with 98%+ code coverage adhering to strict architectural invariants * fix(argo): address review feedback on fleet sync and rollouts
…100) * perf(ci): optimize caching configuration across all github workflows * fix(ci): bound tooling cache key and enforce exact devcontainer cacheFrom assertion
- Decompose monolithic docs/agent/task.md into isolated per-task tracking files under docs/agent/tasks/ (task-<issue>-<slug>.md) - Update GitHub Projects v2 parser (src/devops_cli/github/projects.py) to recursively scan and parse docs/agent/tasks/ by default while excluding archives and READMEs - Decompose parser functions to enforce cyclomatic complexity <= 10 and nesting depth <= 5 - Archive historical phases 1-50 in docs/agent/archive/historical-phases-1-to-50.md - Replace docs/agent/task.md with a lean index table pointing to modular task files - Update AGENTS.md, ROUTINE_TASKS.md, and Knowledge Base Task Manual 13 with the modular task architecture and commit context mandate - Author comprehensive unit tests in tests/test_github_projects.py Closes #101
…set synchronization
…and multi-convention discovery
…, and embedding fast failover - Update k8s/otel/jaeger.yaml to configure MEMORY_MAX_TRACES to 10000 and scale memory limits to 1024Mi to eliminate OOMKills - Refactor telemetry tracer span exception handling to avoid attaching stack traces to handled CLI exits (typer.Exit) - Add DEFAULT_RAG_EMBEDDING_TIMEOUT (15.0s) and rapid 2.0s connect timeouts for fast Ollama multi-node failover - Author comprehensive unit tests in tests/test_telemetry.py and tests/test_rag_embeddings.py - Ground and deliver GitHub task 104 in docs/agent/tasks/task-104-telemetry-trace-optimizations.md (Closes #104)
Release Overview: v0.2.15
This release branch initiates Milestone v0.2.15 (GitOps Fleet, FinOps, Centralized Logging & Production Security Mesh). It delivers comprehensive security remediations across all 11 verified findings from review session
20260909-122649, hardens review prompts and knowledge base task manuals for closed-loop feedback, exports the continuous learning dataset, and establishes the active issue roadmap (#87–#91) for v0.2.15.Key Deliverables & Remediations
1. CodeMode Sandbox & Capability Security (Finding 1 - Critical)
sysfrom_allowed_modulesand dynamic reflection primitives (getattr,hasattr,type) fromsafe_builtinsinsrc/devops_cli/ai/harness/os_access.py.tests/test_security_sandbox_and_protection.py.2. K8s Stack Lifecycle Security (Finding 2 - High)
"admin123"default password for Open-WebUI admin bootstrap insrc/devops_cli/commands/k8s/stack_lifecycle.py.secrets.token_urlsafe(24)) when omitted and not configured in environment. Verified intests/test_k8s.py.3. SSH Key Rotation Information Leakage Sanitization (Finding 3 - Medium)
SSHRegistrationErrorexception messages usingmask_secretsand provided actionable connectivity guidance insrc/devops_cli/commands/ssh.py.tests/test_ssh.py.4. SQLite Memory Search Query Bounds (Finding 4 - Medium)
LIMIT ?(max(1000, max_results * 100)) and streaming cursor iteration onSqliteMemoryStore.searchinsrc/devops_cli/ai/harness/memory.pyto prevent denial of service from unbounded memory allocation.tests/test_harness.py.5. Pydantic AI Tool Argument Path Traversal Protection (Finding 5 - Medium)
_check_path_traversalacross all input argument values invalidate_argsinsrc/devops_cli/ai/tools/__init__.py, preventing path traversal bypass when parameter schemas are dynamic or empty.tests/test_pydantic_ai_tools.py.6. Compaction Overflow Memory Eviction (Finding 6 - Medium)
_OVERFLOW_MEMORY_FALLBACKto anOrderedDictwith bounded capacity (_MAX_OVERFLOW_FALLBACK_ENTRIES = 128) and FIFO eviction on repeated disk write failures insrc/devops_cli/ai/harness/compaction.py.tests/test_harness.py.7. Pipeline Protocol Exception Sanitization (Finding 7 - Medium)
rec.error_messageusingmask_secrets(str(exc))in_run_stage_with_spaninsrc/devops_cli/ai/pipeline_protocol.pyto prevent credential leakage into telemetry and execution records.tests/test_pipeline_protocol.py.8. Ollama Provider SSRF & Cloud Metadata Protection (Finding 8 - Medium)
http/https) and explicitly blocked link-local cloud metadata endpoints (169.254.169.254,[fd00:ec2::254]) innormalize_ollama_base_urlinsrc/devops_cli/ai/models/ollama.py.tests/test_pydantic_ai_ollama.py.9 & 10. Ollama Client Response Error Sanitization (Findings 9 & 10 - Medium)
mask_secretsin_try_single_ollama_requestand_try_single_ollama_streaminsrc/devops_cli/ai/client/ollama.py.tests/test_ai_client_security.py.11. Valkey Command Error Sanitization (Finding 11 - Medium)
_print_valkey_errorwithmask_secretsacross all 9 Valkey CLI commands insrc/devops_cli/commands/valkey.py.tests/test_valkey.py.12. Review Prompts, Knowledge Base & Self-Improvement Loop
src/devops_cli/ai/personas/devsecops/prompt.mdwith explicit security focus areas.src/devops_cli/ai/tasks/verify_finding_system.mdwith falsification rules for sandboxes, resource bounds, parameter validation, and error sanitization.src/devops_cli/ai/tasks/review_output_instruction.mdwith criteria precision and architectural invariant guidelines.src/devops_cli/ai/knowledge_base/devops_cli/tasks/ai_code_review.mdandAGENTS.mdwith the 4-step closed-loop finding remediation workflow..data/reviews/20260909-122649/findings.jsonto mark all 11 findingsMITIGATED..data/reviews/feedback_dataset.jsonlviadevops ai review export-feedback.Milestone v0.2.15 Tracking Issues
fix(review): remediate session 20260909-122649 findings and enhance feedback self-improvement review loop(Closes fix(review): remediate session 20260909-122649 findings and enhance feedback self-improvement review loop #87)feat(security): complete security scanner migration to BaseSecurityScanner and ScannerRegistryfeat(k8s): centralized kubernetes logging stack and LogQL integrationfeat(tf): infracost finops cloud cost estimation and reportingfeat(argo): multi-cluster argocd fleet synchronization and rolloutsQuality Gate & Verification Summary
mypystrict mode)ruff check,ruff format)bandit,trivy)devops docs generate --sync-readme