Skip to content

feat: add minimal VMLab CLI and security guardrail tests for dry-run skeleton #57

@SSobol77

Description

@SSobol77

feat: add minimal VMLab CLI and security guardrail tests for dry-run skeleton

Purpose

Add minimal safe CLI surface for the VMLab skeleton and implement security guardrail tests.

Mandatory First Step

Before editing files:

  1. Inspect the actual repository structure.
  2. Verify real package roots, CLI entrypoints, and test conventions.
  3. Do not assume imports from non-existent modules.
  4. Adjust file paths to the real repository layout if required.
  5. Document any path deviation in the PR description.

Development Log Invariant

All generated development logs, dry-run reports, smoke outputs, test evidence, and agent-generated debug artifacts must be written only under:

logs/

Forbidden generated-artifact locations:

.ecli/
.ecli/vmlab/
src/
tests/
tmp/
.tmp/
.cache/
$HOME/
/tmp/
project root outside logs/

Target Files

Expected target files, adjusted only if real repository layout requires:

tests/cli/test_vm_commands.py
tests/extensions/vmlab/test_security_guardrails.py
tests/extensions/vmlab/test_no_logs_outside_logs.py

Scope

Required commands:

ecli vm list
ecli vm show <profile-name>
ecli vm validate <profile-name>
ecli vm export <profile-name> --format qemu-argv
ecli vm start <profile-name> --dry-run
ecli vm doctor <profile-name>
ecli vm doctor <profile-name> --json

Required guardrail tests:

  • symlink escape blocked.
  • forbidden paths rejected.
  • direct sudo/doas/pkexec calls forbidden.
  • direct QEMU execution forbidden.
  • dry-run creates no files, sockets, or processes.
  • user config cannot weaken stricter policy.
  • shell expansion rejected.
  • no logs outside logs/.

Non-Goals

  • no real QEMU execution
  • no privileged remediation
  • no QMP command execution
  • no serial attach
  • no log rotation/cleanup mutation

Dependencies

Depends on Services Foundation, VMLab profile discovery, and VMLab dry-run argv integration.

Acceptance Criteria

  • VMLab CLI commands exist
  • commands route through VMLabService
  • ecli vm validate returns structured validation result
  • ecli vm start --dry-run shows plan preview without execution
  • ecli vm export --format qemu-argv shows resolved argv
  • missing profiles produce structured errors
  • security guardrail tests pass
  • no logs outside logs/
  • no direct QEMU/sudo/subprocess execution paths exist

References

  • docs/extensions/vmlab-implementation-prompt.md
  • docs/extensions/vmlab-security-model.md
  • docs/extensions/vmlab-overview.md

Labels

  • type:implementation
  • type:tests
  • type:security
  • area:vmlab
  • area:cli
  • phase:2A
  • status:blocked
  • priority:medium

Milestone

v0.3.0 — VMLab Skeleton

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCommand-line interface workarea:vmlabVMLab runtime-management modulecliCommand-line interface workimplementationProduction code implementationphase:2APhase 2A — VMLab skeletonpriority:mediumMedium-priority tasksecuritySecurity-sensitive guardrails or safety requirementsservicesShared service-layer architecturestatus:blockedBlocked by dependencytestsTest coverage, test infrastructure, or verificationtype:implementationProduction code implementationtype:securitySecurity-sensitive guardrails or safety requirementstype:testsTest coverage, test infrastructure, or verificationvmlabVMLab runtime-management module

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions